[PATCH] D69116: [TargetLowering][DAGCombine][MSP430] Shift Amount Threshold in DAGCombine (1/2)
Joan LLuch via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 17 15:06:54 PDT 2019
joanlluch added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:3622
+ if (AndRHS->getAPIntValue().isPowerOf2() &&
+ ShCt <= TLI.getShiftAmountThreshold(ShiftTy)) {
return DAG.getNode(ISD::TRUNCATE, dl, VT,
----------------
joanlluch wrote:
> spatel wrote:
> > This is probably not working as you expected because the shift type may not be the same as the value type.
> > I added an x86 test to demonstrate:
> > rL375158
> Would passing the shift value (not the constant amount type) to getShiftAmountThreshold work in all cases?
I mean passing the shift value //type//, not the shift value, of course., so in the case above would be TLI.getShiftAmountThreshold(N0.getValueType())
Would that look good?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69116/new/
https://reviews.llvm.org/D69116
More information about the llvm-commits
mailing list