[llvm] [SelectionDAG] Rename CallOptions::IsSExt to IsSigned. NFC (PR #118574)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 3 17:16:22 PST 2024
https://github.com/topperc created https://github.com/llvm/llvm-project/pull/118574
This is eventually passed to shouldSignExtendTypeInLibCall which calls it IsSigned.
>From 0096c7ee15e2134dbb9055a3cca7a4dc9bd613a6 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Tue, 3 Dec 2024 17:14:28 -0800
Subject: [PATCH] [SelectionDAG] Rename CallOptions::IsSExt to IsSigned. NFC
This is eventually passed to shouldSignExtendTypeInLibCall which
calls it IsSigned.
---
llvm/include/llvm/CodeGen/TargetLowering.h | 8 ++++----
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 2 +-
.../CodeGen/SelectionDAG/LegalizeFloatTypes.cpp | 4 ++--
.../SelectionDAG/LegalizeIntegerTypes.cpp | 16 ++++++++--------
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 6 +++---
5 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h
index 6a41094ff933b0..e9c02806385806 100644
--- a/llvm/include/llvm/CodeGen/TargetLowering.h
+++ b/llvm/include/llvm/CodeGen/TargetLowering.h
@@ -4713,18 +4713,18 @@ class TargetLowering : public TargetLoweringBase {
// shouldExtendTypeInLibCall can get the original type before soften.
ArrayRef<EVT> OpsVTBeforeSoften;
EVT RetVTBeforeSoften;
- bool IsSExt : 1;
+ bool IsSigned : 1;
bool DoesNotReturn : 1;
bool IsReturnValueUsed : 1;
bool IsPostTypeLegalization : 1;
bool IsSoften : 1;
MakeLibCallOptions()
- : IsSExt(false), DoesNotReturn(false), IsReturnValueUsed(true),
+ : IsSigned(false), DoesNotReturn(false), IsReturnValueUsed(true),
IsPostTypeLegalization(false), IsSoften(false) {}
- MakeLibCallOptions &setSExt(bool Value = true) {
- IsSExt = Value;
+ MakeLibCallOptions &setIsSigned(bool Value = true) {
+ IsSigned = Value;
return *this;
}
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 63536336e96228..2b595b26c9c1c5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -4794,7 +4794,7 @@ void SelectionDAGLegalize::ConvertNodeToLibcall(SDNode *Node) {
SDValue Op = DAG.getNode(Signed ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND, dl,
NVT, Node->getOperand(IsStrict ? 1 : 0));
TargetLowering::MakeLibCallOptions CallOptions;
- CallOptions.setSExt(Signed);
+ CallOptions.setIsSigned(Signed);
std::pair<SDValue, SDValue> Tmp =
TLI.makeLibCall(DAG, LC, RVT, Op, CallOptions, dl, Chain);
Results.push_back(Tmp.first);
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
index 3f8d117400efdc..b52c2c07a7fba0 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
@@ -1044,7 +1044,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_XINT_TO_FP(SDNode *N) {
SDValue Op = DAG.getNode(Signed ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND, dl,
NVT, N->getOperand(IsStrict ? 1 : 0));
TargetLowering::MakeLibCallOptions CallOptions;
- CallOptions.setSExt(Signed);
+ CallOptions.setIsSigned(Signed);
CallOptions.setTypeListBeforeSoften(SVT, RVT, true);
std::pair<SDValue, SDValue> Tmp =
TLI.makeLibCall(DAG, LC, TLI.getTypeToTransformTo(*DAG.getContext(), RVT),
@@ -2099,7 +2099,7 @@ void DAGTypeLegalizer::ExpandFloatRes_XINT_TO_FP(SDNode *N, SDValue &Lo,
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported XINT_TO_FP!");
TargetLowering::MakeLibCallOptions CallOptions;
- CallOptions.setSExt(true);
+ CallOptions.setIsSigned(true);
std::pair<SDValue, SDValue> Tmp =
TLI.makeLibCall(DAG, LC, VT, Src, CallOptions, dl, Chain);
if (Strict)
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
index 493abfde148c65..986d69e6c7a9e0 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -2601,7 +2601,7 @@ SDValue DAGTypeLegalizer::PromoteIntOp_ExpOp(SDNode *N) {
N->getOperand(1 + OpOffset).getValueType().getSizeInBits() &&
"POWI exponent should match with sizeof(int) when doing the libcall.");
TargetLowering::MakeLibCallOptions CallOptions;
- CallOptions.setSExt(true);
+ CallOptions.setIsSigned(true);
SDValue Ops[2] = {N->getOperand(0 + OpOffset), N->getOperand(1 + OpOffset)};
std::pair<SDValue, SDValue> Tmp = TLI.makeLibCall(
DAG, LC, N->getValueType(0), Ops, CallOptions, SDLoc(N), Chain);
@@ -4006,7 +4006,7 @@ void DAGTypeLegalizer::ExpandIntRes_FP_TO_XINT(SDNode *N, SDValue &Lo,
if (getTypeAction(Op.getValueType()) == TargetLowering::TypeSoftenFloat)
CallOptions.setTypeListBeforeSoften(OpVT, VT);
else
- CallOptions.setSExt(true);
+ CallOptions.setIsSigned(true); // FIXME: Is this needed?
std::pair<SDValue, SDValue> Tmp = TLI.makeLibCall(DAG, LC, VT, Op,
CallOptions, dl, Chain);
SplitInteger(Tmp.first, Lo, Hi);
@@ -4098,7 +4098,7 @@ void DAGTypeLegalizer::ExpandIntRes_XROUND_XRINT(SDNode *N, SDValue &Lo,
EVT RetVT = N->getValueType(0);
TargetLowering::MakeLibCallOptions CallOptions;
- CallOptions.setSExt(true);
+ CallOptions.setIsSigned(true);
std::pair<SDValue, SDValue> Tmp = TLI.makeLibCall(DAG, LC, RetVT,
Op, CallOptions, dl,
Chain);
@@ -4269,7 +4269,7 @@ void DAGTypeLegalizer::ExpandIntRes_MUL(SDNode *N,
// upper half of the result if it exceeds VT.
SDValue Ops[2] = { N->getOperand(0), N->getOperand(1) };
TargetLowering::MakeLibCallOptions CallOptions;
- CallOptions.setSExt(true);
+ CallOptions.setIsSigned(true);
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, CallOptions, dl).first,
Lo, Hi);
}
@@ -4640,7 +4640,7 @@ void DAGTypeLegalizer::ExpandIntRes_SDIV(SDNode *N,
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported SDIV!");
TargetLowering::MakeLibCallOptions CallOptions;
- CallOptions.setSExt(true);
+ CallOptions.setIsSigned(true);
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, CallOptions, dl).first, Lo, Hi);
}
@@ -4880,7 +4880,7 @@ void DAGTypeLegalizer::ExpandIntRes_Shift(SDNode *N,
SDValue ShAmt = DAG.getZExtOrTrunc(N->getOperand(1), dl, ShAmtTy);
SDValue Ops[2] = {N->getOperand(0), ShAmt};
TargetLowering::MakeLibCallOptions CallOptions;
- CallOptions.setSExt(isSigned);
+ CallOptions.setIsSigned(isSigned);
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, CallOptions, dl).first, Lo, Hi);
return;
}
@@ -4970,7 +4970,7 @@ void DAGTypeLegalizer::ExpandIntRes_SREM(SDNode *N,
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported SREM!");
TargetLowering::MakeLibCallOptions CallOptions;
- CallOptions.setSExt(true);
+ CallOptions.setIsSigned(true);
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, CallOptions, dl).first, Lo, Hi);
}
@@ -5659,7 +5659,7 @@ SDValue DAGTypeLegalizer::ExpandIntOp_XINT_TO_FP(SDNode *N) {
assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Don't know how to expand this XINT_TO_FP!");
TargetLowering::MakeLibCallOptions CallOptions;
- CallOptions.setSExt(true);
+ CallOptions.setIsSigned(true);
std::pair<SDValue, SDValue> Tmp =
TLI.makeLibCall(DAG, LC, DstVT, Op, CallOptions, SDLoc(N), Chain);
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index bd4bcadb57d7a9..5d9e8b35e24ef5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -160,7 +160,7 @@ TargetLowering::makeLibCall(SelectionDAG &DAG, RTLIB::Libcall LC, EVT RetVT,
Entry.Node = NewOp;
Entry.Ty = Entry.Node.getValueType().getTypeForEVT(*DAG.getContext());
Entry.IsSExt = shouldSignExtendTypeInLibCall(NewOp.getValueType(),
- CallOptions.IsSExt);
+ CallOptions.IsSigned);
Entry.IsZExt = !Entry.IsSExt;
if (CallOptions.IsSoften &&
@@ -177,7 +177,7 @@ TargetLowering::makeLibCall(SelectionDAG &DAG, RTLIB::Libcall LC, EVT RetVT,
Type *RetTy = RetVT.getTypeForEVT(*DAG.getContext());
TargetLowering::CallLoweringInfo CLI(DAG);
- bool signExtend = shouldSignExtendTypeInLibCall(RetVT, CallOptions.IsSExt);
+ bool signExtend = shouldSignExtendTypeInLibCall(RetVT, CallOptions.IsSigned);
bool zeroExtend = !signExtend;
if (CallOptions.IsSoften &&
@@ -10876,7 +10876,7 @@ void TargetLowering::forceExpandWideMUL(SelectionDAG &DAG, const SDLoc &dl,
// Attempt a libcall.
SDValue Ret;
TargetLowering::MakeLibCallOptions CallOptions;
- CallOptions.setSExt(Signed);
+ CallOptions.setIsSigned(Signed);
CallOptions.setIsPostTypeLegalization(true);
if (shouldSplitFunctionArgumentsAsLittleEndian(DAG.getDataLayout())) {
// Halves of WideVT are packed into registers in different order
More information about the llvm-commits
mailing list