Skip to content

Commit

Permalink
[SelectionDAG] Remove LegalTypes argument from getShiftAmountTy. NFC (l…
Browse files Browse the repository at this point in the history
…lvm#97757)

This argument is no longer used inside the function. Remove it from the
interface.
  • Loading branch information
topperc authored and kbluck committed Jul 6, 2024
1 parent 42aba8f commit 734643f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
4 changes: 1 addition & 3 deletions llvm/include/llvm/CodeGen/TargetLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/TargetLoweringBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 734643f

Please sign in to comment.