[llvm] [SelectionDAG] Remove LegalTypes argument from getShiftAmountTy. NFC (PR #97757)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 4 11:22:31 PDT 2024
https://github.com/topperc created https://github.com/llvm/llvm-project/pull/97757
This argument is no longer used inside the function. Remove it from the interface.
>From 68e1c13174ee203dd2e3c6cb79580b535e3563a1 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Thu, 4 Jul 2024 11:20:10 -0700
Subject: [PATCH] [SelectionDAG] Remove LegalTypes argument from
getShiftAmountTy. NFC
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 51ff7855ec046..55b60b01e5827 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 a7b469ea17f18..a4260220f012a 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 96242305e9eab..a0cfb55e6cd81 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 fdd9f1f461759..1d5882ba8fa9a 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 c1a4e5d198ac4..353b0cafbd72e 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;
More information about the llvm-commits
mailing list