82 #define DEBUG_TYPE "mips-lower" 84 STATISTIC(NumTailCalls,
"Number of tail calls");
92 cl::desc(
"MIPS: Don't trap on integer division by zero."),
98 Mips::D12_64, Mips::D13_64, Mips::D14_64, Mips::D15_64,
99 Mips::D16_64, Mips::D17_64, Mips::D18_64, Mips::D19_64
140 unsigned &NumIntermediates,
MVT &RegisterVT)
const {
143 IntermediateVT = RegisterVT;
148 return NumIntermediates;
158 unsigned Flag)
const {
164 unsigned Flag)
const {
170 unsigned Flag)
const {
176 unsigned Flag)
const {
182 unsigned Flag)
const {
572 unsigned LO = (Ty ==
MVT::i32) ? Mips::LO0 : Mips::LO0_64;
573 unsigned HI = (Ty ==
MVT::i32) ? Mips::HI0 : Mips::HI0_64;
635 "Illegal Condition Code");
776 return DAG.
getNode(Opc,
SDLoc(N), ValueIfFalse.getValueType(),
777 ValueIfFalse, FCC, ValueIfTrue, Glue);
787 unsigned FirstOperandOpc = FirstOperand.
getOpcode();
792 uint64_t Pos = 0, SMPos, SMSize;
798 if (!(CN = dyn_cast<ConstantSDNode>(Mask)) ||
808 if (!(CN = dyn_cast<ConstantSDNode>(FirstOperand.
getOperand(1))))
828 if (!(CN = dyn_cast<ConstantSDNode>(FirstOperand.
getOperand(1))))
833 if (SMPos != Pos || Pos >= ValTy.
getSizeInBits() || SMSize >= 32 ||
855 NewOperand = FirstOperand;
857 return DAG.
getNode(Opc, DL, ValTy, NewOperand,
873 uint64_t SMPos0, SMSize0, SMPos1, SMSize1;
880 if (!(CN = dyn_cast<ConstantSDNode>(And0.
getOperand(1))) ||
886 And1.getOperand(0).getOpcode() ==
ISD::SHL) {
888 if (!(CN = dyn_cast<ConstantSDNode>(And1.getOperand(1))) ||
893 if (SMPos0 != SMPos1 || SMSize0 != SMSize1)
898 if (!(CN = dyn_cast<ConstantSDNode>(Shl.
getOperand(1))))
906 if ((Shamt != SMPos0) || (SMPos0 + SMSize0 > ValTy.
getSizeInBits()))
919 if (~CN->
getSExtValue() == ((((int64_t)1 << SMSize0) - 1) << SMPos0) &&
920 ((SMSize0 + SMPos0 <= 64 && Subtarget.
hasMips64r2()) ||
921 (SMSize0 + SMPos0 <= 32))) {
925 if (!(CN1 = dyn_cast<ConstantSDNode>(And1->getOperand(1))))
928 if (!(CN1 = dyn_cast<ConstantSDNode>(N->
getOperand(1))))
1020 if (!IsSigned && !IsUnsigned)
1111 unsigned FirstOperandOpc = FirstOperand.
getOpcode();
1116 uint64_t Pos = 0, SMPos, SMSize;
1121 if (!(CN = dyn_cast<ConstantSDNode>(SecondOperand)))
1133 if (!(CN = dyn_cast<ConstantSDNode>(FirstOperand.
getOperand(1))) ||
1139 if (SMPos != 0 || SMSize > 32 || Pos + SMSize > ValTy.
getSizeInBits())
1228 case ISD::SRL_PARTS:
return lowerShiftRightParts(Op, DAG,
false);
1255 bool Is64Bit,
bool IsMicroMips) {
1264 TII.
get(IsMicroMips ? Mips::TEQ_MM : Mips::TEQ))
1288 case Mips::ATOMIC_LOAD_ADD_I8:
1289 return emitAtomicBinaryPartword(MI, BB, 1);
1290 case Mips::ATOMIC_LOAD_ADD_I16:
1291 return emitAtomicBinaryPartword(MI, BB, 2);
1292 case Mips::ATOMIC_LOAD_ADD_I32:
1293 return emitAtomicBinary(MI, BB);
1294 case Mips::ATOMIC_LOAD_ADD_I64:
1295 return emitAtomicBinary(MI, BB);
1297 case Mips::ATOMIC_LOAD_AND_I8:
1298 return emitAtomicBinaryPartword(MI, BB, 1);
1299 case Mips::ATOMIC_LOAD_AND_I16:
1300 return emitAtomicBinaryPartword(MI, BB, 2);
1301 case Mips::ATOMIC_LOAD_AND_I32:
1302 return emitAtomicBinary(MI, BB);
1303 case Mips::ATOMIC_LOAD_AND_I64:
1304 return emitAtomicBinary(MI, BB);
1306 case Mips::ATOMIC_LOAD_OR_I8:
1307 return emitAtomicBinaryPartword(MI, BB, 1);
1308 case Mips::ATOMIC_LOAD_OR_I16:
1309 return emitAtomicBinaryPartword(MI, BB, 2);
1310 case Mips::ATOMIC_LOAD_OR_I32:
1311 return emitAtomicBinary(MI, BB);
1312 case Mips::ATOMIC_LOAD_OR_I64:
1313 return emitAtomicBinary(MI, BB);
1315 case Mips::ATOMIC_LOAD_XOR_I8:
1316 return emitAtomicBinaryPartword(MI, BB, 1);
1317 case Mips::ATOMIC_LOAD_XOR_I16:
1318 return emitAtomicBinaryPartword(MI, BB, 2);
1319 case Mips::ATOMIC_LOAD_XOR_I32:
1320 return emitAtomicBinary(MI, BB);
1321 case Mips::ATOMIC_LOAD_XOR_I64:
1322 return emitAtomicBinary(MI, BB);
1324 case Mips::ATOMIC_LOAD_NAND_I8:
1325 return emitAtomicBinaryPartword(MI, BB, 1);
1326 case Mips::ATOMIC_LOAD_NAND_I16:
1327 return emitAtomicBinaryPartword(MI, BB, 2);
1328 case Mips::ATOMIC_LOAD_NAND_I32:
1329 return emitAtomicBinary(MI, BB);
1330 case Mips::ATOMIC_LOAD_NAND_I64:
1331 return emitAtomicBinary(MI, BB);
1333 case Mips::ATOMIC_LOAD_SUB_I8:
1334 return emitAtomicBinaryPartword(MI, BB, 1);
1335 case Mips::ATOMIC_LOAD_SUB_I16:
1336 return emitAtomicBinaryPartword(MI, BB, 2);
1337 case Mips::ATOMIC_LOAD_SUB_I32:
1338 return emitAtomicBinary(MI, BB);
1339 case Mips::ATOMIC_LOAD_SUB_I64:
1340 return emitAtomicBinary(MI, BB);
1342 case Mips::ATOMIC_SWAP_I8:
1343 return emitAtomicBinaryPartword(MI, BB, 1);
1344 case Mips::ATOMIC_SWAP_I16:
1345 return emitAtomicBinaryPartword(MI, BB, 2);
1346 case Mips::ATOMIC_SWAP_I32:
1347 return emitAtomicBinary(MI, BB);
1348 case Mips::ATOMIC_SWAP_I64:
1349 return emitAtomicBinary(MI, BB);
1351 case Mips::ATOMIC_CMP_SWAP_I8:
1352 return emitAtomicCmpSwapPartword(MI, BB, 1);
1353 case Mips::ATOMIC_CMP_SWAP_I16:
1354 return emitAtomicCmpSwapPartword(MI, BB, 2);
1355 case Mips::ATOMIC_CMP_SWAP_I32:
1356 return emitAtomicCmpSwap(MI, BB);
1357 case Mips::ATOMIC_CMP_SWAP_I64:
1358 return emitAtomicCmpSwap(MI, BB);
1359 case Mips::PseudoSDIV:
1360 case Mips::PseudoUDIV:
1367 case Mips::SDIV_MM_Pseudo:
1368 case Mips::UDIV_MM_Pseudo:
1371 case Mips::DIV_MMR6:
1372 case Mips::DIVU_MMR6:
1373 case Mips::MOD_MMR6:
1374 case Mips::MODU_MMR6:
1376 case Mips::PseudoDSDIV:
1377 case Mips::PseudoDUDIV:
1384 case Mips::PseudoSELECT_I:
1385 case Mips::PseudoSELECT_I64:
1386 case Mips::PseudoSELECT_S:
1387 case Mips::PseudoSELECT_D32:
1388 case Mips::PseudoSELECT_D64:
1389 return emitPseudoSELECT(MI, BB,
false, Mips::BNE);
1390 case Mips::PseudoSELECTFP_F_I:
1391 case Mips::PseudoSELECTFP_F_I64:
1392 case Mips::PseudoSELECTFP_F_S:
1393 case Mips::PseudoSELECTFP_F_D32:
1394 case Mips::PseudoSELECTFP_F_D64:
1395 return emitPseudoSELECT(MI, BB,
true, Mips::BC1F);
1396 case Mips::PseudoSELECTFP_T_I:
1397 case Mips::PseudoSELECTFP_T_I64:
1398 case Mips::PseudoSELECTFP_T_S:
1399 case Mips::PseudoSELECTFP_T_D32:
1400 case Mips::PseudoSELECTFP_T_D64:
1401 return emitPseudoSELECT(MI, BB,
true, Mips::BC1T);
1402 case Mips::PseudoD_SELECT_I:
1403 case Mips::PseudoD_SELECT_I64:
1404 return emitPseudoD_SELECT(MI, BB);
1421 case Mips::ATOMIC_LOAD_ADD_I32:
1422 AtomicOp = Mips::ATOMIC_LOAD_ADD_I32_POSTRA;
1424 case Mips::ATOMIC_LOAD_SUB_I32:
1425 AtomicOp = Mips::ATOMIC_LOAD_SUB_I32_POSTRA;
1427 case Mips::ATOMIC_LOAD_AND_I32:
1428 AtomicOp = Mips::ATOMIC_LOAD_AND_I32_POSTRA;
1430 case Mips::ATOMIC_LOAD_OR_I32:
1431 AtomicOp = Mips::ATOMIC_LOAD_OR_I32_POSTRA;
1433 case Mips::ATOMIC_LOAD_XOR_I32:
1434 AtomicOp = Mips::ATOMIC_LOAD_XOR_I32_POSTRA;
1436 case Mips::ATOMIC_LOAD_NAND_I32:
1437 AtomicOp = Mips::ATOMIC_LOAD_NAND_I32_POSTRA;
1439 case Mips::ATOMIC_SWAP_I32:
1440 AtomicOp = Mips::ATOMIC_SWAP_I32_POSTRA;
1442 case Mips::ATOMIC_LOAD_ADD_I64:
1443 AtomicOp = Mips::ATOMIC_LOAD_ADD_I64_POSTRA;
1445 case Mips::ATOMIC_LOAD_SUB_I64:
1446 AtomicOp = Mips::ATOMIC_LOAD_SUB_I64_POSTRA;
1448 case Mips::ATOMIC_LOAD_AND_I64:
1449 AtomicOp = Mips::ATOMIC_LOAD_AND_I64_POSTRA;
1451 case Mips::ATOMIC_LOAD_OR_I64:
1452 AtomicOp = Mips::ATOMIC_LOAD_OR_I64_POSTRA;
1454 case Mips::ATOMIC_LOAD_XOR_I64:
1455 AtomicOp = Mips::ATOMIC_LOAD_XOR_I64_POSTRA;
1457 case Mips::ATOMIC_LOAD_NAND_I64:
1458 AtomicOp = Mips::ATOMIC_LOAD_NAND_I64_POSTRA;
1460 case Mips::ATOMIC_SWAP_I64:
1461 AtomicOp = Mips::ATOMIC_SWAP_I64_POSTRA;
1512 BuildMI(*BB, II, DL, TII->
get(Mips::COPY), IncrCopy).addReg(Incr);
1513 BuildMI(*BB, II, DL, TII->
get(Mips::COPY), PtrCopy).addReg(Ptr);
1529 unsigned SrcReg)
const {
1534 BuildMI(BB, DL, TII->
get(Mips::SEB), DstReg).addReg(SrcReg);
1539 BuildMI(BB, DL, TII->
get(Mips::SEH), DstReg).addReg(SrcReg);
1549 int64_t ShiftImm = 32 - (Size * 8);
1551 BuildMI(BB, DL, TII->
get(Mips::SLL), ScrReg).addReg(SrcReg).
addImm(ShiftImm);
1559 assert((Size == 1 || Size == 2) &&
1560 "Unsupported size for EmitAtomicBinaryPartial.");
1587 unsigned AtomicOp = 0;
1589 case Mips::ATOMIC_LOAD_NAND_I8:
1590 AtomicOp = Mips::ATOMIC_LOAD_NAND_I8_POSTRA;
1592 case Mips::ATOMIC_LOAD_NAND_I16:
1593 AtomicOp = Mips::ATOMIC_LOAD_NAND_I16_POSTRA;
1595 case Mips::ATOMIC_SWAP_I8:
1596 AtomicOp = Mips::ATOMIC_SWAP_I8_POSTRA;
1598 case Mips::ATOMIC_SWAP_I16:
1599 AtomicOp = Mips::ATOMIC_SWAP_I16_POSTRA;
1601 case Mips::ATOMIC_LOAD_ADD_I8:
1602 AtomicOp = Mips::ATOMIC_LOAD_ADD_I8_POSTRA;
1604 case Mips::ATOMIC_LOAD_ADD_I16:
1605 AtomicOp = Mips::ATOMIC_LOAD_ADD_I16_POSTRA;
1607 case Mips::ATOMIC_LOAD_SUB_I8:
1608 AtomicOp = Mips::ATOMIC_LOAD_SUB_I8_POSTRA;
1610 case Mips::ATOMIC_LOAD_SUB_I16:
1611 AtomicOp = Mips::ATOMIC_LOAD_SUB_I16_POSTRA;
1613 case Mips::ATOMIC_LOAD_AND_I8:
1614 AtomicOp = Mips::ATOMIC_LOAD_AND_I8_POSTRA;
1616 case Mips::ATOMIC_LOAD_AND_I16:
1617 AtomicOp = Mips::ATOMIC_LOAD_AND_I16_POSTRA;
1619 case Mips::ATOMIC_LOAD_OR_I8:
1620 AtomicOp = Mips::ATOMIC_LOAD_OR_I8_POSTRA;
1622 case Mips::ATOMIC_LOAD_OR_I16:
1623 AtomicOp = Mips::ATOMIC_LOAD_OR_I16_POSTRA;
1625 case Mips::ATOMIC_LOAD_XOR_I8:
1626 AtomicOp = Mips::ATOMIC_LOAD_XOR_I8_POSTRA;
1628 case Mips::ATOMIC_LOAD_XOR_I16:
1629 AtomicOp = Mips::ATOMIC_LOAD_XOR_I16_POSTRA;
1658 int64_t MaskImm = (Size == 1) ? 255 : 65535;
1663 BuildMI(BB, DL, TII->
get(Mips::ANDi), PtrLSB2)
1664 .addReg(Ptr, 0, ArePtrs64bit ? Mips::sub_32 : 0).
addImm(3);
1670 .addReg(PtrLSB2).
addImm((Size == 1) ? 3 : 2);
1673 BuildMI(BB, DL, TII->
get(Mips::ORi), MaskUpper)
1674 .addReg(Mips::ZERO).
addImm(MaskImm);
1676 .addReg(MaskUpper).
addReg(ShiftAmt);
1677 BuildMI(BB, DL, TII->
get(Mips::NOR), Mask2).addReg(Mips::ZERO).
addReg(Mask);
1678 BuildMI(BB, DL, TII->
get(Mips::SLLV), Incr2).addReg(Incr).
addReg(ShiftAmt);
1710 MipsTargetLowering::emitAtomicCmpSwap(
MachineInstr &MI,
1714 MI.
getOpcode() == Mips::ATOMIC_CMP_SWAP_I64) &&
1715 "Unsupported atomic psseudo for EmitAtomicCmpSwap.");
1717 const unsigned Size = MI.
getOpcode() == Mips::ATOMIC_CMP_SWAP_I32 ? 4 : 8;
1725 unsigned AtomicOp = MI.
getOpcode() == Mips::ATOMIC_CMP_SWAP_I32
1726 ? Mips::ATOMIC_CMP_SWAP_I32_POSTRA
1727 : Mips::ATOMIC_CMP_SWAP_I64_POSTRA;
1746 BuildMI(*BB, II, DL, TII->
get(Mips::COPY), DestCopy).addReg(Dest);
1747 BuildMI(*BB, II, DL, TII->
get(Mips::COPY), PtrCopy).addReg(Ptr);
1748 BuildMI(*BB, II, DL, TII->
get(Mips::COPY), OldValCopy).addReg(OldVal);
1749 BuildMI(*BB, II, DL, TII->
get(Mips::COPY), NewValCopy).addReg(NewVal);
1770 assert((Size == 1 || Size == 2) &&
1771 "Unsupported size for EmitAtomicCmpSwapPartial.");
1798 unsigned AtomicOp = MI.
getOpcode() == Mips::ATOMIC_CMP_SWAP_I8
1799 ? Mips::ATOMIC_CMP_SWAP_I8_POSTRA
1800 : Mips::ATOMIC_CMP_SWAP_I16_POSTRA;
1841 int64_t MaskImm = (Size == 1) ? 255 : 65535;
1842 BuildMI(BB, DL, TII->
get(ArePtrs64bit ? Mips::DADDiu : Mips::ADDiu), MaskLSB2)
1845 .addReg(Ptr).
addReg(MaskLSB2);
1846 BuildMI(BB, DL, TII->
get(Mips::ANDi), PtrLSB2)
1847 .addReg(Ptr, 0, ArePtrs64bit ? Mips::sub_32 : 0).
addImm(3);
1853 .addReg(PtrLSB2).
addImm((Size == 1) ? 3 : 2);
1856 BuildMI(BB, DL, TII->
get(Mips::ORi), MaskUpper)
1857 .addReg(Mips::ZERO).
addImm(MaskImm);
1859 .addReg(MaskUpper).
addReg(ShiftAmt);
1860 BuildMI(BB, DL, TII->
get(Mips::NOR), Mask2).addReg(Mips::ZERO).
addReg(Mask);
1861 BuildMI(BB, DL, TII->
get(Mips::ANDi), MaskedCmpVal)
1862 .addReg(CmpVal).
addImm(MaskImm);
1863 BuildMI(BB, DL, TII->
get(Mips::SLLV), ShiftedCmpVal)
1864 .addReg(MaskedCmpVal).
addReg(ShiftAmt);
1865 BuildMI(BB, DL, TII->
get(Mips::ANDi), MaskedNewVal)
1866 .addReg(NewVal).
addImm(MaskImm);
1867 BuildMI(BB, DL, TII->
get(Mips::SLLV), ShiftedNewVal)
1868 .addReg(MaskedNewVal).
addReg(ShiftAmt);
1913 FCC0, Dest, CondRes);
1935 "Floating point operand expected.");
1976 if (GV->hasLocalLinkage())
1986 N,
SDLoc(N), Ty, DAG,
2035 Entry.
Node = Argument;
2037 Args.push_back(Entry);
2042 .setLibCallee(
CallingConv::C, PtrTy, TlsGetAddr, std::move(Args));
2043 std::pair<SDValue, SDValue> CallResult =
LowerCallTo(CLI);
2142 const Value *SV = cast<SrcValueSDNode>(Node->
getOperand(2))->getValue();
2158 assert(((Align & (Align-1)) == 0) &&
"Expected Align to be a power of 2");
2170 unsigned ArgSizeInBytes =
2186 unsigned Adjustment = ArgSlotSizeInBytes - ArgSizeInBytes;
2195 bool HasExtractInsert) {
2214 if (HasExtractInsert) {
2242 bool HasExtractInsert) {
2253 if (HasExtractInsert) {
2259 if (WidthX > WidthY)
2261 else if (WidthY > WidthX)
2280 if (WidthX > WidthY)
2282 else if (WidthY > WidthX)
2303 "Frame address can only be determined for current frame.");
2321 "Return address can be determined only for current frame.");
2352 unsigned OffsetReg =
ABI.
IsN64() ? Mips::V1_64 : Mips::V1;
2353 unsigned AddrReg =
ABI.
IsN64() ? Mips::V0_64 : Mips::V0;
2440 : Mips::PseudoD_SELECT_I,
2441 DL, VTList, Cond, ShiftRightHi,
2448 IsSRA ? Ext : DAG.
getConstant(0, DL, VT), ShiftRightHi);
2466 SDValue Ops[] = { Chain, Ptr, Src };
2480 if ((LD->
getAlignment() >= MemVT.getSizeInBits() / 8) ||
2663 static const MCPhysReg IntRegs[] = { Mips::A0, Mips::A1, Mips::A2, Mips::A3 };
2667 static const MCPhysReg F32Regs[] = { Mips::F12, Mips::F14 };
2669 static const MCPhysReg FloatVectorIntRegs[] = { Mips::A0, Mips::A2 };
2681 else if (ArgFlags.
isZExt())
2693 else if (ArgFlags.
isZExt())
2704 bool AllocateFloatsInIntReg = State.
isVarArg() || ValNo > 1 ||
2707 bool isI64 = (ValVT ==
MVT::i32 && OrigAlign == 8);
2711 if (ValVT ==
MVT::i32 && isVectorFloat) {
2718 if (Reg == Mips::A2)
2727 }
else if (ValVT ==
MVT::i32 || (ValVT ==
MVT::f32 && AllocateFloatsInIntReg)) {
2731 if (isI64 && (Reg == Mips::A1 || Reg == Mips::A3))
2734 }
else if (ValVT ==
MVT::f64 && AllocateFloatsInIntReg) {
2738 if (Reg == Mips::A1 || Reg == Mips::A3)
2752 if (Reg2 == Mips::A1 || Reg2 == Mips::A3)
2771 static const MCPhysReg F64Regs[] = { Mips::D6, Mips::D7 };
2773 return CC_MipsO32(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State, F64Regs);
2779 static const MCPhysReg F64Regs[] = { Mips::D12_64, Mips::D14_64 };
2781 return CC_MipsO32(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State, F64Regs);
2788 #include "MipsGenCallingConv.inc" 2803 assert((Reg == Mips::A0) || (Reg == Mips::A2));
2804 return (Reg == Mips::A0) ? Mips::A1 : Mips::A3;
2809 const SDLoc &DL,
bool IsTailCall,
2827 std::deque<std::pair<unsigned, SDValue>> &RegsToPass,
2828 bool IsPICCall,
bool GlobalOrExternal,
bool InternalLinkage,
2841 if (IsPICCall && !InternalLinkage && IsCallReloc) {
2842 unsigned GPReg =
ABI.
IsN64() ? Mips::GP_64 : Mips::GP;
2844 RegsToPass.push_back(std::make_pair(GPReg,
getGlobalReg(CLI.
DAG, Ty)));
2853 for (
unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
2855 RegsToPass[i].second, InFlag);
2861 for (
unsigned i = 0, e = RegsToPass.size(); i != e; ++i)
2863 RegsToPass[i].second.getValueType()));
2869 assert(Mask &&
"Missing call preserved mask for calling convention");
2873 Function *
F =
G->getGlobal()->getParent()->getFunction(Sym);
2891 case Mips::JALRPseudo:
2893 case Mips::JALR64Pseudo:
2894 case Mips::JALR16_MM:
2895 case Mips::JALRC16_MMR6:
2896 case Mips::TAILCALLREG:
2897 case Mips::TAILCALLREG64:
2898 case Mips::TAILCALLR6REG:
2899 case Mips::TAILCALL64R6REG:
2900 case Mips::TAILCALLREG_MM:
2901 case Mips::TAILCALLREG_MMR6: {
2902 if (!EmitJalrReloc ||
2915 dyn_cast_or_null<const GlobalAddressSDNode>(TargetAddr)) {
2916 Sym =
G->getGlobal()->getName();
2919 dyn_cast_or_null<const ExternalSymbolSDNode>(TargetAddr)) {
2920 Sym = ES->getSymbol();
2962 dyn_cast_or_null<const ExternalSymbolSDNode>(Callee.
getNode());
2988 bool MemcpyInByVal = ES &&
2995 unsigned ReservedArgArea =
3007 bool InternalLinkage =
false;
3009 IsTailCall = isEligibleForTailCallOptimization(
3012 InternalLinkage =
G->getGlobal()->hasInternalLinkage();
3013 IsTailCall &= (InternalLinkage ||
G->getGlobal()->hasLocalLinkage() ||
3014 G->getGlobal()->hasPrivateLinkage() ||
3015 G->getGlobal()->hasHiddenVisibility() ||
3016 G->getGlobal()->hasProtectedVisibility());
3021 "site marked musttail");
3030 NextStackOffset =
alignTo(NextStackOffset, StackAlignment);
3033 if (!(IsTailCall || MemcpyInByVal))
3040 std::deque<std::pair<unsigned, SDValue>> RegsToPass;
3046 for (
unsigned i = 0, e = ArgLocs.
size(); i != e; ++i) {
3051 bool UseUpperBits =
false;
3055 unsigned FirstByValReg, LastByValReg;
3060 "ByVal args of size 0 should have been ignored by front-end.");
3063 "Do not tail-call optimize if there is a byval argument.");
3064 passByValArg(Chain, DL, RegsToPass, MemOpChains, StackPtr, MFI, DAG, Arg,
3090 RegsToPass.push_back(std::make_pair(LocRegLo, Lo));
3091 RegsToPass.push_back(std::make_pair(LocRegHigh, Hi));
3100 UseUpperBits =
true;
3106 UseUpperBits =
true;
3112 UseUpperBits =
true;
3120 unsigned ValSizeInBits = Outs[i].ArgVT.getSizeInBits();
3130 RegsToPass.push_back(std::make_pair(VA.
getLocReg(),
Arg));
3140 Chain,
Arg, DL, IsTailCall, DAG));
3145 if (!MemOpChains.
empty())
3153 bool GlobalOrExternal =
false, IsCallReloc =
false;
3162 if (
auto *N = dyn_cast<ExternalSymbolSDNode>(Callee)) {
3167 }
else if (
auto *N = dyn_cast<GlobalAddressSDNode>(Callee)) {
3171 if (
auto *
F = dyn_cast<Function>(N->getGlobal())) {
3172 if (
F->hasFnAttribute(
"long-call"))
3173 UseLongCalls =
true;
3174 else if (
F->hasFnAttribute(
"short-call"))
3175 UseLongCalls =
false;
3189 if (InternalLinkage)
3205 GlobalOrExternal =
true;
3208 const char *Sym = S->getSymbol();
3224 GlobalOrExternal =
true;
3230 getOpndList(Ops, RegsToPass, IsPIC, GlobalOrExternal, InternalLinkage,
3231 IsCallReloc, CLI, Callee, Chain);
3243 if (!(MemcpyInByVal)) {
3251 return LowerCallResult(Chain, InFlag, CallConv, IsVarArg, Ins, DL, DAG,
3257 SDValue MipsTargetLowering::LowerCallResult(
3268 dyn_cast_or_null<const ExternalSymbolSDNode>(CLI.
Callee.
getNode());
3269 CCInfo.AnalyzeCallResult(Ins, RetCC_Mips, CLI.
RetTy,
3270 ES ? ES->getSymbol() :
nullptr);
3273 for (
unsigned i = 0; i != RVLocs.
size(); ++i) {
3278 RVLocs[i].getLocVT(), InFlag);
3283 unsigned ValSizeInBits = Ins[i].ArgVT.getSizeInBits();
3384 SDValue MipsTargetLowering::LowerFormalArguments(
3395 std::vector<SDValue> OutChains;
3407 "Functions with the interrupt attribute cannot have arguments!");
3409 CCInfo.AnalyzeFormalArguments(Ins, CC_Mips_FixedArg);
3411 CCInfo.getInRegsParamsCount() > 0);
3413 unsigned CurArgIdx = 0;
3414 CCInfo.rewindByValRegsInfo();
3416 for (
unsigned i = 0, e = ArgLocs.
size(); i != e; ++i) {
3418 if (Ins[i].isOrigArg()) {
3419 std::advance(FuncArg, Ins[i].getOrigArgIndex() - CurArgIdx);
3420 CurArgIdx = Ins[i].getOrigArgIndex();
3427 assert(Ins[i].isOrigArg() &&
"Byval arguments cannot be implicit");
3428 unsigned FirstByValReg, LastByValReg;
3429 unsigned ByValIdx = CCInfo.getInRegsParamsProcessed();
3430 CCInfo.getInRegsParamInfo(ByValIdx, FirstByValReg, LastByValReg);
3433 "ByVal args of size 0 should have been ignored by front-end.");
3434 assert(ByValIdx < CCInfo.getInRegsParamsCount());
3435 copyByValRegs(Chain, DL, OutChains, DAG, Flags, InVals, &*FuncArg,
3436 FirstByValReg, LastByValReg, VA, CCInfo);
3437 CCInfo.nextInRegsParam();
3468 ArgValue, ArgValue2);
3494 LocVT, DL, Chain, FIN,
3496 OutChains.push_back(ArgValue.
getValue(1));
3504 for (
unsigned i = 0, e = ArgLocs.
size(); i != e; ++i) {
3508 if (Ins[i].Flags.isSRet()) {
3522 writeVarArgRegs(OutChains, Chain, DL, DAG, CCInfo);
3526 if (!OutChains.empty()) {
3527 OutChains.push_back(Chain);
3544 MipsCCState CCInfo(CallConv, IsVarArg, MF, RVLocs, Context);
3549 MipsTargetLowering::shouldSignExtendTypeInLibCall(
EVT Type,
bool IsSigned)
const {
3589 for (
unsigned i = 0; i != RVLocs.
size(); ++i) {
3593 bool UseUpperBits =
false;
3604 UseUpperBits =
true;
3610 UseUpperBits =
true;
3616 UseUpperBits =
true;
3624 unsigned ValSizeInBits = Outs[i].ArgVT.getSizeInBits();
3650 unsigned V0 =
ABI.
IsN64() ? Mips::V0_64 : Mips::V0;
3665 return LowerInterruptReturn(RetOps, DL, DAG);
3678 MipsTargetLowering::getConstraintType(
StringRef Constraint)
const {
3690 if (Constraint.
size() == 1) {
3691 switch (Constraint[0]) {
3705 if (Constraint ==
"ZC")
3715 MipsTargetLowering::getSingleConstraintMatchWeight(
3716 AsmOperandInfo &
info,
const char *constraint)
const {
3718 Value *CallOperandVal = info.CallOperandVal;
3721 if (!CallOperandVal)
3725 switch (*constraint) {
3754 if (isa<ConstantInt>(CallOperandVal))
3769 unsigned long long &
Reg) {
3770 if (C.
front() !=
'{' || C.
back() !=
'}')
3771 return std::make_pair(
false,
false);
3781 return std::make_pair(
true,
false);
3792 return VT.
bitsLT(MinVT) ? MinVT : VT;
3795 std::pair<unsigned, const TargetRegisterClass *> MipsTargetLowering::
3801 unsigned long long Reg;
3806 return std::make_pair(0U,
nullptr);
3808 if ((Prefix ==
"hi" || Prefix ==
"lo")) {
3811 return std::make_pair(0U,
nullptr);
3814 Mips::HI32RegClassID : Mips::LO32RegClassID);
3815 return std::make_pair(*(RC->
begin()), RC);
3821 return std::make_pair(0U,
nullptr);
3824 .Case(
"$msair", Mips::MSAIR)
3825 .
Case(
"$msacsr", Mips::MSACSR)
3826 .
Case(
"$msaaccess", Mips::MSAAccess)
3827 .
Case(
"$msasave", Mips::MSASave)
3828 .
Case(
"$msamodify", Mips::MSAModify)
3829 .
Case(
"$msarequest", Mips::MSARequest)
3830 .
Case(
"$msamap", Mips::MSAMap)
3831 .
Case(
"$msaunmap", Mips::MSAUnmap)
3835 return std::make_pair(0U,
nullptr);
3838 return std::make_pair(Reg, RC);
3842 return std::make_pair(0U,
nullptr);
3844 if (Prefix ==
"$f") {
3852 if (RC == &Mips::AFGR64RegClass) {
3856 }
else if (Prefix ==
"$fcc")
3858 else if (Prefix ==
"$w") {
3865 assert(Reg < RC->getNumRegs());
3866 return std::make_pair(*(RC->
begin() +
Reg), RC);
3872 std::pair<unsigned, const TargetRegisterClass *>
3876 if (Constraint.
size() == 1) {
3877 switch (Constraint[0]) {
3883 return std::make_pair(0U, &Mips::CPU16RegsRegClass);
3884 return std::make_pair(0U, &Mips::GPR32RegClass);
3887 return std::make_pair(0U, &Mips::GPR32RegClass);
3889 return std::make_pair(0U, &Mips::GPR64RegClass);
3891 return std::make_pair(0U,
nullptr);
3894 return std::make_pair(0U, &Mips::MSA128BRegClass);
3896 return std::make_pair(0U, &Mips::MSA128HRegClass);
3898 return std::make_pair(0U, &Mips::MSA128WRegClass);
3900 return std::make_pair(0U, &Mips::MSA128DRegClass);
3902 return std::make_pair(0U, &Mips::FGR32RegClass);
3905 return std::make_pair(0U, &Mips::FGR64RegClass);
3906 return std::make_pair(0U, &Mips::AFGR64RegClass);
3911 return std::make_pair((
unsigned)Mips::T9, &Mips::GPR32RegClass);
3913 return std::make_pair((
unsigned)Mips::T9_64, &Mips::GPR64RegClass);
3915 return std::make_pair(0U,
nullptr);
3919 return std::make_pair((
unsigned)Mips::LO0, &Mips::LO32RegClass);
3920 return std::make_pair((
unsigned)Mips::LO0_64, &Mips::LO64RegClass);
3925 return std::make_pair(0U,
nullptr);
3929 std::pair<unsigned, const TargetRegisterClass *> R;
3930 R = parseRegForInlineAsmConstraint(Constraint, VT);
3940 void MipsTargetLowering::LowerAsmOperandForConstraint(
SDValue Op,
3941 std::string &Constraint,
3942 std::vector<SDValue>&Ops,
3948 if (Constraint.length() > 1)
return;
3950 char ConstraintLetter = Constraint[0];
3951 switch (ConstraintLetter) {
3957 int64_t Val = C->getSExtValue();
3967 int64_t Val = C->getZExtValue();
3977 uint64_t Val = (uint64_t)C->getZExtValue();
3987 int64_t Val = C->getSExtValue();
3988 if ((
isInt<32>(Val)) && ((Val & 0xffff) == 0)){
3997 int64_t Val = C->getSExtValue();
3998 if ((Val >= -65535) && (Val <= -1)) {
4007 int64_t Val = C->getSExtValue();
4008 if ((isInt<15>(Val))) {
4017 int64_t Val = C->getSExtValue();
4018 if ((Val <= 65535) && (Val >= 1)) {
4027 Ops.push_back(Result);
4034 bool MipsTargetLowering::isLegalAddressingMode(
const DataLayout &DL,
4061 EVT MipsTargetLowering::getOptimalMemOpType(uint64_t Size,
unsigned DstAlign,
4063 bool IsMemset,
bool ZeroMemset,
4072 bool MipsTargetLowering::isFPImmLegal(
const APFloat &Imm,
EVT VT)
const {
4080 unsigned MipsTargetLowering::getJumpTableEncoding()
const {
4089 bool MipsTargetLowering::useSoftFloat()
const {
4093 void MipsTargetLowering::copyByValRegs(
4094 SDValue Chain,
const SDLoc &DL, std::vector<SDValue> &OutChains,
4097 unsigned FirstReg,
unsigned LastReg,
const CCValAssign &VA,
4102 unsigned NumRegs = LastReg - FirstReg;
4103 unsigned RegAreaSize = NumRegs * GPRSizeInBytes;
4111 (
int)((ByValArgRegs.
size() - FirstReg) * GPRSizeInBytes);
4133 for (
unsigned I = 0; I < NumRegs; ++
I) {
4134 unsigned ArgReg = ByValArgRegs[FirstReg +
I];
4135 unsigned VReg =
addLiveIn(MF, ArgReg, RC);
4136 unsigned Offset = I * GPRSizeInBytes;
4141 OutChains.push_back(Store);
4146 void MipsTargetLowering::passByValArg(
4148 std::deque<std::pair<unsigned, SDValue>> &RegsToPass,
4154 unsigned OffsetInBytes = 0;
4156 unsigned Alignment = std::min(Flags.
getByValAlign(), RegSizeInBytes);
4159 unsigned NumRegs = LastReg - FirstReg;
4163 bool LeftoverBytes = (NumRegs * RegSizeInBytes > ByValSizeInBytes);
4167 for (; I < NumRegs - LeftoverBytes; ++
I, OffsetInBytes += RegSizeInBytes) {
4173 unsigned ArgReg = ArgRegs[FirstReg +
I];
4174 RegsToPass.push_back(std::make_pair(ArgReg, LoadVal));
4178 if (ByValSizeInBytes == OffsetInBytes)
4182 if (LeftoverBytes) {
4185 for (
unsigned LoadSizeInBytes = RegSizeInBytes / 2, TotalBytesLoaded = 0;
4186 OffsetInBytes < ByValSizeInBytes; LoadSizeInBytes /= 2) {
4187 unsigned RemainingSizeInBytes = ByValSizeInBytes - OffsetInBytes;
4189 if (RemainingSizeInBytes < LoadSizeInBytes)
4205 Shamt = TotalBytesLoaded * 8;
4207 Shamt = (RegSizeInBytes - (TotalBytesLoaded + LoadSizeInBytes)) * 8;
4217 OffsetInBytes += LoadSizeInBytes;
4218 TotalBytesLoaded += LoadSizeInBytes;
4219 Alignment = std::min(Alignment, LoadSizeInBytes);
4222 unsigned ArgReg = ArgRegs[FirstReg +
I];
4223 RegsToPass.push_back(std::make_pair(ArgReg, Val));
4229 unsigned MemCpySize = ByValSizeInBytes - OffsetInBytes;
4234 Chain = DAG.
getMemcpy(Chain, DL, Dst, Src,
4236 Alignment,
false,
false,
4242 void MipsTargetLowering::writeVarArgRegs(std::vector<SDValue> &OutChains,
4258 if (ArgRegs.
size() == Idx)
4263 (
int)(RegSizeInBytes * (ArgRegs.
size() - Idx));
4275 for (
unsigned I = Idx; I < ArgRegs.
size();
4276 ++
I, VaArgOffset += RegSizeInBytes) {
4283 cast<StoreSDNode>(Store.
getNode())->getMemOperand()->setValue(
4285 OutChains.push_back(Store);
4290 unsigned Align)
const {
4293 assert(Size &&
"Byval argument's size shouldn't be 0.");
4297 unsigned FirstReg = 0;
4298 unsigned NumRegs = 0;
4309 assert(!(Align % RegSizeInBytes) &&
4310 "Byval argument's alignment should be a multiple of" 4319 if ((Align > RegSizeInBytes) && (FirstReg % 2)) {
4320 State->
AllocateReg(IntArgRegs[FirstReg], ShadowRegs[FirstReg]);
4325 Size =
alignTo(Size, RegSizeInBytes);
4326 for (
unsigned I = FirstReg; Size > 0 && (I < IntArgRegs.
size());
4327 Size -= RegSizeInBytes, ++
I, ++NumRegs)
4337 unsigned Opc)
const {
4339 "Subtarget already supports SELECT nodes with the use of" 4340 "conditional-move instructions.");
4415 "Subtarget already supports SELECT nodes with the use of" 4416 "conditional-move instructions.");
4495 .Case(
"$28", Mips::GP_64)
4501 .Case(
"$28", Mips::GP)
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)
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...
bool inMips16HardFloat() const
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.
static MVT getIntegerVT(unsigned BitWidth)
A parsed version of the target data layout string in and methods for querying it. ...
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo)
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
EVT getValueType() const
Return the ValueType of the referenced return value.
This represents an addressing mode of: BaseGV + BaseOffs + BaseReg + Scale*ScaleReg If BaseGV is null...
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
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...
SDValue getAddrGPRel(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, bool IsN64) const
C - The default llvm calling convention, compatible with C.
const GlobalValue * getGlobal() const
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.
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
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 TargetRegisterClass * getRegClass(unsigned Reg) const
Return the register class of the specified virtual register.
const MipsSubtarget & Subtarget
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.
This class represents lattice values for constants.
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)
static MachineOperand CreateMCSymbol(MCSymbol *Sym, unsigned char TargetFlags=0)
iterator begin() const
begin/end - Return all of the registers in this class.
static SDValue lowerFP_TO_SINT_STORE(StoreSDNode *SD, SelectionDAG &DAG, bool SingleFloat)
const MipsTargetLowering * createMips16TargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI)
Create MipsTargetLowering objects.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
unsigned EnableFastISel
EnableFastISel - This flag enables fast-path instruction selection which trades away generated code q...
bool inMips16Mode() const
int getVarArgsFrameIndex() const
static SDValue performADDCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
void addLiveIn(unsigned Reg, unsigned vreg=0)
addLiveIn - Add the specified register as a live-in.
const SDValue & getBasePtr() const
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.
bool ArePtrs64bit() const
virtual unsigned getJumpTableEncoding() const
Return the entry encoding for a jump table in the current function.
void push_back(const T &Elt)
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
virtual void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint, std::vector< SDValue > &Ops, SelectionDAG &DAG) const
Lower the specified operand into the Ops vector.
static SDValue performCMovFPCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
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.
unsigned getReg() const
getReg - Returns the register number.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
MipsTargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI)
const SDValue & getValue() const
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...
bool CCAssignFn(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
CCAssignFn - This function assigns a location for Val, updating State to reflect the change...
const MipsInstrInfo * getInstrInfo() const override
static SDValue lowerFCOPYSIGN64(SDValue Op, SelectionDAG &DAG, bool HasExtractInsert)
const SDValue & getChain() const
Function Alias Analysis Results
unsigned getAlignment() const
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
virtual std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const
Given a physical register constraint (e.g.
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...
virtual const TargetRegisterClass * getRegClassFor(MVT VT) const
Return the register class that should be used for the specified value type.
constexpr bool isInt< 16 >(int64_t x)
STATISTIC(NumFunctions, "Total number of functions")
cl::opt< bool > EmitJalrReloc
unsigned const TargetRegisterInfo * TRI
bool hasExtractInsert() const
Features related to the presence of specific instructions.
bool isInteger() const
Return true if this is an integer or a vector integer type.
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const override
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
CallLoweringInfo & setDebugLoc(const SDLoc &dl)
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)
MachineFunction & getMachineFunction() const
SDNode * getNode() const
get the SDNode which holds the desired result
SDValue getTargetExternalSymbol(const char *Sym, EVT VT, unsigned char TargetFlags=0)
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
bool isVectorTy() const
True if this is an instance of VectorType.
static BranchProbability getOne()
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
SDValue getAddrNonPIC(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG) const
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...
virtual SDValue LowerToTLSEmulatedModel(const GlobalAddressSDNode *GA, SelectionDAG &DAG) const
Lower TLS global address SDNode for target independent emulated TLS model.
SDValue getAddrLocal(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, bool IsN32OrN64) const
bool isUpperBitsInLoc() const
unsigned getValueSizeInBits() const
Returns the size of the value in bits.
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) ...
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
bool hasOneUse() const
Return true if there is exactly one node using value ResNo of Node.
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...
bool isValid() const
Return true if this is a valid simple valuetype.
const TargetRegisterClass * getRegClass(unsigned i) const
Returns the register class associated with the enumeration value.
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 isTruncatingStore() const
Return true if the op does a truncation before store.
bool WasOriginalArgVectorFloat(unsigned ValNo) const
MVT getRegisterType(MVT VT) const
Return the type of registers that this ValueType will eventually require.
bool hasStructRetAttr() const
Determine if the function returns a structure through first or second pointer argument.
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)
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
SI optimize exec mask operations pre RA
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations...
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
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...
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
void AdjustInstrPostInstrSelection(MachineInstr &MI, SDNode *Node) const override
This method should be implemented by targets that mark instructions with the 'hasPostISelHook' flag...
Shift and rotation operations.
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
bool inMicroMipsMode() const
static unsigned addLiveIn(MachineFunction &MF, unsigned PReg, const TargetRegisterClass *RC)
CallLoweringInfo & setChain(SDValue InChain)
BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.
CCAssignFn * CCAssignFnForCall() const
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.
void addLoc(const CCValAssign &V)
bool isIntegerTy() const
True if this is an instance of IntegerType.
unsigned GetCalleeAllocdArgSizeInBytes(CallingConv::ID CC) const
Obtain the size of the area allocated by the callee for arguments.
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
CALLSEQ_START/CALLSEQ_END - These operators mark the beginning and end of a call sequence, and carry arbitrary information that target might want to know.
MVT getRegisterTypeForCallingConv(LLVMContext &Context, CallingConv::ID CC, EVT VT) const override
Return the register type for a given MVT, ensuring vectors are treated as a series of gpr sized integ...
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...
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
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...
const DataLayout & getDataLayout() const
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
FRAMEADDR, RETURNADDR - These nodes represent llvm.frameaddress and llvm.returnaddress on the DAG...
const BlockAddress * getBlockAddress() const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(T Value)
unsigned getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
LocInfo getLocInfo() const
static Mips::CondCode condCodeToFCC(ISD::CondCode CC)
SDValue getAddrGlobalLargeGOT(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, unsigned HiFlag, unsigned LoFlag, SDValue Chain, const MachinePointerInfo &PtrInfo) const
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
const MipsABIInfo & getABI() const
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())
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.
unsigned getSizeInBits() const
SDValue getGlobalReg(SelectionDAG &DAG, EVT Ty) const
int64_t getSExtValue() const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
Fast - This calling convention attempts to make calls as fast as possible (e.g.
This is a fast-path instruction selection class that generates poor code and doesn't support illegal ...
unsigned getSizeInBits() const
Return the size of the specified value type in bits.
unsigned getNextStackOffset() const
getNextStackOffset - Return the next stack offset such that all stack slots satisfy their alignment r...
Type * getType() const
All values are typed, get the type of this value.
MachineFunction & getMachineFunction() const
static const MCPhysReg Mips64DPRegs[8]
SDValue getRegisterMask(const uint32_t *RegMask)
const TargetMachine & getTarget() const
SDValue getAddrNonPICSym64(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG) const
static bool invertFPCondCodeUser(Mips::CondCode CC)
This function returns true if the floating point conditional branches and conditional moves which use...
Simple integer binary arithmetic operators.
void addInRegsParamInfo(unsigned RegBegin, unsigned RegEnd)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
SmallVector< ISD::OutputArg, 32 > Outs
static SpecialCallingConvType getSpecialCallingConvForCallee(const SDNode *Callee, const MipsSubtarget &Subtarget)
Determine the SpecialCallingConvType for the given callee.
ArrayRef< MCPhysReg > GetByValArgRegs() const
The registers to use for byval arguments.
unsigned getRegisterByName(const char *RegName, EVT VT, SelectionDAG &DAG) const override
Return the register ID of the name passed in.
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
TLSModel::Model getTLSModel(const GlobalValue *GV) const
Returns the TLS model which should be used for the given global variable.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
unsigned GetPtrAndOp() const
amdgpu Simplify well known AMD library false Value * Callee
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *bb=nullptr)
CreateMachineBasicBlock - Allocate a new MachineBasicBlock.
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
const char * getSymbol() const
unsigned getByValSize() const
unsigned getKillRegState(bool B)
This class is used to represent ISD::STORE nodes.
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.
MVT getSimpleValueType() const
Return the simple ValueType of the referenced return value.
MCContext & getContext() const
bool useEmulatedTLS() const
Returns true if this target uses emulated TLS.
bool isFloatTy() const
Return true if this is 'float', a 32-bit IEEE fp type.
The memory access is volatile.
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...
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
const SDValue & getBasePtr() const
unsigned getGPRSizeInBytes() const
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...
initializer< Ty > init(const Ty &Val)
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...
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 GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static SDValue createCMovFP(SelectionDAG &DAG, SDValue Cond, SDValue True, SDValue False, const SDLoc &DL)
unsigned const MachineRegisterInfo * MRI
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...
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...
unsigned GetPtrAddiuOp() const
LLVM Basic Block Representation.
unsigned getOrigAlign() const
The instances of the Type class are immutable: once they are created, they are never changed...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
bool useLongCalls() const
This is an important class for using LLVM in a threaded context.
virtual ConstraintType getConstraintType(StringRef Constraint) const
Given a constraint, return the type of constraint it is for this target.
void setTargetDAGCombine(ISD::NodeType NT)
Targets should invoke this method for each target independent node that they want to provide a custom...
bool hasAnyUseOfValue(unsigned Value) const
Return true if there are any use of the indicated value.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
size_t size() const
size - Get the array size.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
VAEND, VASTART - VAEND and VASTART have three operands: an input chain, pointer, and a SRCVALUE...
const SDValue & getOperand(unsigned Num) const
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static SDValue createStoreLR(unsigned Opc, SelectionDAG &DAG, StoreSDNode *SD, SDValue Chain, unsigned Offset)
bool IsConstantInSmallSection(const DataLayout &DL, const Constant *CN, const TargetMachine &TM) const
Return true if this constant should be placed into small data section.
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()
This file declares a class to represent arbitrary precision floating point values and provide a varie...
bool hasInternalLinkage() const
static EVT getFloatingPointVT(unsigned BitWidth)
Returns the EVT that represents a floating-point type with the given number of bits.
virtual ConstraintWeight getSingleConstraintMatchWeight(AsmOperandInfo &info, const char *constraint) const
Examine constraint string and operand type and determine a weight value.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
TRAP - Trapping instruction.
AssertSext, AssertZext - These nodes record if a register contains a value that has already been zero...
self_iterator getIterator()
SDValue getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef< SDValue > Ops, EVT MemVT, MachinePointerInfo PtrInfo, unsigned Align=0, MachineMemOperand::Flags Flags=MachineMemOperand::MOLoad|MachineMemOperand::MOStore, unsigned Size=0)
Creates a MemIntrinsicNode that may produce a result and takes a list of operands.
Class to represent integer types.
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)
auto find_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly...
bool isCheapToSpeculateCttz() const override
Return true if it is cheap to speculate a call to intrinsic cttz.
SDValue getAddrGlobal(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, unsigned Flag, SDValue Chain, const MachinePointerInfo &PtrInfo) 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/...
unsigned getInRegsParamsProcessed() const
SDValue lowerLOAD(SDValue Op, SelectionDAG &DAG) const
std::vector< ArgListEntry > ArgListTy
unsigned getAlignment() const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
bool isSingleFloat() const
This structure contains all information that is necessary for lowering calls.
bool isPositionIndependent() const
LLVM_NODISCARD char back() const
back - Get the last character in the string.
bool isBeforeLegalizeOps() const
const TargetMachine & getTargetMachine() const
This class contains a discriminated union of information about pointers in memory operands...
unsigned getNumOperands() const
Return the number of values used by this operation.
unsigned getStackAlignment() const
getStackAlignment - This method returns the number of bytes to which the stack pointer must be aligne...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
MO_GOTTPREL - Represents the offset from the thread pointer (Initial.
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...
void setIsKill(bool Val=true)
static SDValue createLoadLR(unsigned Opc, SelectionDAG &DAG, LoadSDNode *LD, SDValue Chain, SDValue Src, unsigned Offset)
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
SDValue getTargetConstantPool(const Constant *C, EVT VT, unsigned Align=0, int Offset=0, unsigned char TargetFlags=0)
SDValue getTargetJumpTable(int JTI, EVT VT, unsigned char TargetFlags=0)
TokenFactor - This node takes multiple tokens as input and produces a single token result...
unsigned getNumRegistersForCallingConv(LLVMContext &Context, CallingConv::ID CC, EVT VT) const override
Return the number of registers for a given MVT, ensuring vectors are treated as a series of gpr sized...
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 countPopulation(T Value)
Count the number of set bits in a value.
void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
constexpr bool isInt< 32 >(int64_t x)
void addOperand(MachineFunction &MF, const MachineOperand &Op)
Add the specified operand to the instruction.
virtual TargetLoweringObjectFile * getObjFileLowering() const
unsigned getGlobalBaseReg()
const MipsRegisterInfo * getRegisterInfo() const override
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
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...
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)
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)
EVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
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))
CallingConv::ID getCallingConv() const
Byte Swap and Counting operators.
void AnalyzeCallOperands(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn, std::vector< TargetLowering::ArgListEntry > &FuncArgs, const char *Func)
FP16_TO_FP, FP_TO_FP16 - These operators are used to perform promotions and truncation for half-preci...
int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool IsImmutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
static IntegerType * getIntNTy(LLVMContext &C, unsigned N)
const Constant * getConstVal() const
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)
const Function & getFunction() const
Return the LLVM function that this machine code represents.
static mvt_range integer_valuetypes()
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.
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...
EVT getMemoryVT() const
Return the type of the in-memory value.
unsigned getByValAlign() const
Select(COND, TRUEVAL, FALSEVAL).
void setMinFunctionAlignment(unsigned Align)
Set the target's minimum function alignment (in log2(bytes))
bool bitsLT(EVT VT) const
Return true if this has less bits than VT.
static SDValue performSHLCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
ZERO_EXTEND - Used for integer types, zeroing the new bits.
ANY_EXTEND - Used for integer types. The high bits are undefined.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(StringLiteral S, T Value)
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)
amdgpu Simplify well known AMD library false Value Value * Arg
MO_TPREL_HI/LO - Represents the hi and low part of the offset from.
const MachineBasicBlock * getParent() const
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
std::pair< SDValue, SDValue > LowerCallTo(CallLoweringInfo &CLI) const
This function lowers an abstract call to a function into an actual call.
static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
BR_JT - Jumptable branch.
unsigned getVectorTypeBreakdownForCallingConv(LLVMContext &Context, CallingConv::ID CC, EVT VT, EVT &IntermediateVT, unsigned &NumIntermediates, MVT &RegisterVT) const override
Break down vectors to the correct number of gpr sized integers.
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)
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
ArrayRef< MCPhysReg > GetVarArgRegs() const
The registers to use for the variable argument list.
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 isVector() const
Return true if this is a vector value type.
void setFormalArgInfo(unsigned Size, bool HasByval)
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
Bitwise operators - logical and, logical or, logical xor.
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 '...
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT)
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
unsigned getLocMemOffset() const
static cl::opt< bool > LargeGOT("mxgot", cl::Hidden, cl::desc("MIPS: Enable GOT larger than 64k."), cl::init(false))
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
LLVM_NODISCARD bool empty() const
bool isPositionIndependent() const
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
bool isCheapToSpeculateCtlz() const override
Return true if it is cheap to speculate a call to intrinsic ctlz.
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
Flags getFlags() const
Return the raw flags of the source value,.
void setSubReg(unsigned subReg)
SDValue lowerSTORE(SDValue Op, SelectionDAG &DAG) const
void setStackPointerRegisterToSaveRestore(unsigned R)
If set to a physical register, this specifies the register that llvm.savestack/llvm.restorestack should save and restore.
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
MipsFunctionInfo - This class is derived from MachineFunction private Mips target-specific informatio...
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)
static CCValAssign getMem(unsigned ValNo, MVT ValVT, unsigned Offset, MVT LocVT, LocInfo HTP)
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
unsigned getOpcode() const
FSINCOS - Compute both fsin and fcos as a single operation.
static SDValue performMADD_MSUBCombine(SDNode *ROOTNode, SelectionDAG &CurDAG, const MipsSubtarget &Subtarget)
SDValue getValue(unsigned R) const
unsigned getInRegsParamsCount() const
unsigned MaxStoresPerMemcpy
Specify maximum bytes of store instructions per memcpy call.
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
constexpr bool isUInt< 16 >(uint64_t x)
unsigned getNumRegisters(LLVMContext &Context, EVT VT) const
Return the number of registers that this ValueType will eventually require.
static SDValue UnpackFromArgumentSlot(SDValue Val, const CCValAssign &VA, EVT ArgVT, const SDLoc &DL, SelectionDAG &DAG)
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...
const GlobalObject * getBaseObject() const
const MachinePointerInfo & getPointerInfo() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void insert(iterator MBBI, MachineBasicBlock *MBB)
SDValue getFrameIndex(int FI, EVT VT, bool isTarget=false)
LLVM_NODISCARD char front() const
front - Get the first character in the string.
void setReturnAddressIsTaken(bool s)
void getInRegsParamInfo(unsigned InRegsParamRecordIndex, unsigned &BeginReg, unsigned &EndReg) const
void setMinStackArgumentAlignment(unsigned Align)
Set the minimum stack alignment of an argument (in log2(bytes)).
static MachinePointerInfo getGOT(MachineFunction &MF)
Return a MachinePointerInfo record that refers to a GOT entry.
LLVM Value Representation.
uint64_t getConstantOperandVal(unsigned Num) const
Helper method returns the integer value of a ConstantSDNode operand.
FMA - Perform a * b + c with no intermediate rounding step.
SDValue getRegister(unsigned Reg, EVT VT)
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.
bool CheckReturn(const SmallVectorImpl< ISD::OutputArg > &ArgsFlags, CCAssignFn Fn)
CCAssignFn * CCAssignFnForReturn() const
void rewindByValRegsInfo()
bool useSoftFloat() const
void ReplaceAllUsesOfValueWith(SDValue From, SDValue To)
Replace any uses of From with To, leaving uses of other values produced by From.getNode() alone...
StringRef - Represent a constant reference to a string, i.e.
SetCC operator - This evaluates to a true value iff the condition is true.
#define LLVM_ATTRIBUTE_UNUSED
unsigned getNumOperands() const
const SDValue & getOperand(unsigned i) const
unsigned GetNullPtr() const
bool verifyReturnAddressArgumentIsConstant(SDValue Op, SelectionDAG &DAG) const
OUTCHAIN = ATOMIC_STORE(INCHAIN, ptr, val) This corresponds to "store atomic" instruction.
bool systemSupportsUnalignedAccess() const
Does the system support unaligned memory access.
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned char TargetFlags=0) const
unsigned getLocReg() const
uint64_t getZExtValue() const
TRUNCATE - Completely drop the high bits.
unsigned getSRetReturnReg() const
const char * getTargetNodeName(unsigned Opcode) const override
getTargetNodeName - This method returns the name of a target specific
unsigned AllocateReg(unsigned Reg)
AllocateReg - Attempt to allocate one register.
const MachineOperand & getOperand(unsigned i) const
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
bool isMustTailCall() const
Tests if this call site must be tail call optimized.
unsigned getMinStackArgumentAlignment() const
Return the minimum stack alignment of an argument.
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.
LLVMContext * getContext() const
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
unsigned createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
EVT getTypeForExtReturn(LLVMContext &Context, EVT VT, ISD::NodeType) const override
Return the type that should be used to zero or sign extend a zeroext/signext integer return value...
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)
Helper operand used to generate R_MIPS_JALR.
This class is used to represent ISD::LOAD nodes.
DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned to a specified boundary...