Skip to content

Commit 3141c11

Browse files
authored
[SelectionDAG] Remove LegalTypes argument from getShiftAmountTy. NFC (#97757)
This argument is no longer used inside the function. Remove it from the interface.
1 parent b298e2d commit 3141c11

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

llvm/include/llvm/CodeGen/TargetLowering.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,7 @@ class TargetLoweringBase {
403403
/// returns the input type. For scalars, calls getScalarShiftAmountTy.
404404
/// If getScalarShiftAmountTy type cannot represent all possible shift
405405
/// amounts, returns MVT::i32.
406-
/// \p LegalTypes is no longer used and will be removed from the interface.
407-
EVT getShiftAmountTy(EVT LHSTy, const DataLayout &DL,
408-
bool LegalTypes = true) const;
406+
EVT getShiftAmountTy(EVT LHSTy, const DataLayout &DL) const;
409407

410408
/// Return the preferred type to use for a shift opcode, given the shifted
411409
/// amount type is \p ShiftValueTy.

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ namespace {
847847
/// legalization these can be huge.
848848
EVT getShiftAmountTy(EVT LHSTy) {
849849
assert(LHSTy.isInteger() && "Shift amount is not an integer type!");
850-
return TLI.getShiftAmountTy(LHSTy, DAG.getDataLayout(), LegalTypes);
850+
return TLI.getShiftAmountTy(LHSTy, DAG.getDataLayout());
851851
}
852852

853853
/// This method returns true if we are running before type legalization or

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,14 +1754,14 @@ SDValue SelectionDAG::getIntPtrConstant(uint64_t Val, const SDLoc &DL,
17541754
SDValue SelectionDAG::getShiftAmountConstant(uint64_t Val, EVT VT,
17551755
const SDLoc &DL, bool LegalTypes) {
17561756
assert(VT.isInteger() && "Shift amount is not an integer type!");
1757-
EVT ShiftVT = TLI->getShiftAmountTy(VT, getDataLayout(), LegalTypes);
1757+
EVT ShiftVT = TLI->getShiftAmountTy(VT, getDataLayout());
17581758
return getConstant(Val, DL, ShiftVT);
17591759
}
17601760

17611761
SDValue SelectionDAG::getShiftAmountConstant(const APInt &Val, EVT VT,
17621762
const SDLoc &DL, bool LegalTypes) {
17631763
assert(Val.ult(VT.getScalarSizeInBits()) && "Out of range shift");
1764-
return getShiftAmountConstant(Val.getZExtValue(), VT, DL, LegalTypes);
1764+
return getShiftAmountConstant(Val.getZExtValue(), VT, DL);
17651765
}
17661766

17671767
SDValue SelectionDAG::getVectorIdxConstant(uint64_t Val, const SDLoc &DL,

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6639,7 +6639,7 @@ TargetLowering::prepareUREMEqFold(EVT SETCCVT, SDValue REMNode,
66396639

66406640
EVT VT = REMNode.getValueType();
66416641
EVT SVT = VT.getScalarType();
6642-
EVT ShVT = getShiftAmountTy(VT, DAG.getDataLayout(), !DCI.isBeforeLegalize());
6642+
EVT ShVT = getShiftAmountTy(VT, DAG.getDataLayout());
66436643
EVT ShSVT = ShVT.getScalarType();
66446644

66456645
// If MUL is unavailable, we cannot proceed in any case.
@@ -6897,7 +6897,7 @@ TargetLowering::prepareSREMEqFold(EVT SETCCVT, SDValue REMNode,
68976897

68986898
EVT VT = REMNode.getValueType();
68996899
EVT SVT = VT.getScalarType();
6900-
EVT ShVT = getShiftAmountTy(VT, DAG.getDataLayout(), !DCI.isBeforeLegalize());
6900+
EVT ShVT = getShiftAmountTy(VT, DAG.getDataLayout());
69016901
EVT ShSVT = ShVT.getScalarType();
69026902

69036903
// If we are after ops legalization, and MUL is unavailable, we can not

llvm/lib/CodeGen/TargetLoweringBase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,8 +1052,8 @@ MVT TargetLoweringBase::getScalarShiftAmountTy(const DataLayout &DL,
10521052
return MVT::getIntegerVT(DL.getPointerSizeInBits(0));
10531053
}
10541054

1055-
EVT TargetLoweringBase::getShiftAmountTy(EVT LHSTy, const DataLayout &DL,
1056-
bool LegalTypes) const {
1055+
EVT TargetLoweringBase::getShiftAmountTy(EVT LHSTy,
1056+
const DataLayout &DL) const {
10571057
assert(LHSTy.isInteger() && "Shift amount is not an integer type!");
10581058
if (LHSTy.isVector())
10591059
return LHSTy;

0 commit comments

Comments
 (0)