50#define DEBUG_TYPE "asm-printer"
53 std::unique_ptr<MCStreamer> Streamer)
55 InConstantPool(
false), OptimizationGoals(-1) {}
66 InConstantPool =
false;
73 if (AFI->isThumbFunction()) {
81 if (AFI->isCmseNSEntryFunction()) {
93 assert(
Size &&
"C++ constructor pointer had zero size!");
96 assert(GV &&
"C++ constructor pointer was not a GlobalValue!");
107 if (PromotedGlobals.count(GV))
118 MCP =
MF.getConstantPool();
127 PromotedGlobals.insert_range(AFI->getGlobalsPromotedToConstantPool());
130 unsigned OptimizationGoal;
133 OptimizationGoal = 6;
134 else if (
F.hasMinSize())
136 OptimizationGoal = 4;
137 else if (
F.hasOptSize())
139 OptimizationGoal = 3;
142 OptimizationGoal = 2;
145 OptimizationGoal = 1;
148 OptimizationGoal = 5;
151 if (OptimizationGoals == -1)
152 OptimizationGoals = OptimizationGoal;
153 else if (OptimizationGoals != (
int)OptimizationGoal)
154 OptimizationGoals = 0;
156 if (
TM.getTargetTriple().isOSBinFormatCOFF()) {
157 bool Local =
F.hasLocalLinkage();
177 if (! ThumbIndirectPads.empty()) {
182 for (std::pair<unsigned, MCSymbol *> &TIP : ThumbIndirectPads) {
190 ThumbIndirectPads.clear();
228 if(ARM::GPRPairRegClass.
contains(Reg)) {
231 Reg =
TRI->getSubReg(Reg, ARM::gsub_0);
263 "execute-only should not generate constant pools");
281GetARMJTIPICJumpTableLabel(
unsigned uid)
const {
292 if (ExtraCode && ExtraCode[0]) {
293 if (ExtraCode[1] != 0)
return true;
295 switch (ExtraCode[0]) {
304 if (
MI->getOperand(OpNum).isReg()) {
305 MCRegister Reg =
MI->getOperand(OpNum).getReg().asMCReg();
312 bool Lane0 =
TRI->getSubReg(SR, ARM::ssub_0) == Reg;
319 if (!
MI->getOperand(OpNum).isImm())
321 O << ~(
MI->getOperand(OpNum).
getImm());
324 if (!
MI->getOperand(OpNum).isImm())
326 O << (
MI->getOperand(OpNum).
getImm() & 0xffff);
329 if (!
MI->getOperand(OpNum).isReg())
337 if (ARM::GPRPairRegClass.
contains(RegBegin)) {
339 Register Reg0 =
TRI->getSubReg(RegBegin, ARM::gsub_0);
341 RegBegin =
TRI->getSubReg(RegBegin, ARM::gsub_1);
349 unsigned RegOps = OpNum + 1;
350 while (
MI->getOperand(RegOps).isReg()) {
365 if (!FlagsOP.
isImm())
373 if (
F.isUseOperandTiedToDef(TiedIdx)) {
375 unsigned OpFlags =
MI->getOperand(OpNum).getImm();
377 OpNum +=
F.getNumOperandRegisters() + 1;
386 const unsigned NumVals =
F.getNumOperandRegisters();
395 if (ExtraCode[0] ==
'Q')
401 if (
F.hasRegClassConstraint(RC) &&
402 ARM::GPRPairRegClass.hasSubClassEq(
TRI->getRegClass(RC))) {
410 TRI->getSubReg(MO.
getReg(), FirstHalf ? ARM::gsub_0 : ARM::gsub_1);
416 unsigned RegOp = FirstHalf ? OpNum : OpNum + 1;
417 if (RegOp >=
MI->getNumOperands())
429 if (!
MI->getOperand(OpNum).isReg())
431 Register Reg =
MI->getOperand(OpNum).getReg();
432 if (!ARM::QPRRegClass.
contains(Reg))
436 TRI->getSubReg(Reg, ExtraCode[0] ==
'e' ? ARM::dsub_0 : ARM::dsub_1);
451 if(!ARM::GPRPairRegClass.
contains(Reg))
453 Reg =
TRI->getSubReg(Reg, ARM::gsub_1);
465 unsigned OpNum,
const char *ExtraCode,
468 if (ExtraCode && ExtraCode[0]) {
469 if (ExtraCode[1] != 0)
return true;
471 switch (ExtraCode[0]) {
473 default:
return true;
475 if (!
MI->getOperand(OpNum).isReg())
483 assert(MO.
isReg() &&
"unexpected inline asm memory operand");
496 const bool WasThumb =
isThumb(StartInfo);
497 if (!EndInfo || WasThumb !=
isThumb(*EndInfo)) {
508 const Triple &TT =
TM.getTargetTriple();
515 if (TT.isOSBinFormatELF())
520 if (!M.getModuleInlineAsm().empty() && TT.isThumb())
549 const Triple &TT =
TM.getTargetTriple();
550 if (TT.isOSBinFormatMachO()) {
560 if (!Stubs.empty()) {
565 for (
auto &Stub : Stubs)
573 if (!Stubs.empty()) {
578 for (
auto &Stub : Stubs)
597 if (OptimizationGoals > 0 &&
598 (TT.isTargetAEABI() || TT.isTargetGNUAEABI() || TT.isTargetMuslAEABI()))
600 OptimizationGoals = -1;
617 if (
F.isDeclaration())
619 return F.getFnAttribute(Attr).getValueAsString() !=
Value;
627 if (
F.isDeclaration())
629 StringRef AttrVal =
F.getFnAttribute(Attr).getValueAsString();
636 auto F = M.functions().begin();
637 auto E = M.functions().end();
643 return !
F.isDeclaration() &&
F.getDenormalModeRaw() !=
Value;
647void ARMAsmPrinter::emitAttributes() {
648 MCTargetStreamer &TS = *
OutStreamer->getTargetStreamer();
649 ARMTargetStreamer &ATS =
static_cast<ARMTargetStreamer &
>(TS);
660 const Triple &
TT =
TM.getTargetTriple();
661 StringRef CPU =
TM.getTargetCPU();
662 StringRef
FS =
TM.getTargetFeatureString();
666 ArchFS = (Twine(ArchFS) +
"," +
FS).str();
668 ArchFS = std::string(FS);
670 const ARMBaseTargetMachine &ATM =
671 static_cast<const ARMBaseTargetMachine &
>(
TM);
672 const ARMSubtarget STI(TT, std::string(CPU), ArchFS, ATM,
682 }
else if (STI.isRWPI()) {
719 if (!STI.hasVFP2Base()) {
729 }
else if (STI.hasVFP3Base()) {
746 "no-trapping-math",
"true") ||
747 TM.Options.NoTrappingFPMath)
755 if (
TM.Options.HonorSignDependentRoundingFPMathOption)
761 if (
TM.Options.NoInfsFPMath &&
TM.Options.NoNaNsFPMath)
784 if (
const Module *SourceModule =
MMI->getModule()) {
788 SourceModule->getModuleFlag(
"wchar_size"))) {
789 int WCharWidth = WCharWidthValue->getZExtValue();
790 assert((WCharWidth == 2 || WCharWidth == 4) &&
791 "wchar_t width must be 2 or 4 bytes");
799 SourceModule->getModuleFlag(
"min_enum_size"))) {
800 int EnumWidth = EnumWidthValue->getZExtValue();
801 assert((EnumWidth == 1 || EnumWidth == 4) &&
802 "Minimum enum width must be 1 or 4 bytes");
803 int EnumBuildAttr = EnumWidth == 1 ? 1 : 2;
808 SourceModule->getModuleFlag(
"sign-return-address"));
809 if (PACValue && PACValue->isOne()) {
813 if (!STI.hasPACBTI()) {
821 SourceModule->getModuleFlag(
"branch-target-enforcement"));
822 if (BTIValue && !BTIValue->isZero()) {
826 if (!STI.hasPACBTI()) {
838 else if (STI.isR9Reserved())
852 +
"BF" +
Twine(FunctionNumber) +
"_" +
Twine(LabelId));
860 +
"PC" +
Twine(FunctionNumber) +
"_" +
Twine(LabelId));
885 unsigned char TargetFlags) {
886 const Triple &
TT =
TM.getTargetTriple();
887 if (
TT.isOSBinFormatMachO()) {
896 MachineModuleInfoMachO &MMIMachO =
897 MMI->getObjFileInfo<MachineModuleInfoMachO>();
902 if (!StubSym.getPointer())
906 }
else if (
TT.isOSBinFormatCOFF()) {
907 assert(
TT.isOSWindows() &&
"Windows is the only supported COFF target");
914 SmallString<128>
Name;
924 MachineModuleInfoCOFF &MMICOFF =
925 MMI->getObjFileInfo<MachineModuleInfoCOFF>();
929 if (!StubSym.getPointer())
934 }
else if (
TT.isOSBinFormatELF()) {
958 for (
const auto *GV : ACPC->promotedGlobals()) {
959 if (!EmittedPromotedGlobalLabels.count(GV)) {
962 EmittedPromotedGlobalLabels.insert(GV);
982 MCSym = GetARMGVSymbol(GV, TF);
985 MCSym =
MBB->getSymbol();
1028 MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel(JTI);
1036 const std::vector<MachineJumpTableEntry> &JT = MJTI->
getJumpTables();
1037 const std::vector<MachineBasicBlock*> &JTBBs = JT[JTI].MBBs;
1057 else if (AFI->isThumbFunction())
1075 MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel(JTI);
1080 const std::vector<MachineJumpTableEntry> &JT = MJTI->
getJumpTables();
1081 const std::vector<MachineBasicBlock*> &JTBBs = JT[JTI].MBBs;
1088 .addExpr(MBBSymbolExpr)
1095 unsigned OffsetWidth) {
1096 assert((OffsetWidth == 1 || OffsetWidth == 2) &&
"invalid tbb/tbh width");
1104 MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel(JTI);
1109 const std::vector<MachineJumpTableEntry> &JT = MJTI->
getJumpTables();
1110 const std::vector<MachineBasicBlock*> &JTBBs = JT[JTI].MBBs;
1116 for (
auto *
MBB : JTBBs) {
1152 const MCSymbol *BranchLabel)
const {
1162 BaseLabel = GetARMJTIPICJumpTableLabel(JTI);
1169 BaseLabel = BranchLabel;
1177 BaseLabel = BranchLabel;
1182 BaseLabel =
nullptr;
1189 return std::make_tuple(BaseLabel, BaseOffset, BranchLabel, EntrySize);
1192void ARMAsmPrinter::EmitUnwindingInstruction(
const MachineInstr *
MI) {
1194 "Only instruction which are involved into frame setup code are allowed");
1204 unsigned Opc =
MI->getOpcode();
1205 unsigned SrcReg, DstReg;
1210 SrcReg = DstReg = ARM::SP;
1214 case ARM::t2MOVTi16:
1235 DstReg =
MI->getOperand(0).getReg();
1238 SrcReg = ARM::FPSCR;
1239 DstReg =
MI->getOperand(0).getReg();
1241 case ARM::VMRS_FPEXC:
1242 SrcReg = ARM::FPEXC;
1243 DstReg =
MI->getOperand(0).getReg();
1246 SrcReg =
MI->getOperand(1).getReg();
1247 DstReg =
MI->getOperand(0).getReg();
1252 if (
MI->mayStore()) {
1254 assert(DstReg == ARM::SP &&
1255 "Only stack pointer as a destination reg is supported");
1259 unsigned StartOp = 2 + 2;
1261 unsigned NumOffset = 0;
1264 unsigned PadBefore = 0;
1267 unsigned PadAfter = 0;
1275 StartOp = 2; NumOffset = 2;
1277 case ARM::STMDB_UPD:
1278 case ARM::t2STMDB_UPD:
1279 case ARM::VSTMDDB_UPD:
1280 assert(SrcReg == ARM::SP &&
1281 "Only stack pointer as a source reg is supported");
1282 for (
unsigned i = StartOp,
NumOps =
MI->getNumOperands() - NumOffset;
1295 "Pad registers must come before restored ones");
1304 if (
unsigned RemappedReg = AFI->EHPrologueRemappedRegs.lookup(
Reg))
1309 case ARM::STR_PRE_IMM:
1310 case ARM::STR_PRE_REG:
1311 case ARM::t2STR_PRE:
1312 assert(
MI->getOperand(2).getReg() == ARM::SP &&
1313 "Only stack pointer as a source reg is supported");
1314 if (
unsigned RemappedReg = AFI->EHPrologueRemappedRegs.lookup(SrcReg))
1315 SrcReg = RemappedReg;
1319 case ARM::t2STRD_PRE:
1320 assert(
MI->getOperand(3).getReg() == ARM::SP &&
1321 "Only stack pointer as a source reg is supported");
1322 SrcReg =
MI->getOperand(1).getReg();
1323 if (
unsigned RemappedReg = AFI->EHPrologueRemappedRegs.lookup(SrcReg))
1324 SrcReg = RemappedReg;
1326 SrcReg =
MI->getOperand(2).getReg();
1327 if (
unsigned RemappedReg = AFI->EHPrologueRemappedRegs.lookup(SrcReg))
1328 SrcReg = RemappedReg;
1330 PadBefore = -
MI->getOperand(4).getImm() - 8;
1343 if (SrcReg == ARM::SP) {
1359 case ARM::t2ADDri12:
1360 case ARM::t2ADDspImm:
1361 case ARM::t2ADDspImm12:
1362 Offset = -
MI->getOperand(2).getImm();
1366 case ARM::t2SUBri12:
1367 case ARM::t2SUBspImm:
1368 case ARM::t2SUBspImm12:
1369 Offset =
MI->getOperand(2).getImm();
1372 Offset =
MI->getOperand(2).getImm()*4;
1376 Offset = -
MI->getOperand(2).getImm()*4;
1380 -AFI->EHPrologueOffsetInRegs.lookup(
MI->getOperand(2).getReg());
1389 else if (DstReg == ARM::SP) {
1399 }
else if (DstReg == ARM::SP) {
1409 AFI->EHPrologueRemappedRegs[DstReg] = SrcReg;
1412 case ARM::VMRS_FPEXC:
1419 case ARM::tLDRpci: {
1422 unsigned CPI =
MI->getOperand(1).getIndex();
1423 const MachineConstantPool *MCP =
MF.getConstantPool();
1424 if (CPI >= MCP->getConstants().size())
1425 CPI = AFI->getOriginalCPIdx(CPI);
1426 assert(CPI != -1U &&
"Invalid constpool index");
1429 const MachineConstantPoolEntry &CPE = MCP->getConstants()[CPI];
1432 AFI->EHPrologueOffsetInRegs[DstReg] =
Offset;
1436 Offset =
MI->getOperand(1).getImm();
1437 AFI->EHPrologueOffsetInRegs[DstReg] =
Offset;
1439 case ARM::t2MOVTi16:
1440 Offset =
MI->getOperand(2).getImm();
1441 AFI->EHPrologueOffsetInRegs[DstReg] |= (
Offset << 16);
1444 Offset =
MI->getOperand(2).getImm();
1445 AFI->EHPrologueOffsetInRegs[DstReg] =
Offset;
1448 assert(
MI->getOperand(3).getImm() == 8 &&
1449 "The shift amount is not equal to 8");
1450 assert(
MI->getOperand(2).getReg() ==
MI->getOperand(0).getReg() &&
1451 "The source register is not equal to the destination register");
1452 AFI->EHPrologueOffsetInRegs[DstReg] <<= 8;
1455 assert(
MI->getOperand(2).getReg() ==
MI->getOperand(0).getReg() &&
1456 "The source register is not equal to the destination register");
1457 Offset =
MI->getOperand(3).getImm();
1458 AFI->EHPrologueOffsetInRegs[DstReg] +=
Offset;
1462 AFI->EHPrologueRemappedRegs[ARM::R12] = ARM::RA_AUTH_CODE;
1474#include "ARMGenMCPseudoLowering.inc"
1487void ARMAsmPrinter::EmitKCFI_CHECK_ARM32(
Register AddrReg, int64_t
Type,
1489 int64_t PrefixNops) {
1491 unsigned ScratchReg = ARM::R12;
1492 if (AddrReg == ARM::R12) {
1493 ScratchReg = ARM::R3;
1498 const ARMBaseRegisterInfo *
TRI =
static_cast<const ARMBaseRegisterInfo *
>(
1499 MF->getSubtarget().getRegisterInfo());
1500 unsigned AddrIndex =
TRI->getEncodingValue(AddrReg);
1501 unsigned ESR = 0x8000 | (31 << 5) | (AddrIndex & 31);
1535 .addImm(-(PrefixNops * 4 + 4))
1540 for (
int i = 0; i < 4; i++) {
1541 uint8_t
byte = (
Type >> (i * 8)) & 0xFF;
1542 uint32_t imm =
byte << (i * 8);
1543 bool isLast = (i == 3);
1548 "Cannot encode immediate as ARM modified immediate");
1552 MCInstBuilder(ARM::EORri)
1558 .addReg(isLast ? ARM::CPSR : ARM::NoRegister));
1576 MCInstBuilder(ARM::Bcc)
1579 .addReg(ARM::CPSR));
1587void ARMAsmPrinter::EmitKCFI_CHECK_Thumb2(
Register AddrReg, int64_t
Type,
1589 int64_t PrefixNops) {
1591 unsigned ScratchReg = ARM::R12;
1592 if (AddrReg == ARM::R12) {
1593 ScratchReg = ARM::R3;
1600 const ARMBaseRegisterInfo *
TRI =
static_cast<const ARMBaseRegisterInfo *
>(
1601 MF->getSubtarget().getRegisterInfo());
1602 unsigned AddrIndex =
TRI->getEncodingValue(AddrReg);
1603 unsigned ESR = 0x80 | (AddrIndex & 0x1F);
1614 MCInstBuilder(ARM::tPUSH).addImm(
ARMCC::AL).addReg(0).addReg(ARM::R3));
1634 .addImm(-(PrefixNops * 4 + 4))
1639 for (
int i = 0; i < 4; i++) {
1640 uint8_t
byte = (
Type >> (i * 8)) & 0xFF;
1641 uint32_t imm =
byte << (i * 8);
1642 bool isLast = (i == 3);
1646 "Cannot encode immediate as Thumb2 modified immediate");
1650 MCInstBuilder(ARM::t2EORri)
1656 .addReg(isLast ? ARM::CPSR : ARM::NoRegister));
1665 MCInstBuilder(ARM::tPOP).addImm(
ARMCC::AL).addReg(0).addReg(ARM::R3));
1671 MCInstBuilder(ARM::t2Bcc)
1674 .addReg(ARM::CPSR));
1682void ARMAsmPrinter::EmitKCFI_CHECK_Thumb1(
Register AddrReg, int64_t
Type,
1684 int64_t PrefixNops) {
1687 unsigned ScratchReg = ARM::R2;
1688 unsigned TempReg = ARM::R3;
1697 MCInstBuilder(ARM::tPUSH).addImm(
ARMCC::AL).addReg(0).addReg(ARM::R3));
1707 MCInstBuilder(ARM::tPUSH).addImm(
ARMCC::AL).addReg(0).addReg(ARM::R2));
1738 int offset = PrefixNops * 4 + 4;
1768 uint8_t byte0 = (
Type >> 0) & 0xFF;
1769 uint8_t byte1 = (
Type >> 8) & 0xFF;
1770 uint8_t byte2 = (
Type >> 16) & 0xFF;
1771 uint8_t byte3 = (
Type >> 24) & 0xFF;
1847 MCInstBuilder(ARM::tPOP).addImm(
ARMCC::AL).addReg(0).addReg(ARM::R2));
1855 MCInstBuilder(ARM::tPOP).addImm(
ARMCC::AL).addReg(0).addReg(ARM::R3));
1861 MCInstBuilder(ARM::tBcc)
1864 .addReg(ARM::CPSR));
1873 Register AddrReg =
MI.getOperand(0).getReg();
1874 const int64_t
Type =
MI.getOperand(1).getImm();
1877 assert(std::next(
MI.getIterator())->isCall() &&
1878 "KCFI_CHECK not followed by a call instruction");
1882 int64_t PrefixNops = 0;
1885 .getFnAttribute(
"patchable-function-prefix")
1887 .getAsInteger(10, PrefixNops);
1890 switch (
MI.getOpcode()) {
1891 case ARM::KCFI_CHECK_ARM:
1892 EmitKCFI_CHECK_ARM32(AddrReg,
Type,
Call, PrefixNops);
1894 case ARM::KCFI_CHECK_Thumb2:
1895 EmitKCFI_CHECK_Thumb2(AddrReg,
Type,
Call, PrefixNops);
1897 case ARM::KCFI_CHECK_Thumb1:
1898 EmitKCFI_CHECK_Thumb1(AddrReg,
Type,
Call, PrefixNops);
1906 ARM_MC::verifyInstructionPredicates(
MI->getOpcode(),
1915 if (InConstantPool &&
MI->getOpcode() != ARM::CONSTPOOL_ENTRY) {
1917 InConstantPool =
false;
1921 if (
TM.getTargetTriple().isTargetEHABICompatible() &&
1923 EmitUnwindingInstruction(
MI);
1926 if (
MCInst OutInst; lowerPseudoInstExpansion(
MI, OutInst)) {
1932 "Pseudo flag setting opcode should be expanded early");
1935 unsigned Opc =
MI->getOpcode();
1937 case ARM::t2MOVi32imm:
llvm_unreachable(
"Should be lowered by thumb2it pass");
1938 case ARM::DBG_VALUE:
llvm_unreachable(
"Should be handled by generic printing");
1939 case ARM::KCFI_CHECK_ARM:
1940 case ARM::KCFI_CHECK_Thumb2:
1941 case ARM::KCFI_CHECK_Thumb1:
1945 case ARM::tLEApcrel:
1946 case ARM::t2LEApcrel: {
1950 ARM::t2LEApcrel ? ARM::t2ADR
1951 : (
MI->getOpcode() == ARM::tLEApcrel ? ARM::tADR
1953 .
addReg(
MI->getOperand(0).getReg())
1956 .
addImm(
MI->getOperand(2).getImm())
1957 .
addReg(
MI->getOperand(3).getReg()));
1960 case ARM::LEApcrelJT:
1961 case ARM::tLEApcrelJT:
1962 case ARM::t2LEApcrelJT: {
1964 GetARMJTIPICJumpTableLabel(
MI->getOperand(1).getIndex());
1966 ARM::t2LEApcrelJT ? ARM::t2ADR
1967 : (
MI->getOpcode() == ARM::tLEApcrelJT ? ARM::tADR
1969 .
addReg(
MI->getOperand(0).getReg())
1972 .
addImm(
MI->getOperand(2).getImm())
1973 .
addReg(
MI->getOperand(3).getReg()));
1978 case ARM::BX_CALL: {
1988 assert(STI.hasV4TOps() &&
"Expected V4TOps for BX call");
1993 case ARM::tBX_CALL: {
1994 assert(!STI.hasV5TOps() &&
"Expected BLX to be selected for v5t+");
2004 for (std::pair<unsigned, MCSymbol *> &TIP : ThumbIndirectPads) {
2005 if (TIP.first == TReg) {
2006 TRegSym = TIP.second;
2013 ThumbIndirectPads.push_back(std::make_pair(TReg, TRegSym));
2023 case ARM::BMOVPCRX_CALL: {
2035 .addReg(
MI->getOperand(0).getReg())
2043 case ARM::BMOVPCB_CALL: {
2055 const unsigned TF =
Op.getTargetFlags();
2056 MCSymbol *GVSym = GetARMGVSymbol(GV, TF);
2065 case ARM::MOVi16_ga_pcrel:
2066 case ARM::t2MOVi16_ga_pcrel: {
2068 TmpInst.
setOpcode(
Opc == ARM::MOVi16_ga_pcrel? ARM::MOVi16 : ARM::t2MOVi16);
2071 unsigned TF =
MI->getOperand(1).getTargetFlags();
2073 MCSymbol *GVSym = GetARMGVSymbol(GV, TF);
2080 unsigned PCAdj = (
Opc == ARM::MOVi16_ga_pcrel) ? 8 : 4;
2099 case ARM::MOVTi16_ga_pcrel:
2100 case ARM::t2MOVTi16_ga_pcrel: {
2103 ? ARM::MOVTi16 : ARM::t2MOVTi16);
2107 unsigned TF =
MI->getOperand(2).getTargetFlags();
2109 MCSymbol *GVSym = GetARMGVSymbol(GV, TF);
2116 unsigned PCAdj = (
Opc == ARM::MOVTi16_ga_pcrel) ? 8 : 4;
2147 if (
MI->getOperand(1).isReg()) {
2149 MCInst.addReg(
MI->getOperand(1).getReg());
2152 const MCExpr *BranchTarget;
2153 if (
MI->getOperand(1).isMBB())
2156 else if (
MI->getOperand(1).isGlobal()) {
2159 GetARMGVSymbol(GV,
MI->getOperand(1).getTargetFlags()),
OutContext);
2160 }
else if (
MI->getOperand(1).isSymbol()) {
2167 MCInst.addExpr(BranchTarget);
2170 if (
Opc == ARM::t2BFic) {
2175 MCInst.addExpr(ElseLabel);
2176 MCInst.addImm(
MI->getOperand(3).getImm());
2178 MCInst.addImm(
MI->getOperand(2).getImm())
2179 .addReg(
MI->getOperand(3).getReg());
2185 case ARM::t2BF_LabelPseudo: {
2194 case ARM::tPICADD: {
2207 .addReg(
MI->getOperand(0).getReg())
2208 .
addReg(
MI->getOperand(0).getReg())
2228 .addReg(
MI->getOperand(0).getReg())
2230 .
addReg(
MI->getOperand(1).getReg())
2232 .
addImm(
MI->getOperand(3).getImm())
2233 .
addReg(
MI->getOperand(4).getReg())
2245 case ARM::PICLDRSH: {
2259 switch (
MI->getOpcode()) {
2262 case ARM::PICSTR: Opcode = ARM::STRrs;
break;
2263 case ARM::PICSTRB: Opcode = ARM::STRBrs;
break;
2264 case ARM::PICSTRH: Opcode = ARM::STRH;
break;
2265 case ARM::PICLDR: Opcode = ARM::LDRrs;
break;
2266 case ARM::PICLDRB: Opcode = ARM::LDRBrs;
break;
2267 case ARM::PICLDRH: Opcode = ARM::LDRH;
break;
2268 case ARM::PICLDRSB: Opcode = ARM::LDRSB;
break;
2269 case ARM::PICLDRSH: Opcode = ARM::LDRSH;
break;
2272 .addReg(
MI->getOperand(0).getReg())
2274 .
addReg(
MI->getOperand(1).getReg())
2277 .
addImm(
MI->getOperand(3).getImm())
2278 .
addReg(
MI->getOperand(4).getReg()));
2282 case ARM::CONSTPOOL_ENTRY: {
2283 assert(!STI.genExecuteOnly() &&
2284 "execute-only should not generate constant pools");
2291 unsigned LabelId = (
unsigned)
MI->getOperand(0).getImm();
2292 unsigned CPIdx = (
unsigned)
MI->getOperand(1).getIndex();
2295 if (!InConstantPool) {
2297 InConstantPool =
true;
2309 case ARM::JUMPTABLE_ADDRS:
2312 case ARM::JUMPTABLE_INSTS:
2315 case ARM::JUMPTABLE_TBB:
2316 case ARM::JUMPTABLE_TBH:
2319 case ARM::t2BR_JT: {
2322 .addReg(
MI->getOperand(0).getReg())
2329 case ARM::t2TBH_JT: {
2330 unsigned Opc =
MI->getOpcode() == ARM::t2TBB_JT ? ARM::t2TBB : ARM::t2TBH;
2334 .addReg(
MI->getOperand(0).getReg())
2335 .
addReg(
MI->getOperand(1).getReg())
2342 case ARM::tTBH_JT: {
2344 bool Is8Bit =
MI->getOpcode() == ARM::tTBB_JT;
2347 assert(
MI->getOperand(1).isKill() &&
"We need the index register as scratch!");
2360 if (
Base == ARM::PC) {
2383 unsigned Opc = Is8Bit ? ARM::tLDRBi : ARM::tLDRHi;
2387 .addImm(Is8Bit ? 4 : 2)
2397 unsigned Opc = Is8Bit ? ARM::tLDRBr : ARM::tLDRHr;
2430 unsigned Opc =
MI->getOpcode() == ARM::BR_JTr ?
2431 ARM::MOVr : ARM::tMOVr;
2439 if (
Opc == ARM::MOVr)
2444 case ARM::BR_JTm_i12: {
2457 case ARM::BR_JTm_rs: {
2471 case ARM::BR_JTadd: {
2475 .addReg(
MI->getOperand(0).getReg())
2476 .
addReg(
MI->getOperand(1).getReg())
2490 if (!
TM.getTargetTriple().isOSBinFormatMachO()) {
2501 if (!
TM.getTargetTriple().isOSBinFormatMachO()) {
2509 case ARM::t2Int_eh_sjlj_setjmp:
2510 case ARM::t2Int_eh_sjlj_setjmp_nofp:
2511 case ARM::tInt_eh_sjlj_setjmp: {
2520 Register SrcReg =
MI->getOperand(0).getReg();
2521 Register ValReg =
MI->getOperand(1).getReg();
2561 .addExpr(SymbolExpr)
2578 case ARM::Int_eh_sjlj_setjmp_nofp:
2579 case ARM::Int_eh_sjlj_setjmp: {
2586 Register SrcReg =
MI->getOperand(0).getReg();
2587 Register ValReg =
MI->getOperand(1).getReg();
2638 case ARM::Int_eh_sjlj_longjmp: {
2643 Register SrcReg =
MI->getOperand(0).getReg();
2644 Register ScratchReg =
MI->getOperand(1).getReg();
2697 case ARM::tInt_eh_sjlj_longjmp: {
2703 Register SrcReg =
MI->getOperand(0).getReg();
2704 Register ScratchReg =
MI->getOperand(1).getReg();
2766 case ARM::tInt_WIN_eh_sjlj_longjmp: {
2771 Register SrcReg =
MI->getOperand(0).getReg();
2796 case ARM::PATCHABLE_FUNCTION_ENTER:
2799 case ARM::PATCHABLE_FUNCTION_EXIT:
2802 case ARM::PATCHABLE_TAIL_CALL:
2805 case ARM::SpeculationBarrierISBDSBEndBB: {
2817 case ARM::t2SpeculationBarrierISBDSBEndBB: {
2833 case ARM::SpeculationBarrierSBEndBB: {
2840 case ARM::t2SpeculationBarrierSBEndBB: {
2848 case ARM::SEH_StackAlloc:
2850 MI->getOperand(1).getImm());
2853 case ARM::SEH_SaveRegs:
2854 case ARM::SEH_SaveRegs_Ret:
2856 MI->getOperand(1).getImm());
2859 case ARM::SEH_SaveSP:
2863 case ARM::SEH_SaveFRegs:
2865 MI->getOperand(1).getImm());
2868 case ARM::SEH_SaveLR:
2873 case ARM::SEH_Nop_Ret:
2877 case ARM::SEH_PrologEnd:
2881 case ARM::SEH_EpilogStart:
2885 case ARM::SEH_EpilogEnd:
2907LLVMInitializeARMAsmPrinter() {
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static bool isRegisterLiveInCall(const MachineInstr &Call, MCRegister Reg)
static void emitNonLazySymbolPointer(MCStreamer &OutStreamer, MCSymbol *StubLabel, MachineModuleInfoImpl::StubValueTy &MCSym)
static uint8_t getModifierSpecifier(ARMCP::ARMCPModifier Modifier)
static MCSymbol * getPICLabel(StringRef Prefix, unsigned FunctionNumber, unsigned LabelId, MCContext &Ctx)
static bool checkDenormalAttributeInconsistency(const Module &M)
static bool checkFunctionsAttributeConsistency(const Module &M, StringRef Attr, StringRef Value)
static bool isThumb(const MCSubtargetInfo &STI)
static MCSymbol * getBFLabel(StringRef Prefix, unsigned FunctionNumber, unsigned LabelId, MCContext &Ctx)
static bool checkDenormalAttributeConsistency(const Module &M, StringRef Attr, DenormalMode Value)
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
#define LLVM_EXTERNAL_VISIBILITY
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Module.h This file contains the declarations for the Module class.
const size_t AbstractManglingParser< Derived, Alloc >::NumOps
Machine Check Debug Module
Register const TargetRegisterInfo * TRI
Promote Memory to Register
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
This file defines the SmallString class.
static TableGen::Emitter::Opt Y("gen-skeleton-entry", EmitSkeleton, "Generate example skeleton entry")
static TableGen::Emitter::OptClass< SkeletonEmitter > X("gen-skeleton-class", "Generate example skeleton class")
static const unsigned FramePtr
void emitJumpTableAddrs(const MachineInstr *MI)
void emitJumpTableTBInst(const MachineInstr *MI, unsigned OffsetWidth)
void emitFunctionBodyEnd() override
Targets can override this to emit stuff after the last basic block in the function.
bool runOnMachineFunction(MachineFunction &F) override
runOnMachineFunction - This uses the emitInstruction() method to print assembly for each instruction.
MCSymbol * GetCPISymbol(unsigned CPID) const override
Return the symbol for the specified constant pool entry.
void printOperand(const MachineInstr *MI, int OpNum, raw_ostream &O)
void emitStartOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the start of their fi...
ARMAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
void emitFunctionEntryLabel() override
EmitFunctionEntryLabel - Emit the label that is the entrypoint for the function.
void emitInlineAsmEnd(const MCSubtargetInfo &StartInfo, const MCSubtargetInfo *EndInfo) const override
Let the target do anything it needs to do after emitting inlineasm.
void LowerPATCHABLE_FUNCTION_EXIT(const MachineInstr &MI)
void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override
EmitMachineConstantPoolValue - Print a machine constantpool value to the .s file.
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNum, const char *ExtraCode, raw_ostream &O) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
void emitXXStructor(const DataLayout &DL, const Constant *CV) override
Targets can override this to change how global constants that are part of a C++ static/global constru...
void LowerPATCHABLE_FUNCTION_ENTER(const MachineInstr &MI)
void LowerPATCHABLE_TAIL_CALL(const MachineInstr &MI)
void emitEndOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the end of their file...
std::tuple< const MCSymbol *, uint64_t, const MCSymbol *, codeview::JumpTableEntrySize > getCodeViewJumpTableInfo(int JTI, const MachineInstr *BranchInstr, const MCSymbol *BranchLabel) const override
Gets information required to create a CodeView debug symbol for a jump table.
void emitJumpTableInsts(const MachineInstr *MI)
const ARMBaseTargetMachine & getTM() const
void emitGlobalVariable(const GlobalVariable *GV) override
Emit the specified global variable to the .s file.
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNum, const char *ExtraCode, raw_ostream &O) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as...
void emitInstruction(const MachineInstr *MI) override
Targets should implement this to emit instructions.
void PrintSymbolOperand(const MachineOperand &MO, raw_ostream &O) override
Print the MachineOperand as a symbol.
void LowerKCFI_CHECK(const MachineInstr &MI)
bool isGVIndirectSymbol(const GlobalValue *GV) const
bool isLittleEndian() const
ARMConstantPoolValue - ARM specific constantpool value.
bool isPromotedGlobal() const
unsigned char getPCAdjustment() const
bool isMachineBasicBlock() const
bool isGlobalValue() const
ARMCP::ARMCPModifier getModifier() const
bool mustAddCurrentAddress() const
unsigned getLabelId() const
bool isBlockAddress() const
ARMFunctionInfo - This class is derived from MachineFunctionInfo and contains private ARM-specific in...
static const char * getRegisterName(MCRegister Reg, unsigned AltIdx=ARM::NoRegAltName)
bool isThumb1Only() const
MCPhysReg getFramePointerReg() const
bool isTargetWindows() const
bool isTargetDarwin() const
void emitTargetAttributes(const MCSubtargetInfo &STI)
Emit the build attributes that only depend on the hardware that we expect.
virtual void emitSetFP(MCRegister FpReg, MCRegister SpReg, int64_t Offset=0)
virtual void finishAttributeSection()
virtual void emitMovSP(MCRegister Reg, int64_t Offset=0)
virtual void emitARMWinCFISaveSP(unsigned Reg)
virtual void emitInst(uint32_t Inst, char Suffix='\0')
virtual void emitARMWinCFISaveLR(unsigned Offset)
virtual void emitTextAttribute(unsigned Attribute, StringRef String)
virtual void emitARMWinCFIAllocStack(unsigned Size, bool Wide)
virtual void emitARMWinCFISaveRegMask(unsigned Mask, bool Wide)
virtual void emitRegSave(const SmallVectorImpl< MCRegister > &RegList, bool isVector)
virtual void emitARMWinCFIEpilogEnd()
virtual void emitARMWinCFIPrologEnd(bool Fragment)
virtual void switchVendor(StringRef Vendor)
virtual void emitCode16()
virtual void emitARMWinCFISaveFRegs(unsigned First, unsigned Last)
virtual void emitSyntaxUnified()
virtual void emitARMWinCFIEpilogStart(unsigned Condition)
virtual void emitPad(int64_t Offset)
virtual void emitAttribute(unsigned Attribute, unsigned Value)
virtual void emitARMWinCFINop(bool Wide)
const TargetLoweringObjectFile & getObjFileLowering() const
Return information about object file lowering.
MCSymbol * getSymbolWithGlobalValueBase(const GlobalValue *GV, StringRef Suffix) const
Return the MCSymbol for a private symbol with global value name as its base, with the specified suffi...
MCSymbol * getSymbol(const GlobalValue *GV) const
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
virtual void emitGlobalVariable(const GlobalVariable *GV)
Emit the specified global variable to the .s file.
TargetMachine & TM
Target machine description.
void emitXRayTable()
Emit a table with all XRay instrumentation points.
MCSymbol * getMBBExceptionSym(const MachineBasicBlock &MBB)
const MCAsmInfo * MAI
Target Asm Printer information.
MachineFunction * MF
The current machine function.
virtual void SetupMachineFunction(MachineFunction &MF)
This should be called when a new MachineFunction is being processed from runOnMachineFunction.
void emitFunctionBody()
This method emits the body and trailer for a function.
virtual void emitLinkage(const GlobalValue *GV, MCSymbol *GVSym) const
This emits linkage information about GVSym based on GV, if this is supported by the target.
unsigned getFunctionNumber() const
Return a unique ID for the current function.
AsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer, char &ID=AsmPrinter::ID)
void printOffset(int64_t Offset, raw_ostream &OS) const
This is just convenient handler for printing offsets.
void emitGlobalConstant(const DataLayout &DL, const Constant *CV, AliasMapTy *AliasList=nullptr)
EmitGlobalConstant - Print a general LLVM constant to the .s file.
MCSymbol * getSymbolPreferLocal(const GlobalValue &GV) const
Similar to getSymbol() but preferred for references.
MCSymbol * CurrentFnSym
The symbol for the current function.
MachineModuleInfo * MMI
This is a pointer to the current MachineModuleInfo.
void emitAlignment(Align Alignment, const GlobalObject *GV=nullptr, unsigned MaxBytesToEmit=0) const
Emit an alignment directive to the specified power of two boundary.
MCContext & OutContext
This is the context for the output file that we are streaming.
bool isPositionIndependent() const
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
void getNameWithPrefix(SmallVectorImpl< char > &Name, const GlobalValue *GV) const
MCSymbol * GetBlockAddressSymbol(const BlockAddress *BA) const
Return the MCSymbol used to satisfy BlockAddress uses of the specified basic block.
const DataLayout & getDataLayout() const
Return information about data layout.
virtual void emitFunctionEntryLabel()
EmitFunctionEntryLabel - Emit the label that is the entrypoint for the function.
MCSymbol * GetExternalSymbolSymbol(const Twine &Sym) const
Return the MCSymbol for the specified ExternalSymbol.
const MCSubtargetInfo & getSubtargetInfo() const
Return information about subtarget.
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
The address of a basic block.
This is an important base class in LLVM.
const Constant * stripPointerCasts() const
A parsed version of the target data layout string in and methods for querying it.
LLVM_ABI TypeSize getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
bool isThreadLocal() const
If the value is "Thread Local", its value isn't shared by the threads.
bool hasInternalLinkage() const
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())
static const MCBinaryExpr * createDiv(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Context object for machine code objects.
LLVM_ABI MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Base class for the full range of assembler expressions which are needed for parsing.
MCInstBuilder & addReg(MCRegister Reg)
Add a new register operand.
MCInstBuilder & addImm(int64_t Val)
Add a new integer immediate operand.
MCInstBuilder & addExpr(const MCExpr *Val)
Add a new MCExpr operand.
Instances of this class represent a single low-level machine instruction.
void addOperand(const MCOperand Op)
void setOpcode(unsigned Op)
MCSection * getThreadLocalPointerSection() const
MCSection * getNonLazySymbolPointerSection() const
static MCOperand createExpr(const MCExpr *Val)
static MCOperand createReg(MCRegister Reg)
static MCOperand createImm(int64_t Val)
Wrapper class representing physical registers. Should be passed by value.
Streaming machine code generation interface.
virtual bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute)=0
Add the given Attribute to Symbol.
MCContext & getContext() const
void emitValue(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
virtual void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
virtual void emitIntValue(uint64_t Value, unsigned Size)
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers.
Generic base class for all target subtargets.
bool hasFeature(unsigned Feature) const
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
LLVM_ABI void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.
Target specific streamer interface.
LLVM_ABI MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
This class is a data container for one entry in a MachineConstantPool.
union llvm::MachineConstantPoolEntry::@004270020304201266316354007027341142157160323045 Val
The constant itself.
bool isMachineConstantPoolEntry() const
isMachineConstantPoolEntry - Return true if the MachineConstantPoolEntry is indeed a target specific ...
MachineConstantPoolValue * MachineCPVal
const Constant * ConstVal
Abstract base class for all machine specific constantpool value subclasses.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Representation of each machine instruction.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const MachineOperand & getOperand(unsigned i) const
const std::vector< MachineJumpTableEntry > & getJumpTables() const
StubValueTy & getGVStubEntry(MCSymbol *Sym)
std::vector< std::pair< MCSymbol *, StubValueTy > > SymbolListTy
PointerIntPair< MCSymbol *, 1, bool > StubValueTy
MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation for MachO targets.
SymbolListTy GetThreadLocalGVStubList()
StubValueTy & getGVStubEntry(MCSymbol *Sym)
StubValueTy & getThreadLocalGVStubEntry(MCSymbol *Sym)
SymbolListTy GetGVStubList()
Accessor methods to return the set of stubs in sorted order.
MachineOperand class - Representation of each machine instruction operand.
unsigned getSubReg() const
const GlobalValue * getGlobal() const
bool isReg() const
isReg - Tests if this is a MO_Register operand.
MachineBasicBlock * getMBB() const
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
unsigned getTargetFlags() const
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
Register getReg() const
getReg - Returns the register number.
@ MO_Immediate
Immediate operand.
@ MO_ConstantPoolIndex
Address of indexed Constant in Constant Pool.
@ MO_GlobalAddress
Address of a global value.
@ MO_MachineBasicBlock
MachineBasicBlock reference.
@ MO_Register
Register operand.
int64_t getOffset() const
Return the offset from the symbol in this operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
A Module instance is used to store all the information related to an LLVM module.
virtual void print(raw_ostream &OS, const Module *M) const
print - Print out the internal state of the pass.
Pass(PassKind K, char &pid)
PointerTy getPointer() const
Wrapper class representing virtual and physical registers.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Primary interface to the complete machine description for the target machine.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
TypeSize getRegSizeInBits(const TargetRegisterClass &RC) const
Return the size in bits of a register from class RC.
virtual Register getFrameRegister(const MachineFunction &MF) const =0
Debug information queries.
virtual const TargetRegisterInfo * getRegisterInfo() const =0
Return the target's register information.
Triple - Helper class for working with autoconf configuration names.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an SmallVector or SmallString.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ SECREL
Thread Pointer Offset.
@ GOT_PREL
Thread Local Storage (General Dynamic Mode)
@ SBREL
Section Relative (Windows TLS)
@ GOTTPOFF
Global Offset Table, PC Relative.
@ TPOFF
Global Offset Table, Thread Pointer Offset.
@ MO_LO16
MO_LO16 - On a symbol operand, this represents a relocation containing lower 16 bit of the address.
@ MO_LO_0_7
MO_LO_0_7 - On a symbol operand, this represents a relocation containing bits 0 through 7 of the addr...
@ MO_LO_8_15
MO_LO_8_15 - On a symbol operand, this represents a relocation containing bits 8 through 15 of the ad...
@ MO_NONLAZY
MO_NONLAZY - This is an independent flag, on a symbol operand "FOO" it represents a symbol which,...
@ MO_HI_8_15
MO_HI_8_15 - On a symbol operand, this represents a relocation containing bits 24 through 31 of the a...
@ MO_HI16
MO_HI16 - On a symbol operand, this represents a relocation containing higher 16 bit of the address.
@ MO_DLLIMPORT
MO_DLLIMPORT - On a symbol operand, this represents that the reference to the symbol is for an import...
@ MO_HI_0_7
MO_HI_0_7 - On a symbol operand, this represents a relocation containing bits 16 through 23 of the ad...
@ MO_COFFSTUB
MO_COFFSTUB - On a symbol operand "FOO", this indicates that the reference is actually to the "....
int getSOImmVal(unsigned Arg)
getSOImmVal - Given a 32-bit immediate, if it is something that can fit into an shifter_operand immed...
int getT2SOImmVal(unsigned Arg)
getT2SOImmVal - Given a 32-bit immediate, if it is something that can fit into a Thumb-2 shifter_oper...
std::string ParseARMTriple(const Triple &TT, StringRef CPU)
const MCSpecifierExpr * createLower16(const MCExpr *Expr, MCContext &Ctx)
const MCSpecifierExpr * createUpper16(const MCExpr *Expr, MCContext &Ctx)
SymbolStorageClass
Storage class tells where and what the symbol represents.
@ IMAGE_SYM_CLASS_EXTERNAL
External symbol.
@ IMAGE_SYM_CLASS_STATIC
Static.
@ IMAGE_SYM_DTYPE_FUNCTION
A function that returns a base type.
@ SCT_COMPLEX_TYPE_SHIFT
Type is formed as (base + (derived << SCT_COMPLEX_TYPE_SHIFT))
std::enable_if_t< detail::IsValidPointer< X, Y >::value, X * > extract_or_null(Y &&MD)
Extract a Value from Metadata, allowing null.
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Target & getTheThumbBETarget()
@ MCDR_DataRegionEnd
.end_data_region
@ MCDR_DataRegion
.data_region
@ MCDR_DataRegionJT8
.data_region jt8
@ MCDR_DataRegionJT32
.data_region jt32
@ MCDR_DataRegionJT16
.data_region jt16
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
MachineInstr * getImm(const MachineOperand &MO, const MachineRegisterInfo *MRI)
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
void LowerARMMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI, ARMAsmPrinter &AP)
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
DWARFExpression::Operation Op
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
DenormalMode parseDenormalFPAttribute(StringRef Str)
Returns the denormal mode to use for inputs and outputs.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Target & getTheARMLETarget()
unsigned convertAddSubFlagsOpcode(unsigned OldOpc)
Map pseudo instructions that imply an 'S' bit onto real opcodes.
@ MCSA_IndirectSymbol
.indirect_symbol (MachO)
@ MCSA_ELF_TypeFunction
.type _foo, STT_FUNC # aka @function
Target & getTheARMBETarget()
Target & getTheThumbLETarget()
Implement std::hash so that hash_code can be used in STL containers.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Represent subnormal handling kind for floating point instruction inputs and outputs.
static constexpr DenormalMode getPositiveZero()
static constexpr DenormalMode getPreserveSign()
static constexpr DenormalMode getIEEE()
RegisterAsmPrinter - Helper template for registering a target specific assembly printer,...