mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-09 05:31:19 +00:00
Change makeLibCall to take an ArrayRef<SDValue> instead of pointer and size. This removes the need to pass a hardcoded size in many places. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251032 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
30385e0454
commit
ed05a5b554
@ -2105,9 +2105,9 @@ public:
|
||||
/// Returns a pair of (return value, chain).
|
||||
/// It is an error to pass RTLIB::UNKNOWN_LIBCALL as \p LC.
|
||||
std::pair<SDValue, SDValue> makeLibCall(SelectionDAG &DAG, RTLIB::Libcall LC,
|
||||
EVT RetVT, const SDValue *Ops,
|
||||
unsigned NumOps, bool isSigned,
|
||||
SDLoc dl, bool doesNotReturn = false,
|
||||
EVT RetVT, ArrayRef<SDValue> Ops,
|
||||
bool isSigned, SDLoc dl,
|
||||
bool doesNotReturn = false,
|
||||
bool isReturnValueUsed = true) const;
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
|
@ -165,7 +165,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FMINNUM(SDNode *N) {
|
||||
RTLIB::FMIN_F80,
|
||||
RTLIB::FMIN_F128,
|
||||
RTLIB::FMIN_PPCF128),
|
||||
NVT, Ops, 2, false, SDLoc(N)).first;
|
||||
NVT, Ops, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FMAXNUM(SDNode *N) {
|
||||
@ -178,7 +178,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FMAXNUM(SDNode *N) {
|
||||
RTLIB::FMAX_F80,
|
||||
RTLIB::FMAX_F128,
|
||||
RTLIB::FMAX_PPCF128),
|
||||
NVT, Ops, 2, false, SDLoc(N)).first;
|
||||
NVT, Ops, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FADD(SDNode *N) {
|
||||
@ -191,7 +191,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FADD(SDNode *N) {
|
||||
RTLIB::ADD_F80,
|
||||
RTLIB::ADD_F128,
|
||||
RTLIB::ADD_PPCF128),
|
||||
NVT, Ops, 2, false, SDLoc(N)).first;
|
||||
NVT, Ops, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FCEIL(SDNode *N) {
|
||||
@ -203,7 +203,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FCEIL(SDNode *N) {
|
||||
RTLIB::CEIL_F80,
|
||||
RTLIB::CEIL_F128,
|
||||
RTLIB::CEIL_PPCF128),
|
||||
NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FCOPYSIGN(SDNode *N) {
|
||||
@ -263,7 +263,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FCOS(SDNode *N) {
|
||||
RTLIB::COS_F80,
|
||||
RTLIB::COS_F128,
|
||||
RTLIB::COS_PPCF128),
|
||||
NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FDIV(SDNode *N) {
|
||||
@ -276,7 +276,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FDIV(SDNode *N) {
|
||||
RTLIB::DIV_F80,
|
||||
RTLIB::DIV_F128,
|
||||
RTLIB::DIV_PPCF128),
|
||||
NVT, Ops, 2, false, SDLoc(N)).first;
|
||||
NVT, Ops, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FEXP(SDNode *N) {
|
||||
@ -288,7 +288,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FEXP(SDNode *N) {
|
||||
RTLIB::EXP_F80,
|
||||
RTLIB::EXP_F128,
|
||||
RTLIB::EXP_PPCF128),
|
||||
NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FEXP2(SDNode *N) {
|
||||
@ -300,7 +300,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FEXP2(SDNode *N) {
|
||||
RTLIB::EXP2_F80,
|
||||
RTLIB::EXP2_F128,
|
||||
RTLIB::EXP2_PPCF128),
|
||||
NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FFLOOR(SDNode *N) {
|
||||
@ -312,7 +312,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FFLOOR(SDNode *N) {
|
||||
RTLIB::FLOOR_F80,
|
||||
RTLIB::FLOOR_F128,
|
||||
RTLIB::FLOOR_PPCF128),
|
||||
NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FLOG(SDNode *N) {
|
||||
@ -324,7 +324,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FLOG(SDNode *N) {
|
||||
RTLIB::LOG_F80,
|
||||
RTLIB::LOG_F128,
|
||||
RTLIB::LOG_PPCF128),
|
||||
NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FLOG2(SDNode *N) {
|
||||
@ -336,7 +336,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FLOG2(SDNode *N) {
|
||||
RTLIB::LOG2_F80,
|
||||
RTLIB::LOG2_F128,
|
||||
RTLIB::LOG2_PPCF128),
|
||||
NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FLOG10(SDNode *N) {
|
||||
@ -348,7 +348,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FLOG10(SDNode *N) {
|
||||
RTLIB::LOG10_F80,
|
||||
RTLIB::LOG10_F128,
|
||||
RTLIB::LOG10_PPCF128),
|
||||
NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FMA(SDNode *N) {
|
||||
@ -362,7 +362,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FMA(SDNode *N) {
|
||||
RTLIB::FMA_F80,
|
||||
RTLIB::FMA_F128,
|
||||
RTLIB::FMA_PPCF128),
|
||||
NVT, Ops, 3, false, SDLoc(N)).first;
|
||||
NVT, Ops, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FMUL(SDNode *N) {
|
||||
@ -375,7 +375,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FMUL(SDNode *N) {
|
||||
RTLIB::MUL_F80,
|
||||
RTLIB::MUL_F128,
|
||||
RTLIB::MUL_PPCF128),
|
||||
NVT, Ops, 2, false, SDLoc(N)).first;
|
||||
NVT, Ops, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FNEARBYINT(SDNode *N) {
|
||||
@ -387,7 +387,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FNEARBYINT(SDNode *N) {
|
||||
RTLIB::NEARBYINT_F80,
|
||||
RTLIB::NEARBYINT_F128,
|
||||
RTLIB::NEARBYINT_PPCF128),
|
||||
NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FNEG(SDNode *N) {
|
||||
@ -402,7 +402,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FNEG(SDNode *N) {
|
||||
RTLIB::SUB_F80,
|
||||
RTLIB::SUB_F128,
|
||||
RTLIB::SUB_PPCF128),
|
||||
NVT, Ops, 2, false, dl).first;
|
||||
NVT, Ops, false, dl).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FP_EXTEND(SDNode *N) {
|
||||
@ -422,7 +422,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FP_EXTEND(SDNode *N) {
|
||||
if (getTypeAction(Op.getValueType()) == TargetLowering::TypeSoftenFloat)
|
||||
Op = GetSoftenedFloat(Op);
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_EXTEND!");
|
||||
return TLI.makeLibCall(DAG, LC, NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
return TLI.makeLibCall(DAG, LC, NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
// FIXME: Should we just use 'normal' FP_EXTEND / FP_TRUNC instead of special
|
||||
@ -430,7 +430,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FP_EXTEND(SDNode *N) {
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FP16_TO_FP(SDNode *N) {
|
||||
EVT MidVT = TLI.getTypeToTransformTo(*DAG.getContext(), MVT::f32);
|
||||
SDValue Op = N->getOperand(0);
|
||||
SDValue Res32 = TLI.makeLibCall(DAG, RTLIB::FPEXT_F16_F32, MidVT, &Op, 1,
|
||||
SDValue Res32 = TLI.makeLibCall(DAG, RTLIB::FPEXT_F16_F32, MidVT, Op,
|
||||
false, SDLoc(N)).first;
|
||||
if (N->getValueType(0) == MVT::f32)
|
||||
return Res32;
|
||||
@ -438,7 +438,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FP16_TO_FP(SDNode *N) {
|
||||
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0));
|
||||
RTLIB::Libcall LC = RTLIB::getFPEXT(MVT::f32, N->getValueType(0));
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_EXTEND!");
|
||||
return TLI.makeLibCall(DAG, LC, NVT, &Res32, 1, false, SDLoc(N)).first;
|
||||
return TLI.makeLibCall(DAG, LC, NVT, Res32, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FP_ROUND(SDNode *N) {
|
||||
@ -452,7 +452,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FP_ROUND(SDNode *N) {
|
||||
|
||||
RTLIB::Libcall LC = RTLIB::getFPROUND(Op.getValueType(), N->getValueType(0));
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_ROUND!");
|
||||
return TLI.makeLibCall(DAG, LC, NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
return TLI.makeLibCall(DAG, LC, NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FPOW(SDNode *N) {
|
||||
@ -465,7 +465,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FPOW(SDNode *N) {
|
||||
RTLIB::POW_F80,
|
||||
RTLIB::POW_F128,
|
||||
RTLIB::POW_PPCF128),
|
||||
NVT, Ops, 2, false, SDLoc(N)).first;
|
||||
NVT, Ops, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FPOWI(SDNode *N) {
|
||||
@ -479,7 +479,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FPOWI(SDNode *N) {
|
||||
RTLIB::POWI_F80,
|
||||
RTLIB::POWI_F128,
|
||||
RTLIB::POWI_PPCF128),
|
||||
NVT, Ops, 2, false, SDLoc(N)).first;
|
||||
NVT, Ops, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FREM(SDNode *N) {
|
||||
@ -492,7 +492,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FREM(SDNode *N) {
|
||||
RTLIB::REM_F80,
|
||||
RTLIB::REM_F128,
|
||||
RTLIB::REM_PPCF128),
|
||||
NVT, Ops, 2, false, SDLoc(N)).first;
|
||||
NVT, Ops, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FRINT(SDNode *N) {
|
||||
@ -504,7 +504,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FRINT(SDNode *N) {
|
||||
RTLIB::RINT_F80,
|
||||
RTLIB::RINT_F128,
|
||||
RTLIB::RINT_PPCF128),
|
||||
NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FROUND(SDNode *N) {
|
||||
@ -516,7 +516,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FROUND(SDNode *N) {
|
||||
RTLIB::ROUND_F80,
|
||||
RTLIB::ROUND_F128,
|
||||
RTLIB::ROUND_PPCF128),
|
||||
NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FSIN(SDNode *N) {
|
||||
@ -528,7 +528,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FSIN(SDNode *N) {
|
||||
RTLIB::SIN_F80,
|
||||
RTLIB::SIN_F128,
|
||||
RTLIB::SIN_PPCF128),
|
||||
NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FSQRT(SDNode *N) {
|
||||
@ -540,7 +540,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FSQRT(SDNode *N) {
|
||||
RTLIB::SQRT_F80,
|
||||
RTLIB::SQRT_F128,
|
||||
RTLIB::SQRT_PPCF128),
|
||||
NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FSUB(SDNode *N) {
|
||||
@ -553,7 +553,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FSUB(SDNode *N) {
|
||||
RTLIB::SUB_F80,
|
||||
RTLIB::SUB_F128,
|
||||
RTLIB::SUB_PPCF128),
|
||||
NVT, Ops, 2, false, SDLoc(N)).first;
|
||||
NVT, Ops, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FTRUNC(SDNode *N) {
|
||||
@ -568,7 +568,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FTRUNC(SDNode *N) {
|
||||
RTLIB::TRUNC_F80,
|
||||
RTLIB::TRUNC_F128,
|
||||
RTLIB::TRUNC_PPCF128),
|
||||
NVT, &Op, 1, false, SDLoc(N)).first;
|
||||
NVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_LOAD(SDNode *N) {
|
||||
@ -665,7 +665,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_XINT_TO_FP(SDNode *N) {
|
||||
NVT, N->getOperand(0));
|
||||
return TLI.makeLibCall(DAG, LC,
|
||||
TLI.getTypeToTransformTo(*DAG.getContext(), RVT),
|
||||
&Op, 1, Signed, dl).first;
|
||||
Op, Signed, dl).first;
|
||||
}
|
||||
|
||||
|
||||
@ -730,7 +730,7 @@ SDValue DAGTypeLegalizer::SoftenFloatOp_FP_EXTEND(SDNode *N) {
|
||||
RTLIB::Libcall LC = RTLIB::getFPEXT(SVT, RVT);
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_EXTEND libcall");
|
||||
|
||||
return TLI.makeLibCall(DAG, LC, RVT, &Op, 1, false, SDLoc(N)).first;
|
||||
return TLI.makeLibCall(DAG, LC, RVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
|
||||
@ -747,7 +747,7 @@ SDValue DAGTypeLegalizer::SoftenFloatOp_FP_ROUND(SDNode *N) {
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_ROUND libcall");
|
||||
|
||||
SDValue Op = GetSoftenedFloat(N->getOperand(0));
|
||||
return TLI.makeLibCall(DAG, LC, RVT, &Op, 1, false, SDLoc(N)).first;
|
||||
return TLI.makeLibCall(DAG, LC, RVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatOp_BR_CC(SDNode *N) {
|
||||
@ -778,7 +778,7 @@ SDValue DAGTypeLegalizer::SoftenFloatOp_FP_TO_SINT(SDNode *N) {
|
||||
RTLIB::Libcall LC = RTLIB::getFPTOSINT(N->getOperand(0).getValueType(), RVT);
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_TO_SINT!");
|
||||
SDValue Op = GetSoftenedFloat(N->getOperand(0));
|
||||
return TLI.makeLibCall(DAG, LC, RVT, &Op, 1, false, SDLoc(N)).first;
|
||||
return TLI.makeLibCall(DAG, LC, RVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatOp_FP_TO_UINT(SDNode *N) {
|
||||
@ -786,7 +786,7 @@ SDValue DAGTypeLegalizer::SoftenFloatOp_FP_TO_UINT(SDNode *N) {
|
||||
RTLIB::Libcall LC = RTLIB::getFPTOUINT(N->getOperand(0).getValueType(), RVT);
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_TO_UINT!");
|
||||
SDValue Op = GetSoftenedFloat(N->getOperand(0));
|
||||
return TLI.makeLibCall(DAG, LC, RVT, &Op, 1, false, SDLoc(N)).first;
|
||||
return TLI.makeLibCall(DAG, LC, RVT, Op, false, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatOp_SELECT_CC(SDNode *N) {
|
||||
@ -1028,7 +1028,7 @@ void DAGTypeLegalizer::ExpandFloatRes_FDIV(SDNode *N, SDValue &Lo,
|
||||
RTLIB::DIV_F80,
|
||||
RTLIB::DIV_F128,
|
||||
RTLIB::DIV_PPCF128),
|
||||
N->getValueType(0), Ops, 2, false,
|
||||
N->getValueType(0), Ops, false,
|
||||
SDLoc(N)).first;
|
||||
GetPairElements(Call, Lo, Hi);
|
||||
}
|
||||
@ -1102,7 +1102,7 @@ void DAGTypeLegalizer::ExpandFloatRes_FMA(SDNode *N, SDValue &Lo,
|
||||
RTLIB::FMA_F80,
|
||||
RTLIB::FMA_F128,
|
||||
RTLIB::FMA_PPCF128),
|
||||
N->getValueType(0), Ops, 3, false,
|
||||
N->getValueType(0), Ops, false,
|
||||
SDLoc(N)).first;
|
||||
GetPairElements(Call, Lo, Hi);
|
||||
}
|
||||
@ -1116,7 +1116,7 @@ void DAGTypeLegalizer::ExpandFloatRes_FMUL(SDNode *N, SDValue &Lo,
|
||||
RTLIB::MUL_F80,
|
||||
RTLIB::MUL_F128,
|
||||
RTLIB::MUL_PPCF128),
|
||||
N->getValueType(0), Ops, 2, false,
|
||||
N->getValueType(0), Ops, false,
|
||||
SDLoc(N)).first;
|
||||
GetPairElements(Call, Lo, Hi);
|
||||
}
|
||||
@ -1231,7 +1231,7 @@ void DAGTypeLegalizer::ExpandFloatRes_FSUB(SDNode *N, SDValue &Lo,
|
||||
RTLIB::SUB_F80,
|
||||
RTLIB::SUB_F128,
|
||||
RTLIB::SUB_PPCF128),
|
||||
N->getValueType(0), Ops, 2, false,
|
||||
N->getValueType(0), Ops, false,
|
||||
SDLoc(N)).first;
|
||||
GetPairElements(Call, Lo, Hi);
|
||||
}
|
||||
@ -1310,7 +1310,7 @@ void DAGTypeLegalizer::ExpandFloatRes_XINT_TO_FP(SDNode *N, SDValue &Lo,
|
||||
}
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported XINT_TO_FP!");
|
||||
|
||||
Hi = TLI.makeLibCall(DAG, LC, VT, &Src, 1, true, dl).first;
|
||||
Hi = TLI.makeLibCall(DAG, LC, VT, Src, true, dl).first;
|
||||
GetPairElements(Hi, Lo, Hi);
|
||||
}
|
||||
|
||||
@ -1495,7 +1495,7 @@ SDValue DAGTypeLegalizer::ExpandFloatOp_FP_TO_SINT(SDNode *N) {
|
||||
|
||||
RTLIB::Libcall LC = RTLIB::getFPTOSINT(N->getOperand(0).getValueType(), RVT);
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_TO_SINT!");
|
||||
return TLI.makeLibCall(DAG, LC, RVT, &N->getOperand(0), 1, false, dl).first;
|
||||
return TLI.makeLibCall(DAG, LC, RVT, N->getOperand(0), false, dl).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::ExpandFloatOp_FP_TO_UINT(SDNode *N) {
|
||||
@ -1529,7 +1529,7 @@ SDValue DAGTypeLegalizer::ExpandFloatOp_FP_TO_UINT(SDNode *N) {
|
||||
|
||||
RTLIB::Libcall LC = RTLIB::getFPTOUINT(N->getOperand(0).getValueType(), RVT);
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_TO_UINT!");
|
||||
return TLI.makeLibCall(DAG, LC, N->getValueType(0), &N->getOperand(0), 1,
|
||||
return TLI.makeLibCall(DAG, LC, N->getValueType(0), N->getOperand(0),
|
||||
false, dl).first;
|
||||
}
|
||||
|
||||
|
@ -1917,8 +1917,7 @@ void DAGTypeLegalizer::ExpandIntRes_FP_TO_SINT(SDNode *N, SDValue &Lo,
|
||||
|
||||
RTLIB::Libcall LC = RTLIB::getFPTOSINT(Op.getValueType(), VT);
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unexpected fp-to-sint conversion!");
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, &Op, 1, true/*irrelevant*/,
|
||||
dl).first,
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Op, true/*irrelevant*/, dl).first,
|
||||
Lo, Hi);
|
||||
}
|
||||
|
||||
@ -1933,8 +1932,7 @@ void DAGTypeLegalizer::ExpandIntRes_FP_TO_UINT(SDNode *N, SDValue &Lo,
|
||||
|
||||
RTLIB::Libcall LC = RTLIB::getFPTOUINT(Op.getValueType(), VT);
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unexpected fp-to-uint conversion!");
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, &Op, 1, false/*irrelevant*/,
|
||||
dl).first,
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Op, false/*irrelevant*/, dl).first,
|
||||
Lo, Hi);
|
||||
}
|
||||
|
||||
@ -2095,8 +2093,7 @@ void DAGTypeLegalizer::ExpandIntRes_MUL(SDNode *N,
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported MUL!");
|
||||
|
||||
SDValue Ops[2] = { N->getOperand(0), N->getOperand(1) };
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, 2, true/*irrelevant*/,
|
||||
dl).first,
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, true/*irrelevant*/, dl).first,
|
||||
Lo, Hi);
|
||||
}
|
||||
|
||||
@ -2176,7 +2173,7 @@ void DAGTypeLegalizer::ExpandIntRes_SDIV(SDNode *N,
|
||||
LC = RTLIB::SDIV_I128;
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported SDIV!");
|
||||
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, 2, true, dl).first, Lo, Hi);
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, true, dl).first, Lo, Hi);
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandIntRes_Shift(SDNode *N,
|
||||
@ -2271,8 +2268,7 @@ void DAGTypeLegalizer::ExpandIntRes_Shift(SDNode *N,
|
||||
|
||||
if (LC != RTLIB::UNKNOWN_LIBCALL && TLI.getLibcallName(LC)) {
|
||||
SDValue Ops[2] = { N->getOperand(0), N->getOperand(1) };
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, 2, isSigned, dl).first, Lo,
|
||||
Hi);
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, isSigned, dl).first, Lo, Hi);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2362,7 +2358,7 @@ void DAGTypeLegalizer::ExpandIntRes_SREM(SDNode *N,
|
||||
LC = RTLIB::SREM_I128;
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported SREM!");
|
||||
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, 2, true, dl).first, Lo, Hi);
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, true, dl).first, Lo, Hi);
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandIntRes_TRUNCATE(SDNode *N,
|
||||
@ -2509,7 +2505,7 @@ void DAGTypeLegalizer::ExpandIntRes_UDIV(SDNode *N,
|
||||
LC = RTLIB::UDIV_I128;
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported UDIV!");
|
||||
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, 2, false, dl).first, Lo, Hi);
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, false, dl).first, Lo, Hi);
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandIntRes_UREM(SDNode *N,
|
||||
@ -2535,7 +2531,7 @@ void DAGTypeLegalizer::ExpandIntRes_UREM(SDNode *N,
|
||||
LC = RTLIB::UREM_I128;
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported UREM!");
|
||||
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, 2, false, dl).first, Lo, Hi);
|
||||
SplitInteger(TLI.makeLibCall(DAG, LC, VT, Ops, false, dl).first, Lo, Hi);
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandIntRes_ZERO_EXTEND(SDNode *N,
|
||||
@ -2830,7 +2826,7 @@ SDValue DAGTypeLegalizer::ExpandIntOp_SINT_TO_FP(SDNode *N) {
|
||||
RTLIB::Libcall LC = RTLIB::getSINTTOFP(Op.getValueType(), DstVT);
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL &&
|
||||
"Don't know how to expand this SINT_TO_FP!");
|
||||
return TLI.makeLibCall(DAG, LC, DstVT, &Op, 1, true, SDLoc(N)).first;
|
||||
return TLI.makeLibCall(DAG, LC, DstVT, Op, true, SDLoc(N)).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::ExpandIntOp_STORE(StoreSDNode *N, unsigned OpNo) {
|
||||
@ -3001,7 +2997,7 @@ SDValue DAGTypeLegalizer::ExpandIntOp_UINT_TO_FP(SDNode *N) {
|
||||
RTLIB::Libcall LC = RTLIB::getUINTTOFP(SrcVT, DstVT);
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL &&
|
||||
"Don't know how to expand this UINT_TO_FP!");
|
||||
return TLI.makeLibCall(DAG, LC, DstVT, &Op, 1, true, dl).first;
|
||||
return TLI.makeLibCall(DAG, LC, DstVT, Op, true, dl).first;
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::ExpandIntOp_ATOMIC_STORE(SDNode *N) {
|
||||
|
@ -1039,23 +1039,22 @@ SDValue DAGTypeLegalizer::LibCallify(RTLIB::Libcall LC, SDNode *N,
|
||||
unsigned NumOps = N->getNumOperands();
|
||||
SDLoc dl(N);
|
||||
if (NumOps == 0) {
|
||||
return TLI.makeLibCall(DAG, LC, N->getValueType(0), nullptr, 0, isSigned,
|
||||
return TLI.makeLibCall(DAG, LC, N->getValueType(0), None, isSigned,
|
||||
dl).first;
|
||||
} else if (NumOps == 1) {
|
||||
SDValue Op = N->getOperand(0);
|
||||
return TLI.makeLibCall(DAG, LC, N->getValueType(0), &Op, 1, isSigned,
|
||||
return TLI.makeLibCall(DAG, LC, N->getValueType(0), Op, isSigned,
|
||||
dl).first;
|
||||
} else if (NumOps == 2) {
|
||||
SDValue Ops[2] = { N->getOperand(0), N->getOperand(1) };
|
||||
return TLI.makeLibCall(DAG, LC, N->getValueType(0), Ops, 2, isSigned,
|
||||
return TLI.makeLibCall(DAG, LC, N->getValueType(0), Ops, isSigned,
|
||||
dl).first;
|
||||
}
|
||||
SmallVector<SDValue, 8> Ops(NumOps);
|
||||
for (unsigned i = 0; i < NumOps; ++i)
|
||||
Ops[i] = N->getOperand(i);
|
||||
|
||||
return TLI.makeLibCall(DAG, LC, N->getValueType(0),
|
||||
&Ops[0], NumOps, isSigned, dl).first;
|
||||
return TLI.makeLibCall(DAG, LC, N->getValueType(0), Ops, isSigned, dl).first;
|
||||
}
|
||||
|
||||
// ExpandChainLibCall - Expand a node into a call to a libcall. Similar to
|
||||
|
@ -1989,7 +1989,7 @@ SelectionDAGBuilder::visitSPDescriptorFailure(StackProtectorDescriptor &SPD) {
|
||||
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
|
||||
SDValue Chain =
|
||||
TLI.makeLibCall(DAG, RTLIB::STACKPROTECTOR_CHECK_FAIL, MVT::isVoid,
|
||||
nullptr, 0, false, getCurSDLoc(), false, false).second;
|
||||
None, false, getCurSDLoc(), false, false).second;
|
||||
DAG.setRoot(Chain);
|
||||
}
|
||||
|
||||
|
@ -85,19 +85,19 @@ void TargetLowering::ArgListEntry::setAttributes(ImmutableCallSite *CS,
|
||||
std::pair<SDValue, SDValue>
|
||||
TargetLowering::makeLibCall(SelectionDAG &DAG,
|
||||
RTLIB::Libcall LC, EVT RetVT,
|
||||
const SDValue *Ops, unsigned NumOps,
|
||||
ArrayRef<SDValue> Ops,
|
||||
bool isSigned, SDLoc dl,
|
||||
bool doesNotReturn,
|
||||
bool isReturnValueUsed) const {
|
||||
TargetLowering::ArgListTy Args;
|
||||
Args.reserve(NumOps);
|
||||
Args.reserve(Ops.size());
|
||||
|
||||
TargetLowering::ArgListEntry Entry;
|
||||
for (unsigned i = 0; i != NumOps; ++i) {
|
||||
Entry.Node = Ops[i];
|
||||
for (SDValue Op : Ops) {
|
||||
Entry.Node = Op;
|
||||
Entry.Ty = Entry.Node.getValueType().getTypeForEVT(*DAG.getContext());
|
||||
Entry.isSExt = shouldSignExtendTypeInLibCall(Ops[i].getValueType(), isSigned);
|
||||
Entry.isZExt = !shouldSignExtendTypeInLibCall(Ops[i].getValueType(), isSigned);
|
||||
Entry.isSExt = shouldSignExtendTypeInLibCall(Op.getValueType(), isSigned);
|
||||
Entry.isZExt = !shouldSignExtendTypeInLibCall(Op.getValueType(), isSigned);
|
||||
Args.push_back(Entry);
|
||||
}
|
||||
if (LC == RTLIB::UNKNOWN_LIBCALL)
|
||||
@ -206,8 +206,8 @@ void TargetLowering::softenSetCCOperands(SelectionDAG &DAG, EVT VT,
|
||||
// Use the target specific return value for comparions lib calls.
|
||||
EVT RetVT = getCmpLibcallReturnType();
|
||||
SDValue Ops[2] = {NewLHS, NewRHS};
|
||||
NewLHS =
|
||||
makeLibCall(DAG, LC1, RetVT, Ops, 2, false /*sign irrelevant*/, dl).first;
|
||||
NewLHS = makeLibCall(DAG, LC1, RetVT, Ops, false /*sign irrelevant*/,
|
||||
dl).first;
|
||||
NewRHS = DAG.getConstant(0, dl, RetVT);
|
||||
|
||||
CCCode = getCmpLibcallCC(LC1);
|
||||
@ -219,8 +219,8 @@ void TargetLowering::softenSetCCOperands(SelectionDAG &DAG, EVT VT,
|
||||
ISD::SETCC, dl,
|
||||
getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(), RetVT),
|
||||
NewLHS, NewRHS, DAG.getCondCode(CCCode));
|
||||
NewLHS = makeLibCall(DAG, LC2, RetVT, Ops, 2, false/*sign irrelevant*/,
|
||||
dl).first;
|
||||
NewLHS = makeLibCall(DAG, LC2, RetVT, Ops, false/*sign irrelevant*/,
|
||||
dl).first;
|
||||
NewLHS = DAG.getNode(
|
||||
ISD::SETCC, dl,
|
||||
getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(), RetVT),
|
||||
|
@ -1659,8 +1659,7 @@ getAArch64XALUOOp(AArch64CC::CondCode &CC, SDValue Op, SelectionDAG &DAG) {
|
||||
SDValue AArch64TargetLowering::LowerF128Call(SDValue Op, SelectionDAG &DAG,
|
||||
RTLIB::Libcall Call) const {
|
||||
SmallVector<SDValue, 2> Ops(Op->op_begin(), Op->op_end());
|
||||
return makeLibCall(DAG, Call, MVT::f128, &Ops[0], Ops.size(), false,
|
||||
SDLoc(Op)).first;
|
||||
return makeLibCall(DAG, Call, MVT::f128, Ops, false, SDLoc(Op)).first;
|
||||
}
|
||||
|
||||
static SDValue LowerXOR(SDValue Op, SelectionDAG &DAG) {
|
||||
@ -1839,8 +1838,8 @@ SDValue AArch64TargetLowering::LowerFP_ROUND(SDValue Op,
|
||||
// precise. That doesn't take part in the LibCall so we can't directly use
|
||||
// LowerF128Call.
|
||||
SDValue SrcVal = Op.getOperand(0);
|
||||
return makeLibCall(DAG, LC, Op.getValueType(), &SrcVal, 1,
|
||||
/*isSigned*/ false, SDLoc(Op)).first;
|
||||
return makeLibCall(DAG, LC, Op.getValueType(), SrcVal, /*isSigned*/ false,
|
||||
SDLoc(Op)).first;
|
||||
}
|
||||
|
||||
static SDValue LowerVectorFP_TO_INT(SDValue Op, SelectionDAG &DAG) {
|
||||
@ -1896,8 +1895,7 @@ SDValue AArch64TargetLowering::LowerFP_TO_INT(SDValue Op,
|
||||
LC = RTLIB::getFPTOUINT(Op.getOperand(0).getValueType(), Op.getValueType());
|
||||
|
||||
SmallVector<SDValue, 2> Ops(Op->op_begin(), Op->op_end());
|
||||
return makeLibCall(DAG, LC, Op.getValueType(), &Ops[0], Ops.size(), false,
|
||||
SDLoc(Op)).first;
|
||||
return makeLibCall(DAG, LC, Op.getValueType(), Ops, false, SDLoc(Op)).first;
|
||||
}
|
||||
|
||||
static SDValue LowerVectorINT_TO_FP(SDValue Op, SelectionDAG &DAG) {
|
||||
|
@ -3915,7 +3915,7 @@ SDValue ARMTargetLowering::LowerFP_TO_INT(SDValue Op, SelectionDAG &DAG) const {
|
||||
else
|
||||
LC = RTLIB::getFPTOUINT(Op.getOperand(0).getValueType(),
|
||||
Op.getValueType());
|
||||
return makeLibCall(DAG, LC, Op.getValueType(), &Op.getOperand(0), 1,
|
||||
return makeLibCall(DAG, LC, Op.getValueType(), Op.getOperand(0),
|
||||
/*isSigned*/ false, SDLoc(Op)).first;
|
||||
}
|
||||
|
||||
@ -3967,7 +3967,7 @@ SDValue ARMTargetLowering::LowerINT_TO_FP(SDValue Op, SelectionDAG &DAG) const {
|
||||
else
|
||||
LC = RTLIB::getUINTTOFP(Op.getOperand(0).getValueType(),
|
||||
Op.getValueType());
|
||||
return makeLibCall(DAG, LC, Op.getValueType(), &Op.getOperand(0), 1,
|
||||
return makeLibCall(DAG, LC, Op.getValueType(), Op.getOperand(0),
|
||||
/*isSigned*/ false, SDLoc(Op)).first;
|
||||
}
|
||||
|
||||
@ -11383,8 +11383,8 @@ SDValue ARMTargetLowering::LowerFP_EXTEND(SDValue Op, SelectionDAG &DAG) const {
|
||||
LC = RTLIB::getFPEXT(Op.getOperand(0).getValueType(), Op.getValueType());
|
||||
|
||||
SDValue SrcVal = Op.getOperand(0);
|
||||
return makeLibCall(DAG, LC, Op.getValueType(), &SrcVal, 1,
|
||||
/*isSigned*/ false, SDLoc(Op)).first;
|
||||
return makeLibCall(DAG, LC, Op.getValueType(), SrcVal, /*isSigned*/ false,
|
||||
SDLoc(Op)).first;
|
||||
}
|
||||
|
||||
SDValue ARMTargetLowering::LowerFP_ROUND(SDValue Op, SelectionDAG &DAG) const {
|
||||
@ -11396,8 +11396,8 @@ SDValue ARMTargetLowering::LowerFP_ROUND(SDValue Op, SelectionDAG &DAG) const {
|
||||
LC = RTLIB::getFPROUND(Op.getOperand(0).getValueType(), Op.getValueType());
|
||||
|
||||
SDValue SrcVal = Op.getOperand(0);
|
||||
return makeLibCall(DAG, LC, Op.getValueType(), &SrcVal, 1,
|
||||
/*isSigned*/ false, SDLoc(Op)).first;
|
||||
return makeLibCall(DAG, LC, Op.getValueType(), SrcVal, /*isSigned*/ false,
|
||||
SDLoc(Op)).first;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -2885,7 +2885,7 @@ static SDValue LowerUMULO_SMULO(SDValue Op, SelectionDAG &DAG,
|
||||
|
||||
SDValue MulResult = TLI.makeLibCall(DAG,
|
||||
RTLIB::MUL_I128, WideVT,
|
||||
Args, 4, isSigned, dl).first;
|
||||
Args, isSigned, dl).first;
|
||||
SDValue BottomHalf = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, VT,
|
||||
MulResult, DAG.getIntPtrConstant(0, dl));
|
||||
SDValue TopHalf = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, VT,
|
||||
|
Loading…
Reference in New Issue
Block a user