27#define DEBUG_TYPE "legalize-types"
39 VT == MVT::f32 ? Call_F32 :
40 VT == MVT::f64 ? Call_F64 :
41 VT == MVT::f80 ? Call_F80 :
42 VT == MVT::f128 ? Call_F128 :
43 VT == MVT::ppcf128 ? Call_PPCF128 :
44 RTLIB::UNKNOWN_LIBCALL;
51void DAGTypeLegalizer::SoftenFloatResult(
SDNode *
N,
unsigned ResNo) {
52 LLVM_DEBUG(
dbgs() <<
"Soften float result " << ResNo <<
": ";
N->dump(&DAG));
55 switch (
N->getOpcode()) {
59 dbgs() <<
"SoftenFloatResult #" << ResNo <<
": ";
60 N->dump(&DAG);
dbgs() <<
"\n";
71 R = SoftenFloatRes_EXTRACT_VECTOR_ELT(
N, ResNo);
break;
101 case ISD::FMA:
R = SoftenFloatRes_FMA(
N);
break;
161 SetSoftenedFloat(
SDValue(
N, ResNo), R);
166 bool IsStrict =
N->isStrictFPOpcode();
168 unsigned Offset = IsStrict ? 1 : 0;
170 "Unexpected number of operands!");
174 EVT OpVT =
N->getOperand(0 +
Offset).getValueType();
176 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT,
Op,
180 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
185 bool IsStrict =
N->isStrictFPOpcode();
187 unsigned Offset = IsStrict ? 1 : 0;
189 "Unexpected number of operands!");
191 GetSoftenedFloat(
N->getOperand(1 +
Offset)) };
194 EVT OpsVT[2] = {
N->getOperand(0 +
Offset).getValueType(),
195 N->getOperand(1 +
Offset).getValueType() };
197 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT, Ops,
201 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
206 return BitConvertToInteger(
N->getOperand(0));
212 GetSoftenedFloat(
N->getOperand(0)));
218 GetSoftenedFloat(
N->getOperand(0)));
224 SDValue Op = DisintegrateMERGE_VALUES(
N, ResNo);
225 return BitConvertToInteger(
Op);
233 BitConvertToInteger(
N->getOperand(0)),
234 BitConvertToInteger(
N->getOperand(1)));
250 APInt Val(128, words);
261SDValue DAGTypeLegalizer::SoftenFloatRes_EXTRACT_ELEMENT(
SDNode *
N) {
263 assert(Src.getValueType() == MVT::ppcf128 &&
264 "In floats only ppcf128 can be extracted by element!");
266 N->getValueType(0).changeTypeToInteger(),
270SDValue DAGTypeLegalizer::SoftenFloatRes_EXTRACT_VECTOR_ELT(
SDNode *
N,
unsigned ResNo) {
271 SDValue NewOp = BitConvertVectorToIntegerVector(
N->getOperand(0));
274 NewOp,
N->getOperand(1));
285 SDValue Op = GetSoftenedFloat(
N->getOperand(0));
291 return SoftenFloatRes_SELECT_CC(SelCC.getNode());
297 RTLIB::FMIN_PPCF128));
302 return SoftenFloatRes_SELECT_CC(SelCC.getNode());
308 RTLIB::FMAX_PPCF128));
317 RTLIB::ADD_PPCF128));
326 RTLIB::CBRT_PPCF128));
335 RTLIB::CEIL_PPCF128));
340 SDValue RHS = BitConvertToInteger(
N->getOperand(1));
343 EVT LVT =
LHS.getValueType();
344 EVT RVT =
RHS.getValueType();
365 }
else if (SizeDiff < 0) {
392 RTLIB::COS_PPCF128));
401 RTLIB::DIV_PPCF128));
410 RTLIB::EXP_PPCF128));
419 RTLIB::EXP2_PPCF128));
423 return SoftenFloatRes_Unary(
425 GetFPLibCall(
N->getValueType(0), RTLIB::EXP10_F32, RTLIB::EXP10_F64,
426 RTLIB::EXP10_F80, RTLIB::EXP10_F128, RTLIB::EXP10_PPCF128));
435 RTLIB::FLOOR_PPCF128));
444 RTLIB::LOG_PPCF128));
453 RTLIB::LOG2_PPCF128));
462 RTLIB::LOG10_PPCF128));
466 bool IsStrict =
N->isStrictFPOpcode();
468 unsigned Offset = IsStrict ? 1 : 0;
470 GetSoftenedFloat(
N->getOperand(1 +
Offset)),
471 GetSoftenedFloat(
N->getOperand(2 +
Offset)) };
474 EVT OpsVT[3] = {
N->getOperand(0 +
Offset).getValueType(),
475 N->getOperand(1 +
Offset).getValueType(),
476 N->getOperand(2 +
Offset).getValueType() };
478 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG,
485 NVT, Ops, CallOptions,
SDLoc(
N), Chain);
487 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
497 RTLIB::MUL_PPCF128));
502 RTLIB::NEARBYINT_F32,
503 RTLIB::NEARBYINT_F64,
504 RTLIB::NEARBYINT_F80,
505 RTLIB::NEARBYINT_F128,
506 RTLIB::NEARBYINT_PPCF128));
520 bool IsStrict =
N->isStrictFPOpcode();
527 Op = GetPromotedFloat(
Op);
530 if (
Op.getValueType() ==
N->getValueType(0)) {
532 ReplaceValueWith(
SDValue(
N, 1), Chain);
533 return BitConvertToInteger(
Op);
541 if ((
Op.getValueType() == MVT::f16 ||
Op.getValueType() == MVT::bf16) &&
542 N->getValueType(0) != MVT::f32) {
545 { MVT::f32, MVT::Other }, { Chain,
Op });
546 Chain =
Op.getValue(1);
552 if (
Op.getValueType() == MVT::bf16) {
554 return SoftenFloatRes_BF16_TO_FP(
N);
558 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported FP_EXTEND!");
560 EVT OpVT =
N->getOperand(IsStrict ? 1 : 0).getValueType();
562 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT,
Op,
566 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
576 EVT OpsVT[1] = {
N->getOperand(0).getValueType() };
579 CallOptions,
SDLoc(
N)).first;
580 if (
N->getValueType(0) == MVT::f32)
585 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported FP_EXTEND!");
592 assert(
N->getValueType(0) == MVT::f32 &&
593 "Can only soften BF16_TO_FP with f32 result");
605 bool IsStrict =
N->isStrictFPOpcode();
610 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported FP_ROUND!");
612 EVT OpVT =
N->getOperand(IsStrict ? 1 : 0).getValueType();
614 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT,
Op,
618 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
628 RTLIB::POW_PPCF128));
632 bool IsStrict =
N->isStrictFPOpcode();
633 unsigned Offset = IsStrict ? 1 : 0;
634 assert((
N->getOperand(1 +
Offset).getValueType() == MVT::i16 ||
635 N->getOperand(1 +
Offset).getValueType() == MVT::i32) &&
636 "Unsupported power type!");
642 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unexpected fpowi.");
651 N->getOperand(1 +
Offset).getValueType().getSizeInBits()) {
663 EVT OpsVT[2] = {
N->getOperand(0 +
Offset).getValueType(),
664 N->getOperand(1 +
Offset).getValueType() };
666 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT, Ops,
670 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
675 assert(!
N->isStrictFPOpcode() &&
"strictfp not implemented for frexp");
676 EVT VT0 =
N->getValueType(0);
677 EVT VT1 =
N->getValueType(1);
694 SDValue Ops[2] = {GetSoftenedFloat(
N->getOperand(0)), StackSlot};
701 auto [ReturnVal, Chain] = TLI.
makeLibCall(DAG, LC, NVT0, Ops, CallOptions,
DL,
703 int FrameIdx = cast<FrameIndexSDNode>(StackSlot)->getIndex();
709 ReplaceValueWith(
SDValue(
N, 1), LoadExp);
719 RTLIB::REM_PPCF128));
728 RTLIB::RINT_PPCF128));
737 RTLIB::ROUND_PPCF128));
742 RTLIB::ROUNDEVEN_F32,
743 RTLIB::ROUNDEVEN_F64,
744 RTLIB::ROUNDEVEN_F80,
745 RTLIB::ROUNDEVEN_F128,
746 RTLIB::ROUNDEVEN_PPCF128));
755 RTLIB::SIN_PPCF128));
764 RTLIB::SQRT_PPCF128));
773 RTLIB::SUB_PPCF128));
782 RTLIB::TRUNC_PPCF128));
787 EVT VT =
N->getValueType(0);
792 L->getMemOperand()->getFlags() &
796 NewL = DAG.
getLoad(
L->getAddressingMode(),
L->getExtensionType(), NVT, dl,
797 L->getChain(),
L->getBasePtr(),
L->getOffset(),
798 L->getPointerInfo(), NVT,
L->getOriginalAlign(),
799 MMOFlags,
L->getAAInfo());
808 dl,
L->getChain(),
L->getBasePtr(),
L->getOffset(),
809 L->getPointerInfo(),
L->getMemoryVT(),
810 L->getOriginalAlign(), MMOFlags,
L->getAAInfo());
815 return BitConvertToInteger(ExtendNode);
822 LHS.getValueType(),
N->getOperand(0), LHS, RHS);
829 LHS.getValueType(),
N->getOperand(0),
830 N->getOperand(1), LHS, RHS,
N->getOperand(4));
835 N->getValueType(0)));
841 EVT VT =
N->getValueType(0);
846 NewVAARG = DAG.
getVAArg(NVT, dl, Chain,
Ptr,
N->getOperand(2),
847 N->getConstantOperandVal(3));
857 bool IsStrict =
N->isStrictFPOpcode();
860 EVT SVT =
N->getOperand(IsStrict ? 1 : 0).getValueType();
861 EVT RVT =
N->getValueType(0);
869 for (
unsigned t = MVT::FIRST_INTEGER_VALUETYPE;
870 t <= MVT::LAST_INTEGER_VALUETYPE && LC == RTLIB::UNKNOWN_LIBCALL; ++t) {
876 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported XINT_TO_FP!");
881 NVT,
N->getOperand(IsStrict ? 1 : 0));
885 std::pair<SDValue, SDValue> Tmp =
887 Op, CallOptions, dl, Chain);
890 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
900SDValue DAGTypeLegalizer::SoftenFloatRes_VECREDUCE_SEQ(
SDNode *
N) {
909bool DAGTypeLegalizer::SoftenFloatOperand(
SDNode *
N,
unsigned OpNo) {
910 LLVM_DEBUG(
dbgs() <<
"Soften float operand " << OpNo <<
": ";
N->dump(&DAG));
913 switch (
N->getOpcode()) {
916 dbgs() <<
"SoftenFloatOperand Op #" << OpNo <<
": ";
917 N->dump(&DAG);
dbgs() <<
"\n";
922 case ISD::BR_CC: Res = SoftenFloatOp_BR_CC(
N);
break;
935 Res = SoftenFloatOp_FP_TO_XINT_SAT(
N);
break;
941 case ISD::LRINT: Res = SoftenFloatOp_LRINT(
N);
break;
947 case ISD::SETCC: Res = SoftenFloatOp_SETCC(
N);
break;
948 case ISD::STORE: Res = SoftenFloatOp_STORE(
N, OpNo);
break;
953 if (!Res.
getNode())
return false;
961 "Invalid operand softening");
963 ReplaceValueWith(
SDValue(
N, 0), Res);
968 SDValue Op0 = GetSoftenedFloat(
N->getOperand(0));
982 bool IsStrict =
N->isStrictFPOpcode();
984 EVT SVT =
Op.getValueType();
985 EVT RVT =
N->getValueType(0);
992 FloatRVT = MVT::bf16;
995 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported FP_ROUND libcall");
998 Op = GetSoftenedFloat(
Op);
1001 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, RVT,
Op,
1005 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
1006 ReplaceValueWith(
SDValue(
N, 0), Tmp.first);
1013 SDValue NewLHS =
N->getOperand(2), NewRHS =
N->getOperand(3);
1014 ISD::CondCode CCCode = cast<CondCodeSDNode>(
N->getOperand(1))->get();
1017 NewLHS = GetSoftenedFloat(NewLHS);
1018 NewRHS = GetSoftenedFloat(NewRHS);
1020 N->getOperand(2),
N->getOperand(3));
1024 if (!NewRHS.getNode()) {
1042 for (
unsigned IntVT = MVT::FIRST_INTEGER_VALUETYPE;
1043 IntVT <= MVT::LAST_INTEGER_VALUETYPE && LC == RTLIB::UNKNOWN_LIBCALL;
1047 if (Promoted.
bitsGE(RetVT))
1055 bool IsStrict =
N->isStrictFPOpcode();
1059 SDValue Op =
N->getOperand(IsStrict ? 1 : 0);
1060 EVT SVT =
Op.getValueType();
1061 EVT RVT =
N->getValueType(0);
1071 "Unsupported FP_TO_XINT!");
1073 Op = GetSoftenedFloat(
Op);
1077 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT,
Op,
1078 CallOptions, dl, Chain);
1086 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
1087 ReplaceValueWith(
SDValue(
N, 0), Res);
1091SDValue DAGTypeLegalizer::SoftenFloatOp_FP_TO_XINT_SAT(
SDNode *
N) {
1097 SDValue NewLHS =
N->getOperand(0), NewRHS =
N->getOperand(1);
1098 ISD::CondCode CCCode = cast<CondCodeSDNode>(
N->getOperand(4))->get();
1101 NewLHS = GetSoftenedFloat(NewLHS);
1102 NewRHS = GetSoftenedFloat(NewRHS);
1104 N->getOperand(0),
N->getOperand(1));
1108 if (!NewRHS.getNode()) {
1115 N->getOperand(2),
N->getOperand(3),
1121 bool IsStrict =
N->isStrictFPOpcode();
1122 SDValue Op0 =
N->getOperand(IsStrict ? 1 : 0);
1123 SDValue Op1 =
N->getOperand(IsStrict ? 2 : 1);
1126 cast<CondCodeSDNode>(
N->getOperand(IsStrict ? 3 : 2))->get();
1129 SDValue NewLHS = GetSoftenedFloat(Op0);
1130 SDValue NewRHS = GetSoftenedFloat(Op1);
1146 "Unexpected setcc expansion!");
1149 ReplaceValueWith(
SDValue(
N, 0), NewLHS);
1150 ReplaceValueWith(
SDValue(
N, 1), Chain);
1156SDValue DAGTypeLegalizer::SoftenFloatOp_STORE(
SDNode *
N,
unsigned OpNo) {
1158 assert(OpNo == 1 &&
"Can only soften the stored value!");
1163 if (
ST->isTruncatingStore())
1165 Val = BitConvertToInteger(
1169 Val = GetSoftenedFloat(Val);
1171 return DAG.
getStore(
ST->getChain(), dl, Val,
ST->getBasePtr(),
1172 ST->getMemOperand());
1177 SDValue RHS = BitConvertToInteger(
N->getOperand(1));
1180 EVT LVT =
LHS.getValueType();
1182 EVT RVT =
RHS.getValueType();
1188 int SizeDiff = RSize - LSize;
1196 }
else if (SizeDiff < 0) {
1211 bool IsStrict =
N->isStrictFPOpcode();
1212 unsigned Offset = IsStrict ? 1 : 0;
1216 EVT OpVT =
N->getOperand(0 +
Offset).getValueType();
1218 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT,
Op,
1222 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
1223 ReplaceValueWith(
SDValue(
N, 0), Tmp.first);
1231 EVT OpVT =
N->getOperand(
N->isStrictFPOpcode() ? 1 : 0).getValueType();
1237 RTLIB::LROUND_PPCF128));
1241 EVT OpVT =
N->getOperand(
N->isStrictFPOpcode() ? 1 : 0).getValueType();
1246 RTLIB::LLROUND_F128,
1247 RTLIB::LLROUND_PPCF128));
1251 EVT OpVT =
N->getOperand(
N->isStrictFPOpcode() ? 1 : 0).getValueType();
1257 RTLIB::LRINT_PPCF128));
1261 EVT OpVT =
N->getOperand(
N->isStrictFPOpcode() ? 1 : 0).getValueType();
1267 RTLIB::LLRINT_PPCF128));
1278void DAGTypeLegalizer::ExpandFloatResult(
SDNode *
N,
unsigned ResNo) {
1284 if (CustomLowerNode(
N,
N->getValueType(ResNo),
true))
1287 switch (
N->getOpcode()) {
1290 dbgs() <<
"ExpandFloatResult #" << ResNo <<
": ";
1291 N->dump(&DAG);
dbgs() <<
"\n";
1384 "Do not know how to expand this float constant!");
1385 APInt C = cast<ConstantFPSDNode>(
N)->getValueAPF().bitcastToAPInt();
1388 APInt(64,
C.getRawData()[1])),
1391 APInt(64,
C.getRawData()[0])),
1397 bool IsStrict =
N->isStrictFPOpcode();
1398 unsigned Offset = IsStrict ? 1 : 0;
1402 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC,
N->getValueType(0),
1406 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
1407 GetPairElements(Tmp.first,
Lo,
Hi);
1412 bool IsStrict =
N->isStrictFPOpcode();
1413 unsigned Offset = IsStrict ? 1 : 0;
1417 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC,
N->getValueType(0),
1418 Ops, CallOptions,
SDLoc(
N),
1421 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
1422 GetPairElements(Tmp.first,
Lo,
Hi);
1427 assert(
N->getValueType(0) == MVT::ppcf128 &&
1428 "Logic only correct for ppcf128!");
1431 GetExpandedFloat(
N->getOperand(0),
Lo, Tmp);
1442 RTLIB::FMIN_F32, RTLIB::FMIN_F64,
1443 RTLIB::FMIN_F80, RTLIB::FMIN_F128,
1444 RTLIB::FMIN_PPCF128),
Lo,
Hi);
1450 RTLIB::FMAX_F32, RTLIB::FMAX_F64,
1451 RTLIB::FMAX_F80, RTLIB::FMAX_F128,
1452 RTLIB::FMAX_PPCF128),
Lo,
Hi);
1458 RTLIB::ADD_F32, RTLIB::ADD_F64,
1459 RTLIB::ADD_F80, RTLIB::ADD_F128,
1460 RTLIB::ADD_PPCF128),
Lo,
Hi);
1465 ExpandFloatRes_Unary(
N,
GetFPLibCall(
N->getValueType(0), RTLIB::CBRT_F32,
1466 RTLIB::CBRT_F64, RTLIB::CBRT_F80,
1468 RTLIB::CBRT_PPCF128),
Lo,
Hi);
1471void DAGTypeLegalizer::ExpandFloatRes_FCEIL(
SDNode *
N,
1474 RTLIB::CEIL_F32, RTLIB::CEIL_F64,
1475 RTLIB::CEIL_F80, RTLIB::CEIL_F128,
1476 RTLIB::CEIL_PPCF128),
Lo,
Hi);
1479void DAGTypeLegalizer::ExpandFloatRes_FCOPYSIGN(
SDNode *
N,
1482 RTLIB::COPYSIGN_F32,
1483 RTLIB::COPYSIGN_F64,
1484 RTLIB::COPYSIGN_F80,
1485 RTLIB::COPYSIGN_F128,
1486 RTLIB::COPYSIGN_PPCF128),
Lo,
Hi);
1489void DAGTypeLegalizer::ExpandFloatRes_FCOS(
SDNode *
N,
1492 RTLIB::COS_F32, RTLIB::COS_F64,
1493 RTLIB::COS_F80, RTLIB::COS_F128,
1494 RTLIB::COS_PPCF128),
Lo,
Hi);
1504 RTLIB::DIV_PPCF128),
Lo,
Hi);
1507void DAGTypeLegalizer::ExpandFloatRes_FEXP(
SDNode *
N,
1510 RTLIB::EXP_F32, RTLIB::EXP_F64,
1511 RTLIB::EXP_F80, RTLIB::EXP_F128,
1512 RTLIB::EXP_PPCF128),
Lo,
Hi);
1515void DAGTypeLegalizer::ExpandFloatRes_FEXP2(
SDNode *
N,
1518 RTLIB::EXP2_F32, RTLIB::EXP2_F64,
1519 RTLIB::EXP2_F80, RTLIB::EXP2_F128,
1520 RTLIB::EXP2_PPCF128),
Lo,
Hi);
1525 ExpandFloatRes_Unary(
N,
1527 RTLIB::EXP10_F64, RTLIB::EXP10_F80,
1528 RTLIB::EXP10_F128, RTLIB::EXP10_PPCF128),
1532void DAGTypeLegalizer::ExpandFloatRes_FFLOOR(
SDNode *
N,
1535 RTLIB::FLOOR_F32, RTLIB::FLOOR_F64,
1536 RTLIB::FLOOR_F80, RTLIB::FLOOR_F128,
1537 RTLIB::FLOOR_PPCF128),
Lo,
Hi);
1540void DAGTypeLegalizer::ExpandFloatRes_FLOG(
SDNode *
N,
1543 RTLIB::LOG_F32, RTLIB::LOG_F64,
1544 RTLIB::LOG_F80, RTLIB::LOG_F128,
1545 RTLIB::LOG_PPCF128),
Lo,
Hi);
1548void DAGTypeLegalizer::ExpandFloatRes_FLOG2(
SDNode *
N,
1551 RTLIB::LOG2_F32, RTLIB::LOG2_F64,
1552 RTLIB::LOG2_F80, RTLIB::LOG2_F128,
1553 RTLIB::LOG2_PPCF128),
Lo,
Hi);
1556void DAGTypeLegalizer::ExpandFloatRes_FLOG10(
SDNode *
N,
1559 RTLIB::LOG10_F32, RTLIB::LOG10_F64,
1560 RTLIB::LOG10_F80, RTLIB::LOG10_F128,
1561 RTLIB::LOG10_PPCF128),
Lo,
Hi);
1566 bool IsStrict =
N->isStrictFPOpcode();
1567 unsigned Offset = IsStrict ? 1 : 0;
1577 RTLIB::FMA_PPCF128),
1578 N->getValueType(0), Ops, CallOptions,
1581 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
1582 GetPairElements(Tmp.first,
Lo,
Hi);
1592 RTLIB::MUL_PPCF128),
Lo,
Hi);
1595void DAGTypeLegalizer::ExpandFloatRes_FNEARBYINT(
SDNode *
N,
1598 RTLIB::NEARBYINT_F32,
1599 RTLIB::NEARBYINT_F64,
1600 RTLIB::NEARBYINT_F80,
1601 RTLIB::NEARBYINT_F128,
1602 RTLIB::NEARBYINT_PPCF128),
Lo,
Hi);
1608 GetExpandedFloat(
N->getOperand(0),
Lo,
Hi);
1617 bool IsStrict =
N->isStrictFPOpcode();
1622 if (NVT ==
N->getOperand(1).getValueType()) {
1623 Hi =
N->getOperand(1);
1624 Chain =
N->getOperand(0);
1628 {
N->getOperand(0),
N->getOperand(1) });
1629 Chain =
Hi.getValue(1);
1639 ReplaceValueWith(
SDValue(
N, 1), Chain);
1642void DAGTypeLegalizer::ExpandFloatRes_FPOW(
SDNode *
N,
1645 RTLIB::POW_F32, RTLIB::POW_F64,
1646 RTLIB::POW_F80, RTLIB::POW_F128,
1647 RTLIB::POW_PPCF128),
Lo,
Hi);
1650void DAGTypeLegalizer::ExpandFloatRes_FPOWI(
SDNode *
N,
1660void DAGTypeLegalizer::ExpandFloatRes_FREEZE(
SDNode *
N,
1662 assert(
N->getValueType(0) == MVT::ppcf128 &&
1663 "Logic only correct for ppcf128!");
1666 GetExpandedFloat(
N->getOperand(0),
Lo,
Hi);
1671void DAGTypeLegalizer::ExpandFloatRes_FREM(
SDNode *
N,
1674 RTLIB::REM_F32, RTLIB::REM_F64,
1675 RTLIB::REM_F80, RTLIB::REM_F128,
1676 RTLIB::REM_PPCF128),
Lo,
Hi);
1679void DAGTypeLegalizer::ExpandFloatRes_FRINT(
SDNode *
N,
1682 RTLIB::RINT_F32, RTLIB::RINT_F64,
1683 RTLIB::RINT_F80, RTLIB::RINT_F128,
1684 RTLIB::RINT_PPCF128),
Lo,
Hi);
1687void DAGTypeLegalizer::ExpandFloatRes_FROUND(
SDNode *
N,
1694 RTLIB::ROUND_PPCF128),
Lo,
Hi);
1697void DAGTypeLegalizer::ExpandFloatRes_FROUNDEVEN(
SDNode *
N,
1700 RTLIB::ROUNDEVEN_F32,
1701 RTLIB::ROUNDEVEN_F64,
1702 RTLIB::ROUNDEVEN_F80,
1703 RTLIB::ROUNDEVEN_F128,
1704 RTLIB::ROUNDEVEN_PPCF128),
Lo,
Hi);
1707void DAGTypeLegalizer::ExpandFloatRes_FSIN(
SDNode *
N,
1710 RTLIB::SIN_F32, RTLIB::SIN_F64,
1711 RTLIB::SIN_F80, RTLIB::SIN_F128,
1712 RTLIB::SIN_PPCF128),
Lo,
Hi);
1715void DAGTypeLegalizer::ExpandFloatRes_FSQRT(
SDNode *
N,
1718 RTLIB::SQRT_F32, RTLIB::SQRT_F64,
1719 RTLIB::SQRT_F80, RTLIB::SQRT_F128,
1720 RTLIB::SQRT_PPCF128),
Lo,
Hi);
1730 RTLIB::SUB_PPCF128),
Lo,
Hi);
1733void DAGTypeLegalizer::ExpandFloatRes_FTRUNC(
SDNode *
N,
1736 RTLIB::TRUNC_F32, RTLIB::TRUNC_F64,
1737 RTLIB::TRUNC_F80, RTLIB::TRUNC_F128,
1738 RTLIB::TRUNC_PPCF128),
Lo,
Hi);
1744 ExpandRes_NormalLoad(
N,
Lo,
Hi);
1756 assert(
LD->getMemoryVT().bitsLE(NVT) &&
"Float type not round?");
1759 LD->getMemoryVT(),
LD->getMemOperand());
1762 Chain =
Hi.getValue(1);
1770 ReplaceValueWith(
SDValue(LD, 1), Chain);
1775 assert(
N->getValueType(0) == MVT::ppcf128 &&
"Unsupported XINT_TO_FP!");
1776 EVT VT =
N->getValueType(0);
1778 bool Strict =
N->isStrictFPOpcode();
1779 SDValue Src =
N->getOperand(Strict ? 1 : 0);
1780 EVT SrcVT = Src.getValueType();
1788 Flags.setNoFPExcept(
N->getFlags().hasNoFPExcept());
1793 if (SrcVT.
bitsLE(MVT::i32)) {
1799 {Chain, Src}, Flags);
1800 Chain =
Hi.getValue(1);
1802 Hi = DAG.
getNode(
N->getOpcode(), dl, NVT, Src);
1805 if (SrcVT.
bitsLE(MVT::i64)) {
1808 LC = RTLIB::SINTTOFP_I64_PPCF128;
1809 }
else if (SrcVT.
bitsLE(MVT::i128)) {
1811 LC = RTLIB::SINTTOFP_I128_PPCF128;
1813 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported XINT_TO_FP!");
1817 std::pair<SDValue, SDValue> Tmp =
1818 TLI.
makeLibCall(DAG, LC, VT, Src, CallOptions, dl, Chain);
1821 GetPairElements(Tmp.first,
Lo,
Hi);
1827 ReplaceValueWith(
SDValue(
N, 1), Chain);
1837 SrcVT = Src.getValueType();
1840 static const uint64_t TwoE32[] = { 0x41f0000000000000LL, 0 };
1841 static const uint64_t TwoE64[] = { 0x43f0000000000000LL, 0 };
1842 static const uint64_t TwoE128[] = { 0x47f0000000000000LL, 0 };
1864 {Chain, Hi, NewLo}, Flags);
1865 Chain =
Lo.getValue(1);
1866 ReplaceValueWith(
SDValue(
N, 1), Chain);
1871 GetPairElements(
Lo,
Lo,
Hi);
1883bool DAGTypeLegalizer::ExpandFloatOperand(
SDNode *
N,
unsigned OpNo) {
1888 if (CustomLowerNode(
N,
N->getOperand(OpNo).getValueType(),
false))
1891 switch (
N->getOpcode()) {
1894 dbgs() <<
"ExpandFloatOperand Op #" << OpNo <<
": ";
1895 N->dump(&DAG);
dbgs() <<
"\n";
1903 case ISD::BR_CC: Res = ExpandFloatOp_BR_CC(
N);
break;
1911 case ISD::LROUND: Res = ExpandFloatOp_LROUND(
N);
break;
1913 case ISD::LRINT: Res = ExpandFloatOp_LRINT(
N);
break;
1914 case ISD::LLRINT: Res = ExpandFloatOp_LLRINT(
N);
break;
1918 case ISD::SETCC: Res = ExpandFloatOp_SETCC(
N);
break;
1919 case ISD::STORE: Res = ExpandFloatOp_STORE(cast<StoreSDNode>(
N),
1924 if (!Res.
getNode())
return false;
1932 "Invalid operand expansion");
1934 ReplaceValueWith(
SDValue(
N, 0), Res);
1940void DAGTypeLegalizer::FloatExpandSetCCOperands(
SDValue &NewLHS,
1945 SDValue LHSLo, LHSHi, RHSLo, RHSHi;
1946 GetExpandedFloat(NewLHS, LHSLo, LHSHi);
1947 GetExpandedFloat(NewRHS, RHSLo, RHSHi);
1956 SDValue Tmp1, Tmp2, Tmp3, OutputChain;
1961 RHSLo, CCCode, OutputChain, IsSignaling);
1969 RHSHi, CCCode, OutputChain, IsSignaling);
1974 Chain = OutputChain;
1978 SDValue NewLHS =
N->getOperand(2), NewRHS =
N->getOperand(3);
1979 ISD::CondCode CCCode = cast<CondCodeSDNode>(
N->getOperand(1))->get();
1981 FloatExpandSetCCOperands(NewLHS, NewRHS, CCCode,
SDLoc(
N), Chain);
1993 N->getOperand(4)), 0);
1997 assert(
N->getOperand(1).getValueType() == MVT::ppcf128 &&
1998 "Logic only correct for ppcf128!");
2000 GetExpandedFloat(
N->getOperand(1),
Lo,
Hi);
2004 N->getValueType(0),
N->getOperand(0),
Hi);
2008 bool IsStrict =
N->isStrictFPOpcode();
2009 assert(
N->getOperand(IsStrict ? 1 : 0).getValueType() == MVT::ppcf128 &&
2010 "Logic only correct for ppcf128!");
2012 GetExpandedFloat(
N->getOperand(IsStrict ? 1 : 0),
Lo,
Hi);
2017 N->getValueType(0),
Hi,
N->getOperand(1));
2021 if (
Hi.getValueType() ==
N->getValueType(0)) {
2023 ReplaceValueWith(
SDValue(
N, 1),
N->getOperand(0));
2029 {
N->getValueType(0), MVT::Other},
2030 {
N->getOperand(0),
Hi,
N->getOperand(2)});
2037 EVT RVT =
N->getValueType(0);
2040 bool IsStrict =
N->isStrictFPOpcode();
2043 SDValue Op =
N->getOperand(IsStrict ? 1 : 0);
2049 "Unsupported FP_TO_XINT!");
2051 std::pair<SDValue, SDValue> Tmp =
2056 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
2057 ReplaceValueWith(
SDValue(
N, 0), Tmp.first);
2062 SDValue NewLHS =
N->getOperand(0), NewRHS =
N->getOperand(1);
2063 ISD::CondCode CCCode = cast<CondCodeSDNode>(
N->getOperand(4))->get();
2065 FloatExpandSetCCOperands(NewLHS, NewRHS, CCCode,
SDLoc(
N), Chain);
2076 N->getOperand(2),
N->getOperand(3),
2081 bool IsStrict =
N->isStrictFPOpcode();
2082 SDValue NewLHS =
N->getOperand(IsStrict ? 1 : 0);
2083 SDValue NewRHS =
N->getOperand(IsStrict ? 2 : 1);
2086 cast<CondCodeSDNode>(
N->getOperand(IsStrict ? 3 : 2))->get();
2087 FloatExpandSetCCOperands(NewLHS, NewRHS, CCCode,
SDLoc(
N), Chain,
2093 "Unexpected setcc expansion!");
2095 ReplaceValueWith(
SDValue(
N, 0), NewLHS);
2096 ReplaceValueWith(
SDValue(
N, 1), Chain);
2102SDValue DAGTypeLegalizer::ExpandFloatOp_STORE(
SDNode *
N,
unsigned OpNo) {
2104 return ExpandOp_NormalStore(
N, OpNo);
2107 assert(OpNo == 1 &&
"Can only expand the stored value so far");
2114 ST->getValue().getValueType());
2116 assert(
ST->getMemoryVT().bitsLE(NVT) &&
"Float type not round?");
2120 GetExpandedOp(
ST->getValue(),
Lo,
Hi);
2123 ST->getMemoryVT(),
ST->getMemOperand());
2127 EVT RVT =
N->getValueType(0);
2128 EVT RetVT =
N->getOperand(0).getValueType();
2135 RTLIB::LROUND_PPCF128),
2136 RVT,
N->getOperand(0), CallOptions,
SDLoc(
N)).first;
2140 EVT RVT =
N->getValueType(0);
2141 EVT RetVT =
N->getOperand(0).getValueType();
2147 RTLIB::LLROUND_F128,
2148 RTLIB::LLROUND_PPCF128),
2149 RVT,
N->getOperand(0), CallOptions,
SDLoc(
N)).first;
2153 EVT RVT =
N->getValueType(0);
2154 EVT RetVT =
N->getOperand(0).getValueType();
2161 RTLIB::LRINT_PPCF128),
2162 RVT,
N->getOperand(0), CallOptions,
SDLoc(
N)).first;
2166 EVT RVT =
N->getValueType(0);
2167 EVT RetVT =
N->getOperand(0).getValueType();
2174 RTLIB::LLRINT_PPCF128),
2175 RVT,
N->getOperand(0), CallOptions,
SDLoc(
N)).first;
2184 if (OpVT == MVT::f16) {
2186 }
else if (RetVT == MVT::f16) {
2188 }
else if (OpVT == MVT::bf16) {
2190 }
else if (RetVT == MVT::bf16) {
2198 if (OpVT == MVT::f16)
2201 if (RetVT == MVT::f16)
2204 if (OpVT == MVT::bf16)
2207 if (RetVT == MVT::bf16)
2213bool DAGTypeLegalizer::PromoteFloatOperand(
SDNode *
N,
unsigned OpNo) {
2214 LLVM_DEBUG(
dbgs() <<
"Promote float operand " << OpNo <<
": ";
N->dump(&DAG));
2217 if (CustomLowerNode(
N,
N->getOperand(OpNo).getValueType(),
false)) {
2228 switch (
N->getOpcode()) {
2231 dbgs() <<
"PromoteFloatOperand Op #" << OpNo <<
": ";
2232 N->dump(&DAG);
dbgs() <<
"\n";
2241 case ISD::LLRINT:
R = PromoteFloatOp_UnaryOp(
N, OpNo);
break;
2244 R = PromoteFloatOp_FP_TO_XINT_SAT(
N, OpNo);
break;
2247 R = PromoteFloatOp_STRICT_FP_EXTEND(
N, OpNo);
2250 case ISD::SETCC:
R = PromoteFloatOp_SETCC(
N, OpNo);
break;
2251 case ISD::STORE:
R = PromoteFloatOp_STORE(
N, OpNo);
break;
2256 ReplaceValueWith(
SDValue(
N, 0), R);
2260SDValue DAGTypeLegalizer::PromoteFloatOp_BITCAST(
SDNode *
N,
unsigned OpNo) {
2262 EVT OpVT =
Op->getValueType(0);
2264 SDValue Promoted = GetPromotedFloat(
N->getOperand(0));
2273 return DAG.
getBitcast(
N->getValueType(0), Convert);
2278SDValue DAGTypeLegalizer::PromoteFloatOp_FCOPYSIGN(
SDNode *
N,
unsigned OpNo) {
2279 assert (OpNo == 1 &&
"Only Operand 1 must need promotion here");
2280 SDValue Op1 = GetPromotedFloat(
N->getOperand(1));
2283 N->getOperand(0), Op1);
2287SDValue DAGTypeLegalizer::PromoteFloatOp_UnaryOp(
SDNode *
N,
unsigned OpNo) {
2288 SDValue Op = GetPromotedFloat(
N->getOperand(0));
2292SDValue DAGTypeLegalizer::PromoteFloatOp_FP_TO_XINT_SAT(
SDNode *
N,
2294 SDValue Op = GetPromotedFloat(
N->getOperand(0));
2299SDValue DAGTypeLegalizer::PromoteFloatOp_FP_EXTEND(
SDNode *
N,
unsigned OpNo) {
2300 SDValue Op = GetPromotedFloat(
N->getOperand(0));
2301 EVT VT =
N->getValueType(0);
2304 if (VT ==
Op->getValueType(0))
2311SDValue DAGTypeLegalizer::PromoteFloatOp_STRICT_FP_EXTEND(
SDNode *
N,
2313 assert(OpNo == 1 &&
"Promoting unpromotable operand");
2315 SDValue Op = GetPromotedFloat(
N->getOperand(1));
2316 EVT VT =
N->getValueType(0);
2319 if (VT ==
Op->getValueType(0)) {
2320 ReplaceValueWith(
SDValue(
N, 1),
N->getOperand(0));
2326 N->getOperand(0),
Op);
2334SDValue DAGTypeLegalizer::PromoteFloatOp_SELECT_CC(
SDNode *
N,
unsigned OpNo) {
2339 LHS, RHS,
N->getOperand(2),
N->getOperand(3),
2345SDValue DAGTypeLegalizer::PromoteFloatOp_SETCC(
SDNode *
N,
unsigned OpNo) {
2346 EVT VT =
N->getValueType(0);
2347 SDValue Op0 = GetPromotedFloat(
N->getOperand(0));
2348 SDValue Op1 = GetPromotedFloat(
N->getOperand(1));
2349 ISD::CondCode CCCode = cast<CondCodeSDNode>(
N->getOperand(2))->get();
2357SDValue DAGTypeLegalizer::PromoteFloatOp_STORE(
SDNode *
N,
unsigned OpNo) {
2362 SDValue Promoted = GetPromotedFloat(Val);
2363 EVT VT =
ST->getOperand(1).getValueType();
2370 return DAG.
getStore(
ST->getChain(),
DL, NewVal,
ST->getBasePtr(),
2371 ST->getMemOperand());
2378void DAGTypeLegalizer::PromoteFloatResult(
SDNode *
N,
unsigned ResNo) {
2379 LLVM_DEBUG(
dbgs() <<
"Promote float result " << ResNo <<
": ";
N->dump(&DAG));
2383 if (CustomLowerNode(
N,
N->getValueType(ResNo),
true)) {
2388 switch (
N->getOpcode()) {
2395 dbgs() <<
"PromoteFloatResult #" << ResNo <<
": ";
2396 N->dump(&DAG);
dbgs() <<
"\n";
2403 R = PromoteFloatRes_EXTRACT_VECTOR_ELT(
N);
break;
2438 case ISD::FSUB:
R = PromoteFloatRes_BinOp(
N);
break;
2441 case ISD::FMAD:
R = PromoteFloatRes_FMAD(
N);
break;
2449 R = PromoteFloatRes_STRICT_FP_ROUND(
N);
2451 case ISD::LOAD:
R = PromoteFloatRes_LOAD(
N);
break;
2465 R = PromoteFloatRes_VECREDUCE(
N);
2469 R = PromoteFloatRes_VECREDUCE_SEQ(
N);
2474 SetPromotedFloat(
SDValue(
N, ResNo), R);
2483 EVT VT =
N->getValueType(0);
2488 N->getOperand(0).getValueType().getSizeInBits());
2495 EVT VT =
N->getValueType(0);
2514SDValue DAGTypeLegalizer::PromoteFloatRes_EXTRACT_VECTOR_ELT(
SDNode *
N) {
2519 if (isa<ConstantSDNode>(
N->getOperand(1))) {
2527 switch (getTypeAction(VecVT)) {
2530 SDValue Res = GetScalarizedVector(
N->getOperand(0));
2531 ReplaceValueWith(
SDValue(
N, 0), Res);
2535 Vec = GetWidenedVector(Vec);
2537 ReplaceValueWith(
SDValue(
N, 0), Res);
2542 GetSplitVector(Vec,
Lo,
Hi);
2544 uint64_t LoElts =
Lo.getValueType().getVectorNumElements();
2546 if (IdxVal < LoElts)
2551 Idx.getValueType()));
2552 ReplaceValueWith(
SDValue(
N, 0), Res);
2560 SDValue NewOp = BitConvertVectorToIntegerVector(
N->getOperand(0));
2565 NewOp,
N->getOperand(1));
2568 EVT VT =
N->getValueType(0);
2577 EVT VT =
N->getValueType(0);
2579 SDValue Op0 = GetPromotedFloat(
N->getOperand(0));
2590 EVT VT =
N->getValueType(0);
2592 SDValue Op = GetPromotedFloat(
N->getOperand(0));
2601 EVT VT =
N->getValueType(0);
2603 SDValue Op0 = GetPromotedFloat(
N->getOperand(0));
2604 SDValue Op1 = GetPromotedFloat(
N->getOperand(1));
2605 return DAG.
getNode(
N->getOpcode(),
SDLoc(
N), NVT, Op0, Op1,
N->getFlags());
2609 EVT VT =
N->getValueType(0);
2611 SDValue Op0 = GetPromotedFloat(
N->getOperand(0));
2612 SDValue Op1 = GetPromotedFloat(
N->getOperand(1));
2613 SDValue Op2 = GetPromotedFloat(
N->getOperand(2));
2615 return DAG.
getNode(
N->getOpcode(),
SDLoc(
N), NVT, Op0, Op1, Op2);
2620 EVT VT =
N->getValueType(0);
2622 SDValue Op0 = GetPromotedFloat(
N->getOperand(0));
2629 EVT VT =
N->getValueType(0);
2631 SDValue Op = GetPromotedFloat(
N->getOperand(0));
2645 EVT VT =
N->getValueType(0);
2646 EVT OpVT =
Op->getValueType(0);
2658SDValue DAGTypeLegalizer::PromoteFloatRes_STRICT_FP_ROUND(
SDNode *
N) {
2663 EVT VT =
N->getValueType(0);
2664 EVT OpVT =
Op->getValueType(0);
2681 EVT VT =
N->getValueType(0);
2686 L->getAddressingMode(),
L->getExtensionType(), IVT,
SDLoc(
N),
2687 L->getChain(),
L->getBasePtr(),
L->getOffset(),
L->getPointerInfo(), IVT,
2688 L->getOriginalAlign(),
L->getMemOperand()->getFlags(),
L->getAAInfo());
2704 N->getOperand(0), TrueVal, FalseVal);
2714 TrueVal.getNode()->getValueType(0),
N->getOperand(0),
2715 N->getOperand(1), TrueVal, FalseVal,
N->getOperand(4));
2722 EVT VT =
N->getValueType(0);
2734 N->getValueType(0)));
2746SDValue DAGTypeLegalizer::PromoteFloatRes_VECREDUCE_SEQ(
SDNode *
N) {
2752 EVT VT =
N->getValueType(0);
2763 { AM->getChain(), AM->getBasePtr(), CastVal },
2786void DAGTypeLegalizer::SoftPromoteHalfResult(
SDNode *
N,
unsigned ResNo) {
2787 LLVM_DEBUG(
dbgs() <<
"Soft promote half result " << ResNo <<
": ";
2792 if (CustomLowerNode(
N,
N->getValueType(ResNo),
true)) {
2797 switch (
N->getOpcode()) {
2800 dbgs() <<
"SoftPromoteHalfResult #" << ResNo <<
": ";
2801 N->dump(&DAG);
dbgs() <<
"\n";
2809 R = SoftPromoteHalfRes_EXTRACT_VECTOR_ELT(
N);
break;
2847 case ISD::FSUB:
R = SoftPromoteHalfRes_BinOp(
N);
break;
2850 case ISD::FMAD:
R = SoftPromoteHalfRes_FMAD(
N);
break;
2857 case ISD::LOAD:
R = SoftPromoteHalfRes_LOAD(
N);
break;
2862 case ISD::UNDEF:
R = SoftPromoteHalfRes_UNDEF(
N);
break;
2870 R = SoftPromoteHalfRes_VECREDUCE(
N);
2874 R = SoftPromoteHalfRes_VECREDUCE_SEQ(
N);
2879 SetSoftPromotedHalf(
SDValue(
N, ResNo), R);
2883 return BitConvertToInteger(
N->getOperand(0));
2886SDValue DAGTypeLegalizer::SoftPromoteHalfRes_ConstantFP(
SDNode *
N) {
2894SDValue DAGTypeLegalizer::SoftPromoteHalfRes_EXTRACT_VECTOR_ELT(
SDNode *
N) {
2895 SDValue NewOp = BitConvertVectorToIntegerVector(
N->getOperand(0));
2901SDValue DAGTypeLegalizer::SoftPromoteHalfRes_FCOPYSIGN(
SDNode *
N) {
2902 SDValue LHS = GetSoftPromotedHalf(
N->getOperand(0));
2903 SDValue RHS = BitConvertToInteger(
N->getOperand(1));
2906 EVT LVT =
LHS.getValueType();
2907 EVT RVT =
RHS.getValueType();
2928 }
else if (SizeDiff < 0) {
2950 EVT OVT =
N->getValueType(0);
2952 SDValue Op0 = GetSoftPromotedHalf(
N->getOperand(0));
2953 SDValue Op1 = GetSoftPromotedHalf(
N->getOperand(1));
2954 SDValue Op2 = GetSoftPromotedHalf(
N->getOperand(2));
2959 Op0 = DAG.
getNode(PromotionOpcode, dl, NVT, Op0);
2960 Op1 = DAG.
getNode(PromotionOpcode, dl, NVT, Op1);
2961 Op2 = DAG.
getNode(PromotionOpcode, dl, NVT, Op2);
2970 EVT OVT =
N->getValueType(0);
2972 SDValue Op0 = GetSoftPromotedHalf(
N->getOperand(0));
2986 EVT OVT =
N->getValueType(0);
2988 SDValue Op = GetSoftPromotedHalf(
N->getOperand(0));
3003SDValue DAGTypeLegalizer::SoftPromoteHalfRes_FP_ROUND(
SDNode *
N) {
3004 EVT RVT =
N->getValueType(0);
3005 EVT SVT =
N->getOperand(0).getValueType();
3007 if (
N->isStrictFPOpcode()) {
3010 if (RVT == MVT::f16)
3012 else if (RVT == MVT::bf16)
3017 {
N->getOperand(0),
N->getOperand(1)});
3032 DAG.
getLoad(
L->getAddressingMode(),
L->getExtensionType(), MVT::i16,
3033 SDLoc(
N),
L->getChain(),
L->getBasePtr(),
L->getOffset(),
3034 L->getPointerInfo(), MVT::i16,
L->getOriginalAlign(),
3035 L->getMemOperand()->getFlags(),
L->getAAInfo());
3043 SDValue Op1 = GetSoftPromotedHalf(
N->getOperand(1));
3044 SDValue Op2 = GetSoftPromotedHalf(
N->getOperand(2));
3049SDValue DAGTypeLegalizer::SoftPromoteHalfRes_SELECT_CC(
SDNode *
N) {
3050 SDValue Op2 = GetSoftPromotedHalf(
N->getOperand(2));
3051 SDValue Op3 = GetSoftPromotedHalf(
N->getOperand(3));
3053 N->getOperand(0),
N->getOperand(1), Op2, Op3,
3057SDValue DAGTypeLegalizer::SoftPromoteHalfRes_XINT_TO_FP(
SDNode *
N) {
3058 EVT OVT =
N->getValueType(0);
3073 EVT OVT =
N->getValueType(0);
3075 SDValue Op = GetSoftPromotedHalf(
N->getOperand(0));
3088 EVT OVT =
N->getValueType(0);
3090 SDValue Op0 = GetSoftPromotedHalf(
N->getOperand(0));
3091 SDValue Op1 = GetSoftPromotedHalf(
N->getOperand(1));
3096 Op0 = DAG.
getNode(PromotionOpcode, dl, NVT, Op0);
3097 Op1 = DAG.
getNode(PromotionOpcode, dl, NVT, Op1);
3105SDValue DAGTypeLegalizer::SoftPromoteHalfRes_VECREDUCE(
SDNode *
N) {
3111SDValue DAGTypeLegalizer::SoftPromoteHalfRes_VECREDUCE_SEQ(
SDNode *
N) {
3121bool DAGTypeLegalizer::SoftPromoteHalfOperand(
SDNode *
N,
unsigned OpNo) {
3122 LLVM_DEBUG(
dbgs() <<
"Soft promote half operand " << OpNo <<
": ";
3126 if (CustomLowerNode(
N,
N->getOperand(OpNo).getValueType(),
false)) {
3136 switch (
N->getOpcode()) {
3139 dbgs() <<
"SoftPromoteHalfOperand Op #" << OpNo <<
": ";
3140 N->dump(&DAG);
dbgs() <<
"\n";
3145 case ISD::BITCAST: Res = SoftPromoteHalfOp_BITCAST(
N);
break;
3146 case ISD::FCOPYSIGN: Res = SoftPromoteHalfOp_FCOPYSIGN(
N, OpNo);
break;
3151 Res = SoftPromoteHalfOp_FP_TO_XINT_SAT(
N);
break;
3154 case ISD::SELECT_CC: Res = SoftPromoteHalfOp_SELECT_CC(
N, OpNo);
break;
3155 case ISD::SETCC: Res = SoftPromoteHalfOp_SETCC(
N);
break;
3156 case ISD::STORE: Res = SoftPromoteHalfOp_STORE(
N, OpNo);
break;
3158 Res = SoftPromoteHalfOp_STACKMAP(
N, OpNo);
3161 Res = SoftPromoteHalfOp_PATCHPOINT(
N, OpNo);
3171 "Invalid operand expansion");
3173 ReplaceValueWith(
SDValue(
N, 0), Res);
3178 SDValue Op0 = GetSoftPromotedHalf(
N->getOperand(0));
3185 assert(OpNo == 1 &&
"Only Operand 1 must need promotion here");
3192 Op1 = GetSoftPromotedHalf(Op1);
3195 return DAG.
getNode(
N->getOpcode(), dl,
N->getValueType(0),
N->getOperand(0),
3199SDValue DAGTypeLegalizer::SoftPromoteHalfOp_FP_EXTEND(
SDNode *
N) {
3200 EVT RVT =
N->getValueType(0);
3201 bool IsStrict =
N->isStrictFPOpcode();
3202 SDValue Op =
N->getOperand(IsStrict ? 1 : 0);
3203 EVT SVT =
Op.getValueType();
3204 Op = GetSoftPromotedHalf(
N->getOperand(IsStrict ? 1 : 0));
3208 if (SVT == MVT::f16)
3210 else if (SVT == MVT::bf16)
3216 {
N->getOperand(0),
Op});
3218 ReplaceValueWith(
SDValue(
N, 0), Res);
3225SDValue DAGTypeLegalizer::SoftPromoteHalfOp_FP_TO_XINT(
SDNode *
N) {
3226 EVT RVT =
N->getValueType(0);
3228 EVT SVT =
Op.getValueType();
3233 Op = GetSoftPromotedHalf(
Op);
3237 return DAG.
getNode(
N->getOpcode(), dl,
N->getValueType(0), Res);
3240SDValue DAGTypeLegalizer::SoftPromoteHalfOp_FP_TO_XINT_SAT(
SDNode *
N) {
3241 EVT RVT =
N->getValueType(0);
3243 EVT SVT =
Op.getValueType();
3248 Op = GetSoftPromotedHalf(
Op);
3252 return DAG.
getNode(
N->getOpcode(), dl,
N->getValueType(0), Res,
3258 assert(OpNo == 0 &&
"Can only soften the comparison values");
3266 Op0 = GetSoftPromotedHalf(Op0);
3267 Op1 = GetSoftPromotedHalf(Op1);
3271 Op0 = DAG.
getNode(PromotionOpcode, dl, NVT, Op0);
3272 Op1 = DAG.
getNode(PromotionOpcode, dl, NVT, Op1);
3275 N->getOperand(2),
N->getOperand(3),
N->getOperand(4));
3281 ISD::CondCode CCCode = cast<CondCodeSDNode>(
N->getOperand(2))->get();
3287 Op0 = GetSoftPromotedHalf(Op0);
3288 Op1 = GetSoftPromotedHalf(Op1);
3292 Op0 = DAG.
getNode(PromotionOpcode, dl, NVT, Op0);
3293 Op1 = DAG.
getNode(PromotionOpcode, dl, NVT, Op1);
3298SDValue DAGTypeLegalizer::SoftPromoteHalfOp_STORE(
SDNode *
N,
unsigned OpNo) {
3299 assert(OpNo == 1 &&
"Can only soften the stored value!");
3304 assert(!
ST->isTruncatingStore() &&
"Unexpected truncating store.");
3305 SDValue Promoted = GetSoftPromotedHalf(Val);
3306 return DAG.
getStore(
ST->getChain(), dl, Promoted,
ST->getBasePtr(),
3307 ST->getMemOperand());
3310SDValue DAGTypeLegalizer::SoftPromoteHalfOp_STACKMAP(
SDNode *
N,
unsigned OpNo) {
3314 NewOps[OpNo] = GetSoftPromotedHalf(
Op);
3318 for (
unsigned ResNum = 0; ResNum <
N->getNumValues(); ResNum++)
3329 NewOps[OpNo] = GetSoftPromotedHalf(
Op);
3333 for (
unsigned ResNum = 0; ResNum <
N->getNumValues(); ResNum++)
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
static bool isSigned(unsigned int Opcode)
static RTLIB::Libcall findFPToIntLibcall(EVT SrcVT, EVT RetVT, EVT &Promoted, bool Signed)
static RTLIB::Libcall GetFPLibCall(EVT VT, RTLIB::Libcall Call_F32, RTLIB::Libcall Call_F64, RTLIB::Libcall Call_F80, RTLIB::Libcall Call_F128, RTLIB::Libcall Call_PPCF128)
GetFPLibCall - Return the right libcall for the given floating point type.
static ISD::NodeType GetPromotionOpcode(EVT OpVT, EVT RetVT)
static ISD::NodeType GetPromotionOpcodeStrict(EVT OpVT, EVT RetVT)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
APInt bitcastToAPInt() const
Class for arbitrary precision integers.
static APInt getAllOnes(unsigned numBits)
Return an APInt of a specified width with all bits set.
void clearBit(unsigned BitPosition)
Set a given bit to 0.
static APInt getSignMask(unsigned BitWidth)
Get the SignMask for a specific bit width.
const uint64_t * getRawData() const
This function returns a pointer to the internal storage of the APInt.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This is an SDNode representing atomic operations.
const SDValue & getVal() const
const APFloat & getValueAPF() const
@ NewNode
This is a new node, not before seen, that was created in the process of legalizing some other node.
This class represents an Operation in the Expression.
void emitError(uint64_t LocCookie, const Twine &ErrorStr)
emitError - Emit an error message to the currently installed error handler with optional location inf...
This class is used to represent ISD::LOAD nodes.
@ MODereferenceable
The memory access is dereferenceable (i.e., doesn't trap).
@ MOInvariant
The memory access always returns the same value (or traps).
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
SDNode * getNode() const
get the SDNode which holds the desired result
SDValue getValue(unsigned R) const
EVT getValueType() const
Return the ValueType of the referenced return value.
SDValue getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT, MaybeAlign Alignment=MaybeAlign(), MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
SDValue getSelect(const SDLoc &DL, EVT VT, SDValue Cond, SDValue LHS, SDValue RHS)
Helper function to make it easier to build Select's if you just have operands and don't want to check...
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond, SDValue Chain=SDValue(), bool IsSignaling=false)
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
SDValue getConstantFP(double Val, const SDLoc &DL, EVT VT, bool isTarget=false)
Create a ConstantFPSDNode wrapping a constant value.
SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, MaybeAlign Alignment=MaybeAlign(), MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
Loads are not normal binary operators: their result type is not determined by their operands,...
SDValue getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT, SDValue Chain, SDValue Ptr, SDValue Val, MachineMemOperand *MMO)
Gets a node for an atomic op, produces result (if relevant) and chain and takes 2 operands.
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
SDValue getBitcast(EVT VT, SDValue V)
Return a bitcast using the SDLoc of the value operand, and casting to the provided type.
const DataLayout & getDataLayout() const
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
SDValue getVAArg(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, SDValue SV, unsigned Align)
VAArg produces a result and token chain, and takes a pointer and a source value as input.
SDValue getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, EVT SVT, Align Alignment, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, Align Alignment, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Helper function to build ISD::STORE nodes.
static const fltSemantics & EVTToAPFloatSemantics(EVT VT)
Returns an APFloat semantics tag appropriate for the given type.
SDValue getSelectCC(const SDLoc &DL, SDValue LHS, SDValue RHS, SDValue True, SDValue False, ISD::CondCode Cond)
Helper function to make it easier to build SelectCC's if you just have an ISD::CondCode instead of an...
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
const TargetLibraryInfo & getLibInfo() const
MachineFunction & getMachineFunction() const
SDValue getCondCode(ISD::CondCode Cond)
LLVMContext * getContext() const
SDValue getShiftAmountConstant(uint64_t Val, EVT VT, const SDLoc &DL, bool LegalTypes=true)
SDValue CreateStackTemporary(TypeSize Bytes, Align Alignment)
Create a stack temporary based on the size in bytes and the alignment.
SDNode * UpdateNodeOperands(SDNode *N, SDValue Op)
Mutate the specified node in-place to have the specified operands.
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This class is used to represent ISD::STORE nodes.
unsigned getIntSize() const
Get size of a C-level int or unsigned int, in bits.
EVT getShiftAmountTy(EVT LHSTy, const DataLayout &DL, bool LegalTypes=true) const
Returns the type for the shift amount of a shift opcode.
virtual EVT getTypeToTransformTo(LLVMContext &Context, EVT VT) const
For types supported by the target, this is an identity function.
const char * getLibcallName(RTLIB::Libcall Call) const
Get the libcall routine name for the specified libcall.
void softenSetCCOperands(SelectionDAG &DAG, EVT VT, SDValue &NewLHS, SDValue &NewRHS, ISD::CondCode &CCCode, const SDLoc &DL, const SDValue OldLHS, const SDValue OldRHS) const
Soften the operands of a comparison.
std::pair< SDValue, SDValue > makeLibCall(SelectionDAG &DAG, RTLIB::Libcall LC, EVT RetVT, ArrayRef< SDValue > Ops, MakeLibCallOptions CallOptions, const SDLoc &dl, SDValue Chain=SDValue()) const
Returns a pair of (return value, chain).
SDValue expandVecReduceSeq(SDNode *Node, SelectionDAG &DAG) const
Expand a VECREDUCE_SEQ_* into an explicit ordered calculation.
SDValue expandFP_TO_INT_SAT(SDNode *N, SelectionDAG &DAG) const
Expand FP_TO_[US]INT_SAT into FP_TO_[US]INT and selects or min/max.
SDValue expandVecReduce(SDNode *Node, SelectionDAG &DAG) const
Expand a VECREDUCE_* into an explicit calculation.
SDValue createSelectForFMINNUM_FMAXNUM(SDNode *Node, SelectionDAG &DAG) const
Try to convert the fminnum/fmaxnum to a compare/select sequence.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
@ C
The default llvm calling convention, compatible with C.
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
@ SETCC
SetCC operator - This evaluates to a true value iff the condition is true.
@ MERGE_VALUES
MERGE_VALUES - This node takes multiple discrete operands and returns them all as its individual resu...
@ STRICT_FSETCC
STRICT_FSETCC/STRICT_FSETCCS - Constrained versions of SETCC, used for floating-point operands only.
@ VECREDUCE_SEQ_FADD
Generic reduction nodes.
@ FMAD
FMAD - Perform a * b + c, while getting the same result as the separately rounded operations.
@ LOAD
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
@ ANY_EXTEND
ANY_EXTEND - Used for integer types. The high bits are undefined.
@ FMA
FMA - Perform a * b + c with no intermediate rounding step.
@ SINT_TO_FP
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
@ VECREDUCE_FMAX
FMIN/FMAX nodes can have flags, for NaN/NoNaN variants.
@ FADD
Simple binary floating point operators.
@ VECREDUCE_FMAXIMUM
FMINIMUM/FMAXIMUM nodes propatate NaNs and signed zeroes using the llvm.minimum and llvm....
@ FP16_TO_FP
FP16_TO_FP, FP_TO_FP16 - These operators are used to perform promotions and truncation for half-preci...
@ BITCAST
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
@ BUILD_PAIR
BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.
@ FLDEXP
FLDEXP - ldexp, inspired by libm (op0 * 2**op1).
@ STRICT_FSQRT
Constrained versions of libm-equivalent floating point intrinsics.
@ SIGN_EXTEND
Conversion operators.
@ VECREDUCE_FADD
These reductions have relaxed evaluation order semantics, and have a single vector operand.
@ FNEG
Perform various unary floating-point operations inspired by libm.
@ BR_CC
BR_CC - Conditional branch.
@ FCANONICALIZE
Returns platform specific canonical encoding of a floating point number.
@ SELECT
Select(COND, TRUEVAL, FALSEVAL).
@ UNDEF
UNDEF - An undefined node.
@ EXTRACT_ELEMENT
EXTRACT_ELEMENT - This is used to get the lower or upper (determined by a Constant,...
@ ARITH_FENCE
ARITH_FENCE - This corresponds to a arithmetic fence intrinsic.
@ SHL
Shift and rotation operations.
@ EXTRACT_VECTOR_ELT
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
@ ZERO_EXTEND
ZERO_EXTEND - Used for integer types, zeroing the new bits.
@ SELECT_CC
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
@ FMINNUM
FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two values.
@ FP_EXTEND
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
@ STRICT_SINT_TO_FP
STRICT_[US]INT_TO_FP - Convert a signed or unsigned integer to a floating point value.
@ BF16_TO_FP
BF16_TO_FP, FP_TO_BF16 - These operators are used to perform promotions and truncation for bfloat16.
@ STRICT_FP_ROUND
X = STRICT_FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision ...
@ STRICT_FP_TO_SINT
STRICT_FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
@ FMINIMUM
FMINIMUM/FMAXIMUM - NaN-propagating minimum/maximum that also treat -0.0 as less than 0....
@ FP_TO_SINT
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
@ STRICT_FP_EXTEND
X = STRICT_FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
@ AND
Bitwise operators - logical and, logical or, logical xor.
@ STRICT_FADD
Constrained versions of the binary floating point operators.
@ ATOMIC_SWAP
Val, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amt) Val, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN,...
@ FFREXP
FFREXP - frexp, extract fractional and exponent component of a floating-point value.
@ FP_ROUND
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
@ FP_TO_SINT_SAT
FP_TO_[US]INT_SAT - Convert floating point value in operand 0 to a signed or unsigned scalar integer ...
@ TRUNCATE
TRUNCATE - Completely drop the high bits.
@ VAARG
VAARG - VAARG has four operands: an input chain, a pointer, a SRCVALUE, and the alignment.
@ FCOPYSIGN
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
@ BUILD_VECTOR
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width vector with the specified,...
bool isNormalStore(const SDNode *N)
Returns true if the specified node is a non-truncating and unindexed store.
bool isUNINDEXEDLoad(const SDNode *N)
Returns true if the specified node is an unindexed load.
bool isUNINDEXEDStore(const SDNode *N)
Returns true if the specified node is an unindexed store.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out,...
bool isNormalLoad(const SDNode *N)
Returns true if the specified node is a non-extending and unindexed load.
Libcall getPOWI(EVT RetVT)
getPOWI - Return the POWI_* value for the given types, or UNKNOWN_LIBCALL if there is none.
Libcall getSINTTOFP(EVT OpVT, EVT RetVT)
getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
Libcall getLDEXP(EVT RetVT)
getLDEXP - Return the LDEXP_* value for the given types, or UNKNOWN_LIBCALL if there is none.
Libcall getUINTTOFP(EVT OpVT, EVT RetVT)
getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
Libcall getFREXP(EVT RetVT)
getFREXP - Return the FREXP_* value for the given types, or UNKNOWN_LIBCALL if there is none.
Libcall
RTLIB::Libcall enum - This enum defines all of the runtime library calls the backend can emit.
Libcall getFPTOUINT(EVT OpVT, EVT RetVT)
getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
Libcall getFPTOSINT(EVT OpVT, EVT RetVT)
getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
Libcall getFPEXT(EVT OpVT, EVT RetVT)
getFPEXT - Return the FPEXT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
Libcall getFPROUND(EVT OpVT, EVT RetVT)
getFPROUND - Return the FPROUND_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
DiagnosticInfoOptimizationBase::Argument NV
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
DWARFExpression::Operation Op
static const fltSemantics & PPCDoubleDouble() LLVM_READNONE
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
bool isByteSized() const
Return true if the bit size is a multiple of 8.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
static EVT getIntegerVT(LLVMContext &Context, unsigned BitWidth)
Returns the EVT that represents an integer with the given number of bits.
bool bitsGE(EVT VT) const
Return true if this has no less bits than VT.
EVT getVectorElementType() const
Given a vector type, return the type of each element.
bool bitsLE(EVT VT) const
Return true if this has no more bits than VT.
static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
These are IR-level optimization flags that may be propagated to SDNodes.
This structure is used to pass arguments to makeLibCall function.
MakeLibCallOptions & setSExt(bool Value=true)
MakeLibCallOptions & setTypeListBeforeSoften(ArrayRef< EVT > OpsVT, EVT RetVT, bool Value=true)