From 734643f967d0ab7f6e4c50f6d531a4f901290acc Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 4 Jul 2024 15:24:54 -0700 Subject: [PATCH] [SelectionDAG] Remove LegalTypes argument from getShiftAmountTy. NFC (#97757) This argument is no longer used inside the function. Remove it from the interface. --- llvm/include/llvm/CodeGen/TargetLowering.h | 4 +--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 2 +- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 4 ++-- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 4 ++-- llvm/lib/CodeGen/TargetLoweringBase.cpp | 4 ++-- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h index 51ff7855ec046f..55b60b01e58277 100644 --- a/llvm/include/llvm/CodeGen/TargetLowering.h +++ b/llvm/include/llvm/CodeGen/TargetLowering.h @@ -403,9 +403,7 @@ class TargetLoweringBase { /// returns the input type. For scalars, calls getScalarShiftAmountTy. /// If getScalarShiftAmountTy type cannot represent all possible shift /// amounts, returns MVT::i32. - /// \p LegalTypes is no longer used and will be removed from the interface. - EVT getShiftAmountTy(EVT LHSTy, const DataLayout &DL, - bool LegalTypes = true) const; + EVT getShiftAmountTy(EVT LHSTy, const DataLayout &DL) const; /// Return the preferred type to use for a shift opcode, given the shifted /// amount type is \p ShiftValueTy. diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index a7b469ea17f187..a4260220f012ad 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -847,7 +847,7 @@ namespace { /// legalization these can be huge. EVT getShiftAmountTy(EVT LHSTy) { assert(LHSTy.isInteger() && "Shift amount is not an integer type!"); - return TLI.getShiftAmountTy(LHSTy, DAG.getDataLayout(), LegalTypes); + return TLI.getShiftAmountTy(LHSTy, DAG.getDataLayout()); } /// This method returns true if we are running before type legalization or diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 96242305e9eaba..a0cfb55e6cd812 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1754,14 +1754,14 @@ SDValue SelectionDAG::getIntPtrConstant(uint64_t Val, const SDLoc &DL, SDValue SelectionDAG::getShiftAmountConstant(uint64_t Val, EVT VT, const SDLoc &DL, bool LegalTypes) { assert(VT.isInteger() && "Shift amount is not an integer type!"); - EVT ShiftVT = TLI->getShiftAmountTy(VT, getDataLayout(), LegalTypes); + EVT ShiftVT = TLI->getShiftAmountTy(VT, getDataLayout()); return getConstant(Val, DL, ShiftVT); } SDValue SelectionDAG::getShiftAmountConstant(const APInt &Val, EVT VT, const SDLoc &DL, bool LegalTypes) { assert(Val.ult(VT.getScalarSizeInBits()) && "Out of range shift"); - return getShiftAmountConstant(Val.getZExtValue(), VT, DL, LegalTypes); + return getShiftAmountConstant(Val.getZExtValue(), VT, DL); } SDValue SelectionDAG::getVectorIdxConstant(uint64_t Val, const SDLoc &DL, diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index fdd9f1f461759c..1d5882ba8fa9a0 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -6639,7 +6639,7 @@ TargetLowering::prepareUREMEqFold(EVT SETCCVT, SDValue REMNode, EVT VT = REMNode.getValueType(); EVT SVT = VT.getScalarType(); - EVT ShVT = getShiftAmountTy(VT, DAG.getDataLayout(), !DCI.isBeforeLegalize()); + EVT ShVT = getShiftAmountTy(VT, DAG.getDataLayout()); EVT ShSVT = ShVT.getScalarType(); // If MUL is unavailable, we cannot proceed in any case. @@ -6897,7 +6897,7 @@ TargetLowering::prepareSREMEqFold(EVT SETCCVT, SDValue REMNode, EVT VT = REMNode.getValueType(); EVT SVT = VT.getScalarType(); - EVT ShVT = getShiftAmountTy(VT, DAG.getDataLayout(), !DCI.isBeforeLegalize()); + EVT ShVT = getShiftAmountTy(VT, DAG.getDataLayout()); EVT ShSVT = ShVT.getScalarType(); // If we are after ops legalization, and MUL is unavailable, we can not diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index c1a4e5d198ac4d..353b0cafbd72e0 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -1052,8 +1052,8 @@ MVT TargetLoweringBase::getScalarShiftAmountTy(const DataLayout &DL, return MVT::getIntegerVT(DL.getPointerSizeInBits(0)); } -EVT TargetLoweringBase::getShiftAmountTy(EVT LHSTy, const DataLayout &DL, - bool LegalTypes) const { +EVT TargetLoweringBase::getShiftAmountTy(EVT LHSTy, + const DataLayout &DL) const { assert(LHSTy.isInteger() && "Shift amount is not an integer type!"); if (LHSTy.isVector()) return LHSTy;