[PATCH] D120165: [SelectionDAGBuilder] Remove LegalTypes=false from a call to getShiftAmountConstant.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 18 14:48:55 PST 2022


craig.topper created this revision.
craig.topper added reviewers: arsenm, spatel, RKSimon, efriedma.
Herald added a subscriber: hiraditya.
craig.topper requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

getShiftAmountTy will return MVT::i32 if the shift amount
coming from the target's getScalarShiftAmountTy can't reprsent
all possible values. That should eliminate the need to use the
pointer type which is what we do when LegalTypes is false.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120165

Files:
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -566,7 +566,7 @@
     unsigned RoundBits = RoundParts * PartBits;
     unsigned OddParts = NumParts - RoundParts;
     SDValue OddVal = DAG.getNode(ISD::SRL, DL, ValueVT, Val,
-      DAG.getShiftAmountConstant(RoundBits, ValueVT, DL, /*LegalTypes*/false));
+      DAG.getShiftAmountConstant(RoundBits, ValueVT, DL));
 
     getCopyToParts(DAG, DL, OddVal, Parts + RoundParts, OddParts, PartVT, V,
                    CallConv);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120165.410031.patch
Type: text/x-patch
Size: 676 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220218/4347cee3/attachment.bin>


More information about the llvm-commits mailing list