Skip to content

Commit d1952ba

Browse files
committed
[CodeGen] Remove unnecessary setTypeListBeforeSoften() parameter (NFC)
It does not make sense to set the softening type list without setting IsSoften=true.
1 parent 01fac67 commit d1952ba

File tree

5 files changed

+23
-24
lines changed

5 files changed

+23
-24
lines changed

llvm/include/llvm/CodeGen/TargetLowering.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4888,11 +4888,10 @@ class LLVM_ABI TargetLowering : public TargetLoweringBase {
48884888
return *this;
48894889
}
48904890

4891-
MakeLibCallOptions &setTypeListBeforeSoften(ArrayRef<EVT> OpsVT, EVT RetVT,
4892-
bool Value = true) {
4891+
MakeLibCallOptions &setTypeListBeforeSoften(ArrayRef<EVT> OpsVT, EVT RetVT) {
48934892
OpsVTBeforeSoften = OpsVT;
48944893
RetVTBeforeSoften = RetVT;
4895-
IsSoften = Value;
4894+
IsSoften = true;
48964895
return *this;
48974896
}
48984897

llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_Unary(SDNode *N, RTLIB::Libcall LC) {
197197
SDValue Chain = IsStrict ? N->getOperand(0) : SDValue();
198198
TargetLowering::MakeLibCallOptions CallOptions;
199199
EVT OpVT = N->getOperand(0 + Offset).getValueType();
200-
CallOptions.setTypeListBeforeSoften(OpVT, N->getValueType(0), true);
200+
CallOptions.setTypeListBeforeSoften(OpVT, N->getValueType(0));
201201
std::pair<SDValue, SDValue> Tmp = TLI.makeLibCall(DAG, LC, NVT, Op,
202202
CallOptions, SDLoc(N),
203203
Chain);
@@ -218,7 +218,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_Binary(SDNode *N, RTLIB::Libcall LC) {
218218
TargetLowering::MakeLibCallOptions CallOptions;
219219
EVT OpsVT[2] = { N->getOperand(0 + Offset).getValueType(),
220220
N->getOperand(1 + Offset).getValueType() };
221-
CallOptions.setTypeListBeforeSoften(OpsVT, N->getValueType(0), true);
221+
CallOptions.setTypeListBeforeSoften(OpsVT, N->getValueType(0));
222222
std::pair<SDValue, SDValue> Tmp = TLI.makeLibCall(DAG, LC, NVT, Ops,
223223
CallOptions, SDLoc(N),
224224
Chain);
@@ -558,7 +558,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FMA(SDNode *N) {
558558
EVT OpsVT[3] = { N->getOperand(0 + Offset).getValueType(),
559559
N->getOperand(1 + Offset).getValueType(),
560560
N->getOperand(2 + Offset).getValueType() };
561-
CallOptions.setTypeListBeforeSoften(OpsVT, N->getValueType(0), true);
561+
CallOptions.setTypeListBeforeSoften(OpsVT, N->getValueType(0));
562562
std::pair<SDValue, SDValue> Tmp = TLI.makeLibCall(DAG,
563563
GetFPLibCall(N->getValueType(0),
564564
RTLIB::FMA_F32,
@@ -642,7 +642,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FP_EXTEND(SDNode *N) {
642642
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_EXTEND!");
643643
TargetLowering::MakeLibCallOptions CallOptions;
644644
EVT OpVT = N->getOperand(IsStrict ? 1 : 0).getValueType();
645-
CallOptions.setTypeListBeforeSoften(OpVT, N->getValueType(0), true);
645+
CallOptions.setTypeListBeforeSoften(OpVT, N->getValueType(0));
646646
std::pair<SDValue, SDValue> Tmp = TLI.makeLibCall(DAG, LC, NVT, Op,
647647
CallOptions, SDLoc(N),
648648
Chain);
@@ -658,7 +658,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FP16_TO_FP(SDNode *N) {
658658
SDValue Op = N->getOperand(0);
659659
TargetLowering::MakeLibCallOptions CallOptions;
660660
EVT OpsVT[1] = { N->getOperand(0).getValueType() };
661-
CallOptions.setTypeListBeforeSoften(OpsVT, N->getValueType(0), true);
661+
CallOptions.setTypeListBeforeSoften(OpsVT, N->getValueType(0));
662662
SDValue Res32 = TLI.makeLibCall(DAG, RTLIB::FPEXT_F16_F32, MidVT, Op,
663663
CallOptions, SDLoc(N)).first;
664664
if (N->getValueType(0) == MVT::f32)
@@ -694,7 +694,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FP_ROUND(SDNode *N) {
694694
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_ROUND!");
695695
TargetLowering::MakeLibCallOptions CallOptions;
696696
EVT OpVT = N->getOperand(IsStrict ? 1 : 0).getValueType();
697-
CallOptions.setTypeListBeforeSoften(OpVT, N->getValueType(0), true);
697+
CallOptions.setTypeListBeforeSoften(OpVT, N->getValueType(0));
698698
std::pair<SDValue, SDValue> Tmp = TLI.makeLibCall(DAG, LC, NVT, Op,
699699
CallOptions, SDLoc(N),
700700
Chain);
@@ -742,7 +742,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_ExpOp(SDNode *N) {
742742
TargetLowering::MakeLibCallOptions CallOptions;
743743
EVT OpsVT[2] = { N->getOperand(0 + Offset).getValueType(),
744744
N->getOperand(1 + Offset).getValueType() };
745-
CallOptions.setTypeListBeforeSoften(OpsVT, N->getValueType(0), true);
745+
CallOptions.setTypeListBeforeSoften(OpsVT, N->getValueType(0));
746746
std::pair<SDValue, SDValue> Tmp = TLI.makeLibCall(DAG, LC, NVT, Ops,
747747
CallOptions, SDLoc(N),
748748
Chain);
@@ -779,7 +779,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FFREXP(SDNode *N) {
779779

780780
// TODO: setTypeListBeforeSoften can't properly express multiple return types,
781781
// but we only really need to handle the 0th one for softening anyway.
782-
CallOptions.setTypeListBeforeSoften({OpsVT}, VT0, true)
782+
CallOptions.setTypeListBeforeSoften({OpsVT}, VT0)
783783
.setOpsTypeOverrides(CallOpsTypeOverrides);
784784

785785
auto [ReturnVal, Chain] = TLI.makeLibCall(DAG, LC, NVT0, Ops, CallOptions, DL,
@@ -828,7 +828,7 @@ bool DAGTypeLegalizer::SoftenFloatRes_UnaryWithTwoFPResults(
828828
TargetLowering::MakeLibCallOptions CallOptions;
829829
// TODO: setTypeListBeforeSoften can't properly express multiple return types,
830830
// but since both returns have the same type it should be okay.
831-
CallOptions.setTypeListBeforeSoften({OpsVT}, VT, true)
831+
CallOptions.setTypeListBeforeSoften({OpsVT}, VT)
832832
.setOpsTypeOverrides(CallOpsTypeOverrides);
833833

834834
auto [ReturnVal, Chain] = TLI.makeLibCall(DAG, LC, NVT, Ops, CallOptions, DL,
@@ -1100,7 +1100,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_XINT_TO_FP(SDNode *N) {
11001100
NVT, N->getOperand(IsStrict ? 1 : 0));
11011101
TargetLowering::MakeLibCallOptions CallOptions;
11021102
CallOptions.setIsSigned(Signed);
1103-
CallOptions.setTypeListBeforeSoften(SVT, RVT, true);
1103+
CallOptions.setTypeListBeforeSoften(SVT, RVT);
11041104
std::pair<SDValue, SDValue> Tmp =
11051105
TLI.makeLibCall(DAG, LC, TLI.getTypeToTransformTo(*DAG.getContext(), RVT),
11061106
Op, CallOptions, dl, Chain);
@@ -1222,7 +1222,7 @@ SDValue DAGTypeLegalizer::SoftenFloatOp_FP_ROUND(SDNode *N) {
12221222
SDValue Chain = IsStrict ? N->getOperand(0) : SDValue();
12231223
Op = GetSoftenedFloat(Op);
12241224
TargetLowering::MakeLibCallOptions CallOptions;
1225-
CallOptions.setTypeListBeforeSoften(SVT, RVT, true);
1225+
CallOptions.setTypeListBeforeSoften(SVT, RVT);
12261226
std::pair<SDValue, SDValue> Tmp = TLI.makeLibCall(DAG, LC, RVT, Op,
12271227
CallOptions, SDLoc(N),
12281228
Chain);
@@ -1298,7 +1298,7 @@ SDValue DAGTypeLegalizer::SoftenFloatOp_FP_TO_XINT(SDNode *N) {
12981298
Op = GetSoftenedFloat(Op);
12991299
SDValue Chain = IsStrict ? N->getOperand(0) : SDValue();
13001300
TargetLowering::MakeLibCallOptions CallOptions;
1301-
CallOptions.setTypeListBeforeSoften(SVT, RVT, true);
1301+
CallOptions.setTypeListBeforeSoften(SVT, RVT);
13021302
std::pair<SDValue, SDValue> Tmp = TLI.makeLibCall(DAG, LC, NVT, Op,
13031303
CallOptions, dl, Chain);
13041304

@@ -1453,7 +1453,7 @@ SDValue DAGTypeLegalizer::SoftenFloatOp_Unary(SDNode *N, RTLIB::Libcall LC) {
14531453
SDValue Chain = IsStrict ? N->getOperand(0) : SDValue();
14541454
TargetLowering::MakeLibCallOptions CallOptions;
14551455
EVT OpVT = N->getOperand(0 + Offset).getValueType();
1456-
CallOptions.setTypeListBeforeSoften(OpVT, N->getValueType(0), true);
1456+
CallOptions.setTypeListBeforeSoften(OpVT, N->getValueType(0));
14571457
std::pair<SDValue, SDValue> Tmp = TLI.makeLibCall(DAG, LC, NVT, Op,
14581458
CallOptions, SDLoc(N),
14591459
Chain);
@@ -3567,7 +3567,7 @@ SDValue DAGTypeLegalizer::SoftPromoteHalfRes_FP_ROUND(SDNode *N) {
35673567
SDValue Chain = IsStrict ? N->getOperand(0) : SDValue();
35683568
Op = GetSoftenedFloat(Op);
35693569
TargetLowering::MakeLibCallOptions CallOptions;
3570-
CallOptions.setTypeListBeforeSoften(SVT, RVT, true);
3570+
CallOptions.setTypeListBeforeSoften(SVT, RVT);
35713571
std::pair<SDValue, SDValue> Tmp =
35723572
TLI.makeLibCall(DAG, LC, RVT, Op, CallOptions, SDLoc(N), Chain);
35733573
if (IsStrict)

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ void TargetLowering::softenSetCCOperands(SelectionDAG &DAG, EVT VT,
420420
TargetLowering::MakeLibCallOptions CallOptions;
421421
EVT OpsVT[2] = { OldLHS.getValueType(),
422422
OldRHS.getValueType() };
423-
CallOptions.setTypeListBeforeSoften(OpsVT, RetVT, true);
423+
CallOptions.setTypeListBeforeSoften(OpsVT, RetVT);
424424
auto Call = makeLibCall(DAG, LC1, RetVT, Ops, CallOptions, dl, Chain);
425425
NewLHS = Call.first;
426426
NewRHS = DAG.getConstant(0, dl, RetVT);

llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2786,7 +2786,7 @@ SDValue LoongArchTargetLowering::lowerUINT_TO_FP(SDValue Op,
27862786
EVT RetVT = Op.getValueType();
27872787
RTLIB::Libcall LC = RTLIB::getUINTTOFP(OpVT, RetVT);
27882788
MakeLibCallOptions CallOptions;
2789-
CallOptions.setTypeListBeforeSoften(OpVT, RetVT, true);
2789+
CallOptions.setTypeListBeforeSoften(OpVT, RetVT);
27902790
SDValue Chain = SDValue();
27912791
SDValue Result;
27922792
std::tie(Result, Chain) =
@@ -2811,7 +2811,7 @@ SDValue LoongArchTargetLowering::lowerSINT_TO_FP(SDValue Op,
28112811
EVT RetVT = Op.getValueType();
28122812
RTLIB::Libcall LC = RTLIB::getSINTTOFP(OpVT, RetVT);
28132813
MakeLibCallOptions CallOptions;
2814-
CallOptions.setTypeListBeforeSoften(OpVT, RetVT, true);
2814+
CallOptions.setTypeListBeforeSoften(OpVT, RetVT);
28152815
SDValue Chain = SDValue();
28162816
SDValue Result;
28172817
std::tie(Result, Chain) =
@@ -4107,7 +4107,7 @@ void LoongArchTargetLowering::ReplaceNodeResults(
41074107
LC = RTLIB::getFPTOSINT(Src.getValueType(), VT);
41084108
MakeLibCallOptions CallOptions;
41094109
EVT OpVT = Src.getValueType();
4110-
CallOptions.setTypeListBeforeSoften(OpVT, VT, true);
4110+
CallOptions.setTypeListBeforeSoften(OpVT, VT);
41114111
SDValue Chain = SDValue();
41124112
SDValue Result;
41134113
std::tie(Result, Chain) =
@@ -4360,7 +4360,7 @@ void LoongArchTargetLowering::ReplaceNodeResults(
43604360
RTLIB::Libcall LC =
43614361
OpVT == MVT::f64 ? RTLIB::LROUND_F64 : RTLIB::LROUND_F32;
43624362
MakeLibCallOptions CallOptions;
4363-
CallOptions.setTypeListBeforeSoften(OpVT, MVT::i64, true);
4363+
CallOptions.setTypeListBeforeSoften(OpVT, MVT::i64);
43644364
SDValue Result = makeLibCall(DAG, LC, MVT::i64, Op0, CallOptions, DL).first;
43654365
Result = DAG.getNode(ISD::TRUNCATE, DL, MVT::i32, Result);
43664366
Results.push_back(Result);

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14333,7 +14333,7 @@ void RISCVTargetLowering::ReplaceNodeResults(SDNode *N,
1433314333
LC = RTLIB::getFPTOUINT(Op0.getValueType(), N->getValueType(0));
1433414334
MakeLibCallOptions CallOptions;
1433514335
EVT OpVT = Op0.getValueType();
14336-
CallOptions.setTypeListBeforeSoften(OpVT, N->getValueType(0), true);
14336+
CallOptions.setTypeListBeforeSoften(OpVT, N->getValueType(0));
1433714337
SDValue Chain = IsStrict ? N->getOperand(0) : SDValue();
1433814338
SDValue Result;
1433914339
std::tie(Result, Chain) =
@@ -14368,7 +14368,7 @@ void RISCVTargetLowering::ReplaceNodeResults(SDNode *N,
1436814368
Op0.getValueType() == MVT::f64 ? RTLIB::LROUND_F64 : RTLIB::LROUND_F32;
1436914369
MakeLibCallOptions CallOptions;
1437014370
EVT OpVT = Op0.getValueType();
14371-
CallOptions.setTypeListBeforeSoften(OpVT, MVT::i64, true);
14371+
CallOptions.setTypeListBeforeSoften(OpVT, MVT::i64);
1437214372
SDValue Result = makeLibCall(DAG, LC, MVT::i64, Op0, CallOptions, DL).first;
1437314373
Result = DAG.getNode(ISD::TRUNCATE, DL, MVT::i32, Result);
1437414374
Results.push_back(Result);

0 commit comments

Comments
 (0)