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;
164 SetSoftenedFloat(
SDValue(
N, ResNo), R);
169 bool IsStrict =
N->isStrictFPOpcode();
171 unsigned Offset = IsStrict ? 1 : 0;
173 "Unexpected number of operands!");
177 EVT OpVT =
N->getOperand(0 +
Offset).getValueType();
179 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT,
Op,
183 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
188 bool IsStrict =
N->isStrictFPOpcode();
190 unsigned Offset = IsStrict ? 1 : 0;
192 "Unexpected number of operands!");
194 GetSoftenedFloat(
N->getOperand(1 +
Offset)) };
197 EVT OpsVT[2] = {
N->getOperand(0 +
Offset).getValueType(),
198 N->getOperand(1 +
Offset).getValueType() };
200 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT, Ops,
204 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
209 return BitConvertToInteger(
N->getOperand(0));
215 GetSoftenedFloat(
N->getOperand(0)));
221 GetSoftenedFloat(
N->getOperand(0)));
227 SDValue Op = DisintegrateMERGE_VALUES(
N, ResNo);
228 return BitConvertToInteger(
Op);
236 BitConvertToInteger(
N->getOperand(0)),
237 BitConvertToInteger(
N->getOperand(1)));
253 APInt Val(128, words);
264SDValue DAGTypeLegalizer::SoftenFloatRes_EXTRACT_ELEMENT(
SDNode *
N) {
266 assert(Src.getValueType() == MVT::ppcf128 &&
267 "In floats only ppcf128 can be extracted by element!");
269 N->getValueType(0).changeTypeToInteger(),
273SDValue DAGTypeLegalizer::SoftenFloatRes_EXTRACT_VECTOR_ELT(
SDNode *
N,
unsigned ResNo) {
274 SDValue NewOp = BitConvertVectorToIntegerVector(
N->getOperand(0));
277 NewOp,
N->getOperand(1));
288 SDValue Op = GetSoftenedFloat(
N->getOperand(0));
294 return SoftenFloatRes_SELECT_CC(SelCC.getNode());
300 RTLIB::FMIN_PPCF128));
305 return SoftenFloatRes_SELECT_CC(SelCC.getNode());
311 RTLIB::FMAX_PPCF128));
320 RTLIB::ADD_PPCF128));
329 RTLIB::CBRT_PPCF128));
338 RTLIB::CEIL_PPCF128));
343 SDValue RHS = BitConvertToInteger(
N->getOperand(1));
346 EVT LVT =
LHS.getValueType();
347 EVT RVT =
RHS.getValueType();
368 }
else if (SizeDiff < 0) {
395 RTLIB::COS_PPCF128));
404 RTLIB::DIV_PPCF128));
413 RTLIB::EXP_PPCF128));
422 RTLIB::EXP2_PPCF128));
426 return SoftenFloatRes_Unary(
428 GetFPLibCall(
N->getValueType(0), RTLIB::EXP10_F32, RTLIB::EXP10_F64,
429 RTLIB::EXP10_F80, RTLIB::EXP10_F128, RTLIB::EXP10_PPCF128));
438 RTLIB::FLOOR_PPCF128));
447 RTLIB::LOG_PPCF128));
456 RTLIB::LOG2_PPCF128));
465 RTLIB::LOG10_PPCF128));
469 bool IsStrict =
N->isStrictFPOpcode();
471 unsigned Offset = IsStrict ? 1 : 0;
473 GetSoftenedFloat(
N->getOperand(1 +
Offset)),
474 GetSoftenedFloat(
N->getOperand(2 +
Offset)) };
477 EVT OpsVT[3] = {
N->getOperand(0 +
Offset).getValueType(),
478 N->getOperand(1 +
Offset).getValueType(),
479 N->getOperand(2 +
Offset).getValueType() };
481 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG,
488 NVT, Ops, CallOptions,
SDLoc(
N), Chain);
490 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
500 RTLIB::MUL_PPCF128));
505 RTLIB::NEARBYINT_F32,
506 RTLIB::NEARBYINT_F64,
507 RTLIB::NEARBYINT_F80,
508 RTLIB::NEARBYINT_F128,
509 RTLIB::NEARBYINT_PPCF128));
523 bool IsStrict =
N->isStrictFPOpcode();
530 Op = GetPromotedFloat(
Op);
533 if (
Op.getValueType() ==
N->getValueType(0)) {
535 ReplaceValueWith(
SDValue(
N, 1), Chain);
536 return BitConvertToInteger(
Op);
544 if ((
Op.getValueType() == MVT::f16 ||
Op.getValueType() == MVT::bf16) &&
545 N->getValueType(0) != MVT::f32) {
548 { MVT::f32, MVT::Other }, { Chain,
Op });
549 Chain =
Op.getValue(1);
555 if (
Op.getValueType() == MVT::bf16) {
557 return SoftenFloatRes_BF16_TO_FP(
N);
561 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported FP_EXTEND!");
563 EVT OpVT =
N->getOperand(IsStrict ? 1 : 0).getValueType();
565 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT,
Op,
569 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
579 EVT OpsVT[1] = {
N->getOperand(0).getValueType() };
582 CallOptions,
SDLoc(
N)).first;
583 if (
N->getValueType(0) == MVT::f32)
588 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported FP_EXTEND!");
595 assert(
N->getValueType(0) == MVT::f32 &&
596 "Can only soften BF16_TO_FP with f32 result");
608 bool IsStrict =
N->isStrictFPOpcode();
613 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported FP_ROUND!");
615 EVT OpVT =
N->getOperand(IsStrict ? 1 : 0).getValueType();
617 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT,
Op,
621 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
631 RTLIB::POW_PPCF128));
635 bool IsStrict =
N->isStrictFPOpcode();
636 unsigned Offset = IsStrict ? 1 : 0;
637 assert((
N->getOperand(1 +
Offset).getValueType() == MVT::i16 ||
638 N->getOperand(1 +
Offset).getValueType() == MVT::i32) &&
639 "Unsupported power type!");
645 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unexpected fpowi.");
654 N->getOperand(1 +
Offset).getValueType().getSizeInBits()) {
666 EVT OpsVT[2] = {
N->getOperand(0 +
Offset).getValueType(),
667 N->getOperand(1 +
Offset).getValueType() };
669 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT, Ops,
673 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
678 assert(!
N->isStrictFPOpcode() &&
"strictfp not implemented for frexp");
679 EVT VT0 =
N->getValueType(0);
680 EVT VT1 =
N->getValueType(1);
697 SDValue Ops[2] = {GetSoftenedFloat(
N->getOperand(0)), StackSlot};
704 auto [ReturnVal, Chain] = TLI.
makeLibCall(DAG, LC, NVT0, Ops, CallOptions,
DL,
706 int FrameIdx = cast<FrameIndexSDNode>(StackSlot)->getIndex();
712 ReplaceValueWith(
SDValue(
N, 1), LoadExp);
722 RTLIB::REM_PPCF128));
731 RTLIB::RINT_PPCF128));
740 RTLIB::ROUND_PPCF128));
745 RTLIB::ROUNDEVEN_F32,
746 RTLIB::ROUNDEVEN_F64,
747 RTLIB::ROUNDEVEN_F80,
748 RTLIB::ROUNDEVEN_F128,
749 RTLIB::ROUNDEVEN_PPCF128));
758 RTLIB::SIN_PPCF128));
767 RTLIB::SQRT_PPCF128));
776 RTLIB::SUB_PPCF128));
780 return SoftenFloatRes_Unary(
781 N,
GetFPLibCall(
N->getValueType(0), RTLIB::TAN_F32, RTLIB::TAN_F64,
782 RTLIB::TAN_F80, RTLIB::TAN_F128, RTLIB::TAN_PPCF128));
791 RTLIB::TRUNC_PPCF128));
796 EVT VT =
N->getValueType(0);
801 L->getMemOperand()->getFlags() &
805 NewL = DAG.
getLoad(
L->getAddressingMode(),
L->getExtensionType(), NVT, dl,
806 L->getChain(),
L->getBasePtr(),
L->getOffset(),
807 L->getPointerInfo(), NVT,
L->getOriginalAlign(),
808 MMOFlags,
L->getAAInfo());
817 dl,
L->getChain(),
L->getBasePtr(),
L->getOffset(),
818 L->getPointerInfo(),
L->getMemoryVT(),
819 L->getOriginalAlign(), MMOFlags,
L->getAAInfo());
824 return BitConvertToInteger(ExtendNode);
829 EVT VT =
N->getValueType(0);
836 {L->getChain(), L->getBasePtr()},
L->getMemOperand());
851 LHS.getValueType(),
N->getOperand(0), LHS, RHS);
858 LHS.getValueType(),
N->getOperand(0),
859 N->getOperand(1), LHS, RHS,
N->getOperand(4));
864 N->getValueType(0)));
870 EVT VT =
N->getValueType(0);
875 NewVAARG = DAG.
getVAArg(NVT, dl, Chain,
Ptr,
N->getOperand(2),
876 N->getConstantOperandVal(3));
886 bool IsStrict =
N->isStrictFPOpcode();
889 EVT SVT =
N->getOperand(IsStrict ? 1 : 0).getValueType();
890 EVT RVT =
N->getValueType(0);
898 for (
unsigned t = MVT::FIRST_INTEGER_VALUETYPE;
899 t <= MVT::LAST_INTEGER_VALUETYPE && LC == RTLIB::UNKNOWN_LIBCALL; ++t) {
905 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported XINT_TO_FP!");
910 NVT,
N->getOperand(IsStrict ? 1 : 0));
914 std::pair<SDValue, SDValue> Tmp =
916 Op, CallOptions, dl, Chain);
919 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
929SDValue DAGTypeLegalizer::SoftenFloatRes_VECREDUCE_SEQ(
SDNode *
N) {
938bool DAGTypeLegalizer::SoftenFloatOperand(
SDNode *
N,
unsigned OpNo) {
939 LLVM_DEBUG(
dbgs() <<
"Soften float operand " << OpNo <<
": ";
N->dump(&DAG));
942 switch (
N->getOpcode()) {
945 dbgs() <<
"SoftenFloatOperand Op #" << OpNo <<
": ";
946 N->dump(&DAG);
dbgs() <<
"\n";
951 case ISD::BR_CC: Res = SoftenFloatOp_BR_CC(
N);
break;
964 Res = SoftenFloatOp_FP_TO_XINT_SAT(
N);
break;
970 case ISD::LRINT: Res = SoftenFloatOp_LRINT(
N);
break;
976 case ISD::SETCC: Res = SoftenFloatOp_SETCC(
N);
break;
977 case ISD::STORE: Res = SoftenFloatOp_STORE(
N, OpNo);
break;
979 Res = SoftenFloatOp_ATOMIC_STORE(
N, OpNo);
985 if (!Res.
getNode())
return false;
993 "Invalid operand softening");
995 ReplaceValueWith(
SDValue(
N, 0), Res);
1000 SDValue Op0 = GetSoftenedFloat(
N->getOperand(0));
1014 bool IsStrict =
N->isStrictFPOpcode();
1015 SDValue Op =
N->getOperand(IsStrict ? 1 : 0);
1016 EVT SVT =
Op.getValueType();
1017 EVT RVT =
N->getValueType(0);
1021 FloatRVT = MVT::f16;
1024 FloatRVT = MVT::bf16;
1027 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported FP_ROUND libcall");
1030 Op = GetSoftenedFloat(
Op);
1033 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, RVT,
Op,
1037 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
1038 ReplaceValueWith(
SDValue(
N, 0), Tmp.first);
1045 SDValue NewLHS =
N->getOperand(2), NewRHS =
N->getOperand(3);
1046 ISD::CondCode CCCode = cast<CondCodeSDNode>(
N->getOperand(1))->get();
1049 NewLHS = GetSoftenedFloat(NewLHS);
1050 NewRHS = GetSoftenedFloat(NewRHS);
1052 N->getOperand(2),
N->getOperand(3));
1056 if (!NewRHS.getNode()) {
1074 for (
unsigned IntVT = MVT::FIRST_INTEGER_VALUETYPE;
1075 IntVT <= MVT::LAST_INTEGER_VALUETYPE && LC == RTLIB::UNKNOWN_LIBCALL;
1079 if (Promoted.
bitsGE(RetVT))
1087 bool IsStrict =
N->isStrictFPOpcode();
1091 SDValue Op =
N->getOperand(IsStrict ? 1 : 0);
1092 EVT SVT =
Op.getValueType();
1093 EVT RVT =
N->getValueType(0);
1103 "Unsupported FP_TO_XINT!");
1105 Op = GetSoftenedFloat(
Op);
1109 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT,
Op,
1110 CallOptions, dl, Chain);
1118 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
1119 ReplaceValueWith(
SDValue(
N, 0), Res);
1123SDValue DAGTypeLegalizer::SoftenFloatOp_FP_TO_XINT_SAT(
SDNode *
N) {
1129 SDValue NewLHS =
N->getOperand(0), NewRHS =
N->getOperand(1);
1130 ISD::CondCode CCCode = cast<CondCodeSDNode>(
N->getOperand(4))->get();
1133 NewLHS = GetSoftenedFloat(NewLHS);
1134 NewRHS = GetSoftenedFloat(NewRHS);
1136 N->getOperand(0),
N->getOperand(1));
1140 if (!NewRHS.getNode()) {
1147 N->getOperand(2),
N->getOperand(3),
1153 bool IsStrict =
N->isStrictFPOpcode();
1154 SDValue Op0 =
N->getOperand(IsStrict ? 1 : 0);
1155 SDValue Op1 =
N->getOperand(IsStrict ? 2 : 1);
1158 cast<CondCodeSDNode>(
N->getOperand(IsStrict ? 3 : 2))->get();
1161 SDValue NewLHS = GetSoftenedFloat(Op0);
1162 SDValue NewRHS = GetSoftenedFloat(Op1);
1178 "Unexpected setcc expansion!");
1181 ReplaceValueWith(
SDValue(
N, 0), NewLHS);
1182 ReplaceValueWith(
SDValue(
N, 1), Chain);
1188SDValue DAGTypeLegalizer::SoftenFloatOp_STORE(
SDNode *
N,
unsigned OpNo) {
1190 assert(OpNo == 1 &&
"Can only soften the stored value!");
1195 if (
ST->isTruncatingStore())
1197 Val = BitConvertToInteger(
1201 Val = GetSoftenedFloat(Val);
1203 return DAG.
getStore(
ST->getChain(), dl, Val,
ST->getBasePtr(),
1204 ST->getMemOperand());
1207SDValue DAGTypeLegalizer::SoftenFloatOp_ATOMIC_STORE(
SDNode *
N,
unsigned OpNo) {
1208 assert(OpNo == 1 &&
"Can only soften the stored value!");
1214 assert(
ST->getMemoryVT() == VT &&
"truncating atomic store not handled");
1216 SDValue NewVal = GetSoftenedFloat(Val);
1218 ST->getBasePtr(),
ST->getMemOperand());
1223 SDValue RHS = BitConvertToInteger(
N->getOperand(1));
1226 EVT LVT =
LHS.getValueType();
1228 EVT RVT =
RHS.getValueType();
1234 int SizeDiff = RSize - LSize;
1242 }
else if (SizeDiff < 0) {
1257 bool IsStrict =
N->isStrictFPOpcode();
1258 unsigned Offset = IsStrict ? 1 : 0;
1262 EVT OpVT =
N->getOperand(0 +
Offset).getValueType();
1264 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT,
Op,
1268 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
1269 ReplaceValueWith(
SDValue(
N, 0), Tmp.first);
1277 EVT OpVT =
N->getOperand(
N->isStrictFPOpcode() ? 1 : 0).getValueType();
1283 RTLIB::LROUND_PPCF128));
1287 EVT OpVT =
N->getOperand(
N->isStrictFPOpcode() ? 1 : 0).getValueType();
1292 RTLIB::LLROUND_F128,
1293 RTLIB::LLROUND_PPCF128));
1297 EVT OpVT =
N->getOperand(
N->isStrictFPOpcode() ? 1 : 0).getValueType();
1303 RTLIB::LRINT_PPCF128));
1307 EVT OpVT =
N->getOperand(
N->isStrictFPOpcode() ? 1 : 0).getValueType();
1313 RTLIB::LLRINT_PPCF128));
1324void DAGTypeLegalizer::ExpandFloatResult(
SDNode *
N,
unsigned ResNo) {
1330 if (CustomLowerNode(
N,
N->getValueType(ResNo),
true))
1333 switch (
N->getOpcode()) {
1336 dbgs() <<
"ExpandFloatResult #" << ResNo <<
": ";
1337 N->dump(&DAG);
dbgs() <<
"\n";
1433 "Do not know how to expand this float constant!");
1434 APInt C = cast<ConstantFPSDNode>(
N)->getValueAPF().bitcastToAPInt();
1437 APInt(64,
C.getRawData()[1])),
1440 APInt(64,
C.getRawData()[0])),
1446 bool IsStrict =
N->isStrictFPOpcode();
1447 unsigned Offset = IsStrict ? 1 : 0;
1451 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC,
N->getValueType(0),
1455 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
1456 GetPairElements(Tmp.first,
Lo,
Hi);
1461 bool IsStrict =
N->isStrictFPOpcode();
1462 unsigned Offset = IsStrict ? 1 : 0;
1466 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC,
N->getValueType(0),
1467 Ops, CallOptions,
SDLoc(
N),
1470 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
1471 GetPairElements(Tmp.first,
Lo,
Hi);
1476 assert(
N->getValueType(0) == MVT::ppcf128 &&
1477 "Logic only correct for ppcf128!");
1480 GetExpandedFloat(
N->getOperand(0),
Lo, Tmp);
1491 RTLIB::FMIN_F32, RTLIB::FMIN_F64,
1492 RTLIB::FMIN_F80, RTLIB::FMIN_F128,
1493 RTLIB::FMIN_PPCF128),
Lo,
Hi);
1499 RTLIB::FMAX_F32, RTLIB::FMAX_F64,
1500 RTLIB::FMAX_F80, RTLIB::FMAX_F128,
1501 RTLIB::FMAX_PPCF128),
Lo,
Hi);
1507 RTLIB::ADD_F32, RTLIB::ADD_F64,
1508 RTLIB::ADD_F80, RTLIB::ADD_F128,
1509 RTLIB::ADD_PPCF128),
Lo,
Hi);
1514 ExpandFloatRes_Unary(
N,
GetFPLibCall(
N->getValueType(0), RTLIB::CBRT_F32,
1515 RTLIB::CBRT_F64, RTLIB::CBRT_F80,
1517 RTLIB::CBRT_PPCF128),
Lo,
Hi);
1520void DAGTypeLegalizer::ExpandFloatRes_FCEIL(
SDNode *
N,
1523 RTLIB::CEIL_F32, RTLIB::CEIL_F64,
1524 RTLIB::CEIL_F80, RTLIB::CEIL_F128,
1525 RTLIB::CEIL_PPCF128),
Lo,
Hi);
1528void DAGTypeLegalizer::ExpandFloatRes_FCOPYSIGN(
SDNode *
N,
1531 RTLIB::COPYSIGN_F32,
1532 RTLIB::COPYSIGN_F64,
1533 RTLIB::COPYSIGN_F80,
1534 RTLIB::COPYSIGN_F128,
1535 RTLIB::COPYSIGN_PPCF128),
Lo,
Hi);
1538void DAGTypeLegalizer::ExpandFloatRes_FCOS(
SDNode *
N,
1541 RTLIB::COS_F32, RTLIB::COS_F64,
1542 RTLIB::COS_F80, RTLIB::COS_F128,
1543 RTLIB::COS_PPCF128),
Lo,
Hi);
1553 RTLIB::DIV_PPCF128),
Lo,
Hi);
1556void DAGTypeLegalizer::ExpandFloatRes_FEXP(
SDNode *
N,
1559 RTLIB::EXP_F32, RTLIB::EXP_F64,
1560 RTLIB::EXP_F80, RTLIB::EXP_F128,
1561 RTLIB::EXP_PPCF128),
Lo,
Hi);
1564void DAGTypeLegalizer::ExpandFloatRes_FEXP2(
SDNode *
N,
1567 RTLIB::EXP2_F32, RTLIB::EXP2_F64,
1568 RTLIB::EXP2_F80, RTLIB::EXP2_F128,
1569 RTLIB::EXP2_PPCF128),
Lo,
Hi);
1574 ExpandFloatRes_Unary(
N,
1576 RTLIB::EXP10_F64, RTLIB::EXP10_F80,
1577 RTLIB::EXP10_F128, RTLIB::EXP10_PPCF128),
1581void DAGTypeLegalizer::ExpandFloatRes_FFLOOR(
SDNode *
N,
1584 RTLIB::FLOOR_F32, RTLIB::FLOOR_F64,
1585 RTLIB::FLOOR_F80, RTLIB::FLOOR_F128,
1586 RTLIB::FLOOR_PPCF128),
Lo,
Hi);
1589void DAGTypeLegalizer::ExpandFloatRes_FLOG(
SDNode *
N,
1592 RTLIB::LOG_F32, RTLIB::LOG_F64,
1593 RTLIB::LOG_F80, RTLIB::LOG_F128,
1594 RTLIB::LOG_PPCF128),
Lo,
Hi);
1597void DAGTypeLegalizer::ExpandFloatRes_FLOG2(
SDNode *
N,
1600 RTLIB::LOG2_F32, RTLIB::LOG2_F64,
1601 RTLIB::LOG2_F80, RTLIB::LOG2_F128,
1602 RTLIB::LOG2_PPCF128),
Lo,
Hi);
1605void DAGTypeLegalizer::ExpandFloatRes_FLOG10(
SDNode *
N,
1608 RTLIB::LOG10_F32, RTLIB::LOG10_F64,
1609 RTLIB::LOG10_F80, RTLIB::LOG10_F128,
1610 RTLIB::LOG10_PPCF128),
Lo,
Hi);
1615 bool IsStrict =
N->isStrictFPOpcode();
1616 unsigned Offset = IsStrict ? 1 : 0;
1626 RTLIB::FMA_PPCF128),
1627 N->getValueType(0), Ops, CallOptions,
1630 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
1631 GetPairElements(Tmp.first,
Lo,
Hi);
1641 RTLIB::MUL_PPCF128),
Lo,
Hi);
1644void DAGTypeLegalizer::ExpandFloatRes_FNEARBYINT(
SDNode *
N,
1647 RTLIB::NEARBYINT_F32,
1648 RTLIB::NEARBYINT_F64,
1649 RTLIB::NEARBYINT_F80,
1650 RTLIB::NEARBYINT_F128,
1651 RTLIB::NEARBYINT_PPCF128),
Lo,
Hi);
1657 GetExpandedFloat(
N->getOperand(0),
Lo,
Hi);
1666 bool IsStrict =
N->isStrictFPOpcode();
1671 if (NVT ==
N->getOperand(1).getValueType()) {
1672 Hi =
N->getOperand(1);
1673 Chain =
N->getOperand(0);
1677 {
N->getOperand(0),
N->getOperand(1) });
1678 Chain =
Hi.getValue(1);
1688 ReplaceValueWith(
SDValue(
N, 1), Chain);
1691void DAGTypeLegalizer::ExpandFloatRes_FPOW(
SDNode *
N,
1694 RTLIB::POW_F32, RTLIB::POW_F64,
1695 RTLIB::POW_F80, RTLIB::POW_F128,
1696 RTLIB::POW_PPCF128),
Lo,
Hi);
1699void DAGTypeLegalizer::ExpandFloatRes_FPOWI(
SDNode *
N,
1709void DAGTypeLegalizer::ExpandFloatRes_FREEZE(
SDNode *
N,
1711 assert(
N->getValueType(0) == MVT::ppcf128 &&
1712 "Logic only correct for ppcf128!");
1715 GetExpandedFloat(
N->getOperand(0),
Lo,
Hi);
1720void DAGTypeLegalizer::ExpandFloatRes_FREM(
SDNode *
N,
1723 RTLIB::REM_F32, RTLIB::REM_F64,
1724 RTLIB::REM_F80, RTLIB::REM_F128,
1725 RTLIB::REM_PPCF128),
Lo,
Hi);
1728void DAGTypeLegalizer::ExpandFloatRes_FRINT(
SDNode *
N,
1731 RTLIB::RINT_F32, RTLIB::RINT_F64,
1732 RTLIB::RINT_F80, RTLIB::RINT_F128,
1733 RTLIB::RINT_PPCF128),
Lo,
Hi);
1736void DAGTypeLegalizer::ExpandFloatRes_FROUND(
SDNode *
N,
1743 RTLIB::ROUND_PPCF128),
Lo,
Hi);
1746void DAGTypeLegalizer::ExpandFloatRes_FROUNDEVEN(
SDNode *
N,
1749 RTLIB::ROUNDEVEN_F32,
1750 RTLIB::ROUNDEVEN_F64,
1751 RTLIB::ROUNDEVEN_F80,
1752 RTLIB::ROUNDEVEN_F128,
1753 RTLIB::ROUNDEVEN_PPCF128),
Lo,
Hi);
1756void DAGTypeLegalizer::ExpandFloatRes_FSIN(
SDNode *
N,
1759 RTLIB::SIN_F32, RTLIB::SIN_F64,
1760 RTLIB::SIN_F80, RTLIB::SIN_F128,
1761 RTLIB::SIN_PPCF128),
Lo,
Hi);
1764void DAGTypeLegalizer::ExpandFloatRes_FSQRT(
SDNode *
N,
1767 RTLIB::SQRT_F32, RTLIB::SQRT_F64,
1768 RTLIB::SQRT_F80, RTLIB::SQRT_F128,
1769 RTLIB::SQRT_PPCF128),
Lo,
Hi);
1779 RTLIB::SUB_PPCF128),
Lo,
Hi);
1784 ExpandFloatRes_Unary(
N,
1786 RTLIB::TAN_F64, RTLIB::TAN_F80,
1787 RTLIB::TAN_F128, RTLIB::TAN_PPCF128),
1791void DAGTypeLegalizer::ExpandFloatRes_FTRUNC(
SDNode *
N,
1794 RTLIB::TRUNC_F32, RTLIB::TRUNC_F64,
1795 RTLIB::TRUNC_F80, RTLIB::TRUNC_F128,
1796 RTLIB::TRUNC_PPCF128),
Lo,
Hi);
1802 ExpandRes_NormalLoad(
N,
Lo,
Hi);
1814 assert(
LD->getMemoryVT().bitsLE(NVT) &&
"Float type not round?");
1817 LD->getMemoryVT(),
LD->getMemOperand());
1820 Chain =
Hi.getValue(1);
1828 ReplaceValueWith(
SDValue(LD, 1), Chain);
1833 assert(
N->getValueType(0) == MVT::ppcf128 &&
"Unsupported XINT_TO_FP!");
1834 EVT VT =
N->getValueType(0);
1836 bool Strict =
N->isStrictFPOpcode();
1837 SDValue Src =
N->getOperand(Strict ? 1 : 0);
1838 EVT SrcVT = Src.getValueType();
1846 Flags.setNoFPExcept(
N->getFlags().hasNoFPExcept());
1851 if (SrcVT.
bitsLE(MVT::i32)) {
1857 {Chain, Src}, Flags);
1858 Chain =
Hi.getValue(1);
1860 Hi = DAG.
getNode(
N->getOpcode(), dl, NVT, Src);
1863 if (SrcVT.
bitsLE(MVT::i64)) {
1866 LC = RTLIB::SINTTOFP_I64_PPCF128;
1867 }
else if (SrcVT.
bitsLE(MVT::i128)) {
1869 LC = RTLIB::SINTTOFP_I128_PPCF128;
1871 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported XINT_TO_FP!");
1875 std::pair<SDValue, SDValue> Tmp =
1876 TLI.
makeLibCall(DAG, LC, VT, Src, CallOptions, dl, Chain);
1879 GetPairElements(Tmp.first,
Lo,
Hi);
1885 ReplaceValueWith(
SDValue(
N, 1), Chain);
1895 SrcVT = Src.getValueType();
1898 static const uint64_t TwoE32[] = { 0x41f0000000000000LL, 0 };
1899 static const uint64_t TwoE64[] = { 0x43f0000000000000LL, 0 };
1900 static const uint64_t TwoE128[] = { 0x47f0000000000000LL, 0 };
1922 {Chain, Hi, NewLo}, Flags);
1923 Chain =
Lo.getValue(1);
1924 ReplaceValueWith(
SDValue(
N, 1), Chain);
1929 GetPairElements(
Lo,
Lo,
Hi);
1941bool DAGTypeLegalizer::ExpandFloatOperand(
SDNode *
N,
unsigned OpNo) {
1946 if (CustomLowerNode(
N,
N->getOperand(OpNo).getValueType(),
false))
1949 switch (
N->getOpcode()) {
1952 dbgs() <<
"ExpandFloatOperand Op #" << OpNo <<
": ";
1953 N->dump(&DAG);
dbgs() <<
"\n";
1961 case ISD::BR_CC: Res = ExpandFloatOp_BR_CC(
N);
break;
1969 case ISD::LROUND: Res = ExpandFloatOp_LROUND(
N);
break;
1971 case ISD::LRINT: Res = ExpandFloatOp_LRINT(
N);
break;
1972 case ISD::LLRINT: Res = ExpandFloatOp_LLRINT(
N);
break;
1976 case ISD::SETCC: Res = ExpandFloatOp_SETCC(
N);
break;
1977 case ISD::STORE: Res = ExpandFloatOp_STORE(cast<StoreSDNode>(
N),
1982 if (!Res.
getNode())
return false;
1990 "Invalid operand expansion");
1992 ReplaceValueWith(
SDValue(
N, 0), Res);
1998void DAGTypeLegalizer::FloatExpandSetCCOperands(
SDValue &NewLHS,
2003 SDValue LHSLo, LHSHi, RHSLo, RHSHi;
2004 GetExpandedFloat(NewLHS, LHSLo, LHSHi);
2005 GetExpandedFloat(NewRHS, RHSLo, RHSHi);
2014 SDValue Tmp1, Tmp2, Tmp3, OutputChain;
2019 RHSLo, CCCode, OutputChain, IsSignaling);
2027 RHSHi, CCCode, OutputChain, IsSignaling);
2032 Chain = OutputChain;
2036 SDValue NewLHS =
N->getOperand(2), NewRHS =
N->getOperand(3);
2037 ISD::CondCode CCCode = cast<CondCodeSDNode>(
N->getOperand(1))->get();
2039 FloatExpandSetCCOperands(NewLHS, NewRHS, CCCode,
SDLoc(
N), Chain);
2051 N->getOperand(4)), 0);
2055 assert(
N->getOperand(1).getValueType() == MVT::ppcf128 &&
2056 "Logic only correct for ppcf128!");
2058 GetExpandedFloat(
N->getOperand(1),
Lo,
Hi);
2062 N->getValueType(0),
N->getOperand(0),
Hi);
2066 bool IsStrict =
N->isStrictFPOpcode();
2067 assert(
N->getOperand(IsStrict ? 1 : 0).getValueType() == MVT::ppcf128 &&
2068 "Logic only correct for ppcf128!");
2070 GetExpandedFloat(
N->getOperand(IsStrict ? 1 : 0),
Lo,
Hi);
2075 N->getValueType(0),
Hi,
N->getOperand(1));
2079 if (
Hi.getValueType() ==
N->getValueType(0)) {
2081 ReplaceValueWith(
SDValue(
N, 1),
N->getOperand(0));
2087 {
N->getValueType(0), MVT::Other},
2088 {
N->getOperand(0),
Hi,
N->getOperand(2)});
2095 EVT RVT =
N->getValueType(0);
2098 bool IsStrict =
N->isStrictFPOpcode();
2101 SDValue Op =
N->getOperand(IsStrict ? 1 : 0);
2107 "Unsupported FP_TO_XINT!");
2109 std::pair<SDValue, SDValue> Tmp =
2114 ReplaceValueWith(
SDValue(
N, 1), Tmp.second);
2115 ReplaceValueWith(
SDValue(
N, 0), Tmp.first);
2120 SDValue NewLHS =
N->getOperand(0), NewRHS =
N->getOperand(1);
2121 ISD::CondCode CCCode = cast<CondCodeSDNode>(
N->getOperand(4))->get();
2123 FloatExpandSetCCOperands(NewLHS, NewRHS, CCCode,
SDLoc(
N), Chain);
2134 N->getOperand(2),
N->getOperand(3),
2139 bool IsStrict =
N->isStrictFPOpcode();
2140 SDValue NewLHS =
N->getOperand(IsStrict ? 1 : 0);
2141 SDValue NewRHS =
N->getOperand(IsStrict ? 2 : 1);
2144 cast<CondCodeSDNode>(
N->getOperand(IsStrict ? 3 : 2))->get();
2145 FloatExpandSetCCOperands(NewLHS, NewRHS, CCCode,
SDLoc(
N), Chain,
2151 "Unexpected setcc expansion!");
2153 ReplaceValueWith(
SDValue(
N, 0), NewLHS);
2154 ReplaceValueWith(
SDValue(
N, 1), Chain);
2160SDValue DAGTypeLegalizer::ExpandFloatOp_STORE(
SDNode *
N,
unsigned OpNo) {
2162 return ExpandOp_NormalStore(
N, OpNo);
2165 assert(OpNo == 1 &&
"Can only expand the stored value so far");
2172 ST->getValue().getValueType());
2174 assert(
ST->getMemoryVT().bitsLE(NVT) &&
"Float type not round?");
2178 GetExpandedOp(
ST->getValue(),
Lo,
Hi);
2181 ST->getMemoryVT(),
ST->getMemOperand());
2185 EVT RVT =
N->getValueType(0);
2186 EVT RetVT =
N->getOperand(0).getValueType();
2193 RTLIB::LROUND_PPCF128),
2194 RVT,
N->getOperand(0), CallOptions,
SDLoc(
N)).first;
2198 EVT RVT =
N->getValueType(0);
2199 EVT RetVT =
N->getOperand(0).getValueType();
2205 RTLIB::LLROUND_F128,
2206 RTLIB::LLROUND_PPCF128),
2207 RVT,
N->getOperand(0), CallOptions,
SDLoc(
N)).first;
2211 EVT RVT =
N->getValueType(0);
2212 EVT RetVT =
N->getOperand(0).getValueType();
2219 RTLIB::LRINT_PPCF128),
2220 RVT,
N->getOperand(0), CallOptions,
SDLoc(
N)).first;
2224 EVT RVT =
N->getValueType(0);
2225 EVT RetVT =
N->getOperand(0).getValueType();
2232 RTLIB::LLRINT_PPCF128),
2233 RVT,
N->getOperand(0), CallOptions,
SDLoc(
N)).first;
2242 if (OpVT == MVT::f16) {
2244 }
else if (RetVT == MVT::f16) {
2246 }
else if (OpVT == MVT::bf16) {
2248 }
else if (RetVT == MVT::bf16) {
2256 if (OpVT == MVT::f16)
2259 if (RetVT == MVT::f16)
2262 if (OpVT == MVT::bf16)
2265 if (RetVT == MVT::bf16)
2271bool DAGTypeLegalizer::PromoteFloatOperand(
SDNode *
N,
unsigned OpNo) {
2272 LLVM_DEBUG(
dbgs() <<
"Promote float operand " << OpNo <<
": ";
N->dump(&DAG));
2275 if (CustomLowerNode(
N,
N->getOperand(OpNo).getValueType(),
false)) {
2286 switch (
N->getOpcode()) {
2289 dbgs() <<
"PromoteFloatOperand Op #" << OpNo <<
": ";
2290 N->dump(&DAG);
dbgs() <<
"\n";
2299 case ISD::LLRINT:
R = PromoteFloatOp_UnaryOp(
N, OpNo);
break;
2302 R = PromoteFloatOp_FP_TO_XINT_SAT(
N, OpNo);
break;
2305 R = PromoteFloatOp_STRICT_FP_EXTEND(
N, OpNo);
2308 case ISD::SETCC:
R = PromoteFloatOp_SETCC(
N, OpNo);
break;
2309 case ISD::STORE:
R = PromoteFloatOp_STORE(
N, OpNo);
break;
2315 ReplaceValueWith(
SDValue(
N, 0), R);
2319SDValue DAGTypeLegalizer::PromoteFloatOp_BITCAST(
SDNode *
N,
unsigned OpNo) {
2321 EVT OpVT =
Op->getValueType(0);
2323 SDValue Promoted = GetPromotedFloat(
N->getOperand(0));
2332 return DAG.
getBitcast(
N->getValueType(0), Convert);
2337SDValue DAGTypeLegalizer::PromoteFloatOp_FCOPYSIGN(
SDNode *
N,
unsigned OpNo) {
2338 assert (OpNo == 1 &&
"Only Operand 1 must need promotion here");
2339 SDValue Op1 = GetPromotedFloat(
N->getOperand(1));
2342 N->getOperand(0), Op1);
2346SDValue DAGTypeLegalizer::PromoteFloatOp_UnaryOp(
SDNode *
N,
unsigned OpNo) {
2347 SDValue Op = GetPromotedFloat(
N->getOperand(0));
2351SDValue DAGTypeLegalizer::PromoteFloatOp_FP_TO_XINT_SAT(
SDNode *
N,
2353 SDValue Op = GetPromotedFloat(
N->getOperand(0));
2358SDValue DAGTypeLegalizer::PromoteFloatOp_FP_EXTEND(
SDNode *
N,
unsigned OpNo) {
2359 SDValue Op = GetPromotedFloat(
N->getOperand(0));
2360 EVT VT =
N->getValueType(0);
2363 if (VT ==
Op->getValueType(0))
2370SDValue DAGTypeLegalizer::PromoteFloatOp_STRICT_FP_EXTEND(
SDNode *
N,
2372 assert(OpNo == 1 &&
"Promoting unpromotable operand");
2374 SDValue Op = GetPromotedFloat(
N->getOperand(1));
2375 EVT VT =
N->getValueType(0);
2378 if (VT ==
Op->getValueType(0)) {
2379 ReplaceValueWith(
SDValue(
N, 1),
N->getOperand(0));
2385 N->getOperand(0),
Op);
2393SDValue DAGTypeLegalizer::PromoteFloatOp_SELECT_CC(
SDNode *
N,
unsigned OpNo) {
2398 LHS, RHS,
N->getOperand(2),
N->getOperand(3),
2404SDValue DAGTypeLegalizer::PromoteFloatOp_SETCC(
SDNode *
N,
unsigned OpNo) {
2405 EVT VT =
N->getValueType(0);
2406 SDValue Op0 = GetPromotedFloat(
N->getOperand(0));
2407 SDValue Op1 = GetPromotedFloat(
N->getOperand(1));
2408 ISD::CondCode CCCode = cast<CondCodeSDNode>(
N->getOperand(2))->get();
2416SDValue DAGTypeLegalizer::PromoteFloatOp_STORE(
SDNode *
N,
unsigned OpNo) {
2421 SDValue Promoted = GetPromotedFloat(Val);
2422 EVT VT =
ST->getOperand(1).getValueType();
2429 return DAG.
getStore(
ST->getChain(),
DL, NewVal,
ST->getBasePtr(),
2430 ST->getMemOperand());
2439 SDValue Promoted = GetPromotedFloat(Val);
2440 EVT VT =
ST->getOperand(1).getValueType();
2447 ST->getBasePtr(),
ST->getMemOperand());
2454void DAGTypeLegalizer::PromoteFloatResult(
SDNode *
N,
unsigned ResNo) {
2455 LLVM_DEBUG(
dbgs() <<
"Promote float result " << ResNo <<
": ";
N->dump(&DAG));
2459 if (CustomLowerNode(
N,
N->getValueType(ResNo),
true)) {
2464 switch (
N->getOpcode()) {
2471 dbgs() <<
"PromoteFloatResult #" << ResNo <<
": ";
2472 N->dump(&DAG);
dbgs() <<
"\n";
2479 R = PromoteFloatRes_EXTRACT_VECTOR_ELT(
N);
break;
2517 case ISD::FSUB:
R = PromoteFloatRes_BinOp(
N);
break;
2520 case ISD::FMAD:
R = PromoteFloatRes_FMAD(
N);
break;
2528 R = PromoteFloatRes_STRICT_FP_ROUND(
N);
2530 case ISD::LOAD:
R = PromoteFloatRes_LOAD(
N);
break;
2532 R = PromoteFloatRes_ATOMIC_LOAD(
N);
2547 R = PromoteFloatRes_VECREDUCE(
N);
2551 R = PromoteFloatRes_VECREDUCE_SEQ(
N);
2556 SetPromotedFloat(
SDValue(
N, ResNo), R);
2565 EVT VT =
N->getValueType(0);
2570 N->getOperand(0).getValueType().getSizeInBits());
2577 EVT VT =
N->getValueType(0);
2596SDValue DAGTypeLegalizer::PromoteFloatRes_EXTRACT_VECTOR_ELT(
SDNode *
N) {
2601 if (isa<ConstantSDNode>(
N->getOperand(1))) {
2609 switch (getTypeAction(VecVT)) {
2612 SDValue Res = GetScalarizedVector(
N->getOperand(0));
2613 ReplaceValueWith(
SDValue(
N, 0), Res);
2617 Vec = GetWidenedVector(Vec);
2619 ReplaceValueWith(
SDValue(
N, 0), Res);
2624 GetSplitVector(Vec,
Lo,
Hi);
2626 uint64_t LoElts =
Lo.getValueType().getVectorNumElements();
2628 if (IdxVal < LoElts)
2633 Idx.getValueType()));
2634 ReplaceValueWith(
SDValue(
N, 0), Res);
2642 SDValue NewOp = BitConvertVectorToIntegerVector(
N->getOperand(0));
2647 NewOp,
N->getOperand(1));
2650 EVT VT =
N->getValueType(0);
2659 EVT VT =
N->getValueType(0);
2661 SDValue Op0 = GetPromotedFloat(
N->getOperand(0));
2672 EVT VT =
N->getValueType(0);
2674 SDValue Op = GetPromotedFloat(
N->getOperand(0));
2683 EVT VT =
N->getValueType(0);
2685 SDValue Op0 = GetPromotedFloat(
N->getOperand(0));
2686 SDValue Op1 = GetPromotedFloat(
N->getOperand(1));
2687 return DAG.
getNode(
N->getOpcode(),
SDLoc(
N), NVT, Op0, Op1,
N->getFlags());
2691 EVT VT =
N->getValueType(0);
2693 SDValue Op0 = GetPromotedFloat(
N->getOperand(0));
2694 SDValue Op1 = GetPromotedFloat(
N->getOperand(1));
2695 SDValue Op2 = GetPromotedFloat(
N->getOperand(2));
2697 return DAG.
getNode(
N->getOpcode(),
SDLoc(
N), NVT, Op0, Op1, Op2);
2702 EVT VT =
N->getValueType(0);
2704 SDValue Op0 = GetPromotedFloat(
N->getOperand(0));
2711 EVT VT =
N->getValueType(0);
2713 SDValue Op = GetPromotedFloat(
N->getOperand(0));
2727 EVT VT =
N->getValueType(0);
2728 EVT OpVT =
Op->getValueType(0);
2740SDValue DAGTypeLegalizer::PromoteFloatRes_STRICT_FP_ROUND(
SDNode *
N) {
2745 EVT VT =
N->getValueType(0);
2746 EVT OpVT =
Op->getValueType(0);
2763 EVT VT =
N->getValueType(0);
2768 L->getAddressingMode(),
L->getExtensionType(), IVT,
SDLoc(
N),
2769 L->getChain(),
L->getBasePtr(),
L->getOffset(),
L->getPointerInfo(), IVT,
2770 L->getOriginalAlign(),
L->getMemOperand()->getFlags(),
L->getAAInfo());
2780SDValue DAGTypeLegalizer::PromoteFloatRes_ATOMIC_LOAD(
SDNode *
N) {
2805 N->getOperand(0), TrueVal, FalseVal);
2815 TrueVal.getNode()->getValueType(0),
N->getOperand(0),
2816 N->getOperand(1), TrueVal, FalseVal,
N->getOperand(4));
2823 EVT VT =
N->getValueType(0);
2835 N->getValueType(0)));
2847SDValue DAGTypeLegalizer::PromoteFloatRes_VECREDUCE_SEQ(
SDNode *
N) {
2853 EVT VT =
N->getValueType(0);
2864 { AM->getChain(), AM->getBasePtr(), CastVal },
2887void DAGTypeLegalizer::SoftPromoteHalfResult(
SDNode *
N,
unsigned ResNo) {
2888 LLVM_DEBUG(
dbgs() <<
"Soft promote half result " << ResNo <<
": ";
2893 if (CustomLowerNode(
N,
N->getValueType(ResNo),
true)) {
2898 switch (
N->getOpcode()) {
2901 dbgs() <<
"SoftPromoteHalfResult #" << ResNo <<
": ";
2902 N->dump(&DAG);
dbgs() <<
"\n";
2908 R = SoftPromoteHalfRes_ARITH_FENCE(
N);
break;
2912 R = SoftPromoteHalfRes_EXTRACT_VECTOR_ELT(
N);
break;
2951 case ISD::FSUB:
R = SoftPromoteHalfRes_BinOp(
N);
break;
2954 case ISD::FMAD:
R = SoftPromoteHalfRes_FMAD(
N);
break;
2961 case ISD::LOAD:
R = SoftPromoteHalfRes_LOAD(
N);
break;
2963 R = SoftPromoteHalfRes_ATOMIC_LOAD(
N);
2969 case ISD::UNDEF:
R = SoftPromoteHalfRes_UNDEF(
N);
break;
2977 R = SoftPromoteHalfRes_VECREDUCE(
N);
2981 R = SoftPromoteHalfRes_VECREDUCE_SEQ(
N);
2986 SetSoftPromotedHalf(
SDValue(
N, ResNo), R);
2989SDValue DAGTypeLegalizer::SoftPromoteHalfRes_ARITH_FENCE(
SDNode *
N) {
2991 BitConvertToInteger(
N->getOperand(0)));
2995 return BitConvertToInteger(
N->getOperand(0));
2998SDValue DAGTypeLegalizer::SoftPromoteHalfRes_ConstantFP(
SDNode *
N) {
3006SDValue DAGTypeLegalizer::SoftPromoteHalfRes_EXTRACT_VECTOR_ELT(
SDNode *
N) {
3007 SDValue NewOp = BitConvertVectorToIntegerVector(
N->getOperand(0));
3013SDValue DAGTypeLegalizer::SoftPromoteHalfRes_FCOPYSIGN(
SDNode *
N) {
3014 SDValue LHS = GetSoftPromotedHalf(
N->getOperand(0));
3015 SDValue RHS = BitConvertToInteger(
N->getOperand(1));
3018 EVT LVT =
LHS.getValueType();
3019 EVT RVT =
RHS.getValueType();
3040 }
else if (SizeDiff < 0) {
3062 EVT OVT =
N->getValueType(0);
3064 SDValue Op0 = GetSoftPromotedHalf(
N->getOperand(0));
3065 SDValue Op1 = GetSoftPromotedHalf(
N->getOperand(1));
3066 SDValue Op2 = GetSoftPromotedHalf(
N->getOperand(2));
3071 Op0 = DAG.
getNode(PromotionOpcode, dl, NVT, Op0);
3072 Op1 = DAG.
getNode(PromotionOpcode, dl, NVT, Op1);
3073 Op2 = DAG.
getNode(PromotionOpcode, dl, NVT, Op2);
3082 EVT OVT =
N->getValueType(0);
3084 SDValue Op0 = GetSoftPromotedHalf(
N->getOperand(0));
3098 EVT OVT =
N->getValueType(0);
3100 SDValue Op = GetSoftPromotedHalf(
N->getOperand(0));
3115SDValue DAGTypeLegalizer::SoftPromoteHalfRes_FP_ROUND(
SDNode *
N) {
3116 EVT RVT =
N->getValueType(0);
3117 EVT SVT =
N->getOperand(0).getValueType();
3119 if (
N->isStrictFPOpcode()) {
3122 if (RVT == MVT::f16)
3124 else if (RVT == MVT::bf16)
3129 {
N->getOperand(0),
N->getOperand(1)});
3144 DAG.
getLoad(
L->getAddressingMode(),
L->getExtensionType(), MVT::i16,
3145 SDLoc(
N),
L->getChain(),
L->getBasePtr(),
L->getOffset(),
3146 L->getPointerInfo(), MVT::i16,
L->getOriginalAlign(),
3147 L->getMemOperand()->getFlags(),
L->getAAInfo());
3154SDValue DAGTypeLegalizer::SoftPromoteHalfRes_ATOMIC_LOAD(
SDNode *
N) {
3169 SDValue Op1 = GetSoftPromotedHalf(
N->getOperand(1));
3170 SDValue Op2 = GetSoftPromotedHalf(
N->getOperand(2));
3175SDValue DAGTypeLegalizer::SoftPromoteHalfRes_SELECT_CC(
SDNode *
N) {
3176 SDValue Op2 = GetSoftPromotedHalf(
N->getOperand(2));
3177 SDValue Op3 = GetSoftPromotedHalf(
N->getOperand(3));
3179 N->getOperand(0),
N->getOperand(1), Op2, Op3,
3183SDValue DAGTypeLegalizer::SoftPromoteHalfRes_XINT_TO_FP(
SDNode *
N) {
3184 EVT OVT =
N->getValueType(0);
3199 EVT OVT =
N->getValueType(0);
3201 SDValue Op = GetSoftPromotedHalf(
N->getOperand(0));
3214 EVT OVT =
N->getValueType(0);
3216 SDValue Op0 = GetSoftPromotedHalf(
N->getOperand(0));
3217 SDValue Op1 = GetSoftPromotedHalf(
N->getOperand(1));
3222 Op0 = DAG.
getNode(PromotionOpcode, dl, NVT, Op0);
3223 Op1 = DAG.
getNode(PromotionOpcode, dl, NVT, Op1);
3231SDValue DAGTypeLegalizer::SoftPromoteHalfRes_VECREDUCE(
SDNode *
N) {
3237SDValue DAGTypeLegalizer::SoftPromoteHalfRes_VECREDUCE_SEQ(
SDNode *
N) {
3247bool DAGTypeLegalizer::SoftPromoteHalfOperand(
SDNode *
N,
unsigned OpNo) {
3248 LLVM_DEBUG(
dbgs() <<
"Soft promote half operand " << OpNo <<
": ";
3252 if (CustomLowerNode(
N,
N->getOperand(OpNo).getValueType(),
false)) {
3262 switch (
N->getOpcode()) {
3265 dbgs() <<
"SoftPromoteHalfOperand Op #" << OpNo <<
": ";
3266 N->dump(&DAG);
dbgs() <<
"\n";
3271 case ISD::BITCAST: Res = SoftPromoteHalfOp_BITCAST(
N);
break;
3272 case ISD::FCOPYSIGN: Res = SoftPromoteHalfOp_FCOPYSIGN(
N, OpNo);
break;
3277 Res = SoftPromoteHalfOp_FP_TO_XINT_SAT(
N);
break;
3280 case ISD::SELECT_CC: Res = SoftPromoteHalfOp_SELECT_CC(
N, OpNo);
break;
3281 case ISD::SETCC: Res = SoftPromoteHalfOp_SETCC(
N);
break;
3282 case ISD::STORE: Res = SoftPromoteHalfOp_STORE(
N, OpNo);
break;
3284 Res = SoftPromoteHalfOp_ATOMIC_STORE(
N, OpNo);
3287 Res = SoftPromoteHalfOp_STACKMAP(
N, OpNo);
3290 Res = SoftPromoteHalfOp_PATCHPOINT(
N, OpNo);
3300 "Invalid operand expansion");
3302 ReplaceValueWith(
SDValue(
N, 0), Res);
3307 SDValue Op0 = GetSoftPromotedHalf(
N->getOperand(0));
3314 assert(OpNo == 1 &&
"Only Operand 1 must need promotion here");
3321 Op1 = GetSoftPromotedHalf(Op1);
3324 return DAG.
getNode(
N->getOpcode(), dl,
N->getValueType(0),
N->getOperand(0),
3328SDValue DAGTypeLegalizer::SoftPromoteHalfOp_FP_EXTEND(
SDNode *
N) {
3329 EVT RVT =
N->getValueType(0);
3330 bool IsStrict =
N->isStrictFPOpcode();
3331 SDValue Op =
N->getOperand(IsStrict ? 1 : 0);
3332 EVT SVT =
Op.getValueType();
3333 Op = GetSoftPromotedHalf(
N->getOperand(IsStrict ? 1 : 0));
3337 if (SVT == MVT::f16)
3339 else if (SVT == MVT::bf16)
3345 {
N->getOperand(0),
Op});
3347 ReplaceValueWith(
SDValue(
N, 0), Res);
3354SDValue DAGTypeLegalizer::SoftPromoteHalfOp_FP_TO_XINT(
SDNode *
N) {
3355 EVT RVT =
N->getValueType(0);
3357 EVT SVT =
Op.getValueType();
3362 Op = GetSoftPromotedHalf(
Op);
3366 return DAG.
getNode(
N->getOpcode(), dl,
N->getValueType(0), Res);
3369SDValue DAGTypeLegalizer::SoftPromoteHalfOp_FP_TO_XINT_SAT(
SDNode *
N) {
3370 EVT RVT =
N->getValueType(0);
3372 EVT SVT =
Op.getValueType();
3377 Op = GetSoftPromotedHalf(
Op);
3381 return DAG.
getNode(
N->getOpcode(), dl,
N->getValueType(0), Res,
3387 assert(OpNo == 0 &&
"Can only soften the comparison values");
3395 Op0 = GetSoftPromotedHalf(Op0);
3396 Op1 = GetSoftPromotedHalf(Op1);
3400 Op0 = DAG.
getNode(PromotionOpcode, dl, NVT, Op0);
3401 Op1 = DAG.
getNode(PromotionOpcode, dl, NVT, Op1);
3404 N->getOperand(2),
N->getOperand(3),
N->getOperand(4));
3410 ISD::CondCode CCCode = cast<CondCodeSDNode>(
N->getOperand(2))->get();
3416 Op0 = GetSoftPromotedHalf(Op0);
3417 Op1 = GetSoftPromotedHalf(Op1);
3421 Op0 = DAG.
getNode(PromotionOpcode, dl, NVT, Op0);
3422 Op1 = DAG.
getNode(PromotionOpcode, dl, NVT, Op1);
3427SDValue DAGTypeLegalizer::SoftPromoteHalfOp_STORE(
SDNode *
N,
unsigned OpNo) {
3428 assert(OpNo == 1 &&
"Can only soften the stored value!");
3433 assert(!
ST->isTruncatingStore() &&
"Unexpected truncating store.");
3434 SDValue Promoted = GetSoftPromotedHalf(Val);
3435 return DAG.
getStore(
ST->getChain(), dl, Promoted,
ST->getBasePtr(),
3436 ST->getMemOperand());
3439SDValue DAGTypeLegalizer::SoftPromoteHalfOp_ATOMIC_STORE(
SDNode *
N,
3441 assert(OpNo == 1 &&
"Can only soften the stored value!");
3446 SDValue Promoted = GetSoftPromotedHalf(Val);
3448 ST->getChain(), Promoted,
ST->getBasePtr(),
3449 ST->getMemOperand());
3452SDValue DAGTypeLegalizer::SoftPromoteHalfOp_STACKMAP(
SDNode *
N,
unsigned OpNo) {
3456 NewOps[OpNo] = GetSoftPromotedHalf(
Op);
3460 for (
unsigned ResNum = 0; ResNum <
N->getNumValues(); ResNum++)
3471 NewOps[OpNo] = GetSoftPromotedHalf(
Op);
3475 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())
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.
SDValue getSelect(const SDLoc &DL, EVT VT, SDValue Cond, SDValue LHS, SDValue RHS, SDNodeFlags Flags=SDNodeFlags())
Helper function to make it easier to build Select's if you just have operands and don't want to check...
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.
@ ATOMIC_STORE
OUTCHAIN = ATOMIC_STORE(INCHAIN, ptr, val) This corresponds to "store atomic" instruction.
@ 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).
@ ATOMIC_LOAD
Val, OUTCHAIN = ATOMIC_LOAD(INCHAIN, ptr) This corresponds to "load atomic" instruction.
@ 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.
@ FMINNUM_IEEE
FMINNUM_IEEE/FMAXNUM_IEEE - Perform floating-point minimumNumber or maximumNumber on two values,...
@ 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)