[llvm] 04f815c - [SelectionDAGBuilder] Remove LegalTypes=false from a call to getShiftAmountConstant.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 18 15:36:43 PST 2022


Author: Craig Topper
Date: 2022-02-18T15:36:35-08:00
New Revision: 04f815c26f7c7b7932c0f80fda8fcb5fa5814bca

URL: https://github.com/llvm/llvm-project/commit/04f815c26f7c7b7932c0f80fda8fcb5fa5814bca
DIFF: https://github.com/llvm/llvm-project/commit/04f815c26f7c7b7932c0f80fda8fcb5fa5814bca.diff

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

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.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D120165

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 78da827c96f74..3e2dd9ec74e09 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -566,7 +566,7 @@ static void getCopyToParts(SelectionDAG &DAG, const SDLoc &DL, SDValue Val,
     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);


        


More information about the llvm-commits mailing list