36#include "llvm/IR/IntrinsicsMips.h"
51#define DEBUG_TYPE "mips-isel"
116 for (
const auto &VecTy : VecTys) {
158 for (
MVT VT : {MVT::f32, MVT::f64}) {
289 if (
Subtarget.getCLOpts().mno_ldc1_sdc1 ||
422 if (VT == MVT::Untyped)
423 return Subtarget.hasDSP() ? &Mips::ACC64DSPRegClass : &Mips::ACC64RegClass;
467 if (Ty == MVT::v4i32 || Ty == MVT::v2i64) {
499 if (Ty != MVT::v8f16) {
527 EVT ResTy =
Op.getValueType();
528 assert((ResTy == MVT::f32 || ResTy == MVT::f64) &&
"Unexpected FP16_TO_FP");
532 assert(In.getValueType() == MVT::i32 &&
"Unexpected FP16_TO_FP operand type");
543 DAG.
getConstant(Intrinsic::mips_fexupr_w,
DL, MVT::i32), HVec);
545 if (ResTy == MVT::f32) {
553 DAG.
getConstant(Intrinsic::mips_fexupr_d,
DL, MVT::i32), F32Vec);
567 EVT ResTy =
Op.getValueType();
569 assert((
In.getValueType() == MVT::f32 ||
In.getValueType() == MVT::f64) &&
570 "Unexpected FP_TO_FP16");
573 if (
In.getValueType() == MVT::f64) {
587 DAG.
getConstant(Intrinsic::mips_fexdo_h,
DL, MVT::i32), F32Vec, F32Vec);
601 if (
Subtarget.systemSupportsUnalignedAccess()) {
626 switch(
Op.getOpcode()) {
629 case ISD::SMUL_LOHI:
return lowerMulDiv(
Op, MipsISD::Mult,
true,
true, DAG);
630 case ISD::UMUL_LOHI:
return lowerMulDiv(
Op, MipsISD::Multu,
true,
true, DAG);
631 case ISD::MULHS:
return lowerMulDiv(
Op, MipsISD::Mult,
false,
true, DAG);
632 case ISD::MULHU:
return lowerMulDiv(
Op, MipsISD::Multu,
false,
true, DAG);
633 case ISD::MUL:
return lowerMulDiv(
Op, MipsISD::Mult,
true,
false, DAG);
634 case ISD::SDIVREM:
return lowerMulDiv(
Op, MipsISD::DivRem,
true,
true, DAG);
635 case ISD::UDIVREM:
return lowerMulDiv(
Op, MipsISD::DivRemU,
true,
true,
643 return lowerVECTOR_SHUFFLE(
Op, DAG);
645 return lowerFP16_TO_FP(
Op, DAG);
647 return lowerFP_TO_FP16(
Op, DAG);
650 return lowerR5900FPOp(
Op, DAG, RTLIB::ADD_F32);
652 return lowerR5900FPOp(
Op, DAG, RTLIB::SUB_F32);
654 return lowerR5900FPOp(
Op, DAG, RTLIB::MUL_F32);
656 return lowerR5900FPOp(
Op, DAG, RTLIB::DIV_F32);
658 return lowerR5900FPOp(
Op, DAG, RTLIB::SQRT_F32);
665 RTLIB::Libcall LC)
const {
669 if (Flags.hasNoNaNs() && Flags.hasNoInfs()) {
677 MVT VT =
Op.getSimpleValueType();
705 if (Op0Opcode == MipsISD::VEXTRACT_SEXT_ELT ||
706 Op0Opcode == MipsISD::VEXTRACT_ZEXT_ELT) {
712 int32_t Log2IfPositive = (Mask->getAPIntValue() + 1).exactLogBase2();
714 if (Log2IfPositive <= 0)
720 unsigned Log2 = Log2IfPositive;
722 if ((Op0Opcode == MipsISD::VEXTRACT_ZEXT_ELT &&
Log2 >= ExtendTySize) ||
723 Log2 == ExtendTySize) {
725 return DAG.
getNode(MipsISD::VEXTRACT_ZEXT_ELT,
SDLoc(Op0),
749 APInt SplatValue, SplatUndef;
750 unsigned SplatBitSize;
753 if (!
Node->isConstantSplat(SplatValue, SplatUndef, SplatBitSize, HasAnyUndefs,
767 N =
N->getOperand(0);
774 APInt SplatValue, SplatUndef;
775 unsigned SplatBitSize;
780 if (BVN->
isConstantSplat(SplatValue, SplatUndef, SplatBitSize, HasAnyUndefs))
792 return N->getOperand(1) == OfNode;
795 return N->getOperand(0) == OfNode;
812 EVT Ty =
N->getValueType(0);
814 if (!Ty.is128BitVector())
825 bool IsLittleEndian = !
Subtarget.isLittle();
834 if (
isVSplat(Op0Op0, Mask, IsLittleEndian)) {
838 if (
isVSplat(Op1Op0, InvMask, IsLittleEndian) &&
839 Mask.getBitWidth() == InvMask.
getBitWidth() && Mask == ~InvMask)
841 else if (
isVSplat(Op1Op1, InvMask, IsLittleEndian) &&
842 Mask.getBitWidth() == InvMask.
getBitWidth() && Mask == ~InvMask)
853 if (
isVSplat(Op1Op0, InvMask, IsLittleEndian) &&
854 Mask.getBitWidth() == InvMask.
getBitWidth() && Mask == ~InvMask)
856 else if (
isVSplat(Op1Op1, InvMask, IsLittleEndian) &&
857 Mask.getBitWidth() == InvMask.
getBitWidth() && Mask == ~InvMask)
864 bool IsConstantMask = IfClr.
getNode() !=
nullptr;
912 if (IsConstantMask) {
913 if (Mask.isAllOnes())
954 unsigned MaxSteps =
Subtarget.isABI_O32() ? 8 : 12;
960 while (!WorkStack.
empty()) {
963 if (Val == 0 || Val == 1)
966 if (Steps >= MaxSteps)
1042 EVT VT =
N->getValueType(0);
1058 APInt SplatValue, SplatUndef;
1059 unsigned SplatBitSize;
1061 unsigned EltSize = Ty.getScalarSizeInBits();
1068 !BV->
isConstantSplat(SplatValue, SplatUndef, SplatBitSize, HasAnyUndefs,
1070 (SplatBitSize != EltSize) ||
1082 EVT Ty =
N->getValueType(0);
1084 if ((Ty != MVT::v2i16) && (Ty != MVT::v4i8))
1105 EVT Ty =
N->getValueType(0);
1122 if (Op0Op0->
getOpcode() != MipsISD::VEXTRACT_SEXT_ELT &&
1123 Op0Op0->
getOpcode() != MipsISD::VEXTRACT_ZEXT_ELT)
1129 if (TotalBits == 32 ||
1130 (Op0Op0->
getOpcode() == MipsISD::VEXTRACT_SEXT_ELT &&
1134 return DAG.
getNode(MipsISD::VEXTRACT_SEXT_ELT,
SDLoc(Op0Op0),
1141 if ((Ty != MVT::v2i16) && ((Ty != MVT::v4i8) || !
Subtarget.hasDSPR2()))
1151 EVT Ty =
N->getValueType(0);
1153 if (((Ty != MVT::v2i16) || !
Subtarget.hasDSPR2()) && (Ty != MVT::v4i8))
1160 bool IsV216 = (Ty == MVT::v2i16);
1173 default:
return false;
1178 EVT Ty =
N->getValueType(0);
1180 if ((Ty != MVT::v2i16) && (Ty != MVT::v4i8))
1186 return DAG.
getNode(MipsISD::SETCC_DSP,
SDLoc(
N), Ty,
N->getOperand(0),
1187 N->getOperand(1),
N->getOperand(2));
1191 EVT Ty =
N->getValueType(0);
1193 if (Ty == MVT::v2i16 || Ty == MVT::v4i8) {
1196 if (SetCC.
getOpcode() != MipsISD::SETCC_DSP)
1201 N->getOperand(1),
N->getOperand(2), SetCC.
getOperand(2));
1209 EVT Ty =
N->getValueType(0);
1211 if (
Subtarget.hasMSA() && Ty.is128BitVector() && Ty.isInteger()) {
1237 EVT VT =
N->getValueType(0);
1256 switch (
N->getOpcode()) {
1287 N->printrWithDepth(
dbgs(), &DAG);
dbgs() <<
"\n=> \n";
1298 switch (
MI.getOpcode()) {
1301 case Mips::BPOSGE32_PSEUDO:
1302 return emitBPOSGE32(
MI, BB);
1303 case Mips::PseudoTRUNC_W_S_M1:
1304 return emitTRUNC_W_M1(
MI, BB, Mips::CVT_W_S);
1305 case Mips::PseudoTRUNC_W_D32_M1:
1306 return emitTRUNC_W_M1(
MI, BB, Mips::CVT_W_D32);
1307 case Mips::SNZ_B_PSEUDO:
1308 return emitMSACBranchPseudo(
MI, BB, Mips::BNZ_B);
1309 case Mips::SNZ_H_PSEUDO:
1310 return emitMSACBranchPseudo(
MI, BB, Mips::BNZ_H);
1311 case Mips::SNZ_W_PSEUDO:
1312 return emitMSACBranchPseudo(
MI, BB, Mips::BNZ_W);
1313 case Mips::SNZ_D_PSEUDO:
1314 return emitMSACBranchPseudo(
MI, BB, Mips::BNZ_D);
1315 case Mips::SNZ_V_PSEUDO:
1316 return emitMSACBranchPseudo(
MI, BB, Mips::BNZ_V);
1317 case Mips::SZ_B_PSEUDO:
1318 return emitMSACBranchPseudo(
MI, BB, Mips::BZ_B);
1319 case Mips::SZ_H_PSEUDO:
1320 return emitMSACBranchPseudo(
MI, BB, Mips::BZ_H);
1321 case Mips::SZ_W_PSEUDO:
1322 return emitMSACBranchPseudo(
MI, BB, Mips::BZ_W);
1323 case Mips::SZ_D_PSEUDO:
1324 return emitMSACBranchPseudo(
MI, BB, Mips::BZ_D);
1325 case Mips::SZ_V_PSEUDO:
1326 return emitMSACBranchPseudo(
MI, BB, Mips::BZ_V);
1327 case Mips::COPY_FW_PSEUDO:
1328 return emitCOPY_FW(
MI, BB);
1329 case Mips::COPY_FD_PSEUDO:
1330 return emitCOPY_FD(
MI, BB);
1331 case Mips::INSERT_FW_PSEUDO:
1332 return emitINSERT_FW(
MI, BB);
1333 case Mips::INSERT_FD_PSEUDO:
1334 return emitINSERT_FD(
MI, BB);
1335 case Mips::INSERT_B_VIDX_PSEUDO:
1336 case Mips::INSERT_B_VIDX64_PSEUDO:
1337 return emitINSERT_DF_VIDX(
MI, BB, 1,
false);
1338 case Mips::INSERT_H_VIDX_PSEUDO:
1339 case Mips::INSERT_H_VIDX64_PSEUDO:
1340 return emitINSERT_DF_VIDX(
MI, BB, 2,
false);
1341 case Mips::INSERT_W_VIDX_PSEUDO:
1342 case Mips::INSERT_W_VIDX64_PSEUDO:
1343 return emitINSERT_DF_VIDX(
MI, BB, 4,
false);
1344 case Mips::INSERT_D_VIDX_PSEUDO:
1345 case Mips::INSERT_D_VIDX64_PSEUDO:
1346 return emitINSERT_DF_VIDX(
MI, BB, 8,
false);
1347 case Mips::INSERT_FW_VIDX_PSEUDO:
1348 case Mips::INSERT_FW_VIDX64_PSEUDO:
1349 return emitINSERT_DF_VIDX(
MI, BB, 4,
true);
1350 case Mips::INSERT_FD_VIDX_PSEUDO:
1351 case Mips::INSERT_FD_VIDX64_PSEUDO:
1352 return emitINSERT_DF_VIDX(
MI, BB, 8,
true);
1353 case Mips::FILL_FW_PSEUDO:
1354 return emitFILL_FW(
MI, BB);
1355 case Mips::FILL_FD_PSEUDO:
1356 return emitFILL_FD(
MI, BB);
1357 case Mips::FEXP2_W_1_PSEUDO:
1358 return emitFEXP2_W_1(
MI, BB);
1359 case Mips::FEXP2_D_1_PSEUDO:
1360 return emitFEXP2_D_1(
MI, BB);
1364bool MipsSETargetLowering::isEligibleForTailCallOptimization(
1365 const CCState &CCInfo,
unsigned NextStackOffset,
1379void MipsSETargetLowering::getOpndList(
1381 std::deque<std::pair<unsigned, SDValue>> &RegsToPass,
bool IsPICCall,
1382 bool GlobalOrExternal,
bool LocalLinkage,
bool IsCallReloc,
1384 Ops.push_back(Callee);
1386 LocalLinkage, IsCallReloc, CLI, Callee,
1401 EVT VT =
Subtarget.hasMips2() ? MVT::i32 : MVT::f32;
1418 BP = DAG.
getNode(MipsISD::BuildPairF64,
DL, MVT::f64,
Lo,
Hi);
1420 BP = DAG.
getNode(MipsISD::BuildPairF64_FPR,
DL, MVT::f64,
Lo,
Hi);
1437 EVT VT =
Subtarget.hasMips2() ? MVT::i32 : MVT::f32;
1439 unsigned ExtractOp =
Subtarget.hasMips2() ? MipsISD::ExtractElementF64
1440 : MipsISD::ExtractElementF64_FPR;
1455 return DAG.
getStore(Chain,
DL,
Hi, Ptr, MachinePointerInfo(),
1463 MVT Src =
Op.getOperand(0).getValueType().getSimpleVT();
1464 MVT Dest =
Op.getValueType().getSimpleVT();
1467 if (Src == MVT::i64 && Dest == MVT::f64) {
1471 return DAG.
getNode(MipsISD::BuildPairF64,
DL, MVT::f64,
Lo,
Hi);
1475 if (Src == MVT::f64 && Dest == MVT::i64) {
1482 DAG.
getNode(MipsISD::ExtractElementF64,
DL, MVT::i32,
Op.getOperand(0),
1485 DAG.
getNode(MipsISD::ExtractElementF64,
DL, MVT::i32,
Op.getOperand(0),
1495 bool HasLo,
bool HasHi,
1500 EVT Ty =
Op.getOperand(0).getValueType();
1503 Op.getOperand(0),
Op.getOperand(1));
1511 if (!HasLo || !HasHi)
1512 return HasLo ?
Lo :
Hi;
1520 std::tie(InLo, InHi) = DAG.
SplitScalar(In,
DL, MVT::i32, MVT::i32);
1521 return DAG.
getNode(MipsISD::MTLOHI,
DL, MVT::Untyped, InLo, InHi);
1544 bool HasChainIn =
Op->getOperand(0).getValueType() == MVT::Other;
1550 Ops.push_back(
Op->getOperand(OpNo++));
1556 SDValue Opnd =
Op->getOperand(++OpNo), In64;
1561 Ops.push_back(Opnd);
1564 for (++OpNo ; OpNo <
Op->getNumOperands(); ++OpNo)
1565 Ops.push_back(
Op->getOperand(OpNo));
1569 Ops.push_back(In64);
1574 for (
EVT Ty :
Op->values())
1575 ResTys.
push_back((Ty == MVT::i64) ? MVT::Untyped : Ty);
1596 EVT ResTy =
Op->getValueType(0);
1606 EVT ResVecTy =
Op->getValueType(0);
1607 EVT ViaVecTy = ResVecTy;
1617 if (ResVecTy == MVT::v2i64) {
1628 ViaVecTy = MVT::v4i32;
1634 SDValue Ops[16] = { LaneA, LaneB, LaneA, LaneB, LaneA, LaneB, LaneA, LaneB,
1635 LaneA, LaneB, LaneA, LaneB, LaneA, LaneB, LaneA, LaneB };
1640 if (ViaVecTy != ResVecTy) {
1650 bool IsSigned =
false) {
1653 APInt(
Op->getValueType(0).getScalarType().getSizeInBits(),
1654 IsSigned ? CImm->getSExtValue() : CImm->getZExtValue(), IsSigned),
1660 EVT ViaVecTy = VecTy;
1661 SDValue SplatValueA = SplatValue;
1662 SDValue SplatValueB = SplatValue;
1665 if (VecTy == MVT::v2i64) {
1667 ViaVecTy = MVT::v4i32;
1680 SDValue Ops[16] = { SplatValueA, SplatValueB, SplatValueA, SplatValueB,
1681 SplatValueA, SplatValueB, SplatValueA, SplatValueB,
1682 SplatValueA, SplatValueB, SplatValueA, SplatValueB,
1683 SplatValueA, SplatValueB, SplatValueA, SplatValueB };
1688 if (VecTy != ViaVecTy)
1697 EVT VecTy =
Op->getValueType(0);
1703 if (VecTy == MVT::v2i64) {
1705 APInt BitImm =
APInt(64, 1) << CImm->getAPIntValue();
1717 {BitImmLoOp, BitImmHiOp, BitImmLoOp, BitImmHiOp}));
1726 if (VecTy == MVT::v2i64)
1740 EVT ResTy =
Op->getValueType(0);
1743 MVT ResEltTy = ResTy == MVT::v2i64 ? MVT::i64 : MVT::i32;
1752 EVT ResTy =
Op->getValueType(0);
1763 EVT ResTy =
Op->getValueType(0);
1765 <<
Op->getConstantOperandAPInt(2);
1774 unsigned Intrinsic =
Op->getConstantOperandVal(0);
1775 switch (Intrinsic) {
1778 case Intrinsic::mips_shilo:
1780 case Intrinsic::mips_dpau_h_qbl:
1782 case Intrinsic::mips_dpau_h_qbr:
1784 case Intrinsic::mips_dpsu_h_qbl:
1786 case Intrinsic::mips_dpsu_h_qbr:
1788 case Intrinsic::mips_dpa_w_ph:
1790 case Intrinsic::mips_dps_w_ph:
1792 case Intrinsic::mips_dpax_w_ph:
1794 case Intrinsic::mips_dpsx_w_ph:
1796 case Intrinsic::mips_mulsa_w_ph:
1798 case Intrinsic::mips_mult:
1800 case Intrinsic::mips_multu:
1802 case Intrinsic::mips_madd:
1804 case Intrinsic::mips_maddu:
1806 case Intrinsic::mips_msub:
1808 case Intrinsic::mips_msubu:
1810 case Intrinsic::mips_addv_b:
1811 case Intrinsic::mips_addv_h:
1812 case Intrinsic::mips_addv_w:
1813 case Intrinsic::mips_addv_d:
1816 case Intrinsic::mips_addvi_b:
1817 case Intrinsic::mips_addvi_h:
1818 case Intrinsic::mips_addvi_w:
1819 case Intrinsic::mips_addvi_d:
1822 case Intrinsic::mips_and_v:
1825 case Intrinsic::mips_andi_b:
1828 case Intrinsic::mips_bclr_b:
1829 case Intrinsic::mips_bclr_h:
1830 case Intrinsic::mips_bclr_w:
1831 case Intrinsic::mips_bclr_d:
1833 case Intrinsic::mips_bclri_b:
1834 case Intrinsic::mips_bclri_h:
1835 case Intrinsic::mips_bclri_w:
1836 case Intrinsic::mips_bclri_d:
1838 case Intrinsic::mips_binsli_b:
1839 case Intrinsic::mips_binsli_h:
1840 case Intrinsic::mips_binsli_w:
1841 case Intrinsic::mips_binsli_d: {
1843 EVT VecTy =
Op->getValueType(0);
1848 Op->getConstantOperandVal(3) + 1);
1851 Op->getOperand(2),
Op->getOperand(1));
1853 case Intrinsic::mips_binsri_b:
1854 case Intrinsic::mips_binsri_h:
1855 case Intrinsic::mips_binsri_w:
1856 case Intrinsic::mips_binsri_d: {
1858 EVT VecTy =
Op->getValueType(0);
1863 Op->getConstantOperandVal(3) + 1);
1866 Op->getOperand(2),
Op->getOperand(1));
1868 case Intrinsic::mips_bmnz_v:
1870 Op->getOperand(2),
Op->getOperand(1));
1871 case Intrinsic::mips_bmnzi_b:
1875 case Intrinsic::mips_bmz_v:
1877 Op->getOperand(1),
Op->getOperand(2));
1878 case Intrinsic::mips_bmzi_b:
1882 case Intrinsic::mips_bneg_b:
1883 case Intrinsic::mips_bneg_h:
1884 case Intrinsic::mips_bneg_w:
1885 case Intrinsic::mips_bneg_d: {
1886 EVT VecTy =
Op->getValueType(0);
1893 case Intrinsic::mips_bnegi_b:
1894 case Intrinsic::mips_bnegi_h:
1895 case Intrinsic::mips_bnegi_w:
1896 case Intrinsic::mips_bnegi_d:
1899 case Intrinsic::mips_bnz_b:
1900 case Intrinsic::mips_bnz_h:
1901 case Intrinsic::mips_bnz_w:
1902 case Intrinsic::mips_bnz_d:
1903 return DAG.
getNode(MipsISD::VALL_NONZERO,
DL,
Op->getValueType(0),
1905 case Intrinsic::mips_bnz_v:
1906 return DAG.
getNode(MipsISD::VANY_NONZERO,
DL,
Op->getValueType(0),
1908 case Intrinsic::mips_bsel_v:
1911 Op->getOperand(1),
Op->getOperand(3),
1913 case Intrinsic::mips_bseli_b:
1918 case Intrinsic::mips_bset_b:
1919 case Intrinsic::mips_bset_h:
1920 case Intrinsic::mips_bset_w:
1921 case Intrinsic::mips_bset_d: {
1922 EVT VecTy =
Op->getValueType(0);
1929 case Intrinsic::mips_bseti_b:
1930 case Intrinsic::mips_bseti_h:
1931 case Intrinsic::mips_bseti_w:
1932 case Intrinsic::mips_bseti_d:
1935 case Intrinsic::mips_bz_b:
1936 case Intrinsic::mips_bz_h:
1937 case Intrinsic::mips_bz_w:
1938 case Intrinsic::mips_bz_d:
1939 return DAG.
getNode(MipsISD::VALL_ZERO,
DL,
Op->getValueType(0),
1941 case Intrinsic::mips_bz_v:
1942 return DAG.
getNode(MipsISD::VANY_ZERO,
DL,
Op->getValueType(0),
1944 case Intrinsic::mips_ceq_b:
1945 case Intrinsic::mips_ceq_h:
1946 case Intrinsic::mips_ceq_w:
1947 case Intrinsic::mips_ceq_d:
1950 case Intrinsic::mips_ceqi_b:
1951 case Intrinsic::mips_ceqi_h:
1952 case Intrinsic::mips_ceqi_w:
1953 case Intrinsic::mips_ceqi_d:
1956 case Intrinsic::mips_cle_s_b:
1957 case Intrinsic::mips_cle_s_h:
1958 case Intrinsic::mips_cle_s_w:
1959 case Intrinsic::mips_cle_s_d:
1962 case Intrinsic::mips_clei_s_b:
1963 case Intrinsic::mips_clei_s_h:
1964 case Intrinsic::mips_clei_s_w:
1965 case Intrinsic::mips_clei_s_d:
1968 case Intrinsic::mips_cle_u_b:
1969 case Intrinsic::mips_cle_u_h:
1970 case Intrinsic::mips_cle_u_w:
1971 case Intrinsic::mips_cle_u_d:
1974 case Intrinsic::mips_clei_u_b:
1975 case Intrinsic::mips_clei_u_h:
1976 case Intrinsic::mips_clei_u_w:
1977 case Intrinsic::mips_clei_u_d:
1980 case Intrinsic::mips_clt_s_b:
1981 case Intrinsic::mips_clt_s_h:
1982 case Intrinsic::mips_clt_s_w:
1983 case Intrinsic::mips_clt_s_d:
1986 case Intrinsic::mips_clti_s_b:
1987 case Intrinsic::mips_clti_s_h:
1988 case Intrinsic::mips_clti_s_w:
1989 case Intrinsic::mips_clti_s_d:
1992 case Intrinsic::mips_clt_u_b:
1993 case Intrinsic::mips_clt_u_h:
1994 case Intrinsic::mips_clt_u_w:
1995 case Intrinsic::mips_clt_u_d:
1998 case Intrinsic::mips_clti_u_b:
1999 case Intrinsic::mips_clti_u_h:
2000 case Intrinsic::mips_clti_u_w:
2001 case Intrinsic::mips_clti_u_d:
2004 case Intrinsic::mips_copy_s_b:
2005 case Intrinsic::mips_copy_s_h:
2006 case Intrinsic::mips_copy_s_w:
2008 case Intrinsic::mips_copy_s_d:
2016 Op->getValueType(0),
Op->getOperand(1),
2019 case Intrinsic::mips_copy_u_b:
2020 case Intrinsic::mips_copy_u_h:
2021 case Intrinsic::mips_copy_u_w:
2023 case Intrinsic::mips_copy_u_d:
2034 Op->getValueType(0),
Op->getOperand(1),
2037 case Intrinsic::mips_div_s_b:
2038 case Intrinsic::mips_div_s_h:
2039 case Intrinsic::mips_div_s_w:
2040 case Intrinsic::mips_div_s_d:
2043 case Intrinsic::mips_div_u_b:
2044 case Intrinsic::mips_div_u_h:
2045 case Intrinsic::mips_div_u_w:
2046 case Intrinsic::mips_div_u_d:
2049 case Intrinsic::mips_fadd_w:
2050 case Intrinsic::mips_fadd_d:
2052 Op->getOperand(2),
Op->getFlags());
2054 case Intrinsic::mips_fceq_w:
2055 case Intrinsic::mips_fceq_d:
2058 case Intrinsic::mips_fcle_w:
2059 case Intrinsic::mips_fcle_d:
2062 case Intrinsic::mips_fclt_w:
2063 case Intrinsic::mips_fclt_d:
2066 case Intrinsic::mips_fcne_w:
2067 case Intrinsic::mips_fcne_d:
2070 case Intrinsic::mips_fcor_w:
2071 case Intrinsic::mips_fcor_d:
2074 case Intrinsic::mips_fcueq_w:
2075 case Intrinsic::mips_fcueq_d:
2078 case Intrinsic::mips_fcule_w:
2079 case Intrinsic::mips_fcule_d:
2082 case Intrinsic::mips_fcult_w:
2083 case Intrinsic::mips_fcult_d:
2086 case Intrinsic::mips_fcun_w:
2087 case Intrinsic::mips_fcun_d:
2090 case Intrinsic::mips_fcune_w:
2091 case Intrinsic::mips_fcune_d:
2094 case Intrinsic::mips_fdiv_w:
2095 case Intrinsic::mips_fdiv_d:
2099 case Intrinsic::mips_ffint_u_w:
2100 case Intrinsic::mips_ffint_u_d:
2103 case Intrinsic::mips_ffint_s_w:
2104 case Intrinsic::mips_ffint_s_d:
2107 case Intrinsic::mips_fill_b:
2108 case Intrinsic::mips_fill_h:
2109 case Intrinsic::mips_fill_w:
2110 case Intrinsic::mips_fill_d: {
2111 EVT ResTy =
Op->getValueType(0);
2119 case Intrinsic::mips_fexp2_w:
2120 case Intrinsic::mips_fexp2_d: {
2122 EVT ResTy =
Op->getValueType(0);
2127 case Intrinsic::mips_flog2_w:
2128 case Intrinsic::mips_flog2_d:
2130 case Intrinsic::mips_fmadd_w:
2131 case Intrinsic::mips_fmadd_d: {
2134 Op->getOperand(2),
Op->getOperand(3),
Op->getOperand(1));
2136 case Intrinsic::mips_fmul_w:
2137 case Intrinsic::mips_fmul_d:
2139 Op->getOperand(2),
Op->getFlags());
2140 case Intrinsic::mips_fmsub_w:
2141 case Intrinsic::mips_fmsub_d: {
2143 return DAG.
getNode(MipsISD::FMS, SDLoc(
Op),
Op->getValueType(0),
2144 Op->getOperand(1),
Op->getOperand(2),
Op->getOperand(3));
2146 case Intrinsic::mips_frint_w:
2147 case Intrinsic::mips_frint_d:
2149 case Intrinsic::mips_fsqrt_w:
2150 case Intrinsic::mips_fsqrt_d:
2152 case Intrinsic::mips_fsub_w:
2153 case Intrinsic::mips_fsub_d:
2155 Op->getOperand(2),
Op->getFlags());
2156 case Intrinsic::mips_ftrunc_u_w:
2157 case Intrinsic::mips_ftrunc_u_d:
2160 case Intrinsic::mips_ftrunc_s_w:
2161 case Intrinsic::mips_ftrunc_s_d:
2164 case Intrinsic::mips_ilvev_b:
2165 case Intrinsic::mips_ilvev_h:
2166 case Intrinsic::mips_ilvev_w:
2167 case Intrinsic::mips_ilvev_d:
2168 return DAG.
getNode(MipsISD::ILVEV,
DL,
Op->getValueType(0),
2169 Op->getOperand(1),
Op->getOperand(2));
2170 case Intrinsic::mips_ilvl_b:
2171 case Intrinsic::mips_ilvl_h:
2172 case Intrinsic::mips_ilvl_w:
2173 case Intrinsic::mips_ilvl_d:
2174 return DAG.
getNode(MipsISD::ILVL,
DL,
Op->getValueType(0),
2175 Op->getOperand(1),
Op->getOperand(2));
2176 case Intrinsic::mips_ilvod_b:
2177 case Intrinsic::mips_ilvod_h:
2178 case Intrinsic::mips_ilvod_w:
2179 case Intrinsic::mips_ilvod_d:
2180 return DAG.
getNode(MipsISD::ILVOD,
DL,
Op->getValueType(0),
2181 Op->getOperand(1),
Op->getOperand(2));
2182 case Intrinsic::mips_ilvr_b:
2183 case Intrinsic::mips_ilvr_h:
2184 case Intrinsic::mips_ilvr_w:
2185 case Intrinsic::mips_ilvr_d:
2186 return DAG.
getNode(MipsISD::ILVR,
DL,
Op->getValueType(0),
2187 Op->getOperand(1),
Op->getOperand(2));
2188 case Intrinsic::mips_insert_b:
2189 case Intrinsic::mips_insert_h:
2190 case Intrinsic::mips_insert_w:
2191 case Intrinsic::mips_insert_d:
2193 Op->getOperand(1),
Op->getOperand(3),
Op->getOperand(2));
2194 case Intrinsic::mips_insve_b:
2195 case Intrinsic::mips_insve_h:
2196 case Intrinsic::mips_insve_w:
2197 case Intrinsic::mips_insve_d: {
2200 switch (Intrinsic) {
2201 case Intrinsic::mips_insve_b:
Max = 15;
break;
2202 case Intrinsic::mips_insve_h:
Max = 7;
break;
2203 case Intrinsic::mips_insve_w:
Max = 3;
break;
2204 case Intrinsic::mips_insve_d:
Max = 1;
break;
2210 return DAG.
getNode(MipsISD::INSVE,
DL,
Op->getValueType(0),
2211 Op->getOperand(1),
Op->getOperand(2),
Op->getOperand(3),
2214 case Intrinsic::mips_ldi_b:
2215 case Intrinsic::mips_ldi_h:
2216 case Intrinsic::mips_ldi_w:
2217 case Intrinsic::mips_ldi_d:
2219 case Intrinsic::mips_lsa:
2220 case Intrinsic::mips_dlsa: {
2221 EVT ResTy =
Op->getValueType(0);
2224 Op->getOperand(2),
Op->getOperand(3)));
2226 case Intrinsic::mips_maddv_b:
2227 case Intrinsic::mips_maddv_h:
2228 case Intrinsic::mips_maddv_w:
2229 case Intrinsic::mips_maddv_d: {
2230 EVT ResTy =
Op->getValueType(0);
2233 Op->getOperand(2),
Op->getOperand(3)));
2235 case Intrinsic::mips_max_s_b:
2236 case Intrinsic::mips_max_s_h:
2237 case Intrinsic::mips_max_s_w:
2238 case Intrinsic::mips_max_s_d:
2240 Op->getOperand(1),
Op->getOperand(2));
2241 case Intrinsic::mips_max_u_b:
2242 case Intrinsic::mips_max_u_h:
2243 case Intrinsic::mips_max_u_w:
2244 case Intrinsic::mips_max_u_d:
2246 Op->getOperand(1),
Op->getOperand(2));
2247 case Intrinsic::mips_maxi_s_b:
2248 case Intrinsic::mips_maxi_s_h:
2249 case Intrinsic::mips_maxi_s_w:
2250 case Intrinsic::mips_maxi_s_d:
2253 case Intrinsic::mips_maxi_u_b:
2254 case Intrinsic::mips_maxi_u_h:
2255 case Intrinsic::mips_maxi_u_w:
2256 case Intrinsic::mips_maxi_u_d:
2259 case Intrinsic::mips_min_s_b:
2260 case Intrinsic::mips_min_s_h:
2261 case Intrinsic::mips_min_s_w:
2262 case Intrinsic::mips_min_s_d:
2264 Op->getOperand(1),
Op->getOperand(2));
2265 case Intrinsic::mips_min_u_b:
2266 case Intrinsic::mips_min_u_h:
2267 case Intrinsic::mips_min_u_w:
2268 case Intrinsic::mips_min_u_d:
2270 Op->getOperand(1),
Op->getOperand(2));
2271 case Intrinsic::mips_mini_s_b:
2272 case Intrinsic::mips_mini_s_h:
2273 case Intrinsic::mips_mini_s_w:
2274 case Intrinsic::mips_mini_s_d:
2277 case Intrinsic::mips_mini_u_b:
2278 case Intrinsic::mips_mini_u_h:
2279 case Intrinsic::mips_mini_u_w:
2280 case Intrinsic::mips_mini_u_d:
2283 case Intrinsic::mips_mod_s_b:
2284 case Intrinsic::mips_mod_s_h:
2285 case Intrinsic::mips_mod_s_w:
2286 case Intrinsic::mips_mod_s_d:
2289 case Intrinsic::mips_mod_u_b:
2290 case Intrinsic::mips_mod_u_h:
2291 case Intrinsic::mips_mod_u_w:
2292 case Intrinsic::mips_mod_u_d:
2295 case Intrinsic::mips_mulv_b:
2296 case Intrinsic::mips_mulv_h:
2297 case Intrinsic::mips_mulv_w:
2298 case Intrinsic::mips_mulv_d:
2301 case Intrinsic::mips_msubv_b:
2302 case Intrinsic::mips_msubv_h:
2303 case Intrinsic::mips_msubv_w:
2304 case Intrinsic::mips_msubv_d: {
2305 EVT ResTy =
Op->getValueType(0);
2308 Op->getOperand(2),
Op->getOperand(3)));
2310 case Intrinsic::mips_nlzc_b:
2311 case Intrinsic::mips_nlzc_h:
2312 case Intrinsic::mips_nlzc_w:
2313 case Intrinsic::mips_nlzc_d:
2315 case Intrinsic::mips_nor_v: {
2317 Op->getOperand(1),
Op->getOperand(2));
2320 case Intrinsic::mips_nori_b: {
2326 case Intrinsic::mips_or_v:
2329 case Intrinsic::mips_ori_b:
2332 case Intrinsic::mips_pckev_b:
2333 case Intrinsic::mips_pckev_h:
2334 case Intrinsic::mips_pckev_w:
2335 case Intrinsic::mips_pckev_d:
2336 return DAG.
getNode(MipsISD::PCKEV,
DL,
Op->getValueType(0),
2337 Op->getOperand(1),
Op->getOperand(2));
2338 case Intrinsic::mips_pckod_b:
2339 case Intrinsic::mips_pckod_h:
2340 case Intrinsic::mips_pckod_w:
2341 case Intrinsic::mips_pckod_d:
2342 return DAG.
getNode(MipsISD::PCKOD,
DL,
Op->getValueType(0),
2343 Op->getOperand(1),
Op->getOperand(2));
2344 case Intrinsic::mips_pcnt_b:
2345 case Intrinsic::mips_pcnt_h:
2346 case Intrinsic::mips_pcnt_w:
2347 case Intrinsic::mips_pcnt_d:
2349 case Intrinsic::mips_sat_s_b:
2350 case Intrinsic::mips_sat_s_h:
2351 case Intrinsic::mips_sat_s_w:
2352 case Intrinsic::mips_sat_s_d:
2353 case Intrinsic::mips_sat_u_b:
2354 case Intrinsic::mips_sat_u_h:
2355 case Intrinsic::mips_sat_u_w:
2356 case Intrinsic::mips_sat_u_d: {
2359 switch (Intrinsic) {
2360 case Intrinsic::mips_sat_s_b:
2361 case Intrinsic::mips_sat_u_b:
Max = 7;
break;
2362 case Intrinsic::mips_sat_s_h:
2363 case Intrinsic::mips_sat_u_h:
Max = 15;
break;
2364 case Intrinsic::mips_sat_s_w:
2365 case Intrinsic::mips_sat_u_w:
Max = 31;
break;
2366 case Intrinsic::mips_sat_s_d:
2367 case Intrinsic::mips_sat_u_d:
Max = 63;
break;
2375 case Intrinsic::mips_shf_b:
2376 case Intrinsic::mips_shf_h:
2377 case Intrinsic::mips_shf_w: {
2381 return DAG.
getNode(MipsISD::SHF,
DL,
Op->getValueType(0),
2382 Op->getOperand(2),
Op->getOperand(1));
2384 case Intrinsic::mips_sldi_b:
2385 case Intrinsic::mips_sldi_h:
2386 case Intrinsic::mips_sldi_w:
2387 case Intrinsic::mips_sldi_d: {
2390 switch (Intrinsic) {
2391 case Intrinsic::mips_sldi_b:
Max = 15;
break;
2392 case Intrinsic::mips_sldi_h:
Max = 7;
break;
2393 case Intrinsic::mips_sldi_w:
Max = 3;
break;
2394 case Intrinsic::mips_sldi_d:
Max = 1;
break;
2402 case Intrinsic::mips_sll_b:
2403 case Intrinsic::mips_sll_h:
2404 case Intrinsic::mips_sll_w:
2405 case Intrinsic::mips_sll_d:
2408 case Intrinsic::mips_slli_b:
2409 case Intrinsic::mips_slli_h:
2410 case Intrinsic::mips_slli_w:
2411 case Intrinsic::mips_slli_d:
2414 case Intrinsic::mips_splat_b:
2415 case Intrinsic::mips_splat_h:
2416 case Intrinsic::mips_splat_w:
2417 case Intrinsic::mips_splat_d:
2422 return DAG.
getNode(MipsISD::VSHF,
DL,
Op->getValueType(0),
2425 case Intrinsic::mips_splati_b:
2426 case Intrinsic::mips_splati_h:
2427 case Intrinsic::mips_splati_w:
2428 case Intrinsic::mips_splati_d:
2429 return DAG.
getNode(MipsISD::VSHF,
DL,
Op->getValueType(0),
2432 case Intrinsic::mips_sra_b:
2433 case Intrinsic::mips_sra_h:
2434 case Intrinsic::mips_sra_w:
2435 case Intrinsic::mips_sra_d:
2438 case Intrinsic::mips_srai_b:
2439 case Intrinsic::mips_srai_h:
2440 case Intrinsic::mips_srai_w:
2441 case Intrinsic::mips_srai_d:
2444 case Intrinsic::mips_srari_b:
2445 case Intrinsic::mips_srari_h:
2446 case Intrinsic::mips_srari_w:
2447 case Intrinsic::mips_srari_d: {
2450 switch (Intrinsic) {
2451 case Intrinsic::mips_srari_b:
Max = 7;
break;
2452 case Intrinsic::mips_srari_h:
Max = 15;
break;
2453 case Intrinsic::mips_srari_w:
Max = 31;
break;
2454 case Intrinsic::mips_srari_d:
Max = 63;
break;
2462 case Intrinsic::mips_srl_b:
2463 case Intrinsic::mips_srl_h:
2464 case Intrinsic::mips_srl_w:
2465 case Intrinsic::mips_srl_d:
2468 case Intrinsic::mips_srli_b:
2469 case Intrinsic::mips_srli_h:
2470 case Intrinsic::mips_srli_w:
2471 case Intrinsic::mips_srli_d:
2474 case Intrinsic::mips_srlri_b:
2475 case Intrinsic::mips_srlri_h:
2476 case Intrinsic::mips_srlri_w:
2477 case Intrinsic::mips_srlri_d: {
2480 switch (Intrinsic) {
2481 case Intrinsic::mips_srlri_b:
Max = 7;
break;
2482 case Intrinsic::mips_srlri_h:
Max = 15;
break;
2483 case Intrinsic::mips_srlri_w:
Max = 31;
break;
2484 case Intrinsic::mips_srlri_d:
Max = 63;
break;
2492 case Intrinsic::mips_subv_b:
2493 case Intrinsic::mips_subv_h:
2494 case Intrinsic::mips_subv_w:
2495 case Intrinsic::mips_subv_d:
2498 case Intrinsic::mips_subvi_b:
2499 case Intrinsic::mips_subvi_h:
2500 case Intrinsic::mips_subvi_w:
2501 case Intrinsic::mips_subvi_d:
2504 case Intrinsic::mips_vshf_b:
2505 case Intrinsic::mips_vshf_h:
2506 case Intrinsic::mips_vshf_w:
2507 case Intrinsic::mips_vshf_d:
2508 return DAG.
getNode(MipsISD::VSHF,
DL,
Op->getValueType(0),
2509 Op->getOperand(1),
Op->getOperand(2),
Op->getOperand(3));
2510 case Intrinsic::mips_xor_v:
2513 case Intrinsic::mips_xori_b:
2516 case Intrinsic::thread_pointer: {
2518 return DAG.
getNode(MipsISD::ThreadPointer,
DL, PtrVT);
2529 EVT ResTy =
Op->getValueType(0);
2530 EVT PtrTy = Address->getValueType(0);
2545 unsigned Intr =
Op->getConstantOperandVal(1);
2549 case Intrinsic::mips_extp:
2551 case Intrinsic::mips_extpdp:
2553 case Intrinsic::mips_extr_w:
2555 case Intrinsic::mips_extr_r_w:
2557 case Intrinsic::mips_extr_rs_w:
2559 case Intrinsic::mips_extr_s_h:
2561 case Intrinsic::mips_mthlip:
2563 case Intrinsic::mips_mulsaq_s_w_ph:
2565 case Intrinsic::mips_maq_s_w_phl:
2567 case Intrinsic::mips_maq_s_w_phr:
2569 case Intrinsic::mips_maq_sa_w_phl:
2571 case Intrinsic::mips_maq_sa_w_phr:
2573 case Intrinsic::mips_dpaq_s_w_ph:
2575 case Intrinsic::mips_dpsq_s_w_ph:
2577 case Intrinsic::mips_dpaq_sa_l_w:
2579 case Intrinsic::mips_dpsq_sa_l_w:
2581 case Intrinsic::mips_dpaqx_s_w_ph:
2583 case Intrinsic::mips_dpaqx_sa_w_ph:
2585 case Intrinsic::mips_dpsqx_s_w_ph:
2587 case Intrinsic::mips_dpsqx_sa_w_ph:
2589 case Intrinsic::mips_ld_b:
2590 case Intrinsic::mips_ld_h:
2591 case Intrinsic::mips_ld_w:
2592 case Intrinsic::mips_ld_d:
2604 EVT PtrTy = Address->getValueType(0);
2620 unsigned Intr =
Op->getConstantOperandVal(1);
2624 case Intrinsic::mips_st_b:
2625 case Intrinsic::mips_st_h:
2626 case Intrinsic::mips_st_w:
2627 case Intrinsic::mips_st_d:
2642 EVT ResTy =
Op->getValueType(0);
2652 return DAG.
getNode(MipsISD::VEXTRACT_SEXT_ELT,
DL, ResTy, Op0, Op1,
2670 for (
unsigned i = 0; i <
Op->getNumOperands(); ++i)
2692 EVT ResTy =
Op->getValueType(0);
2694 APInt SplatValue, SplatUndef;
2695 unsigned SplatBitSize;
2701 if (
Node->isConstantSplat(SplatValue, SplatUndef, SplatBitSize,
2703 !
Subtarget.isLittle()) && SplatBitSize <= 64) {
2705 if (SplatBitSize != 8 && SplatBitSize != 16 && SplatBitSize != 32 &&
2717 switch (SplatBitSize) {
2721 ViaVecTy = MVT::v16i8;
2724 ViaVecTy = MVT::v8i16;
2727 ViaVecTy = MVT::v4i32;
2738 if (ViaVecTy != ResTy)
2748 EVT ResTy =
Node->getValueType(0);
2754 for (
unsigned i = 0; i < NumElts; ++i) {
2756 Node->getOperand(i),
2786 int SHFIndices[4] = { -1, -1, -1, -1 };
2788 if (Indices.
size() < 4)
2791 for (
unsigned i = 0; i < 4; ++i) {
2792 for (
unsigned j = i; j < Indices.
size(); j += 4) {
2793 int Idx = Indices[j];
2799 if (Idx < 0 || Idx >= 4)
2805 if (SHFIndices[i] == -1)
2806 SHFIndices[i] = Idx;
2810 if (!(Idx == -1 || Idx == SHFIndices[i]))
2817 for (
int i = 3; i >= 0; --i) {
2818 int Idx = SHFIndices[i];
2828 return DAG.
getNode(MipsISD::SHF,
DL, ResTy,
2835template <
typename ValType>
2838 unsigned CheckStride,
2840 ValType ExpectedIndex,
unsigned ExpectedIndexStride) {
2844 if (*
I != -1 && *
I != ExpectedIndex)
2846 ExpectedIndex += ExpectedIndexStride;
2850 for (
unsigned n = 0; n < CheckStride &&
I !=
End; ++n, ++
I)
2869 int SplatIndex = -1;
2870 for (
const auto &
V : Indices) {
2903 const auto &Begin = Indices.
begin();
2904 const auto &
End = Indices.
end();
2909 Wt =
Op->getOperand(0);
2911 Wt =
Op->getOperand(1);
2918 Ws =
Op->getOperand(0);
2920 Ws =
Op->getOperand(1);
2949 const auto &Begin = Indices.
begin();
2950 const auto &
End = Indices.
end();
2955 Wt =
Op->getOperand(0);
2957 Wt =
Op->getOperand(1);
2964 Ws =
Op->getOperand(0);
2966 Ws =
Op->getOperand(1);
2996 const auto &Begin = Indices.
begin();
2997 const auto &
End = Indices.
end();
3002 Wt =
Op->getOperand(0);
3004 Wt =
Op->getOperand(1);
3011 Ws =
Op->getOperand(0);
3013 Ws =
Op->getOperand(1);
3041 unsigned HalfSize = Indices.
size() / 2;
3044 const auto &Begin = Indices.
begin();
3045 const auto &
End = Indices.
end();
3050 Wt =
Op->getOperand(0);
3052 Wt =
Op->getOperand(1);
3059 Ws =
Op->getOperand(0);
3062 Ws =
Op->getOperand(1);
3091 const auto &Begin = Indices.
begin();
3092 const auto &Mid = Indices.
begin() + Indices.
size() / 2;
3093 const auto &
End = Indices.
end();
3096 Wt =
Op->getOperand(0);
3098 Wt =
Op->getOperand(1);
3103 Ws =
Op->getOperand(0);
3105 Ws =
Op->getOperand(1);
3134 const auto &Begin = Indices.
begin();
3135 const auto &Mid = Indices.
begin() + Indices.
size() / 2;
3136 const auto &
End = Indices.
end();
3139 Wt =
Op->getOperand(0);
3141 Wt =
Op->getOperand(1);
3146 Ws =
Op->getOperand(0);
3148 Ws =
Op->getOperand(1);
3170 const bool isSPLATI,
3177 bool Using1stVec =
false;
3178 bool Using2ndVec =
false;
3182 for (
int i = 0; i < ResTyNumElts; ++i) {
3184 int Idx = Indices[i];
3186 if (0 <= Idx && Idx < ResTyNumElts)
3188 if (ResTyNumElts <= Idx && Idx < ResTyNumElts * 2)
3195 for (
int Idx : Indices)
3201 int LastValidIndex = SplatIndex;
3202 for (
size_t i = 0; i < Indices.
size(); i++) {
3203 int Idx = Indices[i];
3206 Idx = isSPLATI ? SplatIndex : LastValidIndex;
3208 LastValidIndex = Idx;
3215 if (Using1stVec && Using2ndVec) {
3216 Op0 =
Op->getOperand(0);
3217 Op1 =
Op->getOperand(1);
3218 }
else if (Using1stVec)
3219 Op0 = Op1 =
Op->getOperand(0);
3220 else if (Using2ndVec)
3221 Op0 = Op1 =
Op->getOperand(1);
3223 llvm_unreachable(
"shuffle vector mask references neither vector operand?");
3232 return DAG.
getNode(MipsISD::VSHF,
DL, ResTy, MaskVec, Op1, Op0);
3240 EVT ResTy =
Op->getValueType(0);
3246 SmallVector<int, 16> Indices;
3248 for (
int i = 0; i < ResTyNumElts; ++i)
3285 unsigned CvtOpc)
const {
3303 MI.eraseFromParent();
3331 MachineBasicBlock *
TBB =
F->CreateMachineBasicBlock(LLVM_BB);
3332 MachineBasicBlock *Sink =
F->CreateMachineBasicBlock(LLVM_BB);
3335 F->insert(It, Sink);
3346 TBB->addSuccessor(Sink);
3368 MI.getOperand(0).getReg())
3374 MI.eraseFromParent();
3401 MachineBasicBlock *FBB =
F->CreateMachineBasicBlock(LLVM_BB);
3402 MachineBasicBlock *
TBB =
F->CreateMachineBasicBlock(LLVM_BB);
3403 MachineBasicBlock *Sink =
F->CreateMachineBasicBlock(LLVM_BB);
3406 F->insert(It, Sink);
3417 TBB->addSuccessor(Sink);
3439 MI.getOperand(0).getReg())
3445 MI.eraseFromParent();
3467 unsigned Lane =
MI.getOperand(2).getImm();
3482 Subtarget.useOddSPReg() ? &Mips::MSA128WRegClass
3483 : &Mips::MSA128WEvensRegClass);
3489 MI.eraseFromParent();
3512 unsigned Lane =
MI.getOperand(2).getImm() * 2;
3524 MI.eraseFromParent();
3543 unsigned Lane =
MI.getOperand(2).getImm();
3546 ? &Mips::MSA128WRegClass
3547 : &Mips::MSA128WEvensRegClass;
3562 MI.eraseFromParent();
3583 unsigned Lane =
MI.getOperand(2).getImm();
3599 MI.eraseFromParent();
3631 Register SrcVecReg =
MI.getOperand(1).getReg();
3632 Register LaneReg =
MI.getOperand(2).getReg();
3633 Register SrcValReg =
MI.getOperand(3).getReg();
3638 Subtarget.isABI_N64() ? &Mips::GPR64RegClass : &Mips::GPR32RegClass;
3639 unsigned SubRegIdx =
Subtarget.isABI_N64() ? Mips::sub_32 : 0;
3640 unsigned ShiftOp =
Subtarget.isABI_N64() ? Mips::DSLL : Mips::SLL;
3641 unsigned EltLog2Size;
3642 unsigned InsertOp = 0;
3643 unsigned InsveOp = 0;
3644 switch (EltSizeInBytes) {
3649 InsertOp = Mips::INSERT_B;
3650 InsveOp = Mips::INSVE_B;
3651 VecRC = &Mips::MSA128BRegClass;
3655 InsertOp = Mips::INSERT_H;
3656 InsveOp = Mips::INSVE_H;
3657 VecRC = &Mips::MSA128HRegClass;
3661 InsertOp = Mips::INSERT_W;
3662 InsveOp = Mips::INSVE_W;
3663 VecRC = &Mips::MSA128WRegClass;
3667 InsertOp = Mips::INSERT_D;
3668 InsveOp = Mips::INSVE_D;
3669 VecRC = &Mips::MSA128DRegClass;
3680 .
addImm(EltSizeInBytes == 8 ? Mips::sub_64 : Mips::sub_lo);
3685 if (EltSizeInBytes != 1) {
3698 .
addReg(LaneReg, {}, SubRegIdx);
3727 .
addReg(LaneTmp2, {}, SubRegIdx);
3729 MI.eraseFromParent();
3749 Subtarget.useOddSPReg() ? &Mips::MSA128WRegClass
3750 : &Mips::MSA128WEvensRegClass);
3752 Subtarget.useOddSPReg() ? &Mips::MSA128WRegClass
3753 : &Mips::MSA128WEvensRegClass);
3762 MI.eraseFromParent();
3793 MI.eraseFromParent();
3820 .
addReg(
MI.getOperand(1).getReg());
3822 MI.eraseFromParent();
3849 .
addReg(
MI.getOperand(1).getReg());
3851 MI.eraseFromParent();
static SDValue performSHLCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
If the operand is a bitwise AND with a constant RHS, and the shift has a constant RHS and is the only...
static SDValue performORCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI)
static SDValue performANDCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI)
static SDValue performSETCCCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
const AArch64Subtarget & Subtarget
const TargetLowering & TLI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
const AArch64InstrInfo & TII
This file implements a class to represent arbitrary precision integral constant values and operations...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
static bool fitsRegularPattern(typename SmallVectorImpl< ValType >::const_iterator Begin, unsigned CheckStride, typename SmallVectorImpl< ValType >::const_iterator End, ValType ExpectedIndex, unsigned ExpectedIndexStride)
Determine whether a range fits a regular pattern of values.
static SDValue performXORCombine(SDNode *N, SelectionDAG &DAG, const LoongArchSubtarget &Subtarget)
static SDValue performVSELECTCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const LoongArchSubtarget &Subtarget)
static SDValue performSRLCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const LoongArchSubtarget &Subtarget)
static SDValue truncateVecElts(SDNode *Node, SelectionDAG &DAG)
static SDValue performMULCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const LoongArchSubtarget &Subtarget)
SmallVector< MachineOperand, 4 > Cond
Promote Memory to Register
static SDValue lowerMSABinaryBitImmIntr(SDValue Op, SelectionDAG &DAG, unsigned Opc, SDValue Imm, bool BigEndian)
static SDValue lowerMSABitClearImm(SDValue Op, SelectionDAG &DAG)
static SDValue lowerDSPIntr(SDValue Op, SelectionDAG &DAG, unsigned Opc)
static SDValue performDSPShiftCombine(unsigned Opc, SDNode *N, EVT Ty, SelectionDAG &DAG, const MipsSubtarget &Subtarget)
static SDValue lowerMSACopyIntr(SDValue Op, SelectionDAG &DAG, unsigned Opc)
static SDValue lowerVECTOR_SHUFFLE_ILVR(SDValue Op, EVT ResTy, SmallVector< int, 16 > Indices, SelectionDAG &DAG)
static SDValue getBuildVectorSplat(EVT VecTy, SDValue SplatValue, bool BigEndian, SelectionDAG &DAG)
static bool isVSplat(SDValue N, APInt &Imm, bool IsLittleEndian)
static SDValue initAccumulator(SDValue In, const SDLoc &DL, SelectionDAG &DAG)
static bool isBitwiseInverse(SDValue N, SDValue OfNode)
static SDValue lowerMSAStoreIntr(SDValue Op, SelectionDAG &DAG, unsigned Intr, const MipsSubtarget &Subtarget)
static SDValue performSRACombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
static bool isVectorAllOnes(SDValue N)
static SDValue lowerVECTOR_SHUFFLE_PCKOD(SDValue Op, EVT ResTy, SmallVector< int, 16 > Indices, SelectionDAG &DAG)
static SDValue performFP_TO_UINTCombine(SDNode *N, SelectionDAG &DAG)
static bool isLegalDSPCondCode(EVT Ty, ISD::CondCode CC)
static SDValue lowerMSASplatZExt(SDValue Op, unsigned OpNr, SelectionDAG &DAG)
static SDValue lowerMSABitClear(SDValue Op, SelectionDAG &DAG)
static SDValue lowerVECTOR_SHUFFLE_PCKEV(SDValue Op, EVT ResTy, SmallVector< int, 16 > Indices, SelectionDAG &DAG)
static SDValue genConstMult(SDValue X, APInt C, const SDLoc &DL, EVT VT, EVT ShiftTy, SelectionDAG &DAG)
static SDValue lowerMSASplatImm(SDValue Op, unsigned ImmOp, SelectionDAG &DAG, bool IsSigned=false)
static SDValue lowerVECTOR_SHUFFLE_ILVOD(SDValue Op, EVT ResTy, SmallVector< int, 16 > Indices, SelectionDAG &DAG)
static bool isConstantOrUndef(const SDValue Op)
static SDValue lowerVECTOR_SHUFFLE_VSHF(SDValue Op, EVT ResTy, const SmallVector< int, 16 > &Indices, const bool isSPLATI, SelectionDAG &DAG)
static SDValue lowerVECTOR_SHUFFLE_SHF(SDValue Op, EVT ResTy, SmallVector< int, 16 > Indices, SelectionDAG &DAG)
static SDValue extractLOHI(SDValue Op, const SDLoc &DL, SelectionDAG &DAG)
static bool shouldTransformMulToShiftsAddsSubs(APInt C, EVT VT, SelectionDAG &DAG, const MipsSubtarget &Subtarget)
static SDValue lowerVECTOR_SHUFFLE_ILVEV(SDValue Op, EVT ResTy, SmallVector< int, 16 > Indices, SelectionDAG &DAG)
static bool isVECTOR_SHUFFLE_SPLATI(SDValue Op, EVT ResTy, SmallVector< int, 16 > Indices, SelectionDAG &DAG)
static bool isConstantOrUndefBUILD_VECTOR(const BuildVectorSDNode *Op)
static SDValue lowerMSALoadIntr(SDValue Op, SelectionDAG &DAG, unsigned Intr, const MipsSubtarget &Subtarget)
static SDValue lowerVECTOR_SHUFFLE_ILVL(SDValue Op, EVT ResTy, SmallVector< int, 16 > Indices, SelectionDAG &DAG)
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
This file defines the SmallVector class.
This file describes how to lower LLVM code to machine code.
Class for arbitrary precision integers.
uint64_t getZExtValue() const
Get zero extended value.
LLVM_ABI APInt trunc(unsigned width) const
Truncate to new width.
bool isAllOnes() const
Determine if all bits are set. This is true for zero-width values.
unsigned getBitWidth() const
Return the number of bits in the APInt.
bool isNegative() const
Determine sign of this APInt.
unsigned logBase2() const
bool isPowerOf2() const
Check if this APInt's value is a power of two greater than zero.
static APInt getLowBitsSet(unsigned numBits, unsigned loBitsSet)
Constructs an APInt value that has the bottom loBitsSet bits set.
static APInt getHighBitsSet(unsigned numBits, unsigned hiBitsSet)
Constructs an APInt value that has the top hiBitsSet bits set.
APInt lshr(unsigned shiftAmt) const
Logical right-shift function.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
A "pseudo-class" with methods for operating on BUILD_VECTORs.
LLVM_ABI bool isConstantSplat(APInt &SplatValue, APInt &SplatUndef, unsigned &SplatBitSize, bool &HasAnyUndefs, unsigned MinSplatBits=0, bool isBigEndian=false) const
Check if this is a constant splat, and if so, find the smallest element size that splats the vector.
CCState - This class holds information needed while lowering arguments and return values.
unsigned getInRegsParamsCount() const
uint64_t getZExtValue() const
const SDValue & getBasePtr() const
const Triple & getTargetTriple() const
TypeSize getSizeInBits() const
Returns the size of the specified MVT in bits.
static auto fixedlen_vector_valuetypes()
LLVM_ABI void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB)
Transfers all the successors, as in transferSuccessors, and update PHI operands in the successor bloc...
LLVM_ABI instr_iterator insert(instr_iterator I, MachineInstr *M)
Insert MI into the instruction list before I, possibly inside a bundle.
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
LLVM_ABI void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
void splice(iterator Where, MachineBasicBlock *Other, iterator From)
Take an instruction from MBB 'Other' at the position From, and insert it into this MBB right before '...
MachineInstrBundleIterator< MachineInstr > iterator
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
BasicBlockListType::iterator iterator
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *BB=nullptr, std::optional< UniqueBBID > BBID=std::nullopt)
CreateMachineInstr - Allocate a new MachineInstr.
const MachineInstrBuilder & addReg(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a new virtual register operand.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0) const
Representation of each machine instruction.
Flags
Flags values. These may be or'd together.
Flags getFlags() const
Return the raw flags of the source value,.
LLVM_ABI Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
AAMDNodes getAAInfo() const
Returns the AA info that describes the dereference.
MachineMemOperand * getMemOperand() const
Return the unique MachineMemOperand object describing the memory reference performed by operation.
const SDValue & getChain() const
EVT getMemoryVT() const
Return the type of the in-memory value.
MipsFunctionInfo - This class is derived from MachineFunction private Mips target-specific informatio...
unsigned getIncomingArgSize() const
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override
This method will be invoked for all target nodes and for any target-independent nodes that the target...
TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(MVT VT) const override
Return the preferred vector type legalization action.
void addMSAFloatType(MVT::SimpleValueType Ty, const TargetRegisterClass *RC)
Enable MSA support for the given floating-point type and Register class.
void addMSAIntType(MVT::SimpleValueType Ty, const TargetRegisterClass *RC)
Enable MSA support for the given integer type and Register class.
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const override
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
const TargetRegisterClass * getRepRegClassFor(MVT VT) const override
Return the 'representative' register class for the specified value type.
bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AS=0, Align Alignment=Align(1), MachineMemOperand::Flags Flags=MachineMemOperand::MONone, unsigned *Fast=nullptr) const override
Determine if the target supports unaligned memory accesses.
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
This callback is invoked for operations that are unsupported by the target, which are registered to u...
MipsSETargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI)
MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override
Return the type to use for a scalar shift opcode, given the shifted amount type.
MipsTargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI)
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override
This method will be invoked for all target nodes and for any target-independent nodes that the target...
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const override
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
virtual void getOpndList(SmallVectorImpl< SDValue > &Ops, std::deque< std::pair< unsigned, SDValue > > &RegsToPass, bool IsPICCall, bool GlobalOrExternal, bool LocalLinkage, bool IsCallReloc, CallLoweringInfo &CLI, SDValue Callee, SDValue Chain) const
This function fills Ops, which is the list of operands that will later be used when a function call n...
SDValue lowerSTORE(SDValue Op, SelectionDAG &DAG) const
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
LowerOperation - Provide custom lowering hooks for some operations.
const MipsSubtarget & Subtarget
SDValue lowerLOAD(SDValue Op, SelectionDAG &DAG) const
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
unsigned getNumOperands() const
Return the number of values used by this operation.
SDVTList getVTList() const
const SDValue & getOperand(unsigned Num) const
LLVM_ABI void printrWithDepth(raw_ostream &O, const SelectionDAG *G=nullptr, unsigned depth=100) const
Print a SelectionDAG node and children up to depth "depth." The given SelectionDAG allows target-spec...
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.
const SDValue & getOperand(unsigned i) const
uint64_t getScalarValueSizeInBits() const
unsigned getOpcode() const
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
const TargetSubtargetInfo & getSubtarget() const
LLVM_ABI SDValue getMergeValues(ArrayRef< SDValue > Ops, const SDLoc &dl)
Create a MERGE_VALUES node from the given operands.
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond, SDValue Chain=SDValue(), bool IsSignaling=false, SDNodeFlags Flags={})
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
LLVM_ABI SDValue getNOT(const SDLoc &DL, SDValue Val, EVT VT)
Create a bitwise NOT operation as (XOR Val, -1).
const TargetLowering & getTargetLoweringInfo() const
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef< SDValue > Ops)
Return an ISD::BUILD_VECTOR node.
LLVM_ABI bool isSplatValue(SDValue V, const APInt &DemandedElts, APInt &UndefElts, unsigned Depth=0) const
Test whether V has a splatted value for all the demanded elements.
const DataLayout & getDataLayout() const
LLVM_ABI SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, Align Alignment, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const MMOMetadata &Metadata=MMOMetadata())
Helper function to build ISD::STORE nodes.
LLVM_ABI SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
LLVM_ABI SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, MaybeAlign Alignment=MaybeAlign(), MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const MMOMetadata &Metadata=MMOMetadata())
Loads are not normal binary operators: their result type is not determined by their operands,...
LLVM_ABI SDValue getValueType(EVT)
LLVM_ABI SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
LLVM_ABI SDValue getVectorIdxConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
SDValue getSplatBuildVector(EVT VT, const SDLoc &DL, SDValue Op)
Return a splat ISD::BUILD_VECTOR node, consisting of Op splatted to all elements.
LLVM_ABI SDValue getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either zero-extending or trunca...
LLVMContext * getContext() const
LLVM_ABI std::pair< SDValue, SDValue > SplitScalar(const SDValue &N, const SDLoc &DL, const EVT &LoVT, const EVT &HiVT)
Split the scalar node with EXTRACT_ELEMENT using the provided VTs and return the low/high part.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
typename SuperClass::const_iterator const_iterator
iterator insert(iterator I, T &&Elt)
void push_back(const T &Elt)
LLVM_NO_SANITIZE_CFI_UNRELATED_CAST iterator begin()
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
const SDValue & getBasePtr() const
const SDValue & getValue() const
void setOperationAction(unsigned Op, MVT VT, LegalizeAction Action)
Indicate that the specified operation does not work with the specified type and indicate what to do a...
void setOperationPromotedToType(unsigned Opc, MVT OrigVT, MVT DestVT)
Convenience method to set an operation to Promote and specify the type in a single call.
LegalizeTypeAction
This enum indicates whether a types are legal for a target, and if not, what action should be used to...
MVT getRegisterType(LLVMContext &Context, EVT VT) const
Return the type of registers that this ValueType will eventually require.
virtual TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(MVT VT) const
Return the preferred vector type legalization action.
void computeRegisterProperties(const TargetRegisterInfo *TRI)
Once all of the register classes are added, this allows us to compute derived properties we expose.
void addRegisterClass(MVT VT, const TargetRegisterClass *RC)
Add the specified register class as an available regclass for the specified value type.
virtual MVT getPointerTy(const DataLayout &DL, uint32_t AS=0) const
Return the pointer type for the given address space, defaults to the pointer type from the data layou...
void setTruncStoreAction(MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified truncating store does not work with the specified type and indicate what ...
virtual const TargetRegisterClass * getRepRegClassFor(MVT VT) const
Return the 'representative' register class for the specified value type.
void setCondCodeAction(ArrayRef< ISD::CondCode > CCs, MVT VT, LegalizeAction Action)
Indicate that the specified condition code is or isn't supported on the target and indicate what to d...
void setTargetDAGCombine(ArrayRef< ISD::NodeType > NTs)
Targets should invoke this method for each target independent node that they want to provide a custom...
void setLoadExtAction(unsigned ExtType, MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified load with extension does not work with the specified type and indicate wh...
LegalizeTypeAction getTypeAction(LLVMContext &Context, EVT VT) const
Return how we should legalize values of this type, either it is already legal (return 'Legal') or we ...
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
std::pair< SDValue, SDValue > makeLibCall(SelectionDAG &DAG, RTLIB::LibcallImpl LibcallImpl, EVT RetVT, ArrayRef< SDValue > Ops, MakeLibCallOptions CallOptions, const SDLoc &dl, SDValue Chain=SDValue()) const
Returns a pair of (return value, chain).
LLVM_ABI bool isLittleEndian() const
Tests whether the target triple is little endian.
LLVM Value Representation.
#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.
@ SETCC
SetCC operator - This evaluates to a true value iff the condition is true.
@ POISON
POISON - A poison node.
@ SMUL_LOHI
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
@ ADDC
Carry-setting nodes for multiple precision addition and subtraction.
@ ADD
Simple integer binary arithmetic operators.
@ LOAD
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
@ FMA
FMA - Perform a * b + c with no intermediate rounding step.
@ INTRINSIC_VOID
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
@ SINT_TO_FP
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
@ FADD
Simple binary floating point operators.
@ ATOMIC_FENCE
OUTCHAIN = ATOMIC_FENCE(INCHAIN, ordering, scope) This corresponds to the fence instruction.
@ SDIVREM
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
@ 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.
@ STRICT_FSQRT
Constrained versions of libm-equivalent floating point intrinsics.
@ BUILTIN_OP_END
BUILTIN_OP_END - This must be the last enum value in this list.
@ SET_ROUNDING
Set rounding mode.
@ SIGN_EXTEND
Conversion operators.
@ SELECT
Select(COND, TRUEVAL, FALSEVAL).
@ UNDEF
UNDEF - An undefined node.
@ BasicBlock
Various leaf nodes.
@ GET_ROUNDING
Returns current rounding mode: -1 Undefined 0 Round to 0 1 Round to nearest, ties to even 2 Round to ...
@ MULHU
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...
@ SHL
Shift and rotation operations.
@ VECTOR_SHUFFLE
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
@ 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) ...
@ SMIN
[US]{MIN/MAX} - Binary minimum or maximum of signed or unsigned integers.
@ VSELECT
Select with a vector condition (op #0) and two vector operands (ops #1 and #2), returning a vector re...
@ STRICT_SINT_TO_FP
STRICT_[US]INT_TO_FP - Convert a signed or unsigned integer to a floating point value.
@ STRICT_FP_ROUND
X = STRICT_FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision ...
@ FP_TO_SINT
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
@ TargetConstant
TargetConstant* - Like Constant*, but the DAG does not do any folding, simplification,...
@ 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.
@ INTRINSIC_WO_CHAIN
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
@ ADDE
Carry-using nodes for multiple precision addition and subtraction.
@ STRICT_FADD
Constrained versions of the binary floating point operators.
@ INSERT_VECTOR_ELT
INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element at IDX replaced with VAL.
@ TRUNCATE
TRUNCATE - Completely drop the high bits.
@ BRCOND
BRCOND - Conditional branch.
@ INTRINSIC_W_CHAIN
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
@ BUILD_VECTOR
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width vector with the specified,...
LLVM_ABI bool isBuildVectorAllOnes(SDValue V)
Return true if the specified value is a BUILD_VECTOR where all of the elements are ~0 or undef.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out,...
NodeAddr< NodeBase * > Node
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
@ Fast
Assign the register banks as fast as possible (default).
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
constexpr unsigned BitWidth
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
const MipsTargetLowering * createMipsSETargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI)
Align commonAlignment(Align A, uint64_t Offset)
Returns the alignment that satisfies both alignments.
unsigned Log2(Align A)
Returns the log2 of the alignment.
@ End
Run the machine verifier once, at the end of the pipeline.
@ Custom
The result value requires a custom uniformity check.
MCRegisterClass TargetRegisterClass
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
This struct is a compact representation of a valid (non-zero power of two) alignment.
EVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
uint64_t getScalarSizeInBits() const
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
bool is128BitVector() const
Return true if this is a 128-bit vector type.
bool isVector() const
Return true if this is a vector value type.
EVT getVectorElementType() const
Given a vector type, return the type of each element.
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
bool isInteger() const
Return true if this is an integer or a vector integer type.
This class contains a discriminated union of information about pointers in memory operands,...
These are IR-level optimization flags that may be propagated to SDNodes.
This structure is used to pass arguments to makeLibCall function.