44 #define DEBUG_TYPE "mips-lower"
46 STATISTIC(NumTailCalls,
"Number of tail calls");
54 cl::desc(
"MIPS: Don't trap on integer division by zero."),
58 Mips::D12_64, Mips::D13_64, Mips::D14_64, Mips::D15_64,
59 Mips::D16_64, Mips::D17_64, Mips::D18_64, Mips::D19_64
104 unsigned &NumIntermediates,
MVT &RegisterVT)
const {
108 IntermediateVT = RegisterVT;
113 return NumIntermediates;
123 unsigned Flag)
const {
129 unsigned Flag)
const {
135 unsigned Flag)
const {
141 unsigned Flag)
const {
147 unsigned Flag)
const {
550 unsigned LO = (Ty ==
MVT::i32) ? Mips::LO0 : Mips::LO0_64;
551 unsigned HI = (Ty ==
MVT::i32) ? Mips::HI0 : Mips::HI0_64;
614 "Illegal Condition Code");
755 return DAG.
getNode(Opc,
SDLoc(N), ValueIfFalse.getValueType(),
756 ValueIfFalse, FCC, ValueIfTrue, Glue);
766 unsigned FirstOperandOpc = FirstOperand.
getOpcode();
771 uint64_t Pos = 0, SMPos, SMSize;
777 if (!(CN = dyn_cast<ConstantSDNode>(Mask)) ||
787 if (!(CN = dyn_cast<ConstantSDNode>(FirstOperand.
getOperand(1))))
807 if (!(CN = dyn_cast<ConstantSDNode>(FirstOperand.
getOperand(1))))
812 if (SMPos != Pos || Pos >= ValTy.
getSizeInBits() || SMSize >= 32 ||
834 NewOperand = FirstOperand;
836 return DAG.
getNode(Opc, DL, ValTy, NewOperand,
852 uint64_t SMPos0, SMSize0, SMPos1, SMSize1;
859 if (!(CN = dyn_cast<ConstantSDNode>(And0.
getOperand(1))) ||
865 And1.getOperand(0).getOpcode() ==
ISD::SHL) {
867 if (!(CN = dyn_cast<ConstantSDNode>(And1.getOperand(1))) ||
872 if (SMPos0 != SMPos1 || SMSize0 != SMSize1)
877 if (!(CN = dyn_cast<ConstantSDNode>(Shl.
getOperand(1))))
885 if ((Shamt != SMPos0) || (SMPos0 + SMSize0 > ValTy.
getSizeInBits()))
898 if (~CN->
getSExtValue() == ((((int64_t)1 << SMSize0) - 1) << SMPos0) &&
899 ((SMSize0 + SMPos0 <= 64 && Subtarget.
hasMips64r2()) ||
900 (SMSize0 + SMPos0 <= 32))) {
904 if (!(CN1 = dyn_cast<ConstantSDNode>(And1->getOperand(1))))
907 if (!(CN1 = dyn_cast<ConstantSDNode>(N->
getOperand(1))))
999 if (!IsSigned && !IsUnsigned)
1097 EVT WiderVT = cast<VTSDNode>(WiderAssertZext->
getOperand(1))->getVT();
1099 if (NarrowerVT.
bitsLT(WiderVT)) {
1122 unsigned FirstOperandOpc = FirstOperand.
getOpcode();
1127 uint64_t Pos = 0, SMPos, SMSize;
1132 if (!(CN = dyn_cast<ConstantSDNode>(SecondOperand)))
1144 if (!(CN = dyn_cast<ConstantSDNode>(FirstOperand.
getOperand(1))) ||
1150 if (SMPos != 0 || SMSize > 32 || Pos + SMSize > ValTy.
getSizeInBits())
1241 case ISD::SRL_PARTS:
return lowerShiftRightParts(Op, DAG,
false);
1268 bool Is64Bit,
bool IsMicroMips) {
1277 TII.
get(IsMicroMips ? Mips::TEQ_MM : Mips::TEQ))
1301 case Mips::ATOMIC_LOAD_ADD_I8:
1302 return emitAtomicBinaryPartword(MI, BB, 1, Mips::ADDu);
1303 case Mips::ATOMIC_LOAD_ADD_I16:
1304 return emitAtomicBinaryPartword(MI, BB, 2, Mips::ADDu);
1305 case Mips::ATOMIC_LOAD_ADD_I32:
1306 return emitAtomicBinary(MI, BB, 4, Mips::ADDu);
1307 case Mips::ATOMIC_LOAD_ADD_I64:
1308 return emitAtomicBinary(MI, BB, 8, Mips::DADDu);
1310 case Mips::ATOMIC_LOAD_AND_I8:
1311 return emitAtomicBinaryPartword(MI, BB, 1,
Mips::AND);
1312 case Mips::ATOMIC_LOAD_AND_I16:
1313 return emitAtomicBinaryPartword(MI, BB, 2,
Mips::AND);
1314 case Mips::ATOMIC_LOAD_AND_I32:
1315 return emitAtomicBinary(MI, BB, 4,
Mips::AND);
1316 case Mips::ATOMIC_LOAD_AND_I64:
1317 return emitAtomicBinary(MI, BB, 8, Mips::AND64);
1319 case Mips::ATOMIC_LOAD_OR_I8:
1320 return emitAtomicBinaryPartword(MI, BB, 1,
Mips::OR);
1321 case Mips::ATOMIC_LOAD_OR_I16:
1322 return emitAtomicBinaryPartword(MI, BB, 2,
Mips::OR);
1323 case Mips::ATOMIC_LOAD_OR_I32:
1324 return emitAtomicBinary(MI, BB, 4,
Mips::OR);
1325 case Mips::ATOMIC_LOAD_OR_I64:
1326 return emitAtomicBinary(MI, BB, 8, Mips::OR64);
1328 case Mips::ATOMIC_LOAD_XOR_I8:
1329 return emitAtomicBinaryPartword(MI, BB, 1,
Mips::XOR);
1330 case Mips::ATOMIC_LOAD_XOR_I16:
1331 return emitAtomicBinaryPartword(MI, BB, 2,
Mips::XOR);
1332 case Mips::ATOMIC_LOAD_XOR_I32:
1333 return emitAtomicBinary(MI, BB, 4,
Mips::XOR);
1334 case Mips::ATOMIC_LOAD_XOR_I64:
1335 return emitAtomicBinary(MI, BB, 8, Mips::XOR64);
1337 case Mips::ATOMIC_LOAD_NAND_I8:
1338 return emitAtomicBinaryPartword(MI, BB, 1, 0,
true);
1339 case Mips::ATOMIC_LOAD_NAND_I16:
1340 return emitAtomicBinaryPartword(MI, BB, 2, 0,
true);
1341 case Mips::ATOMIC_LOAD_NAND_I32:
1342 return emitAtomicBinary(MI, BB, 4, 0,
true);
1343 case Mips::ATOMIC_LOAD_NAND_I64:
1344 return emitAtomicBinary(MI, BB, 8, 0,
true);
1346 case Mips::ATOMIC_LOAD_SUB_I8:
1347 return emitAtomicBinaryPartword(MI, BB, 1, Mips::SUBu);
1348 case Mips::ATOMIC_LOAD_SUB_I16:
1349 return emitAtomicBinaryPartword(MI, BB, 2, Mips::SUBu);
1350 case Mips::ATOMIC_LOAD_SUB_I32:
1351 return emitAtomicBinary(MI, BB, 4, Mips::SUBu);
1352 case Mips::ATOMIC_LOAD_SUB_I64:
1353 return emitAtomicBinary(MI, BB, 8, Mips::DSUBu);
1355 case Mips::ATOMIC_SWAP_I8:
1356 return emitAtomicBinaryPartword(MI, BB, 1, 0);
1357 case Mips::ATOMIC_SWAP_I16:
1358 return emitAtomicBinaryPartword(MI, BB, 2, 0);
1359 case Mips::ATOMIC_SWAP_I32:
1360 return emitAtomicBinary(MI, BB, 4, 0);
1361 case Mips::ATOMIC_SWAP_I64:
1362 return emitAtomicBinary(MI, BB, 8, 0);
1364 case Mips::ATOMIC_CMP_SWAP_I8:
1365 return emitAtomicCmpSwapPartword(MI, BB, 1);
1366 case Mips::ATOMIC_CMP_SWAP_I16:
1367 return emitAtomicCmpSwapPartword(MI, BB, 2);
1368 case Mips::ATOMIC_CMP_SWAP_I32:
1369 return emitAtomicCmpSwap(MI, BB, 4);
1370 case Mips::ATOMIC_CMP_SWAP_I64:
1371 return emitAtomicCmpSwap(MI, BB, 8);
1372 case Mips::PseudoSDIV:
1373 case Mips::PseudoUDIV:
1380 case Mips::SDIV_MM_Pseudo:
1381 case Mips::UDIV_MM_Pseudo:
1384 case Mips::DIV_MMR6:
1385 case Mips::DIVU_MMR6:
1386 case Mips::MOD_MMR6:
1387 case Mips::MODU_MMR6:
1389 case Mips::PseudoDSDIV:
1390 case Mips::PseudoDUDIV:
1396 case Mips::DDIV_MM64R6:
1397 case Mips::DDIVU_MM64R6:
1398 case Mips::DMOD_MM64R6:
1399 case Mips::DMODU_MM64R6:
1402 case Mips::SEL_D_MMR6:
1403 return emitSEL_D(MI, BB);
1405 case Mips::PseudoSELECT_I:
1406 case Mips::PseudoSELECT_I64:
1407 case Mips::PseudoSELECT_S:
1408 case Mips::PseudoSELECT_D32:
1409 case Mips::PseudoSELECT_D64:
1410 return emitPseudoSELECT(MI, BB,
false, Mips::BNE);
1411 case Mips::PseudoSELECTFP_F_I:
1412 case Mips::PseudoSELECTFP_F_I64:
1413 case Mips::PseudoSELECTFP_F_S:
1414 case Mips::PseudoSELECTFP_F_D32:
1415 case Mips::PseudoSELECTFP_F_D64:
1416 return emitPseudoSELECT(MI, BB,
true, Mips::BC1F);
1417 case Mips::PseudoSELECTFP_T_I:
1418 case Mips::PseudoSELECTFP_T_I64:
1419 case Mips::PseudoSELECTFP_T_S:
1420 case Mips::PseudoSELECTFP_T_D32:
1421 case Mips::PseudoSELECTFP_T_D64:
1422 return emitPseudoSELECT(MI, BB,
true, Mips::BC1T);
1433 assert((Size == 4 || Size == 8) &&
"Unsupported size for EmitAtomicBinary.");
1441 unsigned LL,
SC,
AND, NOR, ZERO, BEQ;
1449 ? (ArePtrs64bit ? Mips::LL64_R6 : Mips::LL_R6)
1450 : (ArePtrs64bit ? Mips::LL64 : Mips::LL);
1452 ? (ArePtrs64bit ? Mips::SC64_R6 : Mips::SC_R6)
1453 : (ArePtrs64bit ? Mips::SC64 :
Mips::SC);
1461 LL = Subtarget.
hasMips64r6() ? Mips::LLD_R6 : Mips::LLD;
1462 SC = Subtarget.
hasMips64r6() ? Mips::SCD_R6 : Mips::SCD;
1465 ZERO = Mips::ZERO_64;
1509 }
else if (BinOpcode) {
1511 BuildMI(BB, DL, TII->
get(BinOpcode), StoreVal).addReg(OldVal).
addReg(Incr);
1525 unsigned SrcReg)
const {
1530 BuildMI(BB, DL, TII->
get(Mips::SEB), DstReg).addReg(SrcReg);
1535 BuildMI(BB, DL, TII->
get(Mips::SEH), DstReg).addReg(SrcReg);
1545 int64_t ShiftImm = 32 - (Size * 8);
1547 BuildMI(BB, DL, TII->
get(Mips::SLL), ScrReg).addReg(SrcReg).
addImm(ShiftImm);
1556 assert((Size == 1 || Size == 2) &&
1557 "Unsupported size for EmitAtomicBinaryPartial.");
1595 LL = Subtarget.
hasMips32r6() ? (ArePtrs64bit ? Mips::LL64_R6 : Mips::LL_R6)
1596 : (ArePtrs64bit ? Mips::LL64 : Mips::LL);
1597 SC = Subtarget.
hasMips32r6() ? (ArePtrs64bit ? Mips::SC64_R6 : Mips::SC_R6)
1598 : (ArePtrs64bit ? Mips::SC64 :
Mips::SC);
1631 int64_t MaskImm = (Size == 1) ? 255 : 65535;
1636 BuildMI(BB, DL, TII->
get(Mips::ANDi), PtrLSB2)
1637 .addReg(Ptr, 0, ArePtrs64bit ? Mips::sub_32 : 0).
addImm(3);
1643 .addReg(PtrLSB2).
addImm((Size == 1) ? 3 : 2);
1646 BuildMI(BB, DL, TII->
get(Mips::ORi), MaskUpper)
1647 .addReg(Mips::ZERO).
addImm(MaskImm);
1649 .addReg(MaskUpper).
addReg(ShiftAmt);
1650 BuildMI(BB, DL, TII->
get(Mips::NOR), Mask2).addReg(Mips::ZERO).
addReg(Mask);
1651 BuildMI(BB, DL, TII->
get(Mips::SLLV), Incr2).addReg(Incr).
addReg(ShiftAmt);
1679 BuildMI(BB, DL, TII->
get(Mips::NOR), BinOpRes)
1680 .addReg(Mips::ZERO).
addReg(AndRes);
1682 }
else if (BinOpcode) {
1685 BuildMI(BB, DL, TII->
get(BinOpcode), BinOpRes).addReg(OldVal).
addReg(Incr2);
1693 .addReg(OldVal).
addReg(Mask2);
1695 .addReg(MaskedOldVal0).
addReg(NewVal);
1708 .addReg(OldVal).
addReg(Mask);
1709 BuildMI(BB, DL, TII->
get(Mips::SRLV), SrlRes)
1710 .addReg(MaskedOldVal1).
addReg(ShiftAmt);
1711 BB = emitSignExtendToI32InReg(MI, BB, Size, Dest, SrlRes);
1720 unsigned Size)
const {
1721 assert((Size == 4 || Size == 8) &&
"Unsupported size for EmitAtomicCmpSwap.");
1729 unsigned LL,
SC, ZERO, BNE, BEQ;
1737 ? (ArePtrs64bit ? Mips::LL64_R6 : Mips::LL_R6)
1738 : (ArePtrs64bit ? Mips::LL64 : Mips::LL);
1740 ? (ArePtrs64bit ? Mips::SC64_R6 : Mips::SC_R6)
1741 : (ArePtrs64bit ? Mips::SC64 :
Mips::SC);
1748 LL = Subtarget.
hasMips64r6() ? Mips::LLD_R6 : Mips::LLD;
1749 SC = Subtarget.
hasMips64r6() ? Mips::SCD_R6 : Mips::SCD;
1750 ZERO = Mips::ZERO_64;
1768 MF->
insert(It, loop1MBB);
1769 MF->
insert(It, loop2MBB);
1810 assert((Size == 1 || Size == 2) &&
1811 "Unsupported size for EmitAtomicCmpSwapPartial.");
1850 LL = Subtarget.
hasMips32r6() ? (ArePtrs64bit ? Mips::LL64_R6 : Mips::LL_R6)
1851 : (ArePtrs64bit ? Mips::LL64 : Mips::LL);
1852 SC = Subtarget.
hasMips32r6() ? (ArePtrs64bit ? Mips::SC64_R6 : Mips::SC_R6)
1853 : (ArePtrs64bit ? Mips::SC64 :
Mips::SC);
1863 MF->
insert(It, loop1MBB);
1864 MF->
insert(It, loop2MBB);
1894 int64_t MaskImm = (Size == 1) ? 255 : 65535;
1895 BuildMI(BB, DL, TII->
get(ArePtrs64bit ? Mips::DADDiu : Mips::ADDiu), MaskLSB2)
1898 .addReg(Ptr).
addReg(MaskLSB2);
1899 BuildMI(BB, DL, TII->
get(Mips::ANDi), PtrLSB2)
1900 .addReg(Ptr, 0, ArePtrs64bit ? Mips::sub_32 : 0).
addImm(3);
1906 .addReg(PtrLSB2).
addImm((Size == 1) ? 3 : 2);
1909 BuildMI(BB, DL, TII->
get(Mips::ORi), MaskUpper)
1910 .addReg(Mips::ZERO).
addImm(MaskImm);
1912 .addReg(MaskUpper).
addReg(ShiftAmt);
1913 BuildMI(BB, DL, TII->
get(Mips::NOR), Mask2).addReg(Mips::ZERO).
addReg(Mask);
1914 BuildMI(BB, DL, TII->
get(Mips::ANDi), MaskedCmpVal)
1915 .addReg(CmpVal).
addImm(MaskImm);
1916 BuildMI(BB, DL, TII->
get(Mips::SLLV), ShiftedCmpVal)
1917 .addReg(MaskedCmpVal).
addReg(ShiftAmt);
1918 BuildMI(BB, DL, TII->
get(Mips::ANDi), MaskedNewVal)
1919 .addReg(NewVal).
addImm(MaskImm);
1920 BuildMI(BB, DL, TII->
get(Mips::SLLV), ShiftedNewVal)
1921 .addReg(MaskedNewVal).
addReg(ShiftAmt);
1929 BuildMI(BB, DL, TII->
get(Mips::AND), MaskedOldVal0)
1930 .addReg(OldVal).
addReg(Mask);
1932 .addReg(MaskedOldVal0).
addReg(ShiftedCmpVal).
addMBB(sinkMBB);
1940 BuildMI(BB, DL, TII->
get(Mips::AND), MaskedOldVal1)
1941 .addReg(OldVal).
addReg(Mask2);
1943 .addReg(MaskedOldVal1).
addReg(ShiftedNewVal);
1954 BuildMI(BB, DL, TII->
get(Mips::SRLV), SrlRes)
1955 .addReg(MaskedOldVal0).
addReg(ShiftAmt);
1956 BB = emitSignExtendToI32InReg(MI, BB, Size, Dest, SrlRes);
1973 const auto &FGR64RegClass = TRI->
getRegClass(Mips::FGR64RegClassID);
1977 BuildMI(*BB, II, DL, TII->
get(Mips::SUBREG_TO_REG), Fc2)
2010 FCC0, Dest, CondRes);
2032 "Floating point operand expected.");
2073 if (GV->hasLocalLinkage())
2083 N,
SDLoc(N), Ty, DAG,
2132 Entry.Node = Argument;
2134 Args.push_back(Entry);
2139 .setLibCallee(
CallingConv::C, PtrTy, TlsGetAddr, std::move(Args));
2140 std::pair<SDValue, SDValue> CallResult =
LowerCallTo(CLI);
2239 const Value *SV = cast<SrcValueSDNode>(Node->
getOperand(2))->getValue();
2255 assert(((Align & (Align-1)) == 0) &&
"Expected Align to be a power of 2");
2267 unsigned ArgSizeInBytes =
2282 if (!Subtarget.
isLittle() && ArgSizeInBytes < ArgSlotSizeInBytes) {
2283 unsigned Adjustment = ArgSlotSizeInBytes - ArgSizeInBytes;
2292 bool HasExtractInsert) {
2311 if (HasExtractInsert) {
2339 bool HasExtractInsert) {
2350 if (HasExtractInsert) {
2356 if (WidthX > WidthY)
2358 else if (WidthY > WidthX)
2377 if (WidthX > WidthY)
2379 else if (WidthY > WidthX)
2400 "Frame address can only be determined for current frame.");
2418 "Return address can be determined only for current frame.");
2423 unsigned RA =
ABI.
IsN64() ? Mips::RA_64 : Mips::RA;
2449 unsigned OffsetReg =
ABI.
IsN64() ? Mips::V1_64 : Mips::V1;
2450 unsigned AddrReg =
ABI.
IsN64() ? Mips::V0_64 : Mips::V0;
2535 IsSRA ? Ext : DAG.
getConstant(0, DL, VT), ShiftRightHi);
2567 if ((LD->
getAlignment() >= MemVT.getSizeInBits() / 8) ||
2571 bool IsLittle = Subtarget.
isLittle();
2624 SDValue Chain,
unsigned Offset) {
2745 static const MCPhysReg IntRegs[] = { Mips::A0, Mips::A1, Mips::A2, Mips::A3 };
2749 static const MCPhysReg F32Regs[] = { Mips::F12, Mips::F14 };
2751 static const MCPhysReg FloatVectorIntRegs[] = { Mips::A0, Mips::A2 };
2763 else if (ArgFlags.
isZExt())
2775 else if (ArgFlags.
isZExt())
2786 bool AllocateFloatsInIntReg = State.
isVarArg() || ValNo > 1 ||
2789 bool isI64 = (ValVT ==
MVT::i32 && OrigAlign == 8);
2793 if (ValVT ==
MVT::i32 && isVectorFloat) {
2800 if (Reg == Mips::A2)
2809 }
else if (ValVT ==
MVT::i32 || (ValVT ==
MVT::f32 && AllocateFloatsInIntReg)) {
2813 if (isI64 && (Reg == Mips::A1 || Reg == Mips::A3))
2816 }
else if (ValVT ==
MVT::f64 && AllocateFloatsInIntReg) {
2820 if (Reg == Mips::A1 || Reg == Mips::A3)
2834 if (Reg2 == Mips::A1 || Reg2 == Mips::A3)
2854 static const MCPhysReg F64Regs[] = { Mips::D6, Mips::D7 };
2856 return CC_MipsO32(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State, F64Regs);
2862 static const MCPhysReg F64Regs[] = { Mips::D12_64, Mips::D14_64 };
2864 return CC_MipsO32(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State, F64Regs);
2871 #include "MipsGenCallingConv.inc"
2879 assert((Reg == Mips::A0) || (Reg == Mips::A2));
2880 return (Reg == Mips::A0) ? Mips::A1 : Mips::A3;
2883 SDValue MipsTargetLowering::passArgOnStack(
SDValue StackPtr,
unsigned Offset,
2885 const SDLoc &DL,
bool IsTailCall,
2903 std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
2904 bool IsPICCall,
bool GlobalOrExternal,
bool InternalLinkage,
2917 if (IsPICCall && !InternalLinkage && IsCallReloc) {
2918 unsigned GPReg =
ABI.
IsN64() ? Mips::GP_64 : Mips::GP;
2920 RegsToPass.push_back(std::make_pair(GPReg,
getGlobalReg(CLI.
DAG, Ty)));
2929 for (
unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
2931 RegsToPass[i].second, InFlag);
2937 for (
unsigned i = 0, e = RegsToPass.size(); i != e; ++i)
2939 RegsToPass[i].second.getValueType()));
2945 assert(Mask &&
"Missing call preserved mask for calling convention");
2949 Function *
F =
G->getGlobal()->getParent()->getFunction(Sym);
2994 dyn_cast_or_null<const ExternalSymbolSDNode>(Callee.
getNode());
2999 unsigned NextStackOffset = CCInfo.getNextStackOffset();
3003 bool InternalLinkage =
false;
3005 IsTailCall = isEligibleForTailCallOptimization(
3008 InternalLinkage =
G->getGlobal()->hasInternalLinkage();
3009 IsTailCall &= (InternalLinkage ||
G->getGlobal()->hasLocalLinkage() ||
3010 G->getGlobal()->hasPrivateLinkage() ||
3011 G->getGlobal()->hasHiddenVisibility() ||
3012 G->getGlobal()->hasProtectedVisibility());
3017 "site marked musttail");
3026 NextStackOffset =
alignTo(NextStackOffset, StackAlignment);
3036 std::deque< std::pair<unsigned, SDValue> > RegsToPass;
3039 CCInfo.rewindByValRegsInfo();
3042 for (
unsigned i = 0, e = ArgLocs.
size(); i != e; ++i) {
3047 bool UseUpperBits =
false;
3051 unsigned FirstByValReg, LastByValReg;
3052 unsigned ByValIdx = CCInfo.getInRegsParamsProcessed();
3053 CCInfo.getInRegsParamInfo(ByValIdx, FirstByValReg, LastByValReg);
3056 "ByVal args of size 0 should have been ignored by front-end.");
3057 assert(ByValIdx < CCInfo.getInRegsParamsCount());
3059 "Do not tail-call optimize if there is a byval argument.");
3060 passByValArg(Chain, DL, RegsToPass, MemOpChains, StackPtr, MFI, DAG, Arg,
3061 FirstByValReg, LastByValReg, Flags, Subtarget.
isLittle(),
3063 CCInfo.nextInRegsParam();
3086 RegsToPass.push_back(std::make_pair(LocRegLo, Lo));
3087 RegsToPass.push_back(std::make_pair(LocRegHigh, Hi));
3096 UseUpperBits =
true;
3102 UseUpperBits =
true;
3108 UseUpperBits =
true;
3116 unsigned ValSizeInBits = Outs[i].ArgVT.getSizeInBits();
3126 RegsToPass.push_back(std::make_pair(VA.
getLocReg(), Arg));
3136 Chain, Arg,
DL, IsTailCall, DAG));
3141 if (!MemOpChains.
empty())
3150 bool GlobalOrExternal =
false, IsCallReloc =
false;
3158 if (
auto *N = dyn_cast<GlobalAddressSDNode>(Callee))
3161 else if (
auto *N = dyn_cast<ExternalSymbolSDNode>(Callee))
3171 if (InternalLinkage)
3187 GlobalOrExternal =
true;
3190 const char *Sym = S->getSymbol();
3206 GlobalOrExternal =
true;
3212 getOpndList(Ops, RegsToPass, IsPIC, GlobalOrExternal, InternalLinkage,
3213 IsCallReloc, CLI, Callee, Chain);
3230 return LowerCallResult(Chain, InFlag, CallConv, IsVarArg, Ins, DL, DAG,
3236 SDValue MipsTargetLowering::LowerCallResult(
3247 dyn_cast_or_null<const ExternalSymbolSDNode>(CLI.
Callee.
getNode());
3248 CCInfo.AnalyzeCallResult(Ins, RetCC_Mips, CLI.
RetTy,
3249 ES ? ES->getSymbol() :
nullptr);
3252 for (
unsigned i = 0; i != RVLocs.
size(); ++i) {
3257 RVLocs[i].getLocVT(), InFlag);
3262 unsigned ValSizeInBits = Ins[i].ArgVT.getSizeInBits();
3363 SDValue MipsTargetLowering::LowerFormalArguments(
3374 std::vector<SDValue> OutChains;
3386 "Functions with the interrupt attribute cannot have arguments!");
3388 CCInfo.AnalyzeFormalArguments(Ins, CC_Mips_FixedArg);
3390 CCInfo.getInRegsParamsCount() > 0);
3392 unsigned CurArgIdx = 0;
3393 CCInfo.rewindByValRegsInfo();
3395 for (
unsigned i = 0, e = ArgLocs.
size(); i != e; ++i) {
3397 if (Ins[i].isOrigArg()) {
3398 std::advance(FuncArg, Ins[i].getOrigArgIndex() - CurArgIdx);
3399 CurArgIdx = Ins[i].getOrigArgIndex();
3406 assert(Ins[i].isOrigArg() &&
"Byval arguments cannot be implicit");
3407 unsigned FirstByValReg, LastByValReg;
3408 unsigned ByValIdx = CCInfo.getInRegsParamsProcessed();
3409 CCInfo.getInRegsParamInfo(ByValIdx, FirstByValReg, LastByValReg);
3412 "ByVal args of size 0 should have been ignored by front-end.");
3413 assert(ByValIdx < CCInfo.getInRegsParamsCount());
3414 copyByValRegs(Chain, DL, OutChains, DAG, Flags, InVals, &*FuncArg,
3415 FirstByValReg, LastByValReg, VA, CCInfo);
3416 CCInfo.nextInRegsParam();
3447 ArgValue, ArgValue2);
3473 LocVT, DL, Chain, FIN,
3475 OutChains.push_back(ArgValue.
getValue(1));
3483 for (
unsigned i = 0, e = ArgLocs.
size(); i != e; ++i) {
3487 if (Ins[i].Flags.
isSRet()) {
3501 writeVarArgRegs(OutChains, Chain, DL, DAG, CCInfo);
3505 if (!OutChains.empty()) {
3506 OutChains.push_back(Chain);
3523 MipsCCState CCInfo(CallConv, IsVarArg, MF, RVLocs, Context);
3524 return CCInfo.CheckReturn(Outs, RetCC_Mips);
3528 MipsTargetLowering::shouldSignExtendTypeInLibCall(
EVT Type,
bool IsSigned)
const {
3570 for (
unsigned i = 0; i != RVLocs.
size(); ++i) {
3574 bool UseUpperBits =
false;
3585 UseUpperBits =
true;
3591 UseUpperBits =
true;
3597 UseUpperBits =
true;
3605 unsigned ValSizeInBits = Outs[i].ArgVT.getSizeInBits();
3631 unsigned V0 =
ABI.
IsN64() ? Mips::V0_64 : Mips::V0;
3646 return LowerInterruptReturn(RetOps, DL, DAG);
3659 MipsTargetLowering::getConstraintType(
StringRef Constraint)
const {
3671 if (Constraint.
size() == 1) {
3672 switch (Constraint[0]) {
3686 if (Constraint ==
"ZC")
3696 MipsTargetLowering::getSingleConstraintMatchWeight(
3697 AsmOperandInfo &
info,
const char *constraint)
const {
3699 Value *CallOperandVal = info.CallOperandVal;
3702 if (!CallOperandVal)
3704 Type *type = CallOperandVal->
getType();
3706 switch (*constraint) {
3735 if (isa<ConstantInt>(CallOperandVal))
3750 unsigned long long &Reg) {
3751 if (C.
front() !=
'{' || C.
back() !=
'}')
3752 return std::make_pair(
false,
false);
3762 return std::make_pair(
true,
false);
3769 std::pair<unsigned, const TargetRegisterClass *> MipsTargetLowering::
3775 unsigned long long Reg;
3780 return std::make_pair(0U,
nullptr);
3782 if ((Prefix ==
"hi" || Prefix ==
"lo")) {
3785 return std::make_pair(0U,
nullptr);
3788 Mips::HI32RegClassID : Mips::LO32RegClassID);
3789 return std::make_pair(*(RC->
begin()), RC);
3795 return std::make_pair(0U,
nullptr);
3798 .Case(
"$msair", Mips::MSAIR)
3799 .
Case(
"$msacsr", Mips::MSACSR)
3800 .
Case(
"$msaaccess", Mips::MSAAccess)
3801 .
Case(
"$msasave", Mips::MSASave)
3802 .
Case(
"$msamodify", Mips::MSAModify)
3803 .
Case(
"$msarequest", Mips::MSARequest)
3804 .
Case(
"$msamap", Mips::MSAMap)
3805 .
Case(
"$msaunmap", Mips::MSAUnmap)
3809 return std::make_pair(0U,
nullptr);
3812 return std::make_pair(Reg, RC);
3816 return std::make_pair(0U,
nullptr);
3818 if (Prefix ==
"$f") {
3826 if (RC == &Mips::AFGR64RegClass) {
3830 }
else if (Prefix ==
"$fcc")
3832 else if (Prefix ==
"$w") {
3839 assert(Reg < RC->getNumRegs());
3840 return std::make_pair(*(RC->
begin() +
Reg), RC);
3846 std::pair<unsigned, const TargetRegisterClass *>
3850 if (Constraint.
size() == 1) {
3851 switch (Constraint[0]) {
3857 return std::make_pair(0U, &Mips::CPU16RegsRegClass);
3858 return std::make_pair(0U, &Mips::GPR32RegClass);
3861 return std::make_pair(0U, &Mips::GPR32RegClass);
3863 return std::make_pair(0U, &Mips::GPR64RegClass);
3865 return std::make_pair(0U,
nullptr);
3868 return std::make_pair(0U, &Mips::MSA128BRegClass);
3870 return std::make_pair(0U, &Mips::MSA128HRegClass);
3872 return std::make_pair(0U, &Mips::MSA128WRegClass);
3874 return std::make_pair(0U, &Mips::MSA128DRegClass);
3876 return std::make_pair(0U, &Mips::FGR32RegClass);
3879 return std::make_pair(0U, &Mips::FGR64RegClass);
3880 return std::make_pair(0U, &Mips::AFGR64RegClass);
3885 return std::make_pair((
unsigned)Mips::T9, &Mips::GPR32RegClass);
3887 return std::make_pair((
unsigned)Mips::T9_64, &Mips::GPR64RegClass);
3890 return std::make_pair((
unsigned)Mips::LO0, &Mips::LO32RegClass);
3891 return std::make_pair((
unsigned)Mips::LO0_64, &Mips::LO64RegClass);
3895 return std::make_pair(0U,
nullptr);
3899 std::pair<unsigned, const TargetRegisterClass *> R;
3900 R = parseRegForInlineAsmConstraint(Constraint, VT);
3910 void MipsTargetLowering::LowerAsmOperandForConstraint(
SDValue Op,
3911 std::string &Constraint,
3912 std::vector<SDValue>&Ops,
3918 if (Constraint.length() > 1)
return;
3920 char ConstraintLetter = Constraint[0];
3921 switch (ConstraintLetter) {
3927 int64_t Val = C->getSExtValue();
3937 int64_t Val = C->getZExtValue();
3947 uint64_t Val = (uint64_t)C->getZExtValue();
3957 int64_t Val = C->getSExtValue();
3958 if ((
isInt<32>(Val)) && ((Val & 0xffff) == 0)){
3967 int64_t Val = C->getSExtValue();
3968 if ((Val >= -65535) && (Val <= -1)) {
3977 int64_t Val = C->getSExtValue();
3978 if ((isInt<15>(Val))) {
3987 int64_t Val = C->getSExtValue();
3988 if ((Val <= 65535) && (Val >= 1)) {
3997 Ops.push_back(Result);
4004 bool MipsTargetLowering::isLegalAddressingMode(
const DataLayout &DL,
4006 unsigned AS)
const {
4031 EVT MipsTargetLowering::getOptimalMemOpType(uint64_t Size,
unsigned DstAlign,
4033 bool IsMemset,
bool ZeroMemset,
4042 bool MipsTargetLowering::isFPImmLegal(
const APFloat &Imm,
EVT VT)
const {
4050 unsigned MipsTargetLowering::getJumpTableEncoding()
const {
4059 bool MipsTargetLowering::useSoftFloat()
const {
4063 void MipsTargetLowering::copyByValRegs(
4064 SDValue Chain,
const SDLoc &DL, std::vector<SDValue> &OutChains,
4067 unsigned FirstReg,
unsigned LastReg,
const CCValAssign &VA,
4072 unsigned NumRegs = LastReg - FirstReg;
4073 unsigned RegAreaSize = NumRegs * GPRSizeInBytes;
4081 (
int)((ByValArgRegs.
size() - FirstReg) * GPRSizeInBytes);
4098 for (
unsigned I = 0;
I < NumRegs; ++
I) {
4099 unsigned ArgReg = ByValArgRegs[FirstReg +
I];
4100 unsigned VReg =
addLiveIn(MF, ArgReg, RC);
4101 unsigned Offset =
I * GPRSizeInBytes;
4106 OutChains.push_back(Store);
4111 void MipsTargetLowering::passByValArg(
4113 std::deque<std::pair<unsigned, SDValue>> &RegsToPass,
4119 unsigned OffsetInBytes = 0;
4124 unsigned NumRegs = LastReg - FirstReg;
4128 bool LeftoverBytes = (NumRegs * RegSizeInBytes > ByValSizeInBytes);
4132 for (; I < NumRegs - LeftoverBytes; ++
I, OffsetInBytes += RegSizeInBytes) {
4138 unsigned ArgReg = ArgRegs[FirstReg +
I];
4139 RegsToPass.push_back(std::make_pair(ArgReg, LoadVal));
4143 if (ByValSizeInBytes == OffsetInBytes)
4147 if (LeftoverBytes) {
4150 for (
unsigned LoadSizeInBytes = RegSizeInBytes / 2, TotalBytesLoaded = 0;
4151 OffsetInBytes < ByValSizeInBytes; LoadSizeInBytes /= 2) {
4152 unsigned RemainingSizeInBytes = ByValSizeInBytes - OffsetInBytes;
4154 if (RemainingSizeInBytes < LoadSizeInBytes)
4170 Shamt = TotalBytesLoaded * 8;
4172 Shamt = (RegSizeInBytes - (TotalBytesLoaded + LoadSizeInBytes)) * 8;
4182 OffsetInBytes += LoadSizeInBytes;
4183 TotalBytesLoaded += LoadSizeInBytes;
4184 Alignment =
std::min(Alignment, LoadSizeInBytes);
4187 unsigned ArgReg = ArgRegs[FirstReg +
I];
4188 RegsToPass.push_back(std::make_pair(ArgReg, Val));
4194 unsigned MemCpySize = ByValSizeInBytes - OffsetInBytes;
4199 Chain = DAG.
getMemcpy(Chain, DL, Dst, Src,
4201 Alignment,
false,
false,
4207 void MipsTargetLowering::writeVarArgRegs(std::vector<SDValue> &OutChains,
4223 if (ArgRegs.
size() == Idx)
4228 (
int)(RegSizeInBytes * (ArgRegs.
size() - Idx));
4240 for (
unsigned I = Idx; I < ArgRegs.
size();
4241 ++
I, VaArgOffset += RegSizeInBytes) {
4242 unsigned Reg =
addLiveIn(MF, ArgRegs[I], RC);
4248 cast<StoreSDNode>(Store.
getNode())->getMemOperand()->setValue(
4250 OutChains.push_back(Store);
4255 unsigned Align)
const {
4258 assert(Size &&
"Byval argument's size shouldn't be 0.");
4262 unsigned FirstReg = 0;
4263 unsigned NumRegs = 0;
4274 assert(!(Align % RegSizeInBytes) &&
4275 "Byval argument's alignment should be a multiple of"
4284 if ((Align > RegSizeInBytes) && (FirstReg % 2)) {
4285 State->
AllocateReg(IntArgRegs[FirstReg], ShadowRegs[FirstReg]);
4290 Size =
alignTo(Size, RegSizeInBytes);
4291 for (
unsigned I = FirstReg; Size > 0 && (I < IntArgRegs.
size());
4292 Size -= RegSizeInBytes, ++
I, ++NumRegs)
4302 unsigned Opc)
const {
4304 "Subtarget already supports SELECT nodes with the use of"
4305 "conditional-move instructions.");
4385 .Case(
"$28", Mips::GP_64)
4391 .Case(
"$28", Mips::GP)
MVT getSimpleValueType() const
Return the simple ValueType of the referenced return value.
SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Helper function to build ISD::STORE nodes.
const MipsTargetLowering * createMipsSETargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI)
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type.
void setFrameAddressIsTaken(bool T)
unsigned getStackAlignment() const
getStackAlignment - This method returns the number of bytes to which the stack pointer must be aligne...
static SDValue lowerFCOPYSIGN32(SDValue Op, SelectionDAG &DAG, bool HasExtractInsert)
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
static MVT getIntegerVT(unsigned BitWidth)
void push_back(const T &Elt)
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
A parsed version of the target data layout string in and methods for querying it. ...
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo)
SDValue getValue(unsigned R) const
bool ArePtrs64bit() const
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...
const char * getSymbol() const
virtual ConstraintType getConstraintType(StringRef Constraint) const
Given a constraint, return the type of constraint it is for this target.
static const MCPhysReg IntRegs[32]
EXTRACT_ELEMENT - This is used to get the lower or upper (determined by a Constant, which is required to be operand #1) half of the integer or float value specified as operand #0.
Flags getFlags() const
Return the raw flags of the source value,.
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
unsigned GetCalleeAllocdArgSizeInBytes(CallingConv::ID CC) const
Obtain the size of the area allocated by the callee for arguments.
LLVMContext * getContext() const
This class represents an incoming formal argument to a Function.
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond)
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
SDValue getCALLSEQ_END(SDValue Chain, SDValue Op1, SDValue Op2, SDValue InGlue, const SDLoc &DL)
Return a new CALLSEQ_END node, which always must have a glue result (to ensure it's not CSE'd)...
const MipsSubtarget & Subtarget
virtual MVT getRegisterTypeForCallingConv(MVT VT) const override
Return the register type for a given MVT, ensuring vectors are treated as a series of gpr sized integ...
STATISTIC(NumFunctions,"Total number of functions")
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
BR_CC - Conditional branch.
bool WasOriginalArgVectorFloat(unsigned ValNo) const
LocInfo getLocInfo() const
unsigned getNumRegisters(LLVMContext &Context, EVT VT) const
Return the number of registers that this ValueType will eventually require.
static SDValue lowerUnalignedIntStore(StoreSDNode *SD, SelectionDAG &DAG, bool IsLittle)
MO_TLSLDM - Represents the offset into the global offset table at which.
static MVT getVectorVT(MVT VT, unsigned NumElements)
SDValue getAddrNonPIC(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG) const
const MipsTargetLowering * createMips16TargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI)
Create MipsTargetLowering objects.
unsigned EnableFastISel
EnableFastISel - This flag enables fast-path instruction selection which trades away generated code q...
bool hasOneUse() const
Return true if there is exactly one node using value ResNo of Node.
const TargetMachine & getTargetMachine() const
static SDValue performADDCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
unsigned createVirtualRegister(const TargetRegisterClass *RegClass)
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
void addLiveIn(unsigned Reg, unsigned vreg=0)
addLiveIn - Add the specified register as a live-in.
static SDValue performSELECTCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
MO_GOT_HI16/LO16, MO_CALL_HI16/LO16 - Relocations used for large GOTs.
Carry-setting nodes for multiple precision addition and subtraction.
const TargetMachine & getTarget() const
static SDValue performCMovFPCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
MO_TLSGD - Represents the offset into the global offset table at which.
unsigned addLiveIn(unsigned PReg, const TargetRegisterClass *RC)
addLiveIn - Add the specified physical register as a live-in value and create a corresponding virtual...
bool getAsUnsignedInteger(StringRef Str, unsigned Radix, unsigned long long &Result)
Helper functions for StringRef::getAsInteger.
MipsTargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI)
void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB)
Transfers all the successors, as in transferSuccessors, and update PHI operands in the successor bloc...
STACKRESTORE has two operands, an input chain and a pointer to restore to it returns an output chain...
const GlobalValue * getGlobal() const
CallingConv::ID getCallingConv() const
const MipsInstrInfo * getInstrInfo() const override
static SDValue lowerFCOPYSIGN64(SDValue Op, SelectionDAG &DAG, bool HasExtractInsert)
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
bool verifyReturnAddressArgumentIsConstant(SDValue Op, SelectionDAG &DAG) const
Function Alias Analysis Results
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
unsigned getSizeInBits() const
unsigned getByValSize() const
void setBooleanVectorContents(BooleanContent Ty)
Specify how the target extends the result of a vector boolean value from a vector of i1 to a wider ty...
unsigned getValueSizeInBits() const
Returns the size of the value in bits.
constexpr bool isInt< 16 >(int64_t x)
const SDValue & getOperand(unsigned Num) const
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const override
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
SDValue getAddrLocal(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, bool IsN32OrN64) const
uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
void setVarArgsFrameIndex(int Index)
SDValue getTargetExternalSymbol(const char *Sym, EVT VT, unsigned char TargetFlags=0)
bool isMustTailCall() const
Tests if this call site must be tail call optimized.
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
LLVM_NODISCARD char back() const
back - Get the last character in the string.
void ReplaceNodeResults(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG) const override
ReplaceNodeResults - Replace the results of node with an illegal result type with new values built ou...
const SDValue & getBasePtr() const
OUTCHAIN = ATOMIC_FENCE(INCHAIN, ordering, scope) This corresponds to the fence instruction.
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const override
getSetCCResultType - get the ISD::SETCC result ValueType
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
bool bitsLT(EVT VT) const
Return true if this has less bits than VT.
void LowerOperationWrapper(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG) const override
This callback is invoked by the type legalizer to legalize nodes with an illegal operand type but leg...
SDValue getExternalSymbol(const char *Sym, EVT VT)
void setTruncStoreAction(MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified truncating store does not work with the specified type and indicate what ...
bool useLongCalls() const
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
static bool isShiftedMask(uint64_t I, uint64_t &Pos, uint64_t &Size)
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations...
bool isVector() const
Return true if this is a vector value type.
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
MachinePointerInfo callPtrInfo(const char *ES)
Create a MachinePointerInfo that has an ExternalSymbolPseudoSourceValue object representing a GOT ent...
const MipsABIInfo & getABI() const
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
static SDValue performAssertZextCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
static SDValue performORCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
static SDValue performANDCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
const HexagonInstrInfo * TII
static SDValue lowerFP_TO_SINT_STORE(StoreSDNode *SD, SelectionDAG &DAG)
unsigned getGPRSizeInBytes() const
Shift and rotation operations.
bool systemSupportsUnalignedAccess() const
Does the system support unaligned memory access.
static unsigned addLiveIn(MachineFunction &MF, unsigned PReg, const TargetRegisterClass *RC)
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
const TargetRegisterClass * getRegClass(unsigned i) const
Returns the register class associated with the enumeration value.
unsigned getSRetReturnReg() const
bool hasInternalLinkage() const
MachineFunction & getMachineFunction() const
BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
virtual TargetLoweringObjectFile * getObjFileLowering() const
void addLoc(const CCValAssign &V)
LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(const T &Value) const
SDValue getGlobalReg(SelectionDAG &DAG, EVT Ty) const
iterator begin() const
begin/end - Return all of the registers in this class.
Reg
All possible values of the reg field in the ModR/M byte.
EH_DWARF_CFA - This node represents the pointer to the DWARF Canonical Frame Address (CFA)...
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
const GlobalObject * getBaseObject() 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...
static std::pair< bool, bool > parsePhysicalReg(StringRef C, StringRef &Prefix, unsigned long long &Reg)
This is a helper function to parse a physical register string and split it into non-numeric and numer...
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
bool isPositionIndependent() const
bool hasExtractInsert() const
Features related to the presence of specific instructions.
FRAMEADDR, RETURNADDR - These nodes represent llvm.frameaddress and llvm.returnaddress on the DAG...
bool isUpperBitsInLoc() const
bool inMips16HardFloat() const
static Mips::CondCode condCodeToFCC(ISD::CondCode CC)
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
bool isInteger() const
Return true if this is an integer or a vector integer type.
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
SDValue getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
LLVM_NODISCARD bool empty() const
SmallVector< ISD::InputArg, 32 > Ins
STACKSAVE - STACKSAVE has one operand, an input chain.
SDValue getMergeValues(ArrayRef< SDValue > Ops, const SDLoc &dl)
Create a MERGE_VALUES node from the given operands.
ArrayRef< MCPhysReg > GetVarArgRegs() const
The registers to use for the variable argument list.
MachineFunction & getMachineFunction() const
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(const char(&S)[N], const T &Value)
unsigned getLocReg() const
This is a fast-path instruction selection class that generates poor code and doesn't support illegal ...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
std::pair< SDValue, SDValue > LowerCallTo(CallLoweringInfo &CLI) const
This function lowers an abstract call to a function into an actual call.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
static const MCPhysReg Mips64DPRegs[8]
SDValue getRegisterMask(const uint32_t *RegMask)
bool hasStructRetAttr() const
Determine if the function returns a structure through first or second pointer argument.
static bool invertFPCondCodeUser(Mips::CondCode CC)
This function returns true if the floating point conditional branches and conditional moves which use...
SDValue getAddrGPRel(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG) const
Simple integer binary arithmetic operators.
void addInRegsParamInfo(unsigned RegBegin, unsigned RegEnd)
SmallVector< ISD::OutputArg, 32 > Outs
static SpecialCallingConvType getSpecialCallingConvForCallee(const SDNode *Callee, const MipsSubtarget &Subtarget)
Determine the SpecialCallingConvType for the given callee.
unsigned getRegisterByName(const char *RegName, EVT VT, SelectionDAG &DAG) const override
Return the register ID of the name passed in.
const SDValue & getBasePtr() const
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
ArrayRef< MCPhysReg > GetByValArgRegs() const
The registers to use for byval arguments.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
EVT getMemoryVT() const
Return the type of the in-memory value.
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
LLVM_NODISCARD char front() const
front - Get the first character in the string.
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
size_t size() const
size - Get the array size.
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *bb=nullptr)
CreateMachineBasicBlock - Allocate a new MachineBasicBlock.
const DataLayout & getDataLayout() const
unsigned getKillRegState(bool B)
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
This class is used to represent ISD::STORE nodes.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
static unsigned getNextIntArgReg(unsigned Reg)
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
const TargetFrameLowering * getFrameLowering() const override
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
static CCValAssign getReg(unsigned ValNo, MVT ValVT, unsigned RegNo, MVT LocVT, LocInfo HTP)
Flag
These should be considered private to the implementation of the MCInstrDesc class.
TargetInstrInfo - Interface to description of machine instruction set.
SDNode * getNode() const
get the SDNode which holds the desired result
The memory access is volatile.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
A switch()-like statement whose cases are string literals.
EK_GPRel64BlockAddress - Each entry is an address of block, encoded with a relocation as gp-relative...
unsigned getFirstUnallocated(ArrayRef< MCPhysReg > Regs) const
getFirstUnallocated - Return the index of the first unallocated register in the set, or Regs.size() if they are all allocated.
initializer< Ty > init(const Ty &Val)
static mvt_range fp_vector_valuetypes()
static bool CC_MipsO32_FP64(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
MO_GOT_CALL - Represents the offset into the global offset table at which the address of a call site ...
static SDValue createCMovFP(SelectionDAG &DAG, SDValue Cond, SDValue True, SDValue False, const SDLoc &DL)
std::size_t countTrailingZeros(T Val, ZeroBehavior ZB=ZB_Width)
Count number of 0's from the least significant bit to the most stopping at the first 1...
LLVM Basic Block Representation.
const SDValue & getOperand(unsigned i) const
bool IsConstantInSmallSection(const DataLayout &DL, const Constant *CN, const TargetMachine &TM) const
Return true if this constant should be placed into small data section.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
void setTargetDAGCombine(ISD::NodeType NT)
Targets should invoke this method for each target independent node that they want to provide a custom...
bool isVectorTy() const
True if this is an instance of VectorType.
SDValue getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef< SDValue > Ops, EVT MemVT, MachinePointerInfo PtrInfo, unsigned Align=0, bool Vol=false, bool ReadMem=true, bool WriteMem=true, unsigned Size=0)
Creates a MemIntrinsicNode that may produce a result and takes a list of operands.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
VAEND, VASTART - VAEND and VASTART have three operands: an input chain, pointer, and a SRCVALUE...
bool isVector() const
Return true if this is a vector value type.
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
const Constant * getConstVal() const
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
const MachineOperand & getOperand(unsigned i) const
bool isBeforeLegalizeOps() const
Carry-using nodes for multiple precision addition and subtraction.
static SDValue createStoreLR(unsigned Opc, SelectionDAG &DAG, StoreSDNode *SD, SDValue Chain, unsigned Offset)
bool isFloatTy() const
Return true if this is 'float', a 32-bit IEEE fp type.
static ManagedStatic< OptionRegistry > OR
SDValue getCALLSEQ_START(SDValue Chain, uint64_t InSize, uint64_t OutSize, const SDLoc &DL)
Return a new CALLSEQ_START node, that starts new call frame, in which InSize bytes are set up inside ...
void setBooleanContents(BooleanContent Ty)
Specify how the target extends the result of integer and floating point boolean values from i1 to a w...
void HandleByVal(CCState *, unsigned &, unsigned) const override
Target-specific cleanup for formal ByVal parameters.
static mvt_range fp_valuetypes()
virtual unsigned getVectorTypeBreakdownForCallingConv(LLVMContext &Context, EVT VT, EVT &IntermediateVT, unsigned &NumIntermediates, MVT &RegisterVT) const override
Break down vectors to the correct number of gpr sized integers.
virtual std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const
Given a physical register constraint (e.g.
#define LLVM_ATTRIBUTE_UNUSED
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
static EVT getFloatingPointVT(unsigned BitWidth)
Returns the EVT that represents a floating-point type with the given number of bits.
bool isPositionIndependent() const
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
unsigned getOpcode() const
TRAP - Trapping instruction.
MVT getRegisterType(MVT VT) const
Return the type of registers that this ValueType will eventually require.
AssertSext, AssertZext - These nodes record if a register contains a value that has already been zero...
self_iterator getIterator()
Class to represent integer types.
uint64_t getConstantOperandVal(unsigned Num) const
Helper method returns the integer value of a ConstantSDNode operand.
bool useSoftFloat() const
int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool Immutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
VAARG - VAARG has four operands: an input chain, a pointer, a SRCVALUE, and the alignment.
static const MipsTargetLowering * create(const MipsTargetMachine &TM, const MipsSubtarget &STI)
bool isCheapToSpeculateCttz() const override
Return true if it is cheap to speculate a call to intrinsic cttz.
bool inMicroMipsMode() const
const SDValue & getValue() const
void AddPromotedToType(unsigned Opc, MVT OrigVT, MVT DestVT)
If Opc/OrigVT is specified as being promoted, the promotion code defaults to trying a larger integer/...
bool inMips16Mode() const
std::vector< ArgListEntry > ArgListTy
unsigned getNextStackOffset() const
getNextStackOffset - Return the next stack offset such that all stack slots satisfy their alignment r...
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This structure contains all information that is necessary for lowering calls.
This class contains a discriminated union of information about pointers in memory operands...
MO_GOTTPREL - Represents the offset from the thread pointer (Initial.
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
const BlockAddress * getBlockAddress() const
SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, 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...
const MachinePointerInfo & getPointerInfo() const
void setIsKill(bool Val=true)
unsigned getByValAlign() const
static SDValue createLoadLR(unsigned Opc, SelectionDAG &DAG, LoadSDNode *LD, SDValue Chain, SDValue Src, unsigned Offset)
SDValue getTargetConstantPool(const Constant *C, EVT VT, unsigned Align=0, int Offset=0, unsigned char TargetFlags=0)
virtual unsigned getNumRegistersForCallingConv(LLVMContext &Context, EVT VT) const override
Return the number of registers for a given MVT, ensuring vectors are treated as a series of gpr sized...
SDValue getTargetJumpTable(int JTI, EVT VT, unsigned char TargetFlags=0)
TokenFactor - This node takes multiple tokens as input and produces a single token result...
MO_GOT - Represents the offset into the global offset table at which the address the relocation entry...
static SDValue performSUBCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
Iterator for intrusive lists based on ilist_node.
CCState - This class holds information needed while lowering arguments and return values...
unsigned GetNullPtr() const
unsigned countPopulation(T Value)
Count the number of set bits in a value.
virtual unsigned getJumpTableEncoding() const
Return the entry encoding for a jump table in the current function.
void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
constexpr bool isInt< 32 >(int64_t x)
SDValue getAddrGlobalLargeGOT(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, unsigned HiFlag, unsigned LoFlag, SDValue Chain, const MachinePointerInfo &PtrInfo) const
unsigned getGlobalBaseReg()
const MipsRegisterInfo * getRegisterInfo() const override
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
SDValue lowerSTORE(SDValue Op, SelectionDAG &DAG) const
MachineOperand class - Representation of each machine instruction operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Type * getType() const
All values are typed, get the type of this value.
Provides information about what library functions are available for the current target.
static bool CC_MipsO32(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State, ArrayRef< MCPhysReg > F64Regs)
SDValue getAddrGlobal(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, unsigned Flag, SDValue Chain, const MachinePointerInfo &PtrInfo) const
CCValAssign - Represent assignment of one arg/retval to a location.
SDValue getMemcpy(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, bool AlwaysInline, bool isTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
static MachineBasicBlock * insertDivByZeroTrap(MachineInstr &MI, MachineBasicBlock &MBB, const TargetInstrInfo &TII, bool Is64Bit, bool IsMicroMips)
BRCOND - Conditional branch.
Information about stack frame layout on the target.
static cl::opt< bool > NoZeroDivCheck("mno-check-zero-division", cl::Hidden, cl::desc("MIPS: Don't trap on integer division by zero."), cl::init(false))
const SDValue & getChain() const
Byte Swap and Counting operators.
FP16_TO_FP, FP_TO_FP16 - These operators are used to perform promotions and truncation for half-preci...
CHAIN = SC CHAIN, Imm128 - System call.
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
static IntegerType * getIntNTy(LLVMContext &C, unsigned N)
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
CondCode getSetCCInverse(CondCode Operation, bool isInteger)
Return the operation corresponding to !(X op Y), where 'op' is a valid SetCC operation.
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
LowerOperation - Provide custom lowering hooks for some operations.
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N)
static mvt_range integer_valuetypes()
C - The default llvm calling convention, compatible with C.
static bool CC_Mips(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State) LLVM_ATTRIBUTE_UNUSED
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo) const override
createFastISel - This method returns a target specific FastISel object, or null if the target does no...
virtual const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const
Return a mask of call-preserved registers for the given calling convention on the current function...
Select(COND, TRUEVAL, FALSEVAL).
void setMinFunctionAlignment(unsigned Align)
Set the target's minimum function alignment (in log2(bytes))
int64_t getSExtValue() const
bool isIntegerTy() const
True if this is an instance of IntegerType.
static SDValue performSHLCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
unsigned EmulatedTLS
EmulatedTLS - This flag enables emulated TLS model, using emutls function in the runtime library...
virtual const TargetRegisterClass * getRegClassFor(MVT VT) const
Return the register class that should be used for the specified value type.
ZERO_EXTEND - Used for integer types, zeroing the new bits.
AddrMode
ARM Addressing Modes.
ANY_EXTEND - Used for integer types. The high bits are undefined.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
static SDValue performDivRemCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
static SDValue createFPCmp(SelectionDAG &DAG, const SDValue &Op)
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
llvm_unreachable("Unknown RegBank!")
MO_TPREL_HI/LO - Represents the hi and low part of the offset from.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
BR_JT - Jumptable branch.
static std::vector< std::string > Flags
Representation of each machine instruction.
VACOPY - VACOPY has 5 operands: an input chain, a destination pointer, a source pointer, a SRCVALUE for the destination, and a SRCVALUE for the source.
void AnalyzeReturn(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
static const uint32_t * getMips16RetHelperMask()
SDValue getTargetBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset=0, unsigned char TargetFlags=0)
SmallVector< SDValue, 32 > OutVals
constexpr bool isShiftedMask_64(uint64_t Value)
Return true if the argument contains a non-empty sequence of ones with the remainder zero (64 bit ver...
bool isValid() const
Return true if this is a valid simple valuetype.
void setFormalArgInfo(unsigned Size, bool HasByval)
Bitwise operators - logical and, logical or, logical xor.
SDValue lowerLOAD(SDValue Op, SelectionDAG &DAG) const
bool hasAnyUseOfValue(unsigned Value) const
Return true if there are any use of the indicated value.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
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 '...
unsigned GetPtrAndOp() const
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT)
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
static cl::opt< bool > LargeGOT("mxgot", cl::Hidden, cl::desc("MIPS: Enable GOT larger than 64k."), cl::init(false))
virtual void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint, std::vector< SDValue > &Ops, SelectionDAG &DAG) const
Lower the specified operand into the Ops vector.
SDValue getAddrNonPICSym64(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG) const
bool isSingleFloat() const
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
unsigned getSizeInBits() const
Return the size of the specified value type in bits.
bool isCheapToSpeculateCtlz() const override
Return true if it is cheap to speculate a call to intrinsic ctlz.
void setReg(unsigned Reg)
Change the register this operand corresponds to.
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
void setSubReg(unsigned subReg)
void setStackPointerRegisterToSaveRestore(unsigned R)
If set to a physical register, this specifies the register that llvm.savestack/llvm.restorestack should save and restore.
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
MipsFunctionInfo - This class is derived from MachineFunction private Mips target-specific informatio...
Fast - This calling convention attempts to make calls as fast as possible (e.g.
void setLibcallName(RTLIB::Libcall Call, const char *Name)
Rename the default libcall routine name for the specified libcall.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
virtual void getOpndList(SmallVectorImpl< SDValue > &Ops, std::deque< std::pair< unsigned, SDValue > > &RegsToPass, bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage, 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...
static CCValAssign getMem(unsigned ValNo, MVT ValVT, unsigned Offset, MVT LocVT, LocInfo HTP)
FSINCOS - Compute both fsin and fcos as a single operation.
static SDValue performMADD_MSUBCombine(SDNode *ROOTNode, SelectionDAG &CurDAG, const MipsSubtarget &Subtarget)
unsigned MaxStoresPerMemcpy
Specify maximum bytes of store instructions per memcpy call.
constexpr bool isUInt< 16 >(uint64_t x)
static SDValue UnpackFromArgumentSlot(SDValue Val, const CCValAssign &VA, EVT ArgVT, const SDLoc &DL, SelectionDAG &DAG)
EVT getValueType() const
Return the ValueType of the referenced return value.
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
OUTCHAIN = EH_RETURN(INCHAIN, OFFSET, HANDLER) - This node represents 'eh_return' gcc dwarf builtin...
int getVarArgsFrameIndex() const
TLSModel::Model getTLSModel(const GlobalValue *GV) const
Returns the TLS model which should be used for the given global variable.
unsigned getReg() const
getReg - Returns the register number.
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void insert(iterator MBBI, MachineBasicBlock *MBB)
SDValue getFrameIndex(int FI, EVT VT, bool isTarget=false)
void setReturnAddressIsTaken(bool s)
unsigned getAlignment() const
void setMinStackArgumentAlignment(unsigned Align)
Set the minimum stack alignment of an argument (in log2(bytes)).
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...
static MachinePointerInfo getGOT(MachineFunction &MF)
Return a MachinePointerInfo record that refers to a GOT entry.
LLVM Value Representation.
FMA - Perform a * b + c with no intermediate rounding step.
SDValue getRegister(unsigned Reg, EVT VT)
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned char TargetFlags=0) const
bool isTruncatingStore() const
Return true if the op does a truncation before store.
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
SDValue getValueType(EVT)
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
void ReplaceAllUsesOfValueWith(SDValue From, SDValue To)
Replace any uses of From with To, leaving uses of other values produced by From.Val alone...
StringRef - Represent a constant reference to a string, i.e.
SetCC operator - This evaluates to a true value iff the condition is true.
virtual SDValue LowerToTLSEmulatedModel(const GlobalAddressSDNode *GA, SelectionDAG &DAG) const
Lower TLS global address SDNode for target independent emulated TLS model.
unsigned getOrigAlign() const
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
unsigned getMinStackArgumentAlignment() const
Return the minimum stack alignment of an argument.
unsigned getLocMemOffset() const
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
OUTCHAIN = ATOMIC_STORE(INCHAIN, ptr, val) This corresponds to "store atomic" instruction.
TRUNCATE - Completely drop the high bits.
const char * getTargetNodeName(unsigned Opcode) const override
getTargetNodeName - This method returns the name of a target specific
auto find_if(R &&Range, UnaryPredicate P) -> decltype(std::begin(Range))
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly...
unsigned getAlignment() const
unsigned AllocateReg(unsigned Reg)
AllocateReg - Attempt to allocate one register.
unsigned GetPtrAddiuOp() const
virtual ConstraintWeight getSingleConstraintMatchWeight(AsmOperandInfo &info, const char *constraint) const
Examine constraint string and operand type and determine a weight value.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
unsigned AllocateStack(unsigned Size, unsigned Align)
AllocateStack - Allocate a chunk of stack space with the specified size and alignment.
static bool CC_MipsO32_FP32(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
Val, OUTCHAIN = ATOMIC_LOAD(INCHAIN, ptr) This corresponds to "load atomic" instruction.
EVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
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...
void setSRetReturnReg(unsigned Reg)
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned char TargetFlags=0)
uint64_t getZExtValue() const
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
This class is used to represent ISD::LOAD nodes.
DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned to a specified boundary...