52 #define GET_INSTRINFO_CTOR_DTOR
53 #include "AArch64GenInstrInfo.inc"
57 cl::desc(
"Restrict range of TB[N]Z instructions (DEBUG)"));
61 cl::desc(
"Restrict range of CB[N]Z instructions (DEBUG)"));
65 cl::desc(
"Restrict range of Bcc instructions (DEBUG)"));
69 RI(STI.getTargetTriple()), Subtarget(STI) {}
83 unsigned NumBytes = 0;
90 case TargetOpcode::DBG_VALUE:
92 case TargetOpcode::IMPLICIT_DEF:
96 case TargetOpcode::STACKMAP:
99 assert(NumBytes % 4 == 0 &&
"Invalid number of NOP bytes requested!");
101 case TargetOpcode::PATCHPOINT:
104 assert(NumBytes % 4 == 0 &&
"Invalid number of NOP bytes requested!");
168 int64_t BrOffset)
const {
170 assert(Bits >= 3 &&
"max branch displacement must be enough to jump"
171 "over conditional branch expansion");
172 return isIntN(Bits, BrOffset / 4);
201 bool AllowModify)
const {
207 if (!isUnpredicatedTerminator(*I))
214 unsigned LastOpc = LastInst->
getOpcode();
215 if (I == MBB.
begin() || !isUnpredicatedTerminator(*--I)) {
230 unsigned SecondLastOpc = SecondLastInst->
getOpcode();
237 LastInst = SecondLastInst;
239 if (I == MBB.
begin() || !isUnpredicatedTerminator(*--I)) {
244 SecondLastInst = &*
I;
245 SecondLastOpc = SecondLastInst->
getOpcode();
251 if (SecondLastInst && I != MBB.
begin() && isUnpredicatedTerminator(*--I))
267 I->eraseFromParent();
276 I->eraseFromParent();
286 if (Cond[0].getImm() != -1) {
292 switch (Cond[1].getImm()) {
296 Cond[1].setImm(AArch64::CBNZW);
299 Cond[1].setImm(AArch64::CBZW);
302 Cond[1].setImm(AArch64::CBNZX);
305 Cond[1].setImm(AArch64::CBZX);
308 Cond[1].setImm(AArch64::TBNZW);
311 Cond[1].setImm(AArch64::TBZW);
314 Cond[1].setImm(AArch64::TBNZX);
317 Cond[1].setImm(AArch64::TBZX);
326 int *BytesRemoved)
const {
336 I->eraseFromParent();
340 if (I == MBB.
begin()) {
353 I->eraseFromParent();
360 void AArch64InstrInfo::instantiateCondBranch(
363 if (Cond[0].getImm() != -1) {
370 BuildMI(&MBB, DL,
get(Cond[1].getImm())).
add(Cond[2]);
372 MIB.
addImm(Cond[3].getImm());
382 int *BytesAdded)
const {
384 assert(TBB &&
"insertBranch must not be told to insert a fallthrough");
390 instantiateCondBranch(MBB, DL, TBB, Cond);
399 instantiateCondBranch(MBB, DL, TBB, Cond);
423 unsigned *NewVReg =
nullptr) {
428 bool Is64Bit = AArch64::GPR64allRegClass.hasSubClassEq(MRI.
getRegClass(VReg));
431 unsigned SrcOpNum = 0;
433 case AArch64::ADDSXri:
434 case AArch64::ADDSWri:
440 case AArch64::ADDXri:
441 case AArch64::ADDWri:
447 Opc = Is64Bit ? AArch64::CSINCXr : AArch64::CSINCWr;
450 case AArch64::ORNXrr:
451 case AArch64::ORNWrr: {
454 if (ZReg != AArch64::XZR && ZReg != AArch64::WZR)
457 Opc = Is64Bit ? AArch64::CSINVXr : AArch64::CSINVWr;
461 case AArch64::SUBSXrr:
462 case AArch64::SUBSWrr:
468 case AArch64::SUBXrr:
469 case AArch64::SUBWrr: {
472 if (ZReg != AArch64::XZR && ZReg != AArch64::WZR)
475 Opc = Is64Bit ? AArch64::CSNEGXr : AArch64::CSNEGWr;
481 assert(Opc && SrcOpNum &&
"Missing parameters");
490 unsigned TrueReg,
unsigned FalseReg,
int &CondCycles,
int &TrueCycles,
491 int &FalseCycles)
const {
500 unsigned ExtraCondLat = Cond.
size() != 1;
504 if (AArch64::GPR64allRegClass.hasSubClassEq(RC) ||
505 AArch64::GPR32allRegClass.hasSubClassEq(RC)) {
507 CondCycles = 1 + ExtraCondLat;
508 TrueCycles = FalseCycles = 1;
518 if (AArch64::FPR64RegClass.hasSubClassEq(RC) ||
519 AArch64::FPR32RegClass.hasSubClassEq(RC)) {
520 CondCycles = 5 + ExtraCondLat;
521 TrueCycles = FalseCycles = 2;
531 const DebugLoc &DL,
unsigned DstReg,
533 unsigned TrueReg,
unsigned FalseReg)
const {
538 switch (Cond.
size()) {
547 switch (Cond[1].getImm()) {
567 unsigned SrcReg = Cond[2].getReg();
571 BuildMI(MBB, I, DL,
get(AArch64::SUBSXri), AArch64::XZR)
577 BuildMI(MBB, I, DL,
get(AArch64::SUBSWri), AArch64::WZR)
586 switch (Cond[1].getImm()) {
599 if (Cond[1].getImm() == AArch64::TBZW || Cond[1].getImm() == AArch64::TBNZW)
600 BuildMI(MBB, I, DL,
get(AArch64::ANDSWri), AArch64::WZR)
605 BuildMI(MBB, I, DL,
get(AArch64::ANDSXri), AArch64::XZR)
615 bool TryFold =
false;
617 RC = &AArch64::GPR64RegClass;
618 Opc = AArch64::CSELXr;
621 RC = &AArch64::GPR32RegClass;
622 Opc = AArch64::CSELWr;
625 RC = &AArch64::FPR64RegClass;
626 Opc = AArch64::FCSELDrrr;
628 RC = &AArch64::FPR32RegClass;
629 Opc = AArch64::FCSELSrrr;
631 assert(RC &&
"Unsupported regclass");
635 unsigned NewVReg = 0;
666 uint64_t UImm = Imm << (64 - BitSize) >> (64 - BitSize);
684 case AArch64::ADDWri:
685 case AArch64::ADDXri:
686 case AArch64::SUBWri:
687 case AArch64::SUBXri:
692 case AArch64::ADDWrs:
693 case AArch64::ADDXrs:
694 case AArch64::SUBWrs:
695 case AArch64::SUBXrs:
701 case AArch64::ANDWri:
702 case AArch64::ANDXri:
703 case AArch64::EORWri:
704 case AArch64::EORXri:
705 case AArch64::ORRWri:
706 case AArch64::ORRXri:
710 case AArch64::ANDWrr:
711 case AArch64::ANDXrr:
712 case AArch64::BICWrr:
713 case AArch64::BICXrr:
714 case AArch64::EONWrr:
715 case AArch64::EONXrr:
716 case AArch64::EORWrr:
717 case AArch64::EORXrr:
718 case AArch64::ORNWrr:
719 case AArch64::ORNXrr:
720 case AArch64::ORRWrr:
721 case AArch64::ORRXrr:
725 case AArch64::ANDWrs:
726 case AArch64::ANDXrs:
727 case AArch64::BICWrs:
728 case AArch64::BICXrs:
729 case AArch64::EONWrs:
730 case AArch64::EONXrs:
731 case AArch64::EORWrs:
732 case AArch64::EORXrs:
733 case AArch64::ORNWrs:
734 case AArch64::ORNXrs:
735 case AArch64::ORRWrs:
736 case AArch64::ORRXrs:
744 case AArch64::MOVi32imm:
746 case AArch64::MOVi64imm:
751 case AArch64::FMOVS0:
752 case AArch64::FMOVD0:
754 case TargetOpcode::COPY:
768 case AArch64::ADDWrs:
769 case AArch64::ADDXrs:
770 case AArch64::ADDSWrs:
771 case AArch64::ADDSXrs: {
779 case AArch64::ADDWrx:
780 case AArch64::ADDXrx:
781 case AArch64::ADDXrx64:
782 case AArch64::ADDSWrx:
783 case AArch64::ADDSXrx:
784 case AArch64::ADDSXrx64: {
797 case AArch64::SUBWrs:
798 case AArch64::SUBSWrs: {
801 return ShiftVal == 0 ||
805 case AArch64::SUBXrs:
806 case AArch64::SUBSXrs: {
809 return ShiftVal == 0 ||
813 case AArch64::SUBWrx:
814 case AArch64::SUBXrx:
815 case AArch64::SUBXrx64:
816 case AArch64::SUBSWrx:
817 case AArch64::SUBSXrx:
818 case AArch64::SUBSXrx64: {
831 case AArch64::LDRBBroW:
832 case AArch64::LDRBBroX:
833 case AArch64::LDRBroW:
834 case AArch64::LDRBroX:
835 case AArch64::LDRDroW:
836 case AArch64::LDRDroX:
837 case AArch64::LDRHHroW:
838 case AArch64::LDRHHroX:
839 case AArch64::LDRHroW:
840 case AArch64::LDRHroX:
841 case AArch64::LDRQroW:
842 case AArch64::LDRQroX:
843 case AArch64::LDRSBWroW:
844 case AArch64::LDRSBWroX:
845 case AArch64::LDRSBXroW:
846 case AArch64::LDRSBXroX:
847 case AArch64::LDRSHWroW:
848 case AArch64::LDRSHWroX:
849 case AArch64::LDRSHXroW:
850 case AArch64::LDRSHXroX:
851 case AArch64::LDRSWroW:
852 case AArch64::LDRSWroX:
853 case AArch64::LDRSroW:
854 case AArch64::LDRSroX:
855 case AArch64::LDRWroW:
856 case AArch64::LDRWroX:
857 case AArch64::LDRXroW:
858 case AArch64::LDRXroX:
859 case AArch64::PRFMroW:
860 case AArch64::PRFMroX:
861 case AArch64::STRBBroW:
862 case AArch64::STRBBroX:
863 case AArch64::STRBroW:
864 case AArch64::STRBroX:
865 case AArch64::STRDroW:
866 case AArch64::STRDroX:
867 case AArch64::STRHHroW:
868 case AArch64::STRHHroX:
869 case AArch64::STRHroW:
870 case AArch64::STRHroX:
871 case AArch64::STRQroW:
872 case AArch64::STRQroX:
873 case AArch64::STRSroW:
874 case AArch64::STRSroX:
875 case AArch64::STRWroW:
876 case AArch64::STRWroX:
877 case AArch64::STRXroW:
878 case AArch64::STRXroX: {
886 unsigned &SrcReg,
unsigned &DstReg,
887 unsigned &SubIdx)
const {
891 case AArch64::SBFMXri:
892 case AArch64::UBFMXri:
900 SubIdx = AArch64::sub_32;
908 unsigned BaseRegA = 0, BaseRegB = 0;
909 int64_t OffsetA = 0, OffsetB = 0;
910 unsigned WidthA = 0, WidthB = 0;
926 if (BaseRegA == BaseRegB) {
927 int LowOffset = OffsetA < OffsetB ? OffsetA : OffsetB;
928 int HighOffset = OffsetA < OffsetB ? OffsetB : OffsetA;
929 int LowWidth = (LowOffset == OffsetA) ? WidthA : WidthB;
930 if (LowOffset + LowWidth <= HighOffset)
941 unsigned &SrcReg2,
int &CmpMask,
942 int &CmpValue)
const {
946 case AArch64::SUBSWrr:
947 case AArch64::SUBSWrs:
948 case AArch64::SUBSWrx:
949 case AArch64::SUBSXrr:
950 case AArch64::SUBSXrs:
951 case AArch64::SUBSXrx:
952 case AArch64::ADDSWrr:
953 case AArch64::ADDSWrs:
954 case AArch64::ADDSWrx:
955 case AArch64::ADDSXrr:
956 case AArch64::ADDSXrs:
957 case AArch64::ADDSXrx:
964 case AArch64::SUBSWri:
965 case AArch64::ADDSWri:
966 case AArch64::SUBSXri:
967 case AArch64::ADDSXri:
974 case AArch64::ANDSWri:
975 case AArch64::ANDSXri:
988 MI.
getOpcode() == AArch64::ANDSWri ? 32 : 64) != 0;
997 assert(MBB &&
"Can't get MachineBasicBlock here");
999 assert(MF &&
"Can't get MachineFunction here");
1004 for (
unsigned OpIdx = 0, EndIdx = Instr.
getNumOperands(); OpIdx < EndIdx;
1011 if (!OpRegCstraints)
1019 "Operand has register constraints without being a register!");
1023 if (!OpRegCstraints->
contains(Reg))
1039 bool MIDefinesZeroReg =
false;
1041 MIDefinesZeroReg =
true;
1046 case AArch64::ADDSWrr:
1047 return AArch64::ADDWrr;
1048 case AArch64::ADDSWri:
1049 return MIDefinesZeroReg ? AArch64::ADDSWri : AArch64::ADDWri;
1050 case AArch64::ADDSWrs:
1051 return MIDefinesZeroReg ? AArch64::ADDSWrs : AArch64::ADDWrs;
1052 case AArch64::ADDSWrx:
1053 return AArch64::ADDWrx;
1054 case AArch64::ADDSXrr:
1055 return AArch64::ADDXrr;
1056 case AArch64::ADDSXri:
1057 return MIDefinesZeroReg ? AArch64::ADDSXri : AArch64::ADDXri;
1058 case AArch64::ADDSXrs:
1059 return MIDefinesZeroReg ? AArch64::ADDSXrs : AArch64::ADDXrs;
1060 case AArch64::ADDSXrx:
1061 return AArch64::ADDXrx;
1062 case AArch64::SUBSWrr:
1063 return AArch64::SUBWrr;
1064 case AArch64::SUBSWri:
1065 return MIDefinesZeroReg ? AArch64::SUBSWri : AArch64::SUBWri;
1066 case AArch64::SUBSWrs:
1067 return MIDefinesZeroReg ? AArch64::SUBSWrs : AArch64::SUBWrs;
1068 case AArch64::SUBSWrx:
1069 return AArch64::SUBWrx;
1070 case AArch64::SUBSXrr:
1071 return AArch64::SUBXrr;
1072 case AArch64::SUBSXri:
1073 return MIDefinesZeroReg ? AArch64::SUBSXri : AArch64::SUBXri;
1074 case AArch64::SUBSXrs:
1075 return MIDefinesZeroReg ? AArch64::SUBSXrs : AArch64::SUBXrs;
1076 case AArch64::SUBSXrx:
1077 return AArch64::SUBXrx;
1096 if (To == To->getParent()->begin())
1101 if (To->getParent() != From->getParent())
1107 return MI.getIterator() == From;
1108 }) != To->getParent()->rend());
1111 for (--To; To != From; --To) {
1131 MachineInstr &CmpInstr,
unsigned SrcReg,
unsigned SrcReg2,
int CmpMask,
1138 if (DeadNZCVIdx != -1) {
1153 assert(succeeded &&
"Some operands reg class are incompatible!");
1160 assert((CmpValue == 0 || CmpValue == 1) &&
"CmpValue must be 0 or 1!");
1161 if (CmpValue != 0 || SrcReg2 != 0)
1168 return substituteCmpToZero(CmpInstr, SrcReg, MRI);
1178 return AArch64::INSTRUCTION_LIST_END;
1180 case AArch64::ADDSWrr:
1181 case AArch64::ADDSWri:
1182 case AArch64::ADDSXrr:
1183 case AArch64::ADDSXri:
1184 case AArch64::SUBSWrr:
1185 case AArch64::SUBSWri:
1186 case AArch64::SUBSXrr:
1187 case AArch64::SUBSXri:
1190 case AArch64::ADDWrr:
return AArch64::ADDSWrr;
1191 case AArch64::ADDWri:
return AArch64::ADDSWri;
1192 case AArch64::ADDXrr:
return AArch64::ADDSXrr;
1193 case AArch64::ADDXri:
return AArch64::ADDSXri;
1194 case AArch64::ADCWr:
return AArch64::ADCSWr;
1195 case AArch64::ADCXr:
return AArch64::ADCSXr;
1196 case AArch64::SUBWrr:
return AArch64::SUBSWrr;
1197 case AArch64::SUBWri:
return AArch64::SUBSWri;
1198 case AArch64::SUBXrr:
return AArch64::SUBSXrr;
1199 case AArch64::SUBXri:
return AArch64::SUBSXri;
1200 case AArch64::SBCWr:
return AArch64::SBCSWr;
1201 case AArch64::SBCXr:
return AArch64::SBCSXr;
1202 case AArch64::ANDWri:
return AArch64::ANDSWri;
1203 case AArch64::ANDXri:
return AArch64::ANDSXri;
1210 if (BB->isLiveIn(AArch64::NZCV))
1223 UsedNZCV() =
default;
1225 UsedNZCV&
operator |=(
const UsedNZCV& UsedFlags) {
1226 this->
N |= UsedFlags.N;
1227 this->
Z |= UsedFlags.Z;
1228 this->
C |= UsedFlags.C;
1229 this->V |= UsedFlags.V;
1244 case AArch64::Bcc: {
1250 case AArch64::CSINVWr:
1251 case AArch64::CSINVXr:
1252 case AArch64::CSINCWr:
1253 case AArch64::CSINCXr:
1254 case AArch64::CSELWr:
1255 case AArch64::CSELXr:
1256 case AArch64::CSNEGWr:
1257 case AArch64::CSNEGXr:
1258 case AArch64::FCSELSrrr:
1259 case AArch64::FCSELDrrr: {
1312 return Opcode == AArch64::ADDSWri || Opcode == AArch64::ADDSXri;
1316 return Opcode == AArch64::SUBSWri || Opcode == AArch64::SUBSXri;
1333 assert(
sForm(*MI) != AArch64::INSTRUCTION_LIST_END);
1336 const unsigned CmpOpcode = CmpInstr->
getOpcode();
1352 UsedNZCV NZCVUsedAfterCmp;
1367 return !NZCVUsedAfterCmp.C && !NZCVUsedAfterCmp.V;
1374 bool AArch64InstrInfo::substituteCmpToZero(
1385 unsigned NewOpc =
sForm(*MI);
1386 if (NewOpc == AArch64::INSTRUCTION_LIST_END)
1397 assert(succeeded &&
"Some operands reg class are incompatible!");
1403 if (MI.
getOpcode() != TargetOpcode::LOAD_STACK_GUARD)
1418 BuildMI(MBB, MI, DL,
get(AArch64::LDRXui), Reg)
1423 BuildMI(MBB, MI, DL,
get(AArch64::MOVZXi), Reg)
1425 BuildMI(MBB, MI, DL,
get(AArch64::MOVKXi), Reg)
1428 BuildMI(MBB, MI, DL,
get(AArch64::MOVKXi), Reg)
1431 BuildMI(MBB, MI, DL,
get(AArch64::MOVKXi), Reg)
1434 BuildMI(MBB, MI, DL,
get(AArch64::LDRXui), Reg)
1442 BuildMI(MBB, MI, DL,
get(AArch64::LDRXui), Reg)
1458 case AArch64::ADDSWrs:
1459 case AArch64::ADDSXrs:
1460 case AArch64::ADDWrs:
1461 case AArch64::ADDXrs:
1462 case AArch64::ANDSWrs:
1463 case AArch64::ANDSXrs:
1464 case AArch64::ANDWrs:
1465 case AArch64::ANDXrs:
1466 case AArch64::BICSWrs:
1467 case AArch64::BICSXrs:
1468 case AArch64::BICWrs:
1469 case AArch64::BICXrs:
1470 case AArch64::EONWrs:
1471 case AArch64::EONXrs:
1472 case AArch64::EORWrs:
1473 case AArch64::EORXrs:
1474 case AArch64::ORNWrs:
1475 case AArch64::ORNXrs:
1476 case AArch64::ORRWrs:
1477 case AArch64::ORRXrs:
1478 case AArch64::SUBSWrs:
1479 case AArch64::SUBSXrs:
1480 case AArch64::SUBWrs:
1481 case AArch64::SUBXrs:
1496 case AArch64::ADDSWrx:
1497 case AArch64::ADDSXrx:
1498 case AArch64::ADDSXrx64:
1499 case AArch64::ADDWrx:
1500 case AArch64::ADDXrx:
1501 case AArch64::ADDXrx64:
1502 case AArch64::SUBSWrx:
1503 case AArch64::SUBSXrx:
1504 case AArch64::SUBSXrx64:
1505 case AArch64::SUBWrx:
1506 case AArch64::SUBXrx:
1507 case AArch64::SUBXrx64:
1524 case AArch64::MOVZWi:
1525 case AArch64::MOVZXi:
1532 case AArch64::ANDWri:
1534 case AArch64::ANDXri:
1536 case TargetOpcode::COPY:
1548 case TargetOpcode::COPY: {
1551 return (AArch64::GPR32RegClass.
contains(DstReg) ||
1552 AArch64::GPR64RegClass.
contains(DstReg));
1554 case AArch64::ORRXrs:
1561 case AArch64::ADDXri:
1578 case TargetOpcode::COPY: {
1581 return (AArch64::FPR64RegClass.
contains(DstReg) ||
1582 AArch64::FPR128RegClass.
contains(DstReg));
1584 case AArch64::ORRv16i8:
1587 "invalid ORRv16i8 operands");
1600 case AArch64::LDRWui:
1601 case AArch64::LDRXui:
1602 case AArch64::LDRBui:
1603 case AArch64::LDRHui:
1604 case AArch64::LDRSui:
1605 case AArch64::LDRDui:
1606 case AArch64::LDRQui:
1623 case AArch64::STRWui:
1624 case AArch64::STRXui:
1625 case AArch64::STRBui:
1626 case AArch64::STRHui:
1627 case AArch64::STRSui:
1628 case AArch64::STRDui:
1629 case AArch64::STRQui:
1647 case AArch64::LDRBBroW:
1648 case AArch64::LDRBroW:
1649 case AArch64::LDRDroW:
1650 case AArch64::LDRHHroW:
1651 case AArch64::LDRHroW:
1652 case AArch64::LDRQroW:
1653 case AArch64::LDRSBWroW:
1654 case AArch64::LDRSBXroW:
1655 case AArch64::LDRSHWroW:
1656 case AArch64::LDRSHXroW:
1657 case AArch64::LDRSWroW:
1658 case AArch64::LDRSroW:
1659 case AArch64::LDRWroW:
1660 case AArch64::LDRXroW:
1661 case AArch64::STRBBroW:
1662 case AArch64::STRBroW:
1663 case AArch64::STRDroW:
1664 case AArch64::STRHHroW:
1665 case AArch64::STRHroW:
1666 case AArch64::STRQroW:
1667 case AArch64::STRSroW:
1668 case AArch64::STRWroW:
1669 case AArch64::STRXroW:
1670 case AArch64::LDRBBroX:
1671 case AArch64::LDRBroX:
1672 case AArch64::LDRDroX:
1673 case AArch64::LDRHHroX:
1674 case AArch64::LDRHroX:
1675 case AArch64::LDRQroX:
1676 case AArch64::LDRSBWroX:
1677 case AArch64::LDRSBXroX:
1678 case AArch64::LDRSHWroX:
1679 case AArch64::LDRSHXroX:
1680 case AArch64::LDRSWroX:
1681 case AArch64::LDRSroX:
1682 case AArch64::LDRWroX:
1683 case AArch64::LDRXroX:
1684 case AArch64::STRBBroX:
1685 case AArch64::STRBroX:
1686 case AArch64::STRDroX:
1687 case AArch64::STRHHroX:
1688 case AArch64::STRHroX:
1689 case AArch64::STRQroX:
1690 case AArch64::STRSroX:
1691 case AArch64::STRWroX:
1692 case AArch64::STRXroX:
1726 case AArch64::STURSi:
1727 case AArch64::STURDi:
1728 case AArch64::STURQi:
1729 case AArch64::STURBBi:
1730 case AArch64::STURHHi:
1731 case AArch64::STURWi:
1732 case AArch64::STURXi:
1733 case AArch64::LDURSi:
1734 case AArch64::LDURDi:
1735 case AArch64::LDURQi:
1736 case AArch64::LDURWi:
1737 case AArch64::LDURXi:
1738 case AArch64::LDURSWi:
1739 case AArch64::LDURHHi:
1740 case AArch64::LDURBBi:
1741 case AArch64::LDURSBWi:
1742 case AArch64::LDURSHWi:
1780 case AArch64::LDURQi:
1781 case AArch64::STURQi:
1782 case AArch64::LDRQui:
1783 case AArch64::STRQui:
1818 int64_t Dummy1, Dummy2;
1842 assert(OfsOp.isImm() &&
"Offset operand wasn't immediate.");
1847 unsigned &Width, int64_t &MinOffset,
1848 int64_t &MaxOffset)
const {
1853 MinOffset = MaxOffset = 0;
1855 case AArch64::STRWpost:
1856 case AArch64::LDRWpost:
1862 case AArch64::LDURQi:
1863 case AArch64::STURQi:
1869 case AArch64::LDURXi:
1870 case AArch64::LDURDi:
1871 case AArch64::STURXi:
1872 case AArch64::STURDi:
1878 case AArch64::LDURWi:
1879 case AArch64::LDURSi:
1880 case AArch64::LDURSWi:
1881 case AArch64::STURWi:
1882 case AArch64::STURSi:
1888 case AArch64::LDURHi:
1889 case AArch64::LDURHHi:
1890 case AArch64::LDURSHXi:
1891 case AArch64::LDURSHWi:
1892 case AArch64::STURHi:
1893 case AArch64::STURHHi:
1899 case AArch64::LDURBi:
1900 case AArch64::LDURBBi:
1901 case AArch64::LDURSBXi:
1902 case AArch64::LDURSBWi:
1903 case AArch64::STURBi:
1904 case AArch64::STURBBi:
1910 case AArch64::LDPQi:
1911 case AArch64::LDNPQi:
1912 case AArch64::STPQi:
1913 case AArch64::STNPQi:
1919 case AArch64::LDRQui:
1920 case AArch64::STRQui:
1925 case AArch64::LDPXi:
1926 case AArch64::LDPDi:
1927 case AArch64::LDNPXi:
1928 case AArch64::LDNPDi:
1929 case AArch64::STPXi:
1930 case AArch64::STPDi:
1931 case AArch64::STNPXi:
1932 case AArch64::STNPDi:
1938 case AArch64::LDRXui:
1939 case AArch64::LDRDui:
1940 case AArch64::STRXui:
1941 case AArch64::STRDui:
1946 case AArch64::LDPWi:
1947 case AArch64::LDPSi:
1948 case AArch64::LDNPWi:
1949 case AArch64::LDNPSi:
1950 case AArch64::STPWi:
1951 case AArch64::STPSi:
1952 case AArch64::STNPWi:
1953 case AArch64::STNPSi:
1959 case AArch64::LDRWui:
1960 case AArch64::LDRSui:
1961 case AArch64::LDRSWui:
1962 case AArch64::STRWui:
1963 case AArch64::STRSui:
1968 case AArch64::LDRHui:
1969 case AArch64::LDRHHui:
1970 case AArch64::STRHui:
1971 case AArch64::STRHHui:
1976 case AArch64::LDRBui:
1977 case AArch64::LDRBBui:
1978 case AArch64::STRBui:
1979 case AArch64::STRBBui:
1992 unsigned OffsetStride = 1;
1996 case AArch64::LDURQi:
1997 case AArch64::STURQi:
2000 case AArch64::LDURXi:
2001 case AArch64::LDURDi:
2002 case AArch64::STURXi:
2003 case AArch64::STURDi:
2006 case AArch64::LDURWi:
2007 case AArch64::LDURSi:
2008 case AArch64::LDURSWi:
2009 case AArch64::STURWi:
2010 case AArch64::STURSi:
2016 if (Offset % OffsetStride != 0)
2021 Offset /= OffsetStride;
2026 if (FirstOpc == SecondOpc)
2032 case AArch64::LDRWui:
2033 case AArch64::LDURWi:
2034 return SecondOpc == AArch64::LDRSWui || SecondOpc == AArch64::LDURSWi;
2035 case AArch64::LDRSWui:
2036 case AArch64::LDURSWi:
2037 return SecondOpc == AArch64::LDRWui || SecondOpc == AArch64::LDURWi;
2048 unsigned NumLoads)
const {
2057 unsigned FirstOpc = FirstLdSt.
getOpcode();
2058 unsigned SecondOpc = SecondLdSt.
getOpcode();
2078 if (Offset1 > 63 || Offset1 < -64)
2082 assert(Offset1 <= Offset2 &&
"Caller should have ordered offsets.");
2083 return Offset1 + 1 == Offset2;
2099 unsigned Reg,
unsigned SubIdx,
2103 return MIB.
addReg(Reg, State);
2107 return MIB.
addReg(Reg, State, SubIdx);
2114 return ((DestReg - SrcReg) & 0x1f) < NumRegs;
2119 unsigned DestReg,
unsigned SrcReg,
bool KillSrc,
unsigned Opcode,
2122 "Unexpected register copy without NEON");
2124 uint16_t DestEncoding = TRI->getEncodingValue(DestReg);
2125 uint16_t SrcEncoding = TRI->getEncodingValue(SrcReg);
2126 unsigned NumRegs = Indices.
size();
2128 int SubReg = 0,
End = NumRegs, Incr = 1;
2130 SubReg = NumRegs - 1;
2135 for (; SubReg !=
End; SubReg += Incr) {
2138 AddSubReg(MIB, SrcReg, Indices[SubReg], 0, TRI);
2145 const DebugLoc &DL,
unsigned DestReg,
2146 unsigned SrcReg,
bool KillSrc)
const {
2147 if (AArch64::GPR32spRegClass.
contains(DestReg) &&
2148 (AArch64::GPR32spRegClass.
contains(SrcReg) || SrcReg == AArch64::WZR)) {
2151 if (DestReg == AArch64::WSP || SrcReg == AArch64::WSP) {
2156 &AArch64::GPR64spRegClass);
2158 &AArch64::GPR64spRegClass);
2163 BuildMI(MBB, I, DL,
get(AArch64::ADDXri), DestRegX)
2169 BuildMI(MBB, I, DL,
get(AArch64::ADDWri), DestReg)
2181 &AArch64::GPR64spRegClass);
2183 &AArch64::GPR64spRegClass);
2188 BuildMI(MBB, I, DL,
get(AArch64::ORRXrr), DestRegX)
2194 BuildMI(MBB, I, DL,
get(AArch64::ORRWrr), DestReg)
2202 if (AArch64::GPR64spRegClass.
contains(DestReg) &&
2203 (AArch64::GPR64spRegClass.
contains(SrcReg) || SrcReg == AArch64::XZR)) {
2204 if (DestReg == AArch64::SP || SrcReg == AArch64::SP) {
2206 BuildMI(MBB, I, DL,
get(AArch64::ADDXri), DestReg)
2215 BuildMI(MBB, I, DL,
get(AArch64::ORRXrr), DestReg)
2223 if (AArch64::DDDDRegClass.
contains(DestReg) &&
2224 AArch64::DDDDRegClass.
contains(SrcReg)) {
2225 static const unsigned Indices[] = { AArch64::dsub0, AArch64::dsub1,
2226 AArch64::dsub2, AArch64::dsub3 };
2233 if (AArch64::DDDRegClass.
contains(DestReg) &&
2234 AArch64::DDDRegClass.
contains(SrcReg)) {
2235 static const unsigned Indices[] = { AArch64::dsub0, AArch64::dsub1,
2243 if (AArch64::DDRegClass.
contains(DestReg) &&
2244 AArch64::DDRegClass.
contains(SrcReg)) {
2245 static const unsigned Indices[] = { AArch64::dsub0, AArch64::dsub1 };
2252 if (AArch64::QQQQRegClass.
contains(DestReg) &&
2253 AArch64::QQQQRegClass.
contains(SrcReg)) {
2254 static const unsigned Indices[] = { AArch64::qsub0, AArch64::qsub1,
2255 AArch64::qsub2, AArch64::qsub3 };
2262 if (AArch64::QQQRegClass.
contains(DestReg) &&
2263 AArch64::QQQRegClass.
contains(SrcReg)) {
2264 static const unsigned Indices[] = { AArch64::qsub0, AArch64::qsub1,
2272 if (AArch64::QQRegClass.
contains(DestReg) &&
2273 AArch64::QQRegClass.
contains(SrcReg)) {
2274 static const unsigned Indices[] = { AArch64::qsub0, AArch64::qsub1 };
2280 if (AArch64::FPR128RegClass.
contains(DestReg) &&
2281 AArch64::FPR128RegClass.
contains(SrcReg)) {
2283 BuildMI(MBB, I, DL,
get(AArch64::ORRv16i8), DestReg)
2287 BuildMI(MBB, I, DL,
get(AArch64::STRQpre))
2292 BuildMI(MBB, I, DL,
get(AArch64::LDRQpre))
2301 if (AArch64::FPR64RegClass.
contains(DestReg) &&
2302 AArch64::FPR64RegClass.
contains(SrcReg)) {
2304 DestReg = RI.getMatchingSuperReg(DestReg, AArch64::dsub,
2305 &AArch64::FPR128RegClass);
2306 SrcReg = RI.getMatchingSuperReg(SrcReg, AArch64::dsub,
2307 &AArch64::FPR128RegClass);
2308 BuildMI(MBB, I, DL,
get(AArch64::ORRv16i8), DestReg)
2312 BuildMI(MBB, I, DL,
get(AArch64::FMOVDr), DestReg)
2318 if (AArch64::FPR32RegClass.
contains(DestReg) &&
2319 AArch64::FPR32RegClass.
contains(SrcReg)) {
2321 DestReg = RI.getMatchingSuperReg(DestReg, AArch64::ssub,
2322 &AArch64::FPR128RegClass);
2323 SrcReg = RI.getMatchingSuperReg(SrcReg, AArch64::ssub,
2324 &AArch64::FPR128RegClass);
2325 BuildMI(MBB, I, DL,
get(AArch64::ORRv16i8), DestReg)
2329 BuildMI(MBB, I, DL,
get(AArch64::FMOVSr), DestReg)
2335 if (AArch64::FPR16RegClass.
contains(DestReg) &&
2336 AArch64::FPR16RegClass.
contains(SrcReg)) {
2338 DestReg = RI.getMatchingSuperReg(DestReg, AArch64::hsub,
2339 &AArch64::FPR128RegClass);
2340 SrcReg = RI.getMatchingSuperReg(SrcReg, AArch64::hsub,
2341 &AArch64::FPR128RegClass);
2342 BuildMI(MBB, I, DL,
get(AArch64::ORRv16i8), DestReg)
2346 DestReg = RI.getMatchingSuperReg(DestReg, AArch64::hsub,
2347 &AArch64::FPR32RegClass);
2348 SrcReg = RI.getMatchingSuperReg(SrcReg, AArch64::hsub,
2349 &AArch64::FPR32RegClass);
2350 BuildMI(MBB, I, DL,
get(AArch64::FMOVSr), DestReg)
2356 if (AArch64::FPR8RegClass.
contains(DestReg) &&
2357 AArch64::FPR8RegClass.
contains(SrcReg)) {
2359 DestReg = RI.getMatchingSuperReg(DestReg, AArch64::bsub,
2360 &AArch64::FPR128RegClass);
2361 SrcReg = RI.getMatchingSuperReg(SrcReg, AArch64::bsub,
2362 &AArch64::FPR128RegClass);
2363 BuildMI(MBB, I, DL,
get(AArch64::ORRv16i8), DestReg)
2367 DestReg = RI.getMatchingSuperReg(DestReg, AArch64::bsub,
2368 &AArch64::FPR32RegClass);
2369 SrcReg = RI.getMatchingSuperReg(SrcReg, AArch64::bsub,
2370 &AArch64::FPR32RegClass);
2371 BuildMI(MBB, I, DL,
get(AArch64::FMOVSr), DestReg)
2378 if (AArch64::FPR64RegClass.
contains(DestReg) &&
2379 AArch64::GPR64RegClass.
contains(SrcReg)) {
2380 BuildMI(MBB, I, DL,
get(AArch64::FMOVXDr), DestReg)
2384 if (AArch64::GPR64RegClass.
contains(DestReg) &&
2385 AArch64::FPR64RegClass.
contains(SrcReg)) {
2386 BuildMI(MBB, I, DL,
get(AArch64::FMOVDXr), DestReg)
2391 if (AArch64::FPR32RegClass.
contains(DestReg) &&
2392 AArch64::GPR32RegClass.
contains(SrcReg)) {
2393 BuildMI(MBB, I, DL,
get(AArch64::FMOVWSr), DestReg)
2397 if (AArch64::GPR32RegClass.
contains(DestReg) &&
2398 AArch64::FPR32RegClass.
contains(SrcReg)) {
2399 BuildMI(MBB, I, DL,
get(AArch64::FMOVSWr), DestReg)
2404 if (DestReg == AArch64::NZCV) {
2405 assert(AArch64::GPR64RegClass.
contains(SrcReg) &&
"Invalid NZCV copy");
2406 BuildMI(MBB, I, DL,
get(AArch64::MSR))
2407 .
addImm(AArch64SysReg::NZCV)
2413 if (SrcReg == AArch64::NZCV) {
2414 assert(AArch64::GPR64RegClass.
contains(DestReg) &&
"Invalid NZCV copy");
2415 BuildMI(MBB, I, DL,
get(AArch64::MRS), DestReg)
2416 .
addImm(AArch64SysReg::NZCV)
2429 if (MBBI != MBB.
end())
2430 DL = MBBI->getDebugLoc();
2442 if (AArch64::FPR8RegClass.hasSubClassEq(RC))
2443 Opc = AArch64::STRBui;
2446 if (AArch64::FPR16RegClass.hasSubClassEq(RC))
2447 Opc = AArch64::STRHui;
2450 if (AArch64::GPR32allRegClass.hasSubClassEq(RC)) {
2451 Opc = AArch64::STRWui;
2455 assert(SrcReg != AArch64::WSP);
2456 }
else if (AArch64::FPR32RegClass.hasSubClassEq(RC))
2457 Opc = AArch64::STRSui;
2460 if (AArch64::GPR64allRegClass.hasSubClassEq(RC)) {
2461 Opc = AArch64::STRXui;
2465 assert(SrcReg != AArch64::SP);
2466 }
else if (AArch64::FPR64RegClass.hasSubClassEq(RC))
2467 Opc = AArch64::STRDui;
2470 if (AArch64::FPR128RegClass.hasSubClassEq(RC))
2471 Opc = AArch64::STRQui;
2472 else if (AArch64::DDRegClass.hasSubClassEq(RC)) {
2474 "Unexpected register store without NEON");
2475 Opc = AArch64::ST1Twov1d;
2480 if (AArch64::DDDRegClass.hasSubClassEq(RC)) {
2482 "Unexpected register store without NEON");
2483 Opc = AArch64::ST1Threev1d;
2488 if (AArch64::DDDDRegClass.hasSubClassEq(RC)) {
2490 "Unexpected register store without NEON");
2491 Opc = AArch64::ST1Fourv1d;
2493 }
else if (AArch64::QQRegClass.hasSubClassEq(RC)) {
2495 "Unexpected register store without NEON");
2496 Opc = AArch64::ST1Twov2d;
2501 if (AArch64::QQQRegClass.hasSubClassEq(RC)) {
2503 "Unexpected register store without NEON");
2504 Opc = AArch64::ST1Threev2d;
2509 if (AArch64::QQQQRegClass.hasSubClassEq(RC)) {
2511 "Unexpected register store without NEON");
2512 Opc = AArch64::ST1Fourv2d;
2517 assert(Opc &&
"Unknown register class");
2533 if (MBBI != MBB.
end())
2534 DL = MBBI->getDebugLoc();
2546 if (AArch64::FPR8RegClass.hasSubClassEq(RC))
2547 Opc = AArch64::LDRBui;
2550 if (AArch64::FPR16RegClass.hasSubClassEq(RC))
2551 Opc = AArch64::LDRHui;
2554 if (AArch64::GPR32allRegClass.hasSubClassEq(RC)) {
2555 Opc = AArch64::LDRWui;
2559 assert(DestReg != AArch64::WSP);
2560 }
else if (AArch64::FPR32RegClass.hasSubClassEq(RC))
2561 Opc = AArch64::LDRSui;
2564 if (AArch64::GPR64allRegClass.hasSubClassEq(RC)) {
2565 Opc = AArch64::LDRXui;
2569 assert(DestReg != AArch64::SP);
2570 }
else if (AArch64::FPR64RegClass.hasSubClassEq(RC))
2571 Opc = AArch64::LDRDui;
2574 if (AArch64::FPR128RegClass.hasSubClassEq(RC))
2575 Opc = AArch64::LDRQui;
2576 else if (AArch64::DDRegClass.hasSubClassEq(RC)) {
2578 "Unexpected register load without NEON");
2579 Opc = AArch64::LD1Twov1d;
2584 if (AArch64::DDDRegClass.hasSubClassEq(RC)) {
2586 "Unexpected register load without NEON");
2587 Opc = AArch64::LD1Threev1d;
2592 if (AArch64::DDDDRegClass.hasSubClassEq(RC)) {
2594 "Unexpected register load without NEON");
2595 Opc = AArch64::LD1Fourv1d;
2597 }
else if (AArch64::QQRegClass.hasSubClassEq(RC)) {
2599 "Unexpected register load without NEON");
2600 Opc = AArch64::LD1Twov2d;
2605 if (AArch64::QQQRegClass.hasSubClassEq(RC)) {
2607 "Unexpected register load without NEON");
2608 Opc = AArch64::LD1Threev2d;
2613 if (AArch64::QQQQRegClass.hasSubClassEq(RC)) {
2615 "Unexpected register load without NEON");
2616 Opc = AArch64::LD1Fourv2d;
2621 assert(Opc &&
"Unknown register class");
2633 unsigned DestReg,
unsigned SrcReg,
int Offset,
2636 if (DestReg == SrcReg && Offset == 0)
2639 assert((DestReg != AArch64::SP || Offset % 16 == 0) &&
2640 "SP increment/decrement not 16-byte aligned");
2642 bool isSub = Offset < 0;
2659 Opc = isSub ? AArch64::SUBSXri : AArch64::ADDSXri;
2661 Opc = isSub ? AArch64::SUBXri : AArch64::ADDXri;
2662 const unsigned MaxEncoding = 0xfff;
2663 const unsigned ShiftSize = 12;
2664 const unsigned MaxEncodableValue = MaxEncoding << ShiftSize;
2665 while (((
unsigned)Offset) >= (1 << ShiftSize)) {
2667 if (((
unsigned)Offset) > MaxEncodableValue) {
2668 ThisVal = MaxEncodableValue;
2670 ThisVal = Offset & MaxEncodableValue;
2672 assert((ThisVal >> ShiftSize) <= MaxEncoding &&
2673 "Encoding cannot handle value that big");
2674 BuildMI(MBB, MBBI, DL, TII->
get(Opc), DestReg)
2676 .
addImm(ThisVal >> ShiftSize)
2685 BuildMI(MBB, MBBI, DL, TII->
get(Opc), DestReg)
2712 if (SrcReg == AArch64::SP &&
2717 if (DstReg == AArch64::SP &&
2750 (Ops[0] == 0 || Ops[0] == 1)) {
2751 bool IsSpill = Ops[0] == 0;
2752 bool IsFill = !IsSpill;
2758 unsigned DstReg = DstMO.
getReg();
2759 unsigned SrcReg = SrcMO.
getReg();
2771 "Mismatched register size in non subreg COPY");
2778 return &*--InsertPt;
2790 if (IsSpill && DstMO.
isUndef() &&
2793 "Unexpected subreg on physical register");
2795 unsigned SpillSubreg;
2800 case AArch64::sub_32:
2802 if (AArch64::GPR32RegClass.
contains(SrcReg)) {
2803 SpillRC = &AArch64::GPR64RegClass;
2804 SpillSubreg = AArch64::sub_32;
2805 }
else if (AArch64::FPR32RegClass.
contains(SrcReg)) {
2806 SpillRC = &AArch64::FPR64RegClass;
2807 SpillSubreg = AArch64::ssub;
2812 if (AArch64::FPR64RegClass.
contains(SrcReg)) {
2813 SpillRC = &AArch64::FPR128RegClass;
2814 SpillSubreg = AArch64::dsub;
2821 if (
unsigned WidenedSrcReg =
2825 return &*--InsertPt;
2844 case AArch64::sub_32:
2845 FillRC = &AArch64::GPR32RegClass;
2848 FillRC = &AArch64::FPR32RegClass;
2851 FillRC = &AArch64::FPR64RegClass;
2858 "Mismatched regclass size on folded subreg COPY");
2875 bool *OutUseUnscaledOp,
2876 unsigned *OutUnscaledOp,
2877 int *EmittableOffset) {
2879 bool IsSigned =
false;
2881 unsigned ImmIdx = 2;
2882 unsigned UnscaledOp = 0;
2884 if (EmittableOffset)
2885 *EmittableOffset = 0;
2886 if (OutUseUnscaledOp)
2887 *OutUseUnscaledOp =
false;
2894 case AArch64::LD1Twov2d:
2895 case AArch64::LD1Threev2d:
2896 case AArch64::LD1Fourv2d:
2897 case AArch64::LD1Twov1d:
2898 case AArch64::LD1Threev1d:
2899 case AArch64::LD1Fourv1d:
2900 case AArch64::ST1Twov2d:
2901 case AArch64::ST1Threev2d:
2902 case AArch64::ST1Fourv2d:
2903 case AArch64::ST1Twov1d:
2904 case AArch64::ST1Threev1d:
2905 case AArch64::ST1Fourv1d:
2907 case AArch64::PRFMui:
2909 UnscaledOp = AArch64::PRFUMi;
2911 case AArch64::LDRXui:
2913 UnscaledOp = AArch64::LDURXi;
2915 case AArch64::LDRWui:
2917 UnscaledOp = AArch64::LDURWi;
2919 case AArch64::LDRBui:
2921 UnscaledOp = AArch64::LDURBi;
2923 case AArch64::LDRHui:
2925 UnscaledOp = AArch64::LDURHi;
2927 case AArch64::LDRSui:
2929 UnscaledOp = AArch64::LDURSi;
2931 case AArch64::LDRDui:
2933 UnscaledOp = AArch64::LDURDi;
2935 case AArch64::LDRQui:
2937 UnscaledOp = AArch64::LDURQi;
2939 case AArch64::LDRBBui:
2941 UnscaledOp = AArch64::LDURBBi;
2943 case AArch64::LDRHHui:
2945 UnscaledOp = AArch64::LDURHHi;
2947 case AArch64::LDRSBXui:
2949 UnscaledOp = AArch64::LDURSBXi;
2951 case AArch64::LDRSBWui:
2953 UnscaledOp = AArch64::LDURSBWi;
2955 case AArch64::LDRSHXui:
2957 UnscaledOp = AArch64::LDURSHXi;
2959 case AArch64::LDRSHWui:
2961 UnscaledOp = AArch64::LDURSHWi;
2963 case AArch64::LDRSWui:
2965 UnscaledOp = AArch64::LDURSWi;
2968 case AArch64::STRXui:
2970 UnscaledOp = AArch64::STURXi;
2972 case AArch64::STRWui:
2974 UnscaledOp = AArch64::STURWi;
2976 case AArch64::STRBui:
2978 UnscaledOp = AArch64::STURBi;
2980 case AArch64::STRHui:
2982 UnscaledOp = AArch64::STURHi;
2984 case AArch64::STRSui:
2986 UnscaledOp = AArch64::STURSi;
2988 case AArch64::STRDui:
2990 UnscaledOp = AArch64::STURDi;
2992 case AArch64::STRQui:
2994 UnscaledOp = AArch64::STURQi;
2996 case AArch64::STRBBui:
2998 UnscaledOp = AArch64::STURBBi;
3000 case AArch64::STRHHui:
3002 UnscaledOp = AArch64::STURHHi;
3005 case AArch64::LDPXi:
3006 case AArch64::LDPDi:
3007 case AArch64::STPXi:
3008 case AArch64::STPDi:
3009 case AArch64::LDNPXi:
3010 case AArch64::LDNPDi:
3011 case AArch64::STNPXi:
3012 case AArch64::STNPDi:
3017 case AArch64::LDPQi:
3018 case AArch64::STPQi:
3019 case AArch64::LDNPQi:
3020 case AArch64::STNPQi:
3025 case AArch64::LDPWi:
3026 case AArch64::LDPSi:
3027 case AArch64::STPWi:
3028 case AArch64::STPSi:
3029 case AArch64::LDNPWi:
3030 case AArch64::LDNPSi:
3031 case AArch64::STNPWi:
3032 case AArch64::STNPSi:
3038 case AArch64::LDURXi:
3039 case AArch64::LDURWi:
3040 case AArch64::LDURBi:
3041 case AArch64::LDURHi:
3042 case AArch64::LDURSi:
3043 case AArch64::LDURDi:
3044 case AArch64::LDURQi:
3045 case AArch64::LDURHHi:
3046 case AArch64::LDURBBi:
3047 case AArch64::LDURSBXi:
3048 case AArch64::LDURSBWi:
3049 case AArch64::LDURSHXi:
3050 case AArch64::LDURSHWi:
3051 case AArch64::LDURSWi:
3052 case AArch64::STURXi:
3053 case AArch64::STURWi:
3054 case AArch64::STURBi:
3055 case AArch64::STURHi:
3056 case AArch64::STURSi:
3057 case AArch64::STURDi:
3058 case AArch64::STURQi:
3059 case AArch64::STURBBi:
3060 case AArch64::STURHHi:
3067 bool useUnscaledOp =
false;
3071 if ((Offset & (Scale - 1)) != 0 || (Offset < 0 && UnscaledOp != 0))
3072 useUnscaledOp =
true;
3081 }
else if (UnscaledOp == 0 || useUnscaledOp) {
3092 int MaxOff = (1 << (MaskBits - IsSigned)) - 1;
3093 int MinOff = (IsSigned ? (-MaxOff - 1) : 0);
3094 if (Offset >= MinOff && Offset <= MaxOff) {
3095 if (EmittableOffset)
3096 *EmittableOffset =
Offset;
3099 int NewOff = Offset < 0 ? MinOff : MaxOff;
3100 if (EmittableOffset)
3101 *EmittableOffset = NewOff;
3102 Offset = (Offset - NewOff) * Scale;
3104 if (OutUseUnscaledOp)
3105 *OutUseUnscaledOp = useUnscaledOp;
3107 *OutUnscaledOp = UnscaledOp;
3113 unsigned FrameReg,
int &
Offset,
3116 unsigned ImmIdx = FrameRegIdx + 1;
3118 if (Opcode == AArch64::ADDSXri || Opcode == AArch64::ADDXri) {
3129 unsigned UnscaledOp;
3132 &UnscaledOp, &NewOffset);
3138 MI.
setDesc(TII->get(UnscaledOp));
3161 case AArch64::ADDSWrr:
3162 case AArch64::ADDSWri:
3163 case AArch64::ADDSXrr:
3164 case AArch64::ADDSXri:
3165 case AArch64::SUBSWrr:
3166 case AArch64::SUBSXrr:
3168 case AArch64::SUBSWri:
3169 case AArch64::SUBSXri:
3180 case AArch64::ADDWrr:
3181 case AArch64::ADDWri:
3182 case AArch64::SUBWrr:
3183 case AArch64::ADDSWrr:
3184 case AArch64::ADDSWri:
3185 case AArch64::SUBSWrr:
3187 case AArch64::SUBWri:
3188 case AArch64::SUBSWri:
3199 case AArch64::ADDXrr:
3200 case AArch64::ADDXri:
3201 case AArch64::SUBXrr:
3202 case AArch64::ADDSXrr:
3203 case AArch64::ADDSXri:
3204 case AArch64::SUBSXrr:
3206 case AArch64::SUBXri:
3207 case AArch64::SUBSXri:
3220 case AArch64::FADDSrr:
3221 case AArch64::FADDDrr:
3222 case AArch64::FADDv2f32:
3223 case AArch64::FADDv2f64:
3224 case AArch64::FADDv4f32:
3225 case AArch64::FSUBSrr:
3226 case AArch64::FSUBDrr:
3227 case AArch64::FSUBv2f32:
3228 case AArch64::FSUBv2f64:
3229 case AArch64::FSUBv4f32:
3246 unsigned CombineOpc,
unsigned ZeroReg = 0,
3247 bool CheckZeroReg =
false) {
3275 unsigned MulOpc,
unsigned ZeroReg) {
3276 return canCombine(MBB, MO, MulOpc, ZeroReg,
true);
3292 case AArch64::FADDDrr:
3293 case AArch64::FADDSrr:
3294 case AArch64::FADDv2f32:
3295 case AArch64::FADDv2f64:
3296 case AArch64::FADDv4f32:
3297 case AArch64::FMULDrr:
3298 case AArch64::FMULSrr:
3299 case AArch64::FMULX32:
3300 case AArch64::FMULX64:
3301 case AArch64::FMULXv2f32:
3302 case AArch64::FMULXv2f64:
3303 case AArch64::FMULXv4f32:
3304 case AArch64::FMULv2f32:
3305 case AArch64::FMULv2f64:
3306 case AArch64::FMULv4f32:
3338 case AArch64::ADDWrr:
3340 "ADDWrr does not have register operands");
3352 case AArch64::ADDXrr:
3364 case AArch64::SUBWrr:
3376 case AArch64::SUBXrr:
3388 case AArch64::ADDWri:
3395 case AArch64::ADDXri:
3402 case AArch64::SUBWri:
3409 case AArch64::SUBXri:
3433 assert(
false &&
"Unsupported FP instruction in combiner\n");
3435 case AArch64::FADDSrr:
3437 "FADDWrr does not have register operands");
3442 AArch64::FMULv1i32_indexed)) {
3450 AArch64::FMULv1i32_indexed)) {
3455 case AArch64::FADDDrr:
3460 AArch64::FMULv1i64_indexed)) {
3468 AArch64::FMULv1i64_indexed)) {
3473 case AArch64::FADDv2f32:
3475 AArch64::FMULv2i32_indexed)) {
3479 AArch64::FMULv2f32)) {
3484 AArch64::FMULv2i32_indexed)) {
3488 AArch64::FMULv2f32)) {
3493 case AArch64::FADDv2f64:
3495 AArch64::FMULv2i64_indexed)) {
3499 AArch64::FMULv2f64)) {
3504 AArch64::FMULv2i64_indexed)) {
3508 AArch64::FMULv2f64)) {
3513 case AArch64::FADDv4f32:
3515 AArch64::FMULv4i32_indexed)) {
3519 AArch64::FMULv4f32)) {
3524 AArch64::FMULv4i32_indexed)) {
3528 AArch64::FMULv4f32)) {
3534 case AArch64::FSUBSrr:
3543 AArch64::FMULv1i32_indexed)) {
3552 case AArch64::FSUBDrr:
3561 AArch64::FMULv1i64_indexed)) {
3570 case AArch64::FSUBv2f32:
3572 AArch64::FMULv2i32_indexed)) {
3576 AArch64::FMULv2f32)) {
3581 case AArch64::FSUBv2f64:
3583 AArch64::FMULv2i64_indexed)) {
3587 AArch64::FMULv2f64)) {
3592 case AArch64::FSUBv4f32:
3594 AArch64::FMULv4i32_indexed)) {
3598 AArch64::FMULv4f32)) {
3695 assert(IdxMulOpd == 1 || IdxMulOpd == 2);
3697 unsigned IdxOtherOpd = IdxMulOpd == 1 ? 2 : 1;
3734 assert(
false &&
"Invalid FMA instruction kind \n");
3762 unsigned IdxMulOpd,
unsigned MaddOpc,
3764 assert(IdxMulOpd == 1 || IdxMulOpd == 2);
3812 DelInstrs, InstrIdxForVirtReg);
3821 Opc = AArch64::MADDWrrr;
3822 RC = &AArch64::GPR32RegClass;
3824 Opc = AArch64::MADDXrrr;
3825 RC = &AArch64::GPR64RegClass;
3836 Opc = AArch64::MADDWrrr;
3837 RC = &AArch64::GPR32RegClass;
3839 Opc = AArch64::MADDXrrr;
3840 RC = &AArch64::GPR64RegClass;
3852 unsigned BitSize, OrrOpc, ZeroReg;
3854 OrrOpc = AArch64::ORRWri;
3855 OrrRC = &AArch64::GPR32spRegClass;
3857 ZeroReg = AArch64::WZR;
3858 Opc = AArch64::MADDWrrr;
3859 RC = &AArch64::GPR32RegClass;
3861 OrrOpc = AArch64::ORRXri;
3862 OrrRC = &AArch64::GPR64spRegClass;
3864 ZeroReg = AArch64::XZR;
3865 Opc = AArch64::MADDXrrr;
3866 RC = &AArch64::GPR64RegClass;
3883 InstrIdxForVirtReg.
insert(std::make_pair(NewVR, 0));
3884 MUL =
genMaddR(MF, MRI, TII, Root, InsInstrs, 1, Opc, NewVR, RC);
3896 unsigned SubOpc, ZeroReg;
3898 SubOpc = AArch64::SUBWrr;
3899 SubRC = &AArch64::GPR32spRegClass;
3900 ZeroReg = AArch64::WZR;
3901 Opc = AArch64::MADDWrrr;
3902 RC = &AArch64::GPR32RegClass;
3904 SubOpc = AArch64::SUBXrr;
3905 SubRC = &AArch64::GPR64spRegClass;
3906 ZeroReg = AArch64::XZR;
3907 Opc = AArch64::MADDXrrr;
3908 RC = &AArch64::GPR64RegClass;
3917 InstrIdxForVirtReg.
insert(std::make_pair(NewVR, 0));
3918 MUL =
genMaddR(MF, MRI, TII, Root, InsInstrs, 1, Opc, NewVR, RC);
3928 Opc = AArch64::MSUBWrrr;
3929 RC = &AArch64::GPR32RegClass;
3931 Opc = AArch64::MSUBXrrr;
3932 RC = &AArch64::GPR64RegClass;
3944 unsigned BitSize, OrrOpc, ZeroReg;
3946 OrrOpc = AArch64::ORRWri;
3947 OrrRC = &AArch64::GPR32spRegClass;
3949 ZeroReg = AArch64::WZR;
3950 Opc = AArch64::MADDWrrr;
3951 RC = &AArch64::GPR32RegClass;
3953 OrrOpc = AArch64::ORRXri;
3954 OrrRC = &AArch64::GPR64spRegClass;
3956 ZeroReg = AArch64::XZR;
3957 Opc = AArch64::MADDXrrr;
3958 RC = &AArch64::GPR64RegClass;
3974 InstrIdxForVirtReg.
insert(std::make_pair(NewVR, 0));
3975 MUL =
genMaddR(MF, MRI, TII, Root, InsInstrs, 1, Opc, NewVR, RC);
3987 Opc = AArch64::FMADDSrrr;
3988 RC = &AArch64::FPR32RegClass;
3990 Opc = AArch64::FMADDDrrr;
3991 RC = &AArch64::FPR64RegClass;
4002 Opc = AArch64::FMADDSrrr;
4003 RC = &AArch64::FPR32RegClass;
4005 Opc = AArch64::FMADDDrrr;
4006 RC = &AArch64::FPR64RegClass;
4012 Opc = AArch64::FMLAv1i32_indexed;
4013 RC = &AArch64::FPR32RegClass;
4018 Opc = AArch64::FMLAv1i32_indexed;
4019 RC = &AArch64::FPR32RegClass;
4025 Opc = AArch64::FMLAv1i64_indexed;
4026 RC = &AArch64::FPR64RegClass;
4031 Opc = AArch64::FMLAv1i64_indexed;
4032 RC = &AArch64::FPR64RegClass;
4039 RC = &AArch64::FPR64RegClass;
4041 Opc = AArch64::FMLAv2i32_indexed;
4045 Opc = AArch64::FMLAv2f32;
4052 RC = &AArch64::FPR64RegClass;
4054 Opc = AArch64::FMLAv2i32_indexed;
4058 Opc = AArch64::FMLAv2f32;
4066 RC = &AArch64::FPR128RegClass;
4068 Opc = AArch64::FMLAv2i64_indexed;
4072 Opc = AArch64::FMLAv2f64;
4079 RC = &AArch64::FPR128RegClass;
4081 Opc = AArch64::FMLAv2i64_indexed;
4085 Opc = AArch64::FMLAv2f64;
4093 RC = &AArch64::FPR128RegClass;
4095 Opc = AArch64::FMLAv4i32_indexed;
4099 Opc = AArch64::FMLAv4f32;
4107 RC = &AArch64::FPR128RegClass;
4109 Opc = AArch64::FMLAv4i32_indexed;
4113 Opc = AArch64::FMLAv4f32;
4126 Opc = AArch64::FNMSUBSrrr;
4127 RC = &AArch64::FPR32RegClass;
4129 Opc = AArch64::FNMSUBDrrr;
4130 RC = &AArch64::FPR64RegClass;
4143 Opc = AArch64::FNMADDSrrr;
4144 RC = &AArch64::FPR32RegClass;
4146 Opc = AArch64::FNMADDDrrr;
4147 RC = &AArch64::FPR64RegClass;
4160 Opc = AArch64::FMSUBSrrr;
4161 RC = &AArch64::FPR32RegClass;
4163 Opc = AArch64::FMSUBDrrr;
4164 RC = &AArch64::FPR64RegClass;
4171 Opc = AArch64::FMLSv1i32_indexed;
4172 RC = &AArch64::FPR32RegClass;
4178 Opc = AArch64::FMLSv1i64_indexed;
4179 RC = &AArch64::FPR64RegClass;
4186 RC = &AArch64::FPR64RegClass;
4188 Opc = AArch64::FMLSv2i32_indexed;
4192 Opc = AArch64::FMLSv2f32;
4200 RC = &AArch64::FPR128RegClass;
4202 Opc = AArch64::FMLSv2i64_indexed;
4206 Opc = AArch64::FMLSv2f64;
4214 RC = &AArch64::FPR128RegClass;
4216 Opc = AArch64::FMLSv4i32_indexed;
4220 Opc = AArch64::FMLSv4f32;
4269 bool IsNegativeBranch =
false;
4270 bool IsTestAndBranch =
false;
4271 unsigned TargetBBInMI = 0;
4281 case AArch64::CBNZW:
4282 case AArch64::CBNZX:
4284 IsNegativeBranch =
true;
4289 IsTestAndBranch =
true;
4291 case AArch64::TBNZW:
4292 case AArch64::TBNZX:
4294 IsNegativeBranch =
true;
4295 IsTestAndBranch =
true;
4316 while (DefMI->
isCopy()) {
4329 case AArch64::ANDWri:
4330 case AArch64::ANDXri: {
4331 if (IsTestAndBranch)
4338 bool Is32Bit = (DefMI->
getOpcode() == AArch64::ANDWri);
4345 unsigned NewReg = MO.
getReg();
4355 unsigned Opc = (Imm < 32)
4356 ? (IsNegativeBranch ? AArch64::TBNZW : AArch64::TBZW)
4357 : (IsNegativeBranch ? AArch64::TBNZX : AArch64::TBZX);
4370 if (!Is32Bit && Imm < 32)
4376 case AArch64::CSINCWr:
4377 case AArch64::CSINCXr: {
4396 if (IsNegativeBranch)
4405 std::pair<unsigned, unsigned>
4408 return std::make_pair(TF & Mask, TF & ~Mask);
4413 using namespace AArch64II;
4415 static const std::pair<unsigned, const char *>
TargetFlags[] = {
4418 {
MO_G3,
"aarch64-g3"},
4419 {
MO_G2,
"aarch64-g2"},
4420 {
MO_G1,
"aarch64-g1"},
4421 {
MO_G0,
"aarch64-g0"},
4428 using namespace AArch64II;
4430 static const std::pair<unsigned, const char *>
TargetFlags[] = {
4432 {
MO_NC,
"aarch64-nc"},
4433 {
MO_TLS,
"aarch64-tls"}};
4439 static const std::pair<MachineMemOperand::Flags, const char *>
TargetFlags[] =
4447 bool CanBeTailCall)
const {
4448 unsigned NotOutlinedSize = SequenceSize * Occurrences;
4449 unsigned OutlinedSize;
4452 if (CanBeTailCall) {
4455 OutlinedSize = SequenceSize + Occurrences;
4460 OutlinedSize = (SequenceSize + 1) + (3 * Occurrences);
4464 return NotOutlinedSize > OutlinedSize ? NotOutlinedSize - OutlinedSize : 0;
4471 AArch64GenInstrInfo::MachineOutlinerInstrType
4479 return MachineOutlinerInstrType::Illegal;
4483 return MachineOutlinerInstrType::Invisible;
4490 return MachineOutlinerInstrType::Legal;
4493 return MachineOutlinerInstrType::Illegal;
4498 return MachineOutlinerInstrType::Illegal;
4502 if (MOP.isCPI() || MOP.isJTI() || MOP.isCFIIndex() || MOP.isFI() ||
4503 MOP.isTargetIndex())
4504 return MachineOutlinerInstrType::Illegal;
4509 return MachineOutlinerInstrType::Illegal;
4519 unsigned DummyWidth;
4523 Base != AArch64::SP)
4524 return MachineOutlinerInstrType::Illegal;
4528 int64_t MinOffset, MaxOffset;
4529 unsigned DummyScale;
4536 if (Offset + 16 < MinOffset || Offset + 16 > MaxOffset)
4537 return MachineOutlinerInstrType::Illegal;
4540 return MachineOutlinerInstrType::Legal;
4544 return MachineOutlinerInstrType::Illegal;
4547 return MachineOutlinerInstrType::Legal;
4552 unsigned Base, Width;
4558 Base != AArch64::SP)
4563 int64_t Dummy1, Dummy2;
4566 assert(StackOffsetOperand.
isImm() &&
"Stack offset wasn't immediate!");
4568 assert(Scale != 0 &&
"Unexpected opcode!");
4573 int64_t NewImm = (Offset + 16)/Scale;
4574 StackOffsetOperand.
setImm(NewImm);
4580 bool IsTailCall)
const {
4592 fixupPostOutline(MBB);
4597 bool IsTailCall)
const {}
4619 It = MBB.
insert(It, STRXpre);
4635 It = MBB.
insert(It, LDRXpost);
ArrayRef< std::pair< unsigned, const char * > > getSerializableBitmaskMachineOperandTargetFlags() const override
const MachineInstrBuilder & addMetadata(const MDNode *MD) const
void push_back(const T &Elt)
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
MO_G3 - A symbol operand with this flag (granule 3) represents the high 16-bits of a 64-bit address...
const AArch64RegisterInfo & getRegisterInfo() const
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
bool isGPRZero(const MachineInstr &MI) const
Does this instruction set its full destination register to zero?
AArch64FunctionInfo - This class is derived from MachineFunctionInfo and contains private AArch64-spe...
static unsigned getArithShiftValue(unsigned Imm)
getArithShiftValue - get the arithmetic shift value.
uint32_t getNumPatchBytes() const
Return the number of patchable bytes the given patchpoint should emit.
instr_iterator instr_end()
AArch64GenInstrInfo::MachineOutlinerInstrType getOutliningType(MachineInstr &MI) const override
MO_PAGE - A symbol operand with this flag represents the pc-relative offset of the 4K page containing...
bool getMemOpBaseRegImmOfs(MachineInstr &LdSt, unsigned &BaseReg, int64_t &Offset, const TargetRegisterInfo *TRI) 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...
virtual bool getMachineCombinerPatterns(MachineInstr &Root, SmallVectorImpl< MachineCombinerPattern > &Patterns) const
Return true when there is potentially a faster code sequence for an instruction chain ending in Root...
MachineBasicBlock * getMBB() const
A Module instance is used to store all the information related to an LLVM module. ...
static bool getFMAPatterns(MachineInstr &Root, SmallVectorImpl< MachineCombinerPattern > &Patterns)
Floating-Point Support.
static unsigned sForm(MachineInstr &Instr)
Get opcode of S version of Instr.
unsigned createVirtualRegister(const TargetRegisterClass *RegClass)
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
bool hasShiftedReg(const MachineInstr &MI) const
Returns true if there is a shiftable register and that the shift value is non-zero.
bool hasSubClassEq(const TargetRegisterClass *RC) const
Returns true if RC is a sub-class of or equal to this class.
unsigned getRegSizeInBits(const TargetRegisterClass &RC) const
Return the size in bits of a register from class RC.
static CondCode getInvertedCondCode(CondCode Code)
bool hasZeroCycleRegMove() const
Describe properties that are true of each instruction in the target description file.
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.
void suppressLdStPair(MachineInstr &MI) const
Hint that pairing the given load or store is unprofitable.
static bool isSUBSRegImm(unsigned Opcode)
static bool processLogicalImmediate(uint64_t Imm, unsigned RegSize, uint64_t &Encoding)
processLogicalImmediate - Determine if an immediate value can be encoded as the immediate operand of ...
const MachineInstrBuilder & add(const MachineOperand &MO) const
MachineInstr * foldMemoryOperandImpl(MachineFunction &MF, MachineInstr &MI, ArrayRef< unsigned > Ops, MachineBasicBlock::iterator InsertPt, int FrameIndex, LiveIntervals *LIS=nullptr) const override
bool hasZeroCycleZeroing() const
bool hasOrderedMemoryRef() const
Return true if this instruction may have an ordered or volatile memory reference, or if the informati...
Offset can apply, at least partly.
MachineOperand & getMemOpBaseRegImmOfsOffsetOperand(MachineInstr &LdSt) const
Return the immediate offset of the base register in a load/store LdSt.
bool use_nodbg_empty(unsigned RegNo) const
use_nodbg_empty - Return true if there are no non-Debug instructions using the specified register...
bool hasCustomCheapAsMoveHandling() const
const MCInstrDesc & getDesc() const
Returns the target instruction descriptor of this MachineInstr.
const char * getSymbolName() const
bool shouldClusterMemOps(MachineInstr &FirstLdSt, MachineInstr &SecondLdSt, unsigned NumLoads) const override
Detect opportunities for ldp/stp formation.
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
MO_G0 - A symbol operand with this flag (granule 0) represents the bits 0-15 of a 64-bit address...
iterator_range< mmo_iterator > memoperands()
iterator_range< mop_iterator > operands()
bool hasExtendedReg(const MachineInstr &MI) const
Returns true if there is an extendable register and that the extending value is non-zero.
static unsigned convertToNonFlagSettingOpc(const MachineInstr &MI)
Return the opcode that does not set flags when possible - otherwise return the original opcode...
bool isTerminator(QueryType Type=AnyInBundle) const
Returns true if this instruction part of the terminator for a basic block.
return AArch64::GPR64RegClass contains(Reg)
iterator_range< succ_iterator > successors()
static const MachineInstrBuilder & AddSubReg(const MachineInstrBuilder &MIB, unsigned Reg, unsigned SubIdx, unsigned State, const TargetRegisterInfo *TRI)
MO_G2 - A symbol operand with this flag (granule 2) represents the bits 32-47 of a 64-bit address...
static bool getMemDoShift(unsigned Imm)
getMemDoShift - Extract the "do shift" flag value for load/store instructions.
static MachineInstr * genMaddR(MachineFunction &MF, MachineRegisterInfo &MRI, const TargetInstrInfo *TII, MachineInstr &Root, SmallVectorImpl< MachineInstr * > &InsInstrs, unsigned IdxMulOpd, unsigned MaddOpc, unsigned VR, const TargetRegisterClass *RC)
genMaddR - Generate madd instruction and combine mul and add using an extra virtual register Example ...
bool isPaired128Slow() const
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
bool isUnscaledLdSt(unsigned Opc) const
Return true if this is an unscaled load/store.
A description of a memory reference used in the backend.
bool isAssociativeAndCommutative(const MachineInstr &Inst) const override
Return true when Inst is associative and commutative so that it can be reassociated.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
const HexagonInstrInfo * TII
static AArch64CC::CondCode findCondCodeUsedByInstr(const MachineInstr &Instr)
Find a condition code used by the instruction.
static bool canBeExpandedToORR(const MachineInstr &MI, unsigned BitSize)
Returns true if a MOVi32imm or MOVi64imm can be expanded to an ORRxx.
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
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 eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
const TargetRegisterClass * getRegClass(unsigned Reg) const
Return the register class of the specified virtual register.
bool useMachineCombiner() const override
AArch64 supports MachineCombiner.
Reg
All possible values of the reg field in the ModR/M byte.
static int getRegClass(RegisterKind Is, unsigned RegWidth)
ARMProcFamilyEnum getProcFamily() const
Returns ARM processor family.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
static UsedNZCV getUsedNZCV(AArch64CC::CondCode CC)
static bool canCombineWithMUL(MachineBasicBlock &MBB, MachineOperand &MO, unsigned MulOpc, unsigned ZeroReg)
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.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
zlib-gnu style compression
INLINEASM - Represents an inline asm block.
static bool isCombineInstrCandidate64(unsigned Opc)
unsigned getNumOperands() const
Access to explicit operands of the instruction.
int isAArch64FrameOffsetLegal(const MachineInstr &MI, int &Offset, bool *OutUseUnscaledOp=nullptr, unsigned *OutUnscaledOp=nullptr, int *EmittableOffset=nullptr)
Check if the Offset is a valid frame offset for MI.
void RemoveOperand(unsigned i)
Erase an operand from an instruction, leaving it with one fewer operand than it started with...
AArch64InstrInfo(const AArch64Subtarget &STI)
bool isFI() const
isFI - Tests if this is a MO_FrameIndex operand.
MO_GOT - This flag indicates that a symbol operand represents the address of the GOT entry for the sy...
static AArch64_AM::ShiftExtendType getMemExtendType(unsigned Imm)
getExtendType - Extract the extend type for the offset operand of loads/stores.
unsigned getInstSizeInBytes(const MachineInstr &MI) const override
GetInstSize - Return the number of bytes of code the specified instruction may be.
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...
static bool canCombineWithFMUL(MachineBasicBlock &MBB, MachineOperand &MO, unsigned MulOpc)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
iterator getLastNonDebugInstr()
Returns an iterator to the last non-debug instruction in the basic block, or end().
bool canInsertSelect(const MachineBasicBlock &, ArrayRef< MachineOperand > Cond, unsigned, unsigned, int &, int &, int &) const override
static bool canCombine(MachineBasicBlock &MBB, MachineOperand &MO, unsigned CombineOpc, unsigned ZeroReg=0, bool CheckZeroReg=false)
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
static const MachineMemOperand::Flags MOSuppressPair
instr_iterator insert(instr_iterator I, MachineInstr *M)
Insert MI into the instruction list before I, possibly inside a bundle.
size_t size() const
size - Get the array size.
static bool canPairLdStOpc(unsigned FirstOpc, unsigned SecondOpc)
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...
Instances of this class represent a single low-level machine instruction.
unsigned getKillRegState(bool B)
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
static unsigned getShifterImm(AArch64_AM::ShiftExtendType ST, unsigned Imm)
getShifterImm - Encode the shift type and amount: imm: 6-bit shift amount shifter: 000 ==> lsl 001 ==...
void emitFrameOffset(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, int Offset, const TargetInstrInfo *TII, MachineInstr::MIFlag=MachineInstr::NoFlags, bool SetNZCV=false)
emitFrameOffset - Emit instructions as needed to set DestReg to SrcReg plus Offset.
void ChangeToImmediate(int64_t ImmVal)
ChangeToImmediate - Replace this operand with a new immediate operand of the specified value...
Flag
These should be considered private to the implementation of the MCInstrDesc class.
const MachineBasicBlock * getParent() const
TargetInstrInfo - Interface to description of machine instruction set.
static bool isCondBranchOpcode(int Opc)
bool isDebugValue() const
This class is intended to be used as a base class for asm properties and features specific to the tar...
unsigned getDefRegState(bool B)
static bool isCombineInstrCandidateFP(const MachineInstr &Inst)
static unsigned getShiftValue(unsigned Imm)
getShiftValue - Extract the shift value.
bool operator|=(SparseBitVector< ElementSize > &LHS, const SparseBitVector< ElementSize > *RHS)
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
initializer< Ty > init(const Ty &Val)
unsigned UnsafeFPMath
UnsafeFPMath - This flag is enabled when the -enable-unsafe-fp-math flag is specified on the command ...
FPOpFusion::FPOpFusionMode AllowFPOpFusion
AllowFPOpFusion - This flag is set by the -fuse-fp-ops=xxx option.
bool getMemOpInfo(unsigned Opcode, unsigned &Scale, unsigned &Width, int64_t &MinOffset, int64_t &MaxOffset) const
Returns true if opcode Opc is a memory operation.
unsigned getOutliningBenefit(size_t SequenceSize, size_t Occurrences, bool CanBeTailCall) const override
MO_G1 - A symbol operand with this flag (granule 1) represents the bits 16-31 of a 64-bit address...
unsigned const MachineRegisterInfo * MRI
bool isFalkorShiftExtFast(const MachineInstr &MI) const
Returns true if the instruction has a shift by immediate that can be executed in one cycle less...
bool isFPRCopy(const MachineInstr &MI) const
Does this instruction rename an FPR without modifying bits?
static cl::opt< unsigned > BCCDisplacementBits("aarch64-bcc-offset-bits", cl::Hidden, cl::init(19), cl::desc("Restrict range of Bcc instructions (DEBUG)"))
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
bool reverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const override
static AArch64_AM::ShiftExtendType getArithExtendType(unsigned Imm)
bool isAsCheapAsAMove(QueryType Type=AllInBundle) const
Returns true if this instruction has the same cost (or less) than a move instruction.
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...
MachineInstr * emitFrameIndexDebugValue(MachineFunction &MF, int FrameIx, uint64_t Offset, const MDNode *Var, const MDNode *Expr, const DebugLoc &DL) const
bool isIndirectDebugValue() const
A DBG_VALUE is indirect iff the first operand is a register and the second operand is an immediate...
const MachineOperand & getOperand(unsigned i) const
bool rewriteAArch64FrameIndex(MachineInstr &MI, unsigned FrameRegIdx, unsigned FrameReg, int &Offset, const AArch64InstrInfo *TII)
rewriteAArch64FrameIndex - Rewrite MI to access 'Offset' bytes from the FP.
unsigned getSubReg(unsigned Reg, unsigned Idx) const
Returns the physical register number of sub-register "Index" for physical register RegNo...
static uint64_t decodeLogicalImmediate(uint64_t val, unsigned regSize)
decodeLogicalImmediate - Decode a logical immediate value in the form "N:immr:imms" (where the immr a...
static cl::opt< unsigned > CBZDisplacementBits("aarch64-cbz-offset-bits", cl::Hidden, cl::init(19), cl::desc("Restrict range of CB[N]Z instructions (DEBUG)"))
static bool canInstrSubstituteCmpInstr(MachineInstr *MI, MachineInstr *CmpInstr, const TargetRegisterInfo *TRI)
Check if CmpInstr can be substituted by MI.
constexpr bool isPowerOf2_64(uint64_t Value)
Return true if the argument is a power of two > 0 (64 bit edition.)
unsigned getNumExplicitOperands() const
Returns the number of non-implicit operands.
bool any_of(R &&Range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly...
static bool isPairableLdStInst(const MachineInstr &MI)
static const unsigned End
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
void setImm(int64_t immVal)
bool hasUnmodeledSideEffects() const
Return true if this instruction has side effects that are not modeled by mayLoad / mayStore...
const SetOfInstructions & getLOHRelated() const
void insertOutlinerPrologue(MachineBasicBlock &MBB, MachineFunction &MF, bool isTailCall) const override
MI-level patchpoint operands.
self_iterator getIterator()
bool areMemAccessesTriviallyDisjoint(MachineInstr &MIa, MachineInstr &MIb, AliasAnalysis *AA=nullptr) const override
bool isBranchOffsetInRange(unsigned BranchOpc, int64_t BrOffset) const override
bool isAsCheapAsAMove(const MachineInstr &MI) const override
bool expandPostRAPseudo(MachineInstr &MI) const override
bool empty() const
empty - Check if the array is empty.
bool isThroughputPattern(MachineCombinerPattern Pattern) const override
Return true when a code sequence can improve throughput.
MachineCombinerPattern
These are instruction patterns matched by the machine combiner pass.
bool getMachineCombinerPatterns(MachineInstr &Root, SmallVectorImpl< MachineCombinerPattern > &Patterns) const override
Return true when there is potentially a faster code sequence for an instruction chain ending in Root...
unsigned getSubReg() const
MO_HI12 - This flag indicates that a symbol operand represents the bits 13-24 of a 64-bit address...
bool isIntN(unsigned N, int64_t x)
Checks if an signed integer fits into the given (dynamic) bit width.
ArrayRef< std::pair< unsigned, const char * > > getSerializableDirectMachineOperandTargetFlags() const override
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
reverse_iterator getReverse() const
Get a reverse iterator to the same node.
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const override
void insertSelect(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL, unsigned DstReg, ArrayRef< MachineOperand > Cond, unsigned TrueReg, unsigned FalseReg) const override
This class contains a discriminated union of information about pointers in memory operands...
MO_TLS - Indicates that the operand being accessed is some kind of thread-local symbol.
bool isCoalescableExtInstr(const MachineInstr &MI, unsigned &SrcReg, unsigned &DstReg, unsigned &SubIdx) const override
unsigned char ClassifyGlobalReference(const GlobalValue *GV, const TargetMachine &TM) const
ClassifyGlobalReference - Find the target operand flags that describe how a global value should be re...
unsigned isLoadFromStackSlot(const MachineInstr &MI, int &FrameIndex) const override
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
bool definesRegister(unsigned Reg, const TargetRegisterInfo *TRI=nullptr) const
Return true if the MachineInstr fully defines the specified register.
EH_LABEL - Represents a label in mid basic block used to track locations needed for debug and excepti...
void setIsKill(bool Val=true)
ArrayRef< std::pair< MachineMemOperand::Flags, const char * > > getSerializableMachineMemOperandTargetFlags() const override
unsigned getOpcode() const
Return the opcode number for this descriptor.
The memory access writes data.
static unsigned canFoldIntoCSel(const MachineRegisterInfo &MRI, unsigned VReg, unsigned *NewVReg=nullptr)
static uint64_t encodeLogicalImmediate(uint64_t imm, unsigned regSize)
encodeLogicalImmediate - Return the encoded immediate value for a logical immediate instruction of th...
bool readsRegister(unsigned Reg, const TargetRegisterInfo *TRI=nullptr) const
Return true if the MachineInstr reads the specified register.
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...
bool memoperands_empty() const
Return true if we don't have any memory operands which described the the memory access done by this i...
static bool isIndirectBranchOpcode(int Opc)
void setOpcode(unsigned Op)
static bool isUncondBranchOpcode(int Opc)
void getNoop(MCInst &NopInst) const override
void setDesc(const MCInstrDesc &tid)
Replace the instruction descriptor (thus opcode) of the current instruction with a new one...
MachineBasicBlock::iterator insertOutlinedCall(Module &M, MachineBasicBlock &MBB, MachineBasicBlock::iterator &It, MachineFunction &MF, bool IsTailCall) const override
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
MachineOperand class - Representation of each machine instruction operand.
unsigned getObjectAlignment(int ObjectIdx) const
Return the alignment of the specified stack object.
static void parseCondBranch(MachineInstr *LastInst, MachineBasicBlock *&Target, SmallVectorImpl< MachineOperand > &Cond)
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
static bool isCombineInstrCandidate(unsigned Opc)
const MachineInstrBuilder & addFrameIndex(int Idx) const
bool optimizeCondBranch(MachineInstr &MI) const override
Replace csincr-branch sequence by simple conditional branch.
void addRegisterDefined(unsigned Reg, const TargetRegisterInfo *RegInfo=nullptr)
We have determined MI defines a register.
unsigned isStoreToStackSlot(const MachineInstr &MI, int &FrameIndex) const override
Target - Wrapper for Target specific information.
const TargetRegisterClass * getRegClassConstraint(unsigned OpIdx, const TargetInstrInfo *TII, const TargetRegisterInfo *TRI) const
Compute the static register class constraint for operand OpIdx.
static bool getMaddPatterns(MachineInstr &Root, SmallVectorImpl< MachineCombinerPattern > &Patterns)
Find instructions that can be turned into madd.
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
const TargetRegisterClass * getMinimalPhysRegClass(unsigned Reg, MVT VT=MVT::Other) const
Returns the Register Class of a physical register of the given type, picking the most sub register cl...
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.
uint32_t getNumPatchBytes() const
Return the number of patchable bytes the given stackmap should emit.
static cl::opt< unsigned > TBZDisplacementBits("aarch64-tbz-offset-bits", cl::Hidden, cl::init(14), cl::desc("Restrict range of TB[N]Z instructions (DEBUG)"))
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.
static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
Representation of each machine instruction.
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify=false) const override
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
bool hasOneDef(unsigned RegNo) const
Return true if there is exactly one operand defining the specified register.
bool optimizeCompareInstr(MachineInstr &CmpInstr, unsigned SrcReg, unsigned SrcReg2, int CmpMask, int CmpValue, const MachineRegisterInfo *MRI) const override
optimizeCompareInstr - Convert the instruction supplying the argument to the comparison into one that...
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...
bool isScaledAddr(const MachineInstr &MI) const
Return true if this is load/store scales or extends its register offset.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
static AArch64_AM::ShiftExtendType getShiftType(unsigned Imm)
getShiftType - Extract the shift type.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
MI-level stackmap operands.
bool mayLoadOrStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly read or modify memory.
static bool areCFlagsAliveInSuccessors(MachineBasicBlock *MBB)
Check if AArch64::NZCV should be alive in successors of MBB.
void insertOutlinerEpilogue(MachineBasicBlock &MBB, MachineFunction &MF, bool IsTailCall) const override
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
bool hasOneNonDBGUse(unsigned RegNo) const
hasOneNonDBGUse - Return true if there is exactly one non-Debug instruction using the specified regis...
const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const
static MachineOperand CreateImm(int64_t Val)
MO_PAGEOFF - A symbol operand with this flag represents the offset of that symbol within a 4K page...
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
void setSubReg(unsigned subReg)
bool isLdStPairSuppressed(const MachineInstr &MI) const
Return true if pairing the given load or store is hinted to be unprofitable.
void clearKillFlags(unsigned Reg) const
clearKillFlags - Iterate over all the uses of the given register and clear the kill flag from the Mac...
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
static unsigned getBranchDisplacementBits(unsigned Opc)
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
bool getMemOpBaseRegImmOfsWidth(MachineInstr &LdSt, unsigned &BaseReg, int64_t &Offset, unsigned &Width, const TargetRegisterInfo *TRI) const
constexpr int64_t SignExtend64(uint64_t x)
Sign-extend the number in the bottom B bits of X to a 64-bit integer.
bool isGPRCopy(const MachineInstr &MI) const
Does this instruction rename a GPR without modifying bits?
MachineInstr * getVRegDef(unsigned Reg) const
getVRegDef - Return the machine instr that defines the specified virtual register or null if none is ...
static unsigned removeCopies(const MachineRegisterInfo &MRI, unsigned VReg)
static bool isCombineInstrCandidate32(unsigned Opc)
unsigned getReg() const
getReg - Returns the register number.
static bool scaleOffset(unsigned Opc, int64_t &Offset)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MachineBasicBlock * getBranchDestBlock(const MachineInstr &MI) const override
void copyPhysRegTuple(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, bool KillSrc, unsigned Opcode, llvm::ArrayRef< unsigned > Indices) const
void genAlternativeCodeSequence(MachineInstr &Root, MachineCombinerPattern Pattern, SmallVectorImpl< MachineInstr * > &InsInstrs, SmallVectorImpl< MachineInstr * > &DelInstrs, DenseMap< unsigned, unsigned > &InstrIdxForVirtReg) const override
When getMachineCombinerPatterns() finds patterns, this function generates the instructions that could...
virtual const TargetInstrInfo * getInstrInfo() const
bool isFunctionSafeToOutlineFrom(MachineFunction &MF) const override
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned char TargetFlags=0) const
std::pair< unsigned, unsigned > decomposeMachineOperandsTargetFlags(unsigned TF) const override
bool isStridedAccess(const MachineInstr &MI) const
Return true if the given load or store is a strided memory access.
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
unsigned getNumOperands() const
Return the number of declared MachineOperands for this MachineInstruction.
static bool areCFlagsAccessedBetweenInstrs(MachineBasicBlock::iterator From, MachineBasicBlock::iterator To, const TargetRegisterInfo *TRI, const AccessKind AccessToCheck=AK_All)
True when condition flags are accessed (either by writing or reading) on the instruction trace starti...
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.
virtual void genAlternativeCodeSequence(MachineInstr &Root, MachineCombinerPattern Pattern, SmallVectorImpl< MachineInstr * > &InsInstrs, SmallVectorImpl< MachineInstr * > &DelInstrs, DenseMap< unsigned, unsigned > &InstrIdxForVirtReg) const
When getMachineCombinerPatterns() finds patterns, this function generates the instructions that could...
bool def_empty(unsigned RegNo) const
def_empty - Return true if there are no instructions defining the specified register (it may be live-...
static MachineInstr * genFusedMultiply(MachineFunction &MF, MachineRegisterInfo &MRI, const TargetInstrInfo *TII, MachineInstr &Root, SmallVectorImpl< MachineInstr * > &InsInstrs, unsigned IdxMulOpd, unsigned MaddOpc, const TargetRegisterClass *RC, FMAInstKind kind=FMAInstKind::Default)
genFusedMultiply - Generate fused multiply instructions.
Primary interface to the complete machine description for the target machine.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
void addOperand(const MCOperand &Op)
MO_NC - Indicates whether the linker is expected to check the symbol reference for overflow...
bool isCandidateToMergeOrPair(MachineInstr &MI) const
Return true if this is a load/store that can be potentially paired/merged.
const MachineInstrBuilder & setMIFlag(MachineInstr::MIFlag Flag) const
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
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 ...
static bool isCombineInstrSettingFlag(unsigned Opc)
auto find_if(R &&Range, UnaryPredicate P) -> decltype(std::begin(Range))
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly...
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
static MCOperand createImm(int64_t Val)
GlobalValue * getNamedValue(StringRef Name) const
Return the global value in the module with the specified name, of arbitrary type. ...
unsigned Log2_64(uint64_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
static const MachineMemOperand::Flags MOStridedAccess
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
static bool forwardCopyWillClobberTuple(unsigned DestReg, unsigned SrcReg, unsigned NumRegs)
bool modifiesRegister(unsigned Reg, const TargetRegisterInfo *TRI) const
Return true if the MachineInstr modifies (fully define or partially define) the specified register...
static bool UpdateOperandRegClass(MachineInstr &Instr)
static bool isADDSRegImm(unsigned Opcode)
mmo_iterator memoperands_begin() const
Access to memory operands of the instruction.
bool contains(unsigned Reg) const
Return true if the specified register is included in this register class.