69 #define DEBUG_TYPE "arm-instrinfo"
71 #define GET_INSTRINFO_CTOR_DTOR
72 #include "ARMGenInstrInfo.inc"
76 cl::desc(
"Enable ARM 2-addr to 3-addr conv"));
90 { ARM::VMLAS, ARM::VMULS, ARM::VADDS,
false,
false },
91 { ARM::VMLSS, ARM::VMULS, ARM::VSUBS,
false,
false },
92 { ARM::VMLAD, ARM::VMULD, ARM::VADDD,
false,
false },
93 { ARM::VMLSD, ARM::VMULD, ARM::VSUBD,
false,
false },
94 { ARM::VNMLAS, ARM::VNMULS, ARM::VSUBS,
true,
false },
95 { ARM::VNMLSS, ARM::VMULS, ARM::VSUBS,
true,
false },
96 { ARM::VNMLAD, ARM::VNMULD, ARM::VSUBD,
true,
false },
97 { ARM::VNMLSD, ARM::VMULD, ARM::VSUBD,
true,
false },
100 { ARM::VMLAfd, ARM::VMULfd, ARM::VADDfd,
false,
false },
101 { ARM::VMLSfd, ARM::VMULfd, ARM::VSUBfd,
false,
false },
102 { ARM::VMLAfq, ARM::VMULfq, ARM::VADDfq,
false,
false },
103 { ARM::VMLSfq, ARM::VMULfq, ARM::VSUBfq,
false,
false },
104 { ARM::VMLAslfd, ARM::VMULslfd, ARM::VADDfd,
false,
true },
105 { ARM::VMLSslfd, ARM::VMULslfd, ARM::VSUBfd,
false,
true },
106 { ARM::VMLAslfq, ARM::VMULslfq, ARM::VADDfq,
false,
true },
107 { ARM::VMLSslfq, ARM::VMULslfq, ARM::VSUBfq,
false,
true },
126 if (usePreRAHazardRecognizer()) {
128 static_cast<const ARMSubtarget *
>(STI)->getInstrItineraryData();
153 default:
return nullptr;
176 unsigned WBReg = WB.
getReg();
177 unsigned BaseReg = Base.
getReg();
178 unsigned OffReg = Offset.
getReg();
192 get(isSub ? ARM::SUBri : ARM::ADDri), WBReg)
197 }
else if (Amt != 0) {
201 get(isSub ? ARM::SUBrsi : ARM::ADDrsi), WBReg)
210 get(isSub ? ARM::SUBrr : ARM::ADDrr), WBReg)
223 get(isSub ? ARM::SUBri : ARM::ADDri), WBReg)
230 get(isSub ? ARM::SUBrr : ARM::ADDrr), WBReg)
239 std::vector<MachineInstr*> NewMIs;
254 NewMIs.push_back(MemMI);
255 NewMIs.push_back(UpdateMI);
272 NewMIs.push_back(UpdateMI);
273 NewMIs.push_back(MemMI);
285 MachineInstr *NewMI = (Reg == WBReg) ? UpdateMI : MemMI;
290 for (
unsigned j = 0; j < 2; ++j) {
297 VI.
Kills.push_back(NewMI);
306 MFI->insert(MBBI, NewMIs[1]);
307 MFI->insert(MBBI, NewMIs[0]);
316 bool AllowModify)
const {
321 if (I == MBB.
begin())
327 while (
isPredicated(*I) || I->isTerminator() || I->isDebugValue()) {
331 bool CantAnalyze =
false;
334 while (I->isDebugValue() || !I->isTerminator()) {
335 if (I == MBB.
begin())
346 TBB = I->getOperand(0).getMBB();
352 assert(!FBB &&
"FBB should have been null.");
354 TBB = I->getOperand(0).getMBB();
357 }
else if (I->isReturn()) {
380 while (DI != MBB.
end()) {
391 if (I == MBB.
begin())
403 int *BytesRemoved)
const {
404 assert(!BytesRemoved &&
"code size not handled");
415 I->eraseFromParent();
419 if (I == MBB.
begin())
return 1;
425 I->eraseFromParent();
434 int *BytesAdded)
const {
435 assert(!BytesAdded &&
"code size not handled");
444 assert(TBB &&
"insertBranch must not be told to insert a fallthrough");
446 "ARM branch conditions have two components!");
487 while (++I != E && I->isInsideBundle()) {
488 int PIdx = I->findFirstPredOperandIdx();
489 if (PIdx != -1 && I->getOperand(PIdx).getImm() !=
ARMCC::AL)
505 .addImm(Pred[0].getImm())
506 .addReg(Pred[1].
getReg());
513 PMO.
setImm(Pred[0].getImm());
522 if (Pred1.
size() > 2 || Pred2.
size() > 2)
562 for (
const auto &MO : MI.
operands())
563 if (MO.isReg() && MO.getReg() == ARM::CPSR && MO.isDef() && !MO.isDead())
571 return Offset.
getReg() != 0;
582 int64_t OpcImm = Opc.
getImm();
585 return (isSub && Offset.
getReg() != 0);
591 unsigned OffImm = Opc.
getImm();
599 unsigned OffImm = Opc.
getImm();
605 bool SimpleScaled = (isAdd && ShiftOpc ==
ARM_AM::lsl && Amt == 2);
606 return !SimpleScaled;
625 default:
return true;
684 for (
unsigned i = 0, e =
MI->getNumOperands(); i != e; ++i) {
688 if (MO.
getReg() != ARM::CPSR)
718 case TargetOpcode::BUNDLE:
719 return getInstBundleLength(MI);
720 case ARM::MOVi16_ga_pcrel:
721 case ARM::MOVTi16_ga_pcrel:
722 case ARM::t2MOVi16_ga_pcrel:
723 case ARM::t2MOVTi16_ga_pcrel:
726 case ARM::t2MOVi32imm:
728 case ARM::CONSTPOOL_ENTRY:
729 case ARM::JUMPTABLE_INSTS:
730 case ARM::JUMPTABLE_ADDRS:
731 case ARM::JUMPTABLE_TBB:
732 case ARM::JUMPTABLE_TBH:
736 case ARM::Int_eh_sjlj_longjmp:
738 case ARM::tInt_eh_sjlj_longjmp:
740 case ARM::tInt_WIN_eh_sjlj_longjmp:
742 case ARM::Int_eh_sjlj_setjmp:
743 case ARM::Int_eh_sjlj_setjmp_nofp:
745 case ARM::tInt_eh_sjlj_setjmp:
746 case ARM::t2Int_eh_sjlj_setjmp:
747 case ARM::t2Int_eh_sjlj_setjmp_nofp:
754 unsigned ARMBaseInstrInfo::getInstBundleLength(
const MachineInstr &
MI)
const {
758 while (++I != E && I->isInsideBundle()) {
759 assert(!I->isBundle() &&
"No nested bundle!");
767 unsigned DestReg,
bool KillSrc,
769 unsigned Opc = Subtarget.
isThumb()
770 ? (Subtarget.
isMClass() ? ARM::t2MRS_M : ARM::t2MRS_AR)
774 BuildMI(MBB, I, I->getDebugLoc(),
get(Opc), DestReg);
787 unsigned SrcReg,
bool KillSrc,
789 unsigned Opc = Subtarget.
isThumb()
790 ? (Subtarget.
isMClass() ? ARM::t2MSR_M : ARM::t2MSR_AR)
808 unsigned SrcReg,
bool KillSrc)
const {
809 bool GPRDest = ARM::GPRRegClass.contains(DestReg);
810 bool GPRSrc = ARM::GPRRegClass.contains(SrcReg);
812 if (GPRDest && GPRSrc) {
813 BuildMI(MBB, I, DL,
get(ARM::MOVr), DestReg)
820 bool SPRDest = ARM::SPRRegClass.contains(DestReg);
821 bool SPRSrc = ARM::SPRRegClass.contains(SrcReg);
824 if (SPRDest && SPRSrc)
826 else if (GPRDest && SPRSrc)
828 else if (SPRDest && GPRSrc)
832 else if (ARM::QPRRegClass.
contains(DestReg, SrcReg))
838 if (Opc == ARM::VORRq)
845 unsigned BeginIdx = 0;
846 unsigned SubRegs = 0;
850 if (ARM::QQPRRegClass.
contains(DestReg, SrcReg)) {
852 BeginIdx = ARM::qsub_0;
854 }
else if (ARM::QQQQPRRegClass.
contains(DestReg, SrcReg)) {
856 BeginIdx = ARM::qsub_0;
859 }
else if (ARM::DPairRegClass.
contains(DestReg, SrcReg)) {
861 BeginIdx = ARM::dsub_0;
863 }
else if (ARM::DTripleRegClass.
contains(DestReg, SrcReg)) {
865 BeginIdx = ARM::dsub_0;
867 }
else if (ARM::DQuadRegClass.
contains(DestReg, SrcReg)) {
869 BeginIdx = ARM::dsub_0;
871 }
else if (ARM::GPRPairRegClass.
contains(DestReg, SrcReg)) {
872 Opc = Subtarget.
isThumb2() ? ARM::tMOVr : ARM::MOVr;
873 BeginIdx = ARM::gsub_0;
875 }
else if (ARM::DPairSpcRegClass.
contains(DestReg, SrcReg)) {
877 BeginIdx = ARM::dsub_0;
880 }
else if (ARM::DTripleSpcRegClass.
contains(DestReg, SrcReg)) {
882 BeginIdx = ARM::dsub_0;
885 }
else if (ARM::DQuadSpcRegClass.
contains(DestReg, SrcReg)) {
887 BeginIdx = ARM::dsub_0;
892 BeginIdx = ARM::ssub_0;
894 }
else if (SrcReg == ARM::CPSR) {
897 }
else if (DestReg == ARM::CPSR) {
898 copyToCPSR(MBB, I, SrcReg, KillSrc, Subtarget);
902 assert(Opc &&
"Impossible reg-to-reg copy");
909 BeginIdx = BeginIdx + ((SubRegs - 1) * Spacing);
915 for (
unsigned i = 0; i != SubRegs; ++i) {
916 unsigned Dst = TRI->
getSubReg(DestReg, BeginIdx + i * Spacing);
917 unsigned Src = TRI->
getSubReg(SrcReg, BeginIdx + i * Spacing);
918 assert(Dst && Src &&
"Bad sub-register");
920 assert(!DstRegs.
count(Src) &&
"destructive vector copy");
923 Mov =
BuildMI(MBB, I, I->getDebugLoc(),
get(Opc), Dst).
addReg(Src);
925 if (Opc == ARM::VORRq)
929 if (Opc == ARM::MOVr)
940 unsigned SubIdx,
unsigned State,
943 return MIB.
addReg(Reg, State);
947 return MIB.
addReg(Reg, State, SubIdx);
952 unsigned SrcReg,
bool isKill,
int FI,
956 if (I != MBB.
end()) DL = I->getDebugLoc();
967 if (ARM::GPRRegClass.hasSubClassEq(RC)) {
968 BuildMI(MBB, I, DL,
get(ARM::STRi12))
974 }
else if (ARM::SPRRegClass.hasSubClassEq(RC)) {
975 BuildMI(MBB, I, DL,
get(ARM::VSTRS))
985 if (ARM::DPRRegClass.hasSubClassEq(RC)) {
986 BuildMI(MBB, I, DL,
get(ARM::VSTRD))
992 }
else if (ARM::GPRPairRegClass.hasSubClassEq(RC)) {
996 AddDReg(MIB, SrcReg, ARM::gsub_1, 0, TRI);
1007 AddDReg(MIB, SrcReg, ARM::gsub_1, 0, TRI);
1013 if (ARM::DPairRegClass.hasSubClassEq(RC)) {
1016 BuildMI(MBB, I, DL,
get(ARM::VST1q64))
1023 BuildMI(MBB, I, DL,
get(ARM::VSTMQIA))
1033 if (ARM::DTripleRegClass.hasSubClassEq(RC)) {
1036 BuildMI(MBB, I, DL,
get(ARM::VST1d64TPseudo))
1048 MIB =
AddDReg(MIB, SrcReg, ARM::dsub_1, 0, TRI);
1049 AddDReg(MIB, SrcReg, ARM::dsub_2, 0, TRI);
1055 if (ARM::QQPRRegClass.hasSubClassEq(RC) || ARM::DQuadRegClass.hasSubClassEq(RC)) {
1059 BuildMI(MBB, I, DL,
get(ARM::VST1d64QPseudo))
1071 MIB =
AddDReg(MIB, SrcReg, ARM::dsub_1, 0, TRI);
1072 MIB =
AddDReg(MIB, SrcReg, ARM::dsub_2, 0, TRI);
1073 AddDReg(MIB, SrcReg, ARM::dsub_3, 0, TRI);
1079 if (ARM::QQQQPRRegClass.hasSubClassEq(RC)) {
1085 MIB =
AddDReg(MIB, SrcReg, ARM::dsub_1, 0, TRI);
1086 MIB =
AddDReg(MIB, SrcReg, ARM::dsub_2, 0, TRI);
1087 MIB =
AddDReg(MIB, SrcReg, ARM::dsub_3, 0, TRI);
1088 MIB =
AddDReg(MIB, SrcReg, ARM::dsub_4, 0, TRI);
1089 MIB =
AddDReg(MIB, SrcReg, ARM::dsub_5, 0, TRI);
1090 MIB =
AddDReg(MIB, SrcReg, ARM::dsub_6, 0, TRI);
1091 AddDReg(MIB, SrcReg, ARM::dsub_7, 0, TRI);
1125 case ARM::VST1d64TPseudo:
1126 case ARM::VST1d64QPseudo:
1146 return MI.
mayStore() && hasStoreToStackSlot(MI, Dummy, FrameIndex);
1151 unsigned DestReg,
int FI,
1155 if (I != MBB.
end()) DL = I->getDebugLoc();
1165 if (ARM::GPRRegClass.hasSubClassEq(RC)) {
1166 BuildMI(MBB, I, DL,
get(ARM::LDRi12), DestReg)
1172 }
else if (ARM::SPRRegClass.hasSubClassEq(RC)) {
1173 BuildMI(MBB, I, DL,
get(ARM::VLDRS), DestReg)
1182 if (ARM::DPRRegClass.hasSubClassEq(RC)) {
1183 BuildMI(MBB, I, DL,
get(ARM::VLDRD), DestReg)
1188 }
else if (ARM::GPRPairRegClass.hasSubClassEq(RC)) {
1192 MIB =
BuildMI(MBB, I, DL,
get(ARM::LDRD));
1200 MIB =
BuildMI(MBB, I, DL,
get(ARM::LDMIA))
1214 if (ARM::DPairRegClass.hasSubClassEq(RC)) {
1216 BuildMI(MBB, I, DL,
get(ARM::VLD1q64), DestReg)
1222 BuildMI(MBB, I, DL,
get(ARM::VLDMQIA), DestReg)
1231 if (ARM::DTripleRegClass.hasSubClassEq(RC)) {
1233 BuildMI(MBB, I, DL,
get(ARM::VLD1d64TPseudo), DestReg)
1253 if (ARM::QQPRRegClass.hasSubClassEq(RC) || ARM::DQuadRegClass.hasSubClassEq(RC)) {
1255 BuildMI(MBB, I, DL,
get(ARM::VLD1d64QPseudo), DestReg)
1276 if (ARM::QQQQPRRegClass.hasSubClassEq(RC)) {
1324 case ARM::VLD1d64TPseudo:
1325 case ARM::VLD1d64QPseudo:
1345 return MI.
mayLoad() && hasLoadFromStackSlot(MI, Dummy, FrameIndex);
1352 bool isThumb2 = Subtarget.
isThumb2();
1359 if (isThumb1 || !MI->getOperand(1).isDead()) {
1360 LDM =
BuildMI(*BB, MI, dl, TII->get(isThumb2 ? ARM::t2LDMIA_UPD
1361 : isThumb1 ? ARM::tLDMIA_UPD
1363 .
add(MI->getOperand(1));
1365 LDM =
BuildMI(*BB, MI, dl, TII->get(isThumb2 ? ARM::t2LDMIA : ARM::LDMIA));
1368 if (isThumb1 || !MI->getOperand(0).isDead()) {
1369 STM =
BuildMI(*BB, MI, dl, TII->get(isThumb2 ? ARM::t2STMIA_UPD
1370 : isThumb1 ? ARM::tSTMIA_UPD
1372 .
add(MI->getOperand(0));
1374 STM =
BuildMI(*BB, MI, dl, TII->get(isThumb2 ? ARM::t2STMIA : ARM::STMIA));
1383 for(
unsigned I = 5; I < MI->getNumOperands(); ++
I)
1384 ScratchRegs.
push_back(MI->getOperand(I).getReg());
1386 [&TRI](
const unsigned &Reg1,
1387 const unsigned &Reg2) ->
bool {
1392 for (
const auto &
Reg : ScratchRegs) {
1401 if (MI.
getOpcode() == TargetOpcode::LOAD_STACK_GUARD) {
1403 "LOAD_STACK_GUARD currently supported only for MachO.");
1404 expandLoadStackGuard(MI);
1425 if (!ARM::SPRRegClass.
contains(DstRegS, SrcRegS))
1433 if (!DstRegD || !SrcRegD)
1453 if (ImpDefIdx != -1)
1487 assert(MCPE.isMachineConstantPoolEntry() &&
1488 "Expecting a machine constantpool entry!");
1500 if (ACPV->isGlobalValue())
1502 cast<ARMConstantPoolConstant>(ACPV)->getGV(), PCLabelId,
ARMCP::CPValue,
1503 4, ACPV->getModifier(), ACPV->mustAddCurrentAddress());
1504 else if (ACPV->isExtSymbol())
1507 cast<ARMConstantPoolSymbol>(ACPV)->
getSymbol(), PCLabelId, 4);
1508 else if (ACPV->isBlockAddress())
1510 Create(cast<ARMConstantPoolConstant>(ACPV)->getBlockAddress(), PCLabelId,
1512 else if (ACPV->isLSDA())
1515 else if (ACPV->isMachineBasicBlock())
1518 cast<ARMConstantPoolMBB>(ACPV)->getMBB(), PCLabelId, 4);
1527 unsigned DestReg,
unsigned SubIdx,
1538 case ARM::tLDRpci_pic:
1539 case ARM::t2LDRpci_pic: {
1557 case ARM::tLDRpci_pic:
1558 case ARM::t2LDRpci_pic: {
1573 if (Opcode == ARM::t2LDRpci ||
1574 Opcode == ARM::t2LDRpci_pic ||
1575 Opcode == ARM::tLDRpci ||
1576 Opcode == ARM::tLDRpci_pic ||
1577 Opcode == ARM::LDRLIT_ga_pcrel ||
1578 Opcode == ARM::LDRLIT_ga_pcrel_ldr ||
1579 Opcode == ARM::tLDRLIT_ga_pcrel ||
1580 Opcode == ARM::MOV_ga_pcrel ||
1581 Opcode == ARM::MOV_ga_pcrel_ldr ||
1582 Opcode == ARM::t2MOV_ga_pcrel) {
1593 if (Opcode == ARM::LDRLIT_ga_pcrel ||
1594 Opcode == ARM::LDRLIT_ga_pcrel_ldr ||
1595 Opcode == ARM::tLDRLIT_ga_pcrel ||
1596 Opcode == ARM::MOV_ga_pcrel ||
1597 Opcode == ARM::MOV_ga_pcrel_ldr ||
1598 Opcode == ARM::t2MOV_ga_pcrel)
1610 if (isARMCP0 && isARMCP1) {
1616 }
else if (!isARMCP0 && !isARMCP1) {
1620 }
else if (Opcode == ARM::PICLDR) {
1628 if (Addr0 != Addr1) {
1666 int64_t &Offset2)
const {
1687 case ARM::t2LDRSHi8:
1689 case ARM::t2LDRBi12:
1690 case ARM::t2LDRSHi12:
1707 case ARM::t2LDRSHi8:
1709 case ARM::t2LDRBi12:
1710 case ARM::t2LDRSHi12:
1724 if (isa<ConstantSDNode>(Load1->
getOperand(1)) &&
1726 Offset1 = cast<ConstantSDNode>(Load1->
getOperand(1))->getSExtValue();
1727 Offset2 = cast<ConstantSDNode>(Load2->
getOperand(1))->getSExtValue();
1746 int64_t Offset1, int64_t Offset2,
1747 unsigned NumLoads)
const {
1751 assert(Offset2 > Offset1);
1753 if ((Offset2 - Offset1) / 8 > 64)
1799 while (++I != MBB->
end() && I->isDebugValue())
1801 if (I != MBB->
end() && I->getOpcode() == ARM::t2IT)
1820 unsigned NumCycles,
unsigned ExtraPredCycles,
1830 if (!Pred->
empty()) {
1832 if (LastMI->
getOpcode() == ARM::t2Bcc) {
1834 if (CmpMI != Pred->
begin()) {
1836 if (CmpMI->getOpcode() == ARM::tCMPi8 ||
1837 CmpMI->getOpcode() == ARM::t2CMPri) {
1838 unsigned Reg = CmpMI->getOperand(0).getReg();
1839 unsigned PredReg = 0;
1841 if (P ==
ARMCC::AL && CmpMI->getOperand(1).getImm() == 0 &&
1850 MBB, 0, 0, Probability);
1855 unsigned TCycles,
unsigned TExtra,
1857 unsigned FCycles,
unsigned FExtra,
1865 const unsigned ScalingUpFactor = 1024;
1867 unsigned PredCost = (TCycles + FCycles + TExtra + FExtra) * ScalingUpFactor;
1868 unsigned UnpredCost;
1872 unsigned NotTakenBranchCost = 1;
1874 unsigned TUnpredCycles, FUnpredCycles;
1877 TUnpredCycles = TCycles + NotTakenBranchCost;
1878 FUnpredCycles = TakenBranchCost;
1881 TUnpredCycles = TCycles + TakenBranchCost;
1882 FUnpredCycles = FCycles + NotTakenBranchCost;
1885 PredCost -= 1 * ScalingUpFactor;
1888 unsigned TUnpredCost = Probability.
scale(TUnpredCycles * ScalingUpFactor);
1889 unsigned FUnpredCost = Probability.
getCompl().
scale(FUnpredCycles * ScalingUpFactor);
1890 UnpredCost = TUnpredCost + FUnpredCost;
1893 if (Subtarget.
isThumb2() && TCycles + FCycles > 4) {
1894 PredCost += ((TCycles + FCycles - 4) / 4) * ScalingUpFactor;
1897 unsigned TUnpredCost = Probability.
scale(TCycles * ScalingUpFactor);
1898 unsigned FUnpredCost =
1900 UnpredCost = TUnpredCost + FUnpredCost;
1901 UnpredCost += 1 * ScalingUpFactor;
1905 return PredCost <= UnpredCost;
1920 unsigned &PredReg) {
1936 if (Opc == ARM::t2B)
1945 unsigned OpIdx2)
const {
1948 case ARM::t2MOVCCr: {
1950 unsigned PredReg = 0;
1953 if (CC ==
ARMCC::AL || PredReg != ARM::CPSR)
2000 bool DontMoveAcrossStores =
true;
2008 unsigned &TrueOp,
unsigned &FalseOp,
2009 bool &Optimizable)
const {
2011 "Unknown select instruction");
2030 bool PreferFalse)
const {
2032 "Unknown select instruction");
2035 bool Invert = !DefMI;
2055 for (
unsigned i = 1, e = DefDesc.getNumOperands();
2056 i != e && !DefDesc.OpInfo[i].isPredicate(); ++i)
2075 NewMI.
add(FalseReg);
2080 SeenMIs.
erase(DefMI);
2106 {ARM::ADDSri, ARM::ADDri},
2107 {ARM::ADDSrr, ARM::ADDrr},
2108 {ARM::ADDSrsi, ARM::ADDrsi},
2109 {ARM::ADDSrsr, ARM::ADDrsr},
2111 {ARM::SUBSri, ARM::SUBri},
2112 {ARM::SUBSrr, ARM::SUBrr},
2113 {ARM::SUBSrsi, ARM::SUBrsi},
2114 {ARM::SUBSrsr, ARM::SUBrsr},
2116 {ARM::RSBSri, ARM::RSBri},
2117 {ARM::RSBSrsi, ARM::RSBrsi},
2118 {ARM::RSBSrsr, ARM::RSBrsr},
2120 {ARM::tADDSi3, ARM::tADDi3},
2121 {ARM::tADDSi8, ARM::tADDi8},
2122 {ARM::tADDSrr, ARM::tADDrr},
2123 {ARM::tADCS, ARM::tADC},
2125 {ARM::tSUBSi3, ARM::tSUBi3},
2126 {ARM::tSUBSi8, ARM::tSUBi8},
2127 {ARM::tSUBSrr, ARM::tSUBrr},
2128 {ARM::tSBCS, ARM::tSBC},
2130 {ARM::t2ADDSri, ARM::t2ADDri},
2131 {ARM::t2ADDSrr, ARM::t2ADDrr},
2132 {ARM::t2ADDSrs, ARM::t2ADDrs},
2134 {ARM::t2SUBSri, ARM::t2SUBri},
2135 {ARM::t2SUBSrr, ARM::t2SUBrr},
2136 {ARM::t2SUBSrs, ARM::t2SUBrs},
2138 {ARM::t2RSBSri, ARM::t2RSBri},
2139 {ARM::t2RSBSrs, ARM::t2RSBrs},
2151 const DebugLoc &dl,
unsigned DestReg,
2152 unsigned BaseReg,
int NumBytes,
2156 if (NumBytes == 0 && DestReg != BaseReg) {
2157 BuildMI(MBB, MBBI, dl, TII.get(ARM::MOVr), DestReg)
2165 bool isSub = NumBytes < 0;
2166 if (isSub) NumBytes = -NumBytes;
2171 assert(ThisVal &&
"Didn't extract field correctly");
2174 NumBytes &= ~ThisVal;
2179 unsigned Opc = isSub ? ARM::SUBri : ARM::ADDri;
2180 BuildMI(MBB, MBBI, dl, TII.get(Opc), DestReg)
2192 unsigned NumBytes) {
2203 if (!IsPush && !IsPop)
2206 bool IsVFPPushPop = MI->
getOpcode() == ARM::VSTMDDB_UPD ||
2208 bool IsT1PushPop = MI->
getOpcode() == ARM::tPUSH ||
2214 "trying to fold sp update into non-sp-updating push/pop");
2219 if (NumBytes % (IsVFPPushPop ? 8 : 4) != 0)
2224 int RegListIdx = IsT1PushPop ? 2 : 4;
2227 unsigned RegsNeeded;
2230 RegsNeeded = NumBytes / 8;
2231 RegClass = &ARM::DPRRegClass;
2233 RegsNeeded = NumBytes / 4;
2234 RegClass = &ARM::GPRRegClass;
2244 unsigned FirstRegEnc = -1;
2258 for (
int CurRegEnc = FirstRegEnc - 1; CurRegEnc >= 0 && RegsNeeded;
2260 unsigned CurReg = RegClass->
getRegister(CurRegEnc);
2266 false,
false,
true));
2303 for (
int i = RegList.
size() - 1; i >= 0; --i)
2304 MIB.
add(RegList[i]);
2310 unsigned FrameReg,
int &
Offset,
2321 if (Opcode == ARM::ADDri) {
2325 MI.
setDesc(TII.get(ARM::MOVr));
2330 }
else if (Offset < 0) {
2333 MI.
setDesc(TII.get(ARM::SUBri));
2351 Offset &= ~ThisImmVal;
2355 "Bit extraction didn't work?");
2358 unsigned ImmIdx = 0;
2360 unsigned NumBits = 0;
2364 ImmIdx = FrameRegIdx + 1;
2369 ImmIdx = FrameRegIdx+2;
2376 ImmIdx = FrameRegIdx+2;
2387 ImmIdx = FrameRegIdx+1;
2398 Offset += InstrOffs * Scale;
2399 assert((Offset & (Scale-1)) == 0 &&
"Can't encode this offset!");
2409 int ImmedOffset = Offset / Scale;
2410 unsigned Mask = (1 << NumBits) - 1;
2411 if ((
unsigned)Offset <= Mask * Scale) {
2419 ImmedOffset = -ImmedOffset;
2421 ImmedOffset |= 1 << NumBits;
2429 ImmedOffset = ImmedOffset &
Mask;
2432 ImmedOffset = -ImmedOffset;
2434 ImmedOffset |= 1 << NumBits;
2437 Offset &= ~(Mask*Scale);
2441 Offset = (isSub) ? -Offset : Offset;
2450 unsigned &SrcReg2,
int &CmpMask,
2451 int &CmpValue)
const {
2486 int CmpMask,
bool CommonUse) {
2525 unsigned SrcReg2,
int ImmValue,
2549 default:
return false;
2612 MachineInstr &CmpInstr,
unsigned SrcReg,
unsigned SrcReg2,
int CmpMask,
2616 if (!MI)
return false;
2619 if (CmpMask != ~0) {
2625 if (UI->getParent() != CmpInstr.
getParent())
2634 if (!MI)
return false;
2643 if (I == B)
return false;
2658 if (CmpInstr.
getOpcode() == ARM::CMPri ||
2665 bool IsThumb1 =
false;
2681 if (MI && IsThumb1) {
2683 bool CanReorder =
true;
2684 const bool HasStmts = I !=
E;
2685 for (; I !=
E; --
I) {
2686 if (I->getOpcode() != ARM::tMOVi8) {
2691 if (HasStmts && CanReorder) {
2704 for (; I !=
E; --
I) {
2743 bool isSafe =
false;
2746 while (!isSafe && ++I != E) {
2749 !isSafe && IO != EO; ++IO) {
2763 bool IsInstrVSel =
true;
2766 IsInstrVSel =
false;
2802 std::make_pair(&((*I).getOperand(IO - 1)), NewCC));
2837 if ((*SI)->isLiveIn(ARM::CPSR))
2853 for (
unsigned i = 0, e = OperandsToUpdate.
size(); i < e; i++)
2854 OperandsToUpdate[i].
first->setImm(OperandsToUpdate[i].second);
2864 if (DefOpc != ARM::t2MOVi32imm && DefOpc != ARM::MOVi32imm)
2893 unsigned NewUseOpc = 0;
2895 uint32_t SOImmValV1 = 0, SOImmValV2 = 0;
2896 bool Commute =
false;
2898 default:
return false;
2906 case ARM::t2EORrr: {
2912 if (UseOpc == ARM::SUBrr && Commute)
2918 NewUseOpc = UseOpc == ARM::ADDrr ? ARM::ADDri : ARM::SUBri;
2921 NewUseOpc = UseOpc == ARM::ADDrr ? ARM::SUBri : ARM::ADDri;
2935 case ARM::ORRrr: NewUseOpc = ARM::ORRri;
break;
2936 case ARM::EORrr: NewUseOpc = ARM::EORri;
break;
2941 if (UseOpc == ARM::t2SUBrr && Commute)
2947 NewUseOpc = UseOpc == ARM::t2ADDrr ? ARM::t2ADDri : ARM::t2SUBri;
2950 NewUseOpc = UseOpc == ARM::t2ADDrr ? ARM::t2SUBri : ARM::t2ADDri;
2964 case ARM::t2ORRrr: NewUseOpc = ARM::t2ORRri;
break;
2965 case ARM::t2EORrr: NewUseOpc = ARM::t2EORri;
break;
2972 unsigned OpIdx = Commute ? 2 : 1;
2982 UseMI.
setDesc(
get(NewUseOpc));
2996 assert(UOps >= 0 &&
"bad # UOps");
3009 ((ShImm == 1 || ShImm == 2 || ShImm == 3) &&
3025 ((ShImm == 1 || ShImm == 2 || ShImm == 3) &&
3035 case ARM::LDRSB_POST:
3036 case ARM::LDRSH_POST: {
3039 return (Rt == Rm) ? 4 : 3;
3042 case ARM::LDR_PRE_REG:
3043 case ARM::LDRB_PRE_REG: {
3053 ((ShImm == 1 || ShImm == 2 || ShImm == 3) &&
3059 case ARM::STR_PRE_REG:
3060 case ARM::STRB_PRE_REG: {
3066 ((ShImm == 1 || ShImm == 2 || ShImm == 3) &&
3073 case ARM::STRH_PRE: {
3083 case ARM::LDR_POST_REG:
3084 case ARM::LDRB_POST_REG:
3085 case ARM::LDRH_POST: {
3088 return (Rt == Rm) ? 3 : 2;
3091 case ARM::LDR_PRE_IMM:
3092 case ARM::LDRB_PRE_IMM:
3093 case ARM::LDR_POST_IMM:
3094 case ARM::LDRB_POST_IMM:
3095 case ARM::STRB_POST_IMM:
3096 case ARM::STRB_POST_REG:
3097 case ARM::STRB_PRE_IMM:
3098 case ARM::STRH_POST:
3099 case ARM::STR_POST_IMM:
3100 case ARM::STR_POST_REG:
3101 case ARM::STR_PRE_IMM:
3104 case ARM::LDRSB_PRE:
3105 case ARM::LDRSH_PRE: {
3117 ((ShImm == 1 || ShImm == 2 || ShImm == 3) &&
3130 return (Rt == Rn) ? 3 : 2;
3141 case ARM::LDRD_POST:
3142 case ARM::t2LDRD_POST:
3145 case ARM::STRD_POST:
3146 case ARM::t2STRD_POST:
3149 case ARM::LDRD_PRE: {
3156 return (Rt == Rn) ? 4 : 3;
3159 case ARM::t2LDRD_PRE: {
3162 return (Rt == Rn) ? 4 : 3;
3165 case ARM::STRD_PRE: {
3173 case ARM::t2STRD_PRE:
3176 case ARM::t2LDR_POST:
3177 case ARM::t2LDRB_POST:
3178 case ARM::t2LDRB_PRE:
3179 case ARM::t2LDRSBi12:
3180 case ARM::t2LDRSBi8:
3181 case ARM::t2LDRSBpci:
3183 case ARM::t2LDRH_POST:
3184 case ARM::t2LDRH_PRE:
3186 case ARM::t2LDRSB_POST:
3187 case ARM::t2LDRSB_PRE:
3188 case ARM::t2LDRSH_POST:
3189 case ARM::t2LDRSH_PRE:
3190 case ARM::t2LDRSHi12:
3191 case ARM::t2LDRSHi8:
3192 case ARM::t2LDRSHpci:
3196 case ARM::t2LDRDi8: {
3199 return (Rt == Rn) ? 3 : 2;
3202 case ARM::t2STRB_POST:
3203 case ARM::t2STRB_PRE:
3206 case ARM::t2STRH_POST:
3207 case ARM::t2STRH_PRE:
3209 case ARM::t2STR_POST:
3210 case ARM::t2STR_PRE:
3243 Size += (*I)->getSize();
3250 unsigned UOps = 1 + NumRegs;
3254 case ARM::VLDMDIA_UPD:
3255 case ARM::VLDMDDB_UPD:
3256 case ARM::VLDMSIA_UPD:
3257 case ARM::VLDMSDB_UPD:
3258 case ARM::VSTMDIA_UPD:
3259 case ARM::VSTMDDB_UPD:
3260 case ARM::VSTMSIA_UPD:
3261 case ARM::VSTMSDB_UPD:
3262 case ARM::LDMIA_UPD:
3263 case ARM::LDMDA_UPD:
3264 case ARM::LDMDB_UPD:
3265 case ARM::LDMIB_UPD:
3266 case ARM::STMIA_UPD:
3267 case ARM::STMDA_UPD:
3268 case ARM::STMDB_UPD:
3269 case ARM::STMIB_UPD:
3270 case ARM::tLDMIA_UPD:
3271 case ARM::tSTMIA_UPD:
3272 case ARM::t2LDMIA_UPD:
3273 case ARM::t2LDMDB_UPD:
3274 case ARM::t2STMIA_UPD:
3275 case ARM::t2STMDB_UPD:
3278 case ARM::LDMIA_RET:
3280 case ARM::t2LDMIA_RET:
3289 if (!ItinData || ItinData->
isEmpty())
3295 if (ItinUOps >= 0) {
3321 case ARM::VLDMDIA_UPD:
3322 case ARM::VLDMDDB_UPD:
3324 case ARM::VLDMSIA_UPD:
3325 case ARM::VLDMSDB_UPD:
3327 case ARM::VSTMDIA_UPD:
3328 case ARM::VSTMDDB_UPD:
3330 case ARM::VSTMSIA_UPD:
3331 case ARM::VSTMSDB_UPD: {
3333 return (NumRegs / 2) + (NumRegs % 2) + 1;
3336 case ARM::LDMIA_RET:
3341 case ARM::LDMIA_UPD:
3342 case ARM::LDMDA_UPD:
3343 case ARM::LDMDB_UPD:
3344 case ARM::LDMIB_UPD:
3349 case ARM::STMIA_UPD:
3350 case ARM::STMDA_UPD:
3351 case ARM::STMDB_UPD:
3352 case ARM::STMIB_UPD:
3354 case ARM::tLDMIA_UPD:
3355 case ARM::tSTMIA_UPD:
3359 case ARM::t2LDMIA_RET:
3362 case ARM::t2LDMIA_UPD:
3363 case ARM::t2LDMDB_UPD:
3366 case ARM::t2STMIA_UPD:
3367 case ARM::t2STMDB_UPD: {
3380 unsigned UOps = (NumRegs / 2);
3386 unsigned UOps = (NumRegs / 2);
3404 unsigned DefIdx,
unsigned DefAlign)
const {
3413 DefCycle = RegNo / 2 + 1;
3418 bool isSLoad =
false;
3423 case ARM::VLDMSIA_UPD:
3424 case ARM::VLDMSDB_UPD:
3431 if ((isSLoad && (RegNo % 2)) || DefAlign < 8)
3435 DefCycle = RegNo + 2;
3445 if (
Op.isReg() &&
Op.getReg() == BaseReg)
3461 unsigned DefIdx,
unsigned DefAlign)
const {
3471 DefCycle = RegNo / 2;
3477 DefCycle = (RegNo / 2);
3480 if ((RegNo % 2) || DefAlign < 8)
3486 DefCycle = RegNo + 2;
3496 unsigned UseIdx,
unsigned UseAlign)
const {
3504 UseCycle = RegNo / 2 + 1;
3509 bool isSStore =
false;
3514 case ARM::VSTMSIA_UPD:
3515 case ARM::VSTMSDB_UPD:
3522 if ((isSStore && (RegNo % 2)) || UseAlign < 8)
3526 UseCycle = RegNo + 2;
3536 unsigned UseIdx,
unsigned UseAlign)
const {
3543 UseCycle = RegNo / 2;
3549 UseCycle = (RegNo / 2);
3552 if ((RegNo % 2) || UseAlign < 8)
3564 unsigned DefIdx,
unsigned DefAlign,
3566 unsigned UseIdx,
unsigned UseAlign)
const {
3577 bool LdmBypass =
false;
3584 case ARM::VLDMDIA_UPD:
3585 case ARM::VLDMDDB_UPD:
3587 case ARM::VLDMSIA_UPD:
3588 case ARM::VLDMSDB_UPD:
3589 DefCycle = getVLDMDefCycle(ItinData, DefMCID, DefClass, DefIdx, DefAlign);
3592 case ARM::LDMIA_RET:
3597 case ARM::LDMIA_UPD:
3598 case ARM::LDMDA_UPD:
3599 case ARM::LDMDB_UPD:
3600 case ARM::LDMIB_UPD:
3602 case ARM::tLDMIA_UPD:
3604 case ARM::t2LDMIA_RET:
3607 case ARM::t2LDMIA_UPD:
3608 case ARM::t2LDMDB_UPD:
3610 DefCycle = getLDMDefCycle(ItinData, DefMCID, DefClass, DefIdx, DefAlign);
3625 case ARM::VSTMDIA_UPD:
3626 case ARM::VSTMDDB_UPD:
3628 case ARM::VSTMSIA_UPD:
3629 case ARM::VSTMSDB_UPD:
3630 UseCycle = getVSTMUseCycle(ItinData, UseMCID, UseClass, UseIdx, UseAlign);
3637 case ARM::STMIA_UPD:
3638 case ARM::STMDA_UPD:
3639 case ARM::STMDB_UPD:
3640 case ARM::STMIB_UPD:
3641 case ARM::tSTMIA_UPD:
3646 case ARM::t2STMIA_UPD:
3647 case ARM::t2STMDB_UPD:
3648 UseCycle = getSTMUseCycle(ItinData, UseMCID, UseClass, UseIdx, UseAlign);
3656 UseCycle = DefCycle - UseCycle + 1;
3665 UseClass, UseIdx)) {
3675 unsigned &DefIdx,
unsigned &Dist) {
3680 assert(II->isInsideBundle() &&
"Empty bundle?");
3683 while (II->isInsideBundle()) {
3684 Idx = II->findRegisterDefOperandIdx(Reg,
false,
true, TRI);
3691 assert(Idx != -1 &&
"Cannot find bundled definition!");
3698 unsigned &UseIdx,
unsigned &Dist) {
3702 assert(II->isInsideBundle() &&
"Empty bundle?");
3707 while (II != E && II->isInsideBundle()) {
3708 Idx = II->findRegisterUseOperandIdx(Reg,
false, TRI);
3711 if (II->getOpcode() != ARM::t2IT)
3749 case ARM::t2LDRSHs: {
3752 if (ShAmt == 0 || ShAmt == 2)
3757 }
else if (Subtarget.
isSwift()) {
3769 ((ShImm == 1 || ShImm == 2 || ShImm == 3) &&
3780 case ARM::t2LDRSHs: {
3783 if (ShAmt == 0 || ShAmt == 1 || ShAmt == 2 || ShAmt == 3)
3797 case ARM::VLD1q8wb_fixed:
3798 case ARM::VLD1q16wb_fixed:
3799 case ARM::VLD1q32wb_fixed:
3800 case ARM::VLD1q64wb_fixed:
3801 case ARM::VLD1q8wb_register:
3802 case ARM::VLD1q16wb_register:
3803 case ARM::VLD1q32wb_register:
3804 case ARM::VLD1q64wb_register:
3811 case ARM::VLD2d8wb_fixed:
3812 case ARM::VLD2d16wb_fixed:
3813 case ARM::VLD2d32wb_fixed:
3814 case ARM::VLD2q8wb_fixed:
3815 case ARM::VLD2q16wb_fixed:
3816 case ARM::VLD2q32wb_fixed:
3817 case ARM::VLD2d8wb_register:
3818 case ARM::VLD2d16wb_register:
3819 case ARM::VLD2d32wb_register:
3820 case ARM::VLD2q8wb_register:
3821 case ARM::VLD2q16wb_register:
3822 case ARM::VLD2q32wb_register:
3827 case ARM::VLD3d8_UPD:
3828 case ARM::VLD3d16_UPD:
3829 case ARM::VLD3d32_UPD:
3830 case ARM::VLD1d64Twb_fixed:
3831 case ARM::VLD1d64Twb_register:
3832 case ARM::VLD3q8_UPD:
3833 case ARM::VLD3q16_UPD:
3834 case ARM::VLD3q32_UPD:
3839 case ARM::VLD4d8_UPD:
3840 case ARM::VLD4d16_UPD:
3841 case ARM::VLD4d32_UPD:
3842 case ARM::VLD1d64Qwb_fixed:
3843 case ARM::VLD1d64Qwb_register:
3844 case ARM::VLD4q8_UPD:
3845 case ARM::VLD4q16_UPD:
3846 case ARM::VLD4q32_UPD:
3847 case ARM::VLD1DUPq8:
3848 case ARM::VLD1DUPq16:
3849 case ARM::VLD1DUPq32:
3850 case ARM::VLD1DUPq8wb_fixed:
3851 case ARM::VLD1DUPq16wb_fixed:
3852 case ARM::VLD1DUPq32wb_fixed:
3853 case ARM::VLD1DUPq8wb_register:
3854 case ARM::VLD1DUPq16wb_register:
3855 case ARM::VLD1DUPq32wb_register:
3856 case ARM::VLD2DUPd8:
3857 case ARM::VLD2DUPd16:
3858 case ARM::VLD2DUPd32:
3859 case ARM::VLD2DUPd8wb_fixed:
3860 case ARM::VLD2DUPd16wb_fixed:
3861 case ARM::VLD2DUPd32wb_fixed:
3862 case ARM::VLD2DUPd8wb_register:
3863 case ARM::VLD2DUPd16wb_register:
3864 case ARM::VLD2DUPd32wb_register:
3865 case ARM::VLD4DUPd8:
3866 case ARM::VLD4DUPd16:
3867 case ARM::VLD4DUPd32:
3868 case ARM::VLD4DUPd8_UPD:
3869 case ARM::VLD4DUPd16_UPD:
3870 case ARM::VLD4DUPd32_UPD:
3872 case ARM::VLD1LNd16:
3873 case ARM::VLD1LNd32:
3874 case ARM::VLD1LNd8_UPD:
3875 case ARM::VLD1LNd16_UPD:
3876 case ARM::VLD1LNd32_UPD:
3878 case ARM::VLD2LNd16:
3879 case ARM::VLD2LNd32:
3880 case ARM::VLD2LNq16:
3881 case ARM::VLD2LNq32:
3882 case ARM::VLD2LNd8_UPD:
3883 case ARM::VLD2LNd16_UPD:
3884 case ARM::VLD2LNd32_UPD:
3885 case ARM::VLD2LNq16_UPD:
3886 case ARM::VLD2LNq32_UPD:
3888 case ARM::VLD4LNd16:
3889 case ARM::VLD4LNd32:
3890 case ARM::VLD4LNq16:
3891 case ARM::VLD4LNq32:
3892 case ARM::VLD4LNd8_UPD:
3893 case ARM::VLD4LNd16_UPD:
3894 case ARM::VLD4LNd32_UPD:
3895 case ARM::VLD4LNq16_UPD:
3896 case ARM::VLD4LNq32_UPD:
3910 unsigned UseIdx)
const {
3912 if (!ItinData || ItinData->
isEmpty())
3919 unsigned DefAdj = 0;
3929 unsigned UseAdj = 0;
3937 return getOperandLatencyImpl(
3938 ItinData, *ResolvedDefMI, DefIdx, ResolvedDefMI->
getDesc(), DefAdj, DefMO,
3939 Reg, *ResolvedUseMI, UseIdx, ResolvedUseMI->getDesc(), UseAdj);
3942 int ARMBaseInstrInfo::getOperandLatencyImpl(
3944 unsigned DefIdx,
const MCInstrDesc &DefMCID,
unsigned DefAdj,
3946 unsigned UseIdx,
const MCInstrDesc &UseMCID,
unsigned UseAdj)
const {
3947 if (Reg == ARM::CPSR) {
3950 return Subtarget.
isLikeA9() ? 1 : 20;
3958 unsigned Latency = getInstrLatency(ItinData, DefMI);
3964 if (Latency > 0 && Subtarget.
isThumb2()) {
3991 int Adj = DefAdj + UseAdj;
3995 if (Adj >= 0 || (
int)Latency > -Adj) {
3996 return Latency + Adj;
4004 SDNode *DefNode,
unsigned DefIdx,
4005 SDNode *UseNode,
unsigned UseIdx)
const {
4011 if (isZeroCost(DefMCID.
Opcode))
4014 if (!ItinData || ItinData->
isEmpty())
4015 return DefMCID.
mayLoad() ? 3 : 1;
4021 return Latency <= Threshold ? 1 : Latency - Adj;
4032 UseMCID, UseIdx, UseAlign);
4044 cast<ConstantSDNode>(DefNode->
getOperand(2))->getZExtValue();
4054 case ARM::t2LDRSHs: {
4057 cast<ConstantSDNode>(DefNode->
getOperand(2))->getZExtValue();
4058 if (ShAmt == 0 || ShAmt == 2)
4063 }
else if (DefIdx == 0 && Latency > 2 && Subtarget.
isSwift()) {
4071 cast<ConstantSDNode>(DefNode->
getOperand(2))->getZExtValue();
4074 ((ShImm == 1 || ShImm == 2 || ShImm == 3) &&
4098 case ARM::VLD1q8wb_register:
4099 case ARM::VLD1q16wb_register:
4100 case ARM::VLD1q32wb_register:
4101 case ARM::VLD1q64wb_register:
4102 case ARM::VLD1q8wb_fixed:
4103 case ARM::VLD1q16wb_fixed:
4104 case ARM::VLD1q32wb_fixed:
4105 case ARM::VLD1q64wb_fixed:
4109 case ARM::VLD2q8Pseudo:
4110 case ARM::VLD2q16Pseudo:
4111 case ARM::VLD2q32Pseudo:
4112 case ARM::VLD2d8wb_fixed:
4113 case ARM::VLD2d16wb_fixed:
4114 case ARM::VLD2d32wb_fixed:
4115 case ARM::VLD2q8PseudoWB_fixed:
4116 case ARM::VLD2q16PseudoWB_fixed:
4117 case ARM::VLD2q32PseudoWB_fixed:
4118 case ARM::VLD2d8wb_register:
4119 case ARM::VLD2d16wb_register:
4120 case ARM::VLD2d32wb_register:
4121 case ARM::VLD2q8PseudoWB_register:
4122 case ARM::VLD2q16PseudoWB_register:
4123 case ARM::VLD2q32PseudoWB_register:
4124 case ARM::VLD3d8Pseudo:
4125 case ARM::VLD3d16Pseudo:
4126 case ARM::VLD3d32Pseudo:
4127 case ARM::VLD1d64TPseudo:
4128 case ARM::VLD1d64TPseudoWB_fixed:
4129 case ARM::VLD3d8Pseudo_UPD:
4130 case ARM::VLD3d16Pseudo_UPD:
4131 case ARM::VLD3d32Pseudo_UPD:
4132 case ARM::VLD3q8Pseudo_UPD:
4133 case ARM::VLD3q16Pseudo_UPD:
4134 case ARM::VLD3q32Pseudo_UPD:
4135 case ARM::VLD3q8oddPseudo:
4136 case ARM::VLD3q16oddPseudo:
4137 case ARM::VLD3q32oddPseudo:
4138 case ARM::VLD3q8oddPseudo_UPD:
4139 case ARM::VLD3q16oddPseudo_UPD:
4140 case ARM::VLD3q32oddPseudo_UPD:
4141 case ARM::VLD4d8Pseudo:
4142 case ARM::VLD4d16Pseudo:
4143 case ARM::VLD4d32Pseudo:
4144 case ARM::VLD1d64QPseudo:
4145 case ARM::VLD1d64QPseudoWB_fixed:
4146 case ARM::VLD4d8Pseudo_UPD:
4147 case ARM::VLD4d16Pseudo_UPD:
4148 case ARM::VLD4d32Pseudo_UPD:
4149 case ARM::VLD4q8Pseudo_UPD:
4150 case ARM::VLD4q16Pseudo_UPD:
4151 case ARM::VLD4q32Pseudo_UPD:
4152 case ARM::VLD4q8oddPseudo:
4153 case ARM::VLD4q16oddPseudo:
4154 case ARM::VLD4q32oddPseudo:
4155 case ARM::VLD4q8oddPseudo_UPD:
4156 case ARM::VLD4q16oddPseudo_UPD:
4157 case ARM::VLD4q32oddPseudo_UPD:
4158 case ARM::VLD1DUPq8:
4159 case ARM::VLD1DUPq16:
4160 case ARM::VLD1DUPq32:
4161 case ARM::VLD1DUPq8wb_fixed:
4162 case ARM::VLD1DUPq16wb_fixed:
4163 case ARM::VLD1DUPq32wb_fixed:
4164 case ARM::VLD1DUPq8wb_register:
4165 case ARM::VLD1DUPq16wb_register:
4166 case ARM::VLD1DUPq32wb_register:
4167 case ARM::VLD2DUPd8:
4168 case ARM::VLD2DUPd16:
4169 case ARM::VLD2DUPd32:
4170 case ARM::VLD2DUPd8wb_fixed:
4171 case ARM::VLD2DUPd16wb_fixed:
4172 case ARM::VLD2DUPd32wb_fixed:
4173 case ARM::VLD2DUPd8wb_register:
4174 case ARM::VLD2DUPd16wb_register:
4175 case ARM::VLD2DUPd32wb_register:
4176 case ARM::VLD4DUPd8Pseudo:
4177 case ARM::VLD4DUPd16Pseudo:
4178 case ARM::VLD4DUPd32Pseudo:
4179 case ARM::VLD4DUPd8Pseudo_UPD:
4180 case ARM::VLD4DUPd16Pseudo_UPD:
4181 case ARM::VLD4DUPd32Pseudo_UPD:
4182 case ARM::VLD1LNq8Pseudo:
4183 case ARM::VLD1LNq16Pseudo:
4184 case ARM::VLD1LNq32Pseudo:
4185 case ARM::VLD1LNq8Pseudo_UPD:
4186 case ARM::VLD1LNq16Pseudo_UPD:
4187 case ARM::VLD1LNq32Pseudo_UPD:
4188 case ARM::VLD2LNd8Pseudo:
4189 case ARM::VLD2LNd16Pseudo:
4190 case ARM::VLD2LNd32Pseudo:
4191 case ARM::VLD2LNq16Pseudo:
4192 case ARM::VLD2LNq32Pseudo:
4193 case ARM::VLD2LNd8Pseudo_UPD:
4194 case ARM::VLD2LNd16Pseudo_UPD:
4195 case ARM::VLD2LNd32Pseudo_UPD:
4196 case ARM::VLD2LNq16Pseudo_UPD:
4197 case ARM::VLD2LNq32Pseudo_UPD:
4198 case ARM::VLD4LNd8Pseudo:
4199 case ARM::VLD4LNd16Pseudo:
4200 case ARM::VLD4LNd32Pseudo:
4201 case ARM::VLD4LNq16Pseudo:
4202 case ARM::VLD4LNq32Pseudo:
4203 case ARM::VLD4LNd8Pseudo_UPD:
4204 case ARM::VLD4LNd16Pseudo_UPD:
4205 case ARM::VLD4LNd32Pseudo_UPD:
4206 case ARM::VLD4LNq16Pseudo_UPD:
4207 case ARM::VLD4LNq32Pseudo_UPD:
4217 unsigned ARMBaseInstrInfo::getPredicationCost(
const MachineInstr &MI)
const {
4238 unsigned *PredCost)
const {
4246 unsigned Latency = 0;
4249 while (++I != E && I->isInsideBundle()) {
4250 if (I->getOpcode() != ARM::t2IT)
4251 Latency += getInstrLatency(ItinData, *I, PredCost);
4281 if (Adj >= 0 || (
int)Latency > -Adj) {
4282 return Latency + Adj;
4292 if (!ItinData || ItinData->
isEmpty())
4305 bool ARMBaseInstrInfo::hasHighOperandLatency(
const TargetSchedModel &SchedModel,
4310 unsigned UseIdx)
const {
4326 bool ARMBaseInstrInfo::hasLowDefLatency(
const TargetSchedModel &SchedModel,
4328 unsigned DefIdx)
const {
4330 if (!ItinData || ItinData->
isEmpty())
4337 return (DefCycle != -1 && DefCycle <= 2);
4342 bool ARMBaseInstrInfo::verifyInstruction(
const MachineInstr &MI,
4345 ErrInfo =
"Pseudo flag setting opcodes only exist in Selection DAG";
4354 unsigned LoadImmOpc,
4355 unsigned LoadOpc)
const {
4357 "ROPI/RWPI not currently supported with stack guard");
4361 unsigned Reg = MI->getOperand(0).getReg();
4363 cast<GlobalValue>((*MI->memoperands_begin())->getValue());
4366 BuildMI(MBB, MI, DL,
get(LoadImmOpc), Reg)
4370 MIB =
BuildMI(MBB, MI, DL,
get(LoadOpc), Reg);
4380 MIB =
BuildMI(MBB, MI, DL,
get(LoadOpc), Reg);
4383 .setMemRefs(MI->memoperands_begin(), MI->memoperands_end())
4389 unsigned &AddSubOpc,
4390 bool &NegAcc,
bool &HasLane)
const {
4392 if (I == MLxEntryMap.
end())
4423 std::pair<uint16_t, uint16_t>
4444 return std::make_pair(
ExeNEON, 0);
4449 return std::make_pair(
ExeNEON, 0);
4452 return std::make_pair(
ExeVFP, 0);
4458 unsigned SReg,
unsigned &Lane) {
4462 if (DReg != ARM::NoRegister)
4468 assert(DReg &&
"S-register with no D super-register?");
4489 unsigned Lane,
unsigned &ImplicitSReg) {
4499 (Lane & 1) ? ARM::ssub_0 : ARM::ssub_1);
4515 unsigned Domain)
const {
4516 unsigned DstReg, SrcReg, DReg;
4565 MI.
setDesc(
get(ARM::VGETLNi32));
4586 unsigned ImplicitSReg;
4595 MI.
setDesc(
get(ARM::VSETLNi32));
4605 if (ImplicitSReg != 0)
4617 unsigned DstLane = 0, SrcLane = 0, DDst, DSrc;
4621 unsigned ImplicitSReg;
4631 MI.
setDesc(
get(ARM::VDUPLN32d));
4641 if (ImplicitSReg != 0)
4665 unsigned CurReg = SrcLane == 1 && DstLane == 1 ? DSrc : DDst;
4669 CurReg = SrcLane == 0 && DstLane == 0 ? DSrc : DDst;
4675 if (SrcLane == DstLane)
4678 MI.
setDesc(
get(ARM::VEXTd32));
4683 CurReg = SrcLane == 1 && DstLane == 0 ? DSrc : DDst;
4684 CurUndef = CurReg == DSrc && !MI.
readsRegister(CurReg, TRI);
4687 CurReg = SrcLane == 0 && DstLane == 1 ? DSrc : DDst;
4688 CurUndef = CurReg == DSrc && !MI.
readsRegister(CurReg, TRI);
4693 if (SrcLane != DstLane)
4699 if (ImplicitSReg != 0)
4726 if (!PartialUpdateClearance)
4729 assert(TRI &&
"Need TRI instance");
4734 unsigned Reg = MO.
getReg();
4743 case ARM::VMOVv4i16:
4744 case ARM::VMOVv2i32:
4745 case ARM::VMOVv2f32:
4746 case ARM::VMOVv1i64:
4751 case ARM::VLD1LNd32:
4768 }
else if (ARM::SPRRegClass.
contains(Reg)) {
4778 return PartialUpdateClearance;
4786 assert(TRI &&
"Need TRI instance");
4789 unsigned Reg = MO.
getReg();
4791 "Can't break virtual register dependencies.");
4792 unsigned DReg =
Reg;
4795 if (ARM::SPRRegClass.
contains(Reg)) {
4796 DReg = ARM::D0 + (Reg - ARM::S0) / 2;
4800 assert(ARM::DPRRegClass.
contains(DReg) &&
"Can only break D-reg deps");
4818 return Subtarget.getFeatureBits()[ARM::HasV6KOps];
4828 ((ShImm == 1 || ShImm == 2) &&
4850 RegSubRegPairAndIdx(MOReg->
getReg(), MOReg->
getSubReg(), ARM::ssub_0));
4854 RegSubRegPairAndIdx(MOReg->
getReg(), MOReg->
getSubReg(), ARM::ssub_1));
4862 RegSubRegPairAndIdx &InputReg)
const {
4875 InputReg.SubIdx = DefIdx == 0 ? ARM::ssub_0 : ARM::ssub_1;
4882 const MachineInstr &MI,
unsigned DefIdx, RegSubRegPair &BaseReg,
4883 RegSubRegPairAndIdx &InsertedReg)
const {
4888 case ARM::VSETLNi32:
4896 InsertedReg.Reg = MOInsertedReg.
getReg();
4897 InsertedReg.SubReg = MOInsertedReg.
getSubReg();
4898 InsertedReg.SubIdx = MOIndex.
getImm() == 0 ? ARM::ssub_0 : ARM::ssub_1;
MachineConstantPoolValue * MachineCPVal
void push_back(const T &Elt)
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
bool isProfitableToIfCvt(MachineBasicBlock &MBB, unsigned NumCycles, unsigned ExtraPredCycles, BranchProbability Probability) const override
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
virtual MachineInstr * duplicate(MachineInstr &Orig, MachineFunction &MF) const
Create a duplicate of the Orig instruction in MF.
bool isProfitableToUnpredicate(MachineBasicBlock &TMBB, MachineBasicBlock &FMBB) const override
bool getInsertSubregLikeInputs(const MachineInstr &MI, unsigned DefIdx, RegSubRegPair &BaseReg, RegSubRegPairAndIdx &InsertedReg) const override
Build the equivalent inputs of a INSERT_SUBREG for the given MI and DefIdx.
union llvm::MachineConstantPoolEntry::@132 Val
The constant itself.
const GlobalValue * getGlobal() const
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
instr_iterator instr_end()
static unsigned char getAM3Offset(unsigned AM3Opc)
bool isBranch(QueryType Type=AnyInBundle) const
Returns true if this is a conditional, unconditional, or indirect branch.
bool isSchedulingBoundary(const MachineInstr &MI, const MachineBasicBlock *MBB, const MachineFunction &MF) const override
unsigned getMispredictionPenalty() const
unsigned getRegister(unsigned i) const
Return the specified register in the class.
bool DefinesPredicate(MachineInstr &MI, std::vector< MachineOperand > &Pred) const override
void ChangeToRegister(unsigned Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isDebug=false)
ChangeToRegister - Replace this operand with a new register operand of the specified value...
int getNumMicroOps(unsigned ItinClassIndx) const
Return the number of micro-ops that the given class decodes to.
bool isAddrMode3OpMinusReg(const MachineInstr &MI, unsigned Op) const
unsigned getNumDefs() const
Return the number of MachineOperands that are register definitions.
unsigned createVirtualRegister(const TargetRegisterClass *RegClass)
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
static unsigned getSORegOpc(ShiftOpc ShOp, unsigned Imm)
unsigned getPartialUpdateClearance() const
bool hasOptionalDef() const
Set if this instruction has an optional definition, e.g.
bool hasBranchPredictor() const
bool mayStore() const
Return true if this instruction could possibly modify memory.
ARMConstantPoolValue - ARM specific constantpool value.
void setIsDef(bool Val=true)
Change a def to a use, or a use to a def.
Describe properties that are true of each instruction in the target description file.
bool mayStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly modify memory.
bool expandPostRAPseudo(MachineInstr &MI) const override
void setIsUndef(bool Val=true)
MachineInstrBuilder MachineInstrBuilder &DefMI const MCInstrDesc & Desc
static bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
const MachineInstrBuilder & add(const MachineOperand &MO) const
static bool isSuitableForMask(MachineInstr *&MI, unsigned SrcReg, int CmpMask, bool CommonUse)
isSuitableForMask - Identify a suitable 'and' instruction that operates on the given source register ...
bool isPredicated(const MachineInstr &MI) const override
bool isPredicable(QueryType Type=AllInBundle) const
Return true if this instruction has a predicate operand that controls execution.
bool readsVirtualRegister(unsigned Reg) const
Return true if the MachineInstr reads the specified virtual register.
bool isV8EligibleForIT(const InstrType *Instr)
virtual ScheduleHazardRecognizer * CreateTargetPostRAHazardRecognizer(const InstrItineraryData *, const ScheduleDAG *DAG) const
Allocate and return a hazard recognizer to use for this target when scheduling the machine instructio...
static unsigned getCorrespondingDRegAndLane(const TargetRegisterInfo *TRI, unsigned SReg, unsigned &Lane)
const MCInstrDesc & getDesc() const
Returns the target instruction descriptor of this MachineInstr.
const char * getSymbolName() const
bool isThumbFunction() const
VarInfo - This represents the regions where a virtual register is live in the program.
const SDValue & getOperand(unsigned Num) const
void setIsDead(bool Val=true)
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
unsigned getPartialRegUpdateClearance(const MachineInstr &, unsigned, const TargetRegisterInfo *) const override
bool tryFoldSPUpdateIntoPushPop(const ARMSubtarget &Subtarget, MachineFunction &MF, MachineInstr *MI, unsigned NumBytes)
Tries to add registers to the reglist of a given base-updating push/pop instruction to adjust the sta...
bool isLDMBaseRegInList(const MachineInstr &MI) const
bool checkVLDnAccessAlignment() const
bool isThumb1Only() const
iterator_range< mop_iterator > operands()
void expandLoadStackGuardBase(MachineBasicBlock::iterator MI, unsigned LoadImmOpc, unsigned LoadOpc) const
bool optForSize() const
Optimize this function for size (-Os) or minimum size (-Oz).
unsigned createPICLabelUId()
static bool isThumb(const MCSubtargetInfo &STI)
bool isTerminator(QueryType Type=AnyInBundle) const
Returns true if this instruction part of the terminator for a basic block.
static unsigned getSOImmValRotate(unsigned Imm)
getSOImmValRotate - Try to handle Imm with an immediate shifter operand, computing the rotate amount ...
static bool isOptimizeCompareCandidate(MachineInstr *MI, bool &IsThumb1)
bool optForMinSize() const
Optimize this function for minimum size (-Oz).
return AArch64::GPR64RegClass contains(Reg)
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
bool isLdstSoMinusReg(const MachineInstr &MI, unsigned Op) const
static unsigned rotr32(unsigned Val, unsigned Amt)
rotr32 - Rotate a 32-bit unsigned value right by a specified # bits.
const ARMBaseInstrInfo * getInstrInfo() const override
bool removeKill(MachineInstr &MI)
removeKill - Delete a kill corresponding to the specified machine instruction.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
void clearKillInfo()
Clears kill flags on all operands.
static bool isCPSRDefined(const MachineInstr &MI)
Can load/store 1 register/cycle.
bool isJTI() const
isJTI - Tests if this is a MO_JumpTableIndex operand.
static uint32_t getAlignment(const MCSectionCOFF &Sec)
int getOperandCycle(unsigned ItinClassIndx, unsigned OperandIdx) const
Return the cycle for the given class and operand.
A description of a memory reference used in the backend.
mmo_iterator memoperands_begin() const
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
Provide an instruction scheduling machine model to CodeGen passes.
const HexagonInstrInfo * TII
const TargetRegisterInfo * getTargetRegisterInfo() const
bool useNEONForFPMovs() const
static MachineOperand CreateReg(unsigned Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isEarlyClobber=false, unsigned SubReg=0, bool isDebug=false, bool isInternalRead=false)
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
bool analyzeCompare(const MachineInstr &MI, unsigned &SrcReg, unsigned &SrcReg2, int &CmpMask, int &CmpValue) const override
analyzeCompare - For a comparison instruction, return the source registers in SrcReg and SrcReg2 if h...
bool reverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const override
use_instr_iterator use_instr_begin(unsigned RegNo) const
bool isCall() const
Return true if the instruction is a call.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
bool isReg() const
isReg - Tests if this is a MO_Register operand.
void setImplicit(bool Val=true)
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
bool mayLoad(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly read memory.
bool rewriteARMFrameIndex(MachineInstr &MI, unsigned FrameRegIdx, unsigned FrameReg, int &Offset, const ARMBaseInstrInfo &TII)
rewriteARMFrameIndex / rewriteT2FrameIndex - Rewrite MI to access 'Offset' bytes from the FP...
const TargetRegisterClass * getRegClass(unsigned Reg) const
Return the register class of the specified virtual register.
bool isLdstScaledReg(const MachineInstr &MI, unsigned Op) const
Reg
All possible values of the reg field in the ModR/M byte.
bool memoperands_empty() const
This file contains the simple types necessary to represent the attributes associated with functions a...
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
void setExecutionDomain(MachineInstr &MI, unsigned Domain) const override
The memory access is dereferenceable (i.e., doesn't trap).
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
ScheduleHazardRecognizer * CreateTargetHazardRecognizer(const TargetSubtargetInfo *STI, const ScheduleDAG *DAG) const override
bool shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2, int64_t Offset1, int64_t Offset2, unsigned NumLoads) const override
shouldScheduleLoadsNear - This is a used by the pre-regalloc scheduler to determine (in conjunction w...
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, uint64_t s, unsigned base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
bool analyzeSelect(const MachineInstr &MI, SmallVectorImpl< MachineOperand > &Cond, unsigned &TrueOp, unsigned &FalseOp, bool &Optimizable) const override
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
INLINEASM - Represents an inline asm block.
LLVM_NODISCARD bool empty() const
static unsigned getT2SOImmTwoPartFirst(unsigned Imm)
unsigned getNumOperands() const
Access to explicit operands of the instruction.
bool isCPI() const
isCPI - Tests if this is a MO_ConstantPoolIndex operand.
defusechain_iterator - This class provides iterator support for machine operands in the function that...
bool isFpMLxInstruction(unsigned Opcode) const
isFpMLxInstruction - Return true if the specified opcode is a fp MLA / MLS instruction.
bool PredicateInstruction(MachineInstr &MI, ArrayRef< MachineOperand > Pred) const override
void RemoveOperand(unsigned i)
Erase an operand from an instruction, leaving it with one fewer operand than it started with...
bool FoldImmediate(MachineInstr &UseMI, MachineInstr &DefMI, unsigned Reg, MachineRegisterInfo *MRI) const override
FoldImmediate - 'Reg' is known to be defined by a move immediate instruction, try to fold the immedia...
static std::array< MachineOperand, 2 > predOps(ARMCC::CondCodes Pred, unsigned PredReg=0)
Get the operands corresponding to the given Pred value.
static ARMCC::CondCodes getSwappedCondition(ARMCC::CondCodes CC)
getSwappedCondition - assume the flags are set by MI(a,b), return the condition code if we modify the...
bool isFI() const
isFI - Tests if this is a MO_FrameIndex operand.
MachineInstr * commuteInstructionImpl(MachineInstr &MI, bool NewMI, unsigned OpIdx1, unsigned OpIdx2) const override
Commutes the operands in the given instruction.
Can load/store 2 registers/cycle, but needs an extra cycle if the access is not 64-bit aligned...
unsigned getMatchingSuperReg(unsigned Reg, unsigned SubIdx, const TargetRegisterClass *RC) const
Return a super-register of the specified register Reg so its sub-register of index SubIdx is Reg...
unsigned getNumMicroOps(const InstrItineraryData *ItinData, const MachineInstr &MI) const override
bool isCopyLike() const
Return true if the instruction behaves like a copy.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Itinerary data supplied by a subtarget to be used by a target.
iterator getLastNonDebugInstr()
Returns an iterator to the last non-debug instruction in the basic block, or end().
This class is a data container for one entry in a MachineConstantPool.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
static const ARM_MLxEntry ARM_MLxTable[]
unsigned getMatchingCondBranchOpcode(unsigned Opc)
ARM_MLxEntry - Record information about MLA / MLS instructions.
bool dontWidenVMOVS() const
instr_iterator insert(instr_iterator I, MachineInstr *M)
Insert MI into the instruction list before I, possibly inside a bundle.
unsigned getUndefRegState(bool B)
virtual const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const =0
Return a null-terminated list of all of the callee-saved registers on this target.
LivenessQueryResult computeRegisterLiveness(const TargetRegisterInfo *TRI, unsigned Reg, const_iterator Before, unsigned Neighborhood=10) const
Return whether (physical) register Reg has been <def>ined and not <kill>ed as of just before Before...
size_t size() const
size - Get the array size.
Expected< const typename ELFT::Sym * > getSymbol(typename ELFT::SymRange Symbols, uint32_t Index)
const TargetRegisterClass * constrainRegClass(unsigned Reg, const TargetRegisterClass *RC, unsigned MinNumRegs=0)
constrainRegClass - Constrain the register class of the specified virtual register to be a common sub...
reverse_iterator rbegin()
unsigned getKillRegState(bool B)
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
bool isMachineConstantPoolEntry() const
isMachineConstantPoolEntry - Return true if the MachineConstantPoolEntry is indeed a target specific ...
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
void ChangeToImmediate(int64_t ImmVal)
ChangeToImmediate - Replace this operand with a new immediate operand of the specified value...
const MachineBasicBlock * getParent() const
TargetInstrInfo - Interface to description of machine instruction set.
static bool isCondBranchOpcode(int Opc)
iterator find(const_arg_type_t< KeyT > Val)
const Constant * ConstVal
bool isDebugValue() const
This class is intended to be used as a base class for asm properties and features specific to the tar...
bool isImplicitDef() const
mmo_iterator memoperands_end() const
bool isInsertSubreg() const
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
static bool isCalleeSavedRegister(unsigned Reg, const MCPhysReg *CSRegs)
bool regsOverlap(unsigned regA, unsigned regB) const
Returns true if the two registers are equal or alias each other.
unsigned const MachineRegisterInfo * MRI
bool SubsumesPredicate(ArrayRef< MachineOperand > Pred1, ArrayRef< MachineOperand > Pred2) const override
HazardRecognizer - This determines whether or not an instruction can be issued this cycle...
const InstrItineraryData * getInstrItineraries() const
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
bool areLoadsFromSameBasePtr(SDNode *Load1, SDNode *Load2, int64_t &Offset1, int64_t &Offset2) const override
areLoadsFromSameBasePtr - This is used by the pre-regalloc scheduler to determine if two loads are lo...
MachineInstrBuilder & UseMI
static unsigned char getAM5Offset(unsigned AM5Opc)
static unsigned getSOImmTwoPartSecond(unsigned V)
getSOImmTwoPartSecond - If V is a value that satisfies isSOImmTwoPartVal, return the second chunk of ...
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
int findRegisterDefOperandIdx(unsigned Reg, bool isDead=false, bool Overlap=false, const TargetRegisterInfo *TRI=nullptr) const
Returns the operand index that is a def of the specified register or -1 if it is not found...
unsigned isLoadFromStackSlotPostFE(const MachineInstr &MI, int &FrameIndex) const override
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
This file contains the declarations for the subclasses of Constant, which represent the different fla...
const MachineOperand & getOperand(unsigned i) const
unsigned getInstSizeInBytes(const MachineInstr &MI) const override
GetInstSize - Returns the size of the specified MachineInstr.
unsigned getSubReg(unsigned Reg, unsigned Idx) const
Returns the physical register number of sub-register "Index" for physical register RegNo...
unsigned getSize() const
Return the number of bytes in the encoding of this instruction, or zero if the encoding size cannot b...
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
static bool isJumpTableBranchOpcode(int Opc)
unsigned getStageLatency(unsigned ItinClassIndx) const
Return the total stage latency of the given class.
virtual bool hasSameValue(ARMConstantPoolValue *ACPV)
hasSameValue - Return true if this ARM constpool value can share the same constantpool entry as anoth...
static bool isEligibleForITBlock(const MachineInstr *MI)
static unsigned getT2SOImmTwoPartSecond(unsigned Imm)
Register is known to be fully dead.
static const MachineInstr * getBundledUseMI(const TargetRegisterInfo *TRI, const MachineInstr &MI, unsigned Reg, unsigned &UseIdx, unsigned &Dist)
bool isIdenticalTo(const MachineInstr &Other, MICheckType Check=CheckDefs) const
Return true if this instruction is identical to Other.
const MachineInstrBuilder & setMIFlags(unsigned Flags) const
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
void copyFromCPSR(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, unsigned DestReg, bool KillSrc, const ARMSubtarget &Subtarget) const
void setImm(int64_t immVal)
bool hasOneMemOperand() const
Return true if this instruction has exactly one MachineMemOperand.
MachineInstr * duplicate(MachineInstr &Orig, MachineFunction &MF) const override
unsigned convertAddSubFlagsOpcode(unsigned OldOpc)
Map pseudo instructions that imply an 'S' bit onto real opcodes.
int64_t getOffset() const
Return the offset from the symbol in this operand.
self_iterator getIterator()
static bool isRedundantFlagInstr(MachineInstr *CmpI, unsigned SrcReg, unsigned SrcReg2, int ImmValue, MachineInstr *OI)
isRedundantFlagInstr - check whether the first instruction, whose only purpose is to update flags...
std::pair< NoneType, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
bool empty() const
empty - Check if the array is empty.
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
LivenessQueryResult
Possible outcome of a register liveness query to computeRegisterLiveness()
Register is known to be (at least partially) live.
succ_iterator succ_begin()
void emitARMRegPlusImmediate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const DebugLoc &dl, unsigned DestReg, unsigned BaseReg, int NumBytes, ARMCC::CondCodes Pred, unsigned PredReg, const ARMBaseInstrInfo &TII, unsigned MIFlags=0)
emitARMRegPlusImmediate / emitT2RegPlusImmediate - Emits a series of instructions to materializea des...
unsigned getSubReg() const
VarInfo & getVarInfo(unsigned RegIdx)
getVarInfo - Return the VarInfo structure for the specified VIRTUAL register.
ARMCC::CondCodes getInstrPredicate(const MachineInstr &MI, unsigned &PredReg)
getInstrPredicate - If instruction is predicated, returns its predicate condition, otherwise returns AL.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
pred_iterator pred_begin()
static const MachineInstr * getBundledDefMI(const TargetRegisterInfo *TRI, const MachineInstr *MI, unsigned Reg, unsigned &DefIdx, unsigned &Dist)
ARMLdStMultipleTiming getLdStMultipleTiming() const
bool definesRegister(unsigned Reg, const TargetRegisterInfo *TRI=nullptr) const
Return true if the MachineInstr fully defines the specified register.
void setIsKill(bool Val=true)
bool isRegMask() const
isRegMask - Tests if this is a MO_RegisterMask operand.
unsigned getOpcode() const
Return the opcode number for this descriptor.
The memory access writes data.
std::pair< uint16_t, uint16_t > getExecutionDomain(const MachineInstr &MI) const override
VFP/NEON execution domains.
bool isInsertSubregLike(QueryType Type=IgnoreBundle) const
Return true if this instruction behaves the same way as the generic INSERT_SUBREG instructions...
size_type count(const T &V) const
count - Return 1 if the element is in the set, 0 otherwise.
bool isSafeToMove(AliasAnalysis *AA, bool &SawStore) const
Return true if it is safe to move this instruction.
std::vector< MachineInstr * > Kills
Kills - List of MachineInstruction's which are the last use of this virtual register (kill it) in the...
static AddrOpc getAM2Op(unsigned AM2Opc)
bool readsRegister(unsigned Reg, const TargetRegisterInfo *TRI=nullptr) const
Return true if the MachineInstr reads the specified register.
ARMConstantPoolConstant - ARM-specific constant pool values for Constants, Functions, and BlockAddresses.
int findRegisterUseOperandIdx(unsigned Reg, bool isKill=false, const TargetRegisterInfo *TRI=nullptr) const
Returns the operand index that is a use of the specific register or -1 if it is not found...
static bool isIndirectBranchOpcode(int Opc)
void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, unsigned SubIdx, const MachineInstr &Orig, const TargetRegisterInfo &TRI) const override
Iterator for intrusive lists based on ilist_node.
static bool isUncondBranchOpcode(int Opc)
virtual unsigned getUnindexedOpcode(unsigned Opc) const =0
bool isGVIndirectSymbol(const GlobalValue *GV) const
True if the GV will be accessed via an indirect symbol.
void setDesc(const MCInstrDesc &tid)
Replace the instruction descriptor (thus opcode) of the current instruction with a new one...
void substituteRegister(unsigned FromReg, unsigned ToReg, unsigned SubIdx, const TargetRegisterInfo &RegInfo)
Replace all occurrences of FromReg with ToReg:SubIdx, properly composing subreg indices where necessa...
bool erase(PtrType Ptr)
erase - If the set contains the specified pointer, remove it and return true, otherwise return false...
static unsigned getAM2Offset(unsigned AM2Opc)
ARMConstantPoolSymbol - ARM-specific constantpool values for external symbols.
MachineInstr * CloneMachineInstr(const MachineInstr *Orig)
CloneMachineInstr - Create a new MachineInstr which is a copy of the 'Orig' instruction, identical in all ways except the instruction has no parent, prev, or next.
static unsigned duplicateCPV(MachineFunction &MF, unsigned &CPI)
Create a copy of a const pool value.
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...
unsigned getObjectAlignment(int ObjectIdx) const
Return the alignment of the specified stack object.
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify=false) const override
Map pseudo instructions that imply an 'S' bit onto real opcodes.
constexpr size_t array_lengthof(T(&)[N])
Find the length of an array.
void breakPartialRegDependency(MachineInstr &, unsigned, const TargetRegisterInfo *TRI) const override
An SDNode that represents everything that will be needed to construct a MachineInstr.
bool isSwiftFastImmShift(const MachineInstr *MI) const
Returns true if the instruction has a shift by immediate that can be executed in one cycle less...
bool mayLoad() const
Return true if this instruction could possibly read memory.
instr_iterator getInstrIterator() const
Represents one node in the SelectionDAG.
static bool isPushOpcode(int Opc)
static bool isSOImmTwoPartVal(unsigned V)
isSOImmTwoPartVal - Return true if the specified value can be obtained by or'ing together two SOImmVa...
ARMConstantPoolMBB - ARM-specific constantpool value of a machine basic block.
const MachineInstrBuilder & addFrameIndex(int Idx) const
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void addRegisterDefined(unsigned Reg, const TargetRegisterInfo *RegInfo=nullptr)
We have determined MI defines a register.
static bool clobbersPhysReg(const uint32_t *RegMask, unsigned PhysReg)
clobbersPhysReg - Returns true if this RegMask clobbers PhysReg.
unsigned getLDMVariableDefsSize(const MachineInstr &MI) const
unsigned isLoadFromStackSlot(const MachineInstr &MI, int &FrameIndex) const override
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
void copyToCPSR(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, unsigned SrcReg, bool KillSrc, const ARMSubtarget &Subtarget) const
unsigned getNumLDMAddresses(const MachineInstr &MI) const
Get the number of addresses by LDM or VLDM or zero for unknown.
AddrMode
ARM Addressing Modes.
static AddrOpc getAM3Op(unsigned AM3Opc)
int findFirstPredOperandIdx() const
Find the index of the first operand in the operand list that is used to represent the predicate...
bool isExtractSubregLike(QueryType Type=IgnoreBundle) const
Return true if this instruction behaves the same way as the generic EXTRACT_SUBREG instructions...
MachineInstr * getUniqueVRegDef(unsigned Reg) const
getUniqueVRegDef - Return the unique machine instr that defines the specified virtual register or nul...
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
int getOperandLatency(unsigned DefClass, unsigned DefIdx, unsigned UseClass, unsigned UseIdx) const
Compute and return the use operand latency of a given itinerary class and operand index if the value ...
struct llvm::MachineOperand::@135::@136 Reg
static int getSOImmVal(unsigned Arg)
getSOImmVal - Given a 32-bit immediate, if it is something that can fit into an shifter_operand immed...
ARMBaseInstrInfo(const ARMSubtarget &STI)
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
const MachineInstrBuilder & addGlobalAddress(const GlobalValue *GV, int64_t Offset=0, unsigned char TargetFlags=0) const
llvm_unreachable("Unknown RegBank!")
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
The memory access reads data.
bool IsCPSRDead< MachineInstr >(const MachineInstr *MI)
TargetSubtargetInfo - Generic base class for all target subtargets.
bool nonpipelinedVFP() const
static bool isPopOpcode(int Opc)
static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
static unsigned getNumMicroOpsSwiftLdSt(const InstrItineraryData *ItinData, const MachineInstr &MI)
bool isPredicable(const MachineInstr &MI) const override
isPredicable - Return true if the specified instruction can be predicated.
static std::vector< std::string > Flags
bool isSuperRegister(unsigned RegA, unsigned RegB) const
Returns true if RegB is a super-register of RegA.
bool cheapPredicableCPSRDef() const
static bool isARMLowRegister(unsigned Reg)
isARMLowRegister - Returns true if the register is a low register (r0-r7).
Representation of each machine instruction.
static MachineInstr * canFoldIntoMOVCC(unsigned Reg, const MachineRegisterInfo &MRI, const TargetInstrInfo *TII)
Identify instructions that can be folded into a MOVCC instruction, and return the defining instructio...
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
static CondCodes getOppositeCondition(CondCodes CC)
static const AddSubFlagsOpcodePair AddSubFlagsOpcodeMap[]
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
unsigned getSchedClass() const
Return the scheduling class for this instruction.
void addVirtualRegisterDead(unsigned IncomingReg, MachineInstr &MI, bool AddIfNotFound=false)
addVirtualRegisterDead - Add information about the fact that the specified register is dead after bei...
uint64_t scale(uint64_t Num) const
Scale a large integer.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
bool isLdstScaledRegNotPlusLsl2(const MachineInstr &MI, unsigned Op) const
static MachineOperand condCodeOp(unsigned CCReg=0)
Get the operand corresponding to the conditional code result.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
bool getExtractSubregLikeInputs(const MachineInstr &MI, unsigned DefIdx, RegSubRegPairAndIdx &InputReg) const override
Build the equivalent inputs of a EXTRACT_SUBREG for the given MI and DefIdx.
Register liveness not decidable from local neighborhood.
ARMFunctionInfo - This class is derived from MachineFunctionInfo and contains private ARM-specific in...
virtual MachineInstr * commuteInstructionImpl(MachineInstr &MI, bool NewMI, unsigned OpIdx1, unsigned OpIdx2) const
This method commutes the operands of the given machine instruction MI.
bool hasOneNonDBGUse(unsigned RegNo) const
hasOneNonDBGUse - Return true if there is exactly one non-Debug instruction using the specified regis...
bool hasPipelineForwarding(unsigned DefClass, unsigned DefIdx, unsigned UseClass, unsigned UseIdx) const
Return true if there is a pipeline forwarding between instructions of itinerary classes DefClass and ...
void setReg(unsigned Reg)
Change the register this operand corresponds to.
const MachineInstrBuilder & addConstantPoolIndex(unsigned Idx, int Offset=0, unsigned char TargetFlags=0) const
int getOperandLatency(const InstrItineraryData *ItinData, const MachineInstr &DefMI, unsigned DefIdx, const MachineInstr &UseMI, unsigned UseIdx) const override
const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const
bool isCall(QueryType Type=AnyInBundle) const
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
bool getRegSequenceLikeInputs(const MachineInstr &MI, unsigned DefIdx, SmallVectorImpl< RegSubRegPairAndIdx > &InputRegs) const override
Build the equivalent inputs of a REG_SEQUENCE for the given MI and DefIdx.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
The memory access always returns the same value (or traps).
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
bool isProfitableToUnpredicate() const
bool optimizeCompareInstr(MachineInstr &CmpInstr, unsigned SrcReg, unsigned SrcReg2, int CmpMask, int CmpValue, const MachineRegisterInfo *MRI) const override
optimizeCompareInstr - Convert the instruction to set the zero flag so that we can remove a "comparis...
static AddrOpc getAM5Op(unsigned AM5Opc)
unsigned computeOperandLatency(const MachineInstr *DefMI, unsigned DefOperIdx, const MachineInstr *UseMI, unsigned UseOperIdx) const
Compute operand latency based on the available machine model.
unsigned isStoreToStackSlotPostFE(const MachineInstr &MI, int &FrameIndex) const override
MachineInstr * removeFromParent()
Unlink 'this' from the containing basic block, and return it without deleting it. ...
MachineInstr * getVRegDef(unsigned Reg) const
getVRegDef - Return the machine instr that defines the specified virtual register or null if none is ...
int getPreISelOperandLatencyAdjustment() const
virtual ScheduleHazardRecognizer * CreateTargetHazardRecognizer(const TargetSubtargetInfo *STI, const ScheduleDAG *DAG) const
Allocate and return a hazard recognizer to use for this target when scheduling the machine instructio...
static int const Threshold
TODO: Write a new FunctionPass AliasAnalysis so that it can keep a cache.
unsigned getReg() const
getReg - Returns the register number.
bool isAddrMode3OpImm(const MachineInstr &MI, unsigned Op) const
ScheduleHazardRecognizer * CreateTargetPostRAHazardRecognizer(const InstrItineraryData *II, const ScheduleDAG *DAG) const override
ARMHazardRecognizer handles special constraints that are not expressed in the scheduling itinerary...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static ShiftOpc getAM2ShiftOpc(unsigned AM2Opc)
static MachinePointerInfo getGOT(MachineFunction &MF)
Return a MachinePointerInfo record that refers to a GOT entry.
virtual const ARMBaseRegisterInfo & getRegisterInfo() const =0
uint16_t getEncodingValue(unsigned RegNo) const
Returns the encoding for RegNo.
static unsigned getSORegOffset(unsigned Op)
Can load/store 1 register/cycle, but needs an extra cycle for address computation and potentially als...
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned char TargetFlags=0) const
static use_instr_iterator use_instr_end()
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
unsigned getNumOperands() const
Return the number of declared MachineOperands for this MachineInstruction.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const override
MO_NONLAZY - This is an independent flag, on a symbol operand "FOO" it represents a symbol which...
bool hasImplicitDefOfPhysReg(unsigned Reg, const MCRegisterInfo *MRI=nullptr) const
Return true if this instruction implicitly defines the specified physical register.
Can load/store 2 registers/cycle.
const ARMSubtarget & getSubtarget() const
bool addRegisterKilled(unsigned IncomingReg, const TargetRegisterInfo *RegInfo, bool AddIfNotFound=false)
We have determined MI kills a register.
const std::vector< MachineConstantPoolEntry > & getConstants() const
static int adjustDefLatency(const ARMSubtarget &Subtarget, const MachineInstr &DefMI, const MCInstrDesc &DefMCID, unsigned DefAlign)
Return the number of cycles to add to (or subtract from) the static itinerary based on the def opcode...
StringRef - Represent a constant reference to a string, i.e.
bool readsReg() const
readsReg - Returns true if this operand reads the previous value of its register. ...
void sort(Policy policy, RandomAccessIterator Start, RandomAccessIterator End, const Comparator &Comp=Comparator())
bool hasOptionalDef(QueryType Type=IgnoreBundle) const
Set if this instruction has an optional definition, e.g.
unsigned getSpillSize(const TargetRegisterClass &RC) const
Return the size in bytes of the stack slot allocated to hold a spilled copy of a register from class ...
bool isIdenticalTo(const MachineOperand &Other) const
Returns true if this operand is identical to the specified operand except for liveness related flags ...
bool isRegSequence() const
bool isThumb2Function() const
static bool getImplicitSPRUseForDPRUse(const TargetRegisterInfo *TRI, MachineInstr &MI, unsigned DReg, unsigned Lane, unsigned &ImplicitSReg)
getImplicitSPRUseForDPRUse - Given a use of a DPR register and lane, set ImplicitSReg to a register n...
static bool isT2SOImmTwoPartVal(unsigned Imm)
static unsigned getNumMicroOpsSingleIssuePlusExtras(unsigned Opc, unsigned NumRegs)
bool produceSameValue(const MachineInstr &MI0, const MachineInstr &MI1, const MachineRegisterInfo *MRI) const override
static unsigned getSOImmTwoPartFirst(unsigned V)
getSOImmTwoPartFirst - If V is a value that satisfies isSOImmTwoPartVal, return the first chunk of it...
MachineInstr * convertToThreeAddress(MachineFunction::iterator &MFI, MachineInstr &MI, LiveVariables *LV) const override
bool isRegSequenceLike(QueryType Type=IgnoreBundle) const
Return true if this instruction behaves the same way as the generic REG_SEQUENCE instructions.
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
bool isAm2ScaledReg(const MachineInstr &MI, unsigned Op) const
bool isEmpty() const
Returns true if there are no itineraries.
Instructions::const_iterator const_instr_iterator
void setMemRefs(mmo_iterator NewMemRefs, mmo_iterator NewMemRefsEnd)
Assign this MachineInstr's memory reference descriptor list.
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
static ARMConstantPoolConstant * Create(const Constant *C, unsigned ID)
unsigned getConstantPoolIndex(const Constant *C, unsigned Alignment)
getConstantPoolIndex - Create a new entry in the constant pool or return an existing one...
bool modifiesRegister(unsigned Reg, const TargetRegisterInfo *TRI) const
Return true if the MachineInstr modifies (fully define or partially define) the specified register...
void addVirtualRegisterKilled(unsigned IncomingReg, MachineInstr &MI, bool AddIfNotFound=false)
addVirtualRegisterKilled - Add information about the fact that the specified register is killed after...
std::vector< MachineBasicBlock * >::iterator succ_iterator
const MachineInstrBuilder & AddDReg(MachineInstrBuilder &MIB, unsigned Reg, unsigned SubIdx, unsigned State, const TargetRegisterInfo *TRI) const
MachineInstr * optimizeSelect(MachineInstr &MI, SmallPtrSetImpl< MachineInstr * > &SeenMIs, bool) const override
static cl::opt< bool > EnableARM3Addr("enable-arm-3-addr-conv", cl::Hidden, cl::desc("Enable ARM 2-addr to 3-addr conv"))
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode...
static ShiftOpc getSORegShOp(unsigned Op)
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
BranchProbability getCompl() const
unsigned isStoreToStackSlot(const MachineInstr &MI, int &FrameIndex) const override
mmo_iterator memoperands_begin() const
Access to memory operands of the instruction.
void tieOperands(unsigned DefIdx, unsigned UseIdx)
Add a tie between the register operands at DefIdx and UseIdx.