66#define DEBUG_TYPE "hexagon-instrinfo"
68#define GET_INSTRINFO_CTOR_DTOR
69#define GET_INSTRMAP_INFO
71#include "HexagonGenDFAPacketizer.inc"
72#include "HexagonGenInstrInfo.inc"
76 "packetization boundary."));
83 cl::desc(
"Disable schedule adjustment for new value stores."));
87 cl::desc(
"Enable timing class latency"));
91 cl::desc(
"Enable vec alu forwarding"));
95 cl::desc(
"Enable vec acc forwarding"));
103 cl::desc(
"Use the DFA based hazard recognizer."));
118void HexagonInstrInfo::anchor() {}
123 RegInfo(ST.getHwMode()), Subtarget(ST) {}
132 return (
Reg >= Hexagon::R0 &&
Reg <= Hexagon::R7) ||
133 (
Reg >= Hexagon::R16 &&
Reg <= Hexagon::R23);
145 for (; MIB != MIE; ++MIB) {
146 if (!MIB->isDebugInstr())
157 if (!(
MI.getMF()->getFunction().hasOptSize()))
158 return MI.isAsCheapAsAMove();
160 if (
MI.getOpcode() == Hexagon::A2_tfrsi) {
161 auto Op =
MI.getOperand(1);
169 int64_t Imm =
Op.getImm();
174 return MI.isAsCheapAsAMove();
189 if (
isFloat(
MI) &&
MI.hasRegisterImplicitUseOperand(Hexagon::USR))
203 if (EndLoopOp == Hexagon::ENDLOOP0) {
204 LOOPi = Hexagon::J2_loop0i;
205 LOOPr = Hexagon::J2_loop0r;
207 LOOPi = Hexagon::J2_loop1i;
208 LOOPr = Hexagon::J2_loop1r;
219 unsigned Opc =
I.getOpcode();
220 if (
Opc == LOOPi ||
Opc == LOOPr)
224 if (
Opc == EndLoopOp &&
I.getOperand(0).getMBB() != TargetBB)
251 Uses.push_back(MO.getReg());
290 int &FrameIndex)
const {
291 switch (
MI.getOpcode()) {
294 case Hexagon::L2_loadri_io:
295 case Hexagon::L2_loadrd_io:
296 case Hexagon::V6_vL32b_ai:
297 case Hexagon::V6_vL32b_nt_ai:
298 case Hexagon::V6_vL32Ub_ai:
299 case Hexagon::LDriw_pred:
300 case Hexagon::LDriw_ctr:
301 case Hexagon::PS_vloadrq_ai:
302 case Hexagon::PS_vloadrw_ai:
303 case Hexagon::PS_vloadrw_nt_ai: {
311 return MI.getOperand(0).getReg();
314 case Hexagon::L2_ploadrit_io:
315 case Hexagon::L2_ploadrif_io:
316 case Hexagon::L2_ploadrdt_io:
317 case Hexagon::L2_ploadrdf_io: {
325 return MI.getOperand(0).getReg();
338 int &FrameIndex)
const {
339 switch (
MI.getOpcode()) {
342 case Hexagon::S2_storerb_io:
343 case Hexagon::S2_storerh_io:
344 case Hexagon::S2_storeri_io:
345 case Hexagon::S2_storerd_io:
346 case Hexagon::V6_vS32b_ai:
347 case Hexagon::V6_vS32Ub_ai:
348 case Hexagon::STriw_pred:
349 case Hexagon::STriw_ctr:
350 case Hexagon::PS_vstorerq_ai:
351 case Hexagon::PS_vstorerw_ai: {
359 return MI.getOperand(2).getReg();
362 case Hexagon::S2_pstorerbt_io:
363 case Hexagon::S2_pstorerbf_io:
364 case Hexagon::S2_pstorerht_io:
365 case Hexagon::S2_pstorerhf_io:
366 case Hexagon::S2_pstorerit_io:
367 case Hexagon::S2_pstorerif_io:
368 case Hexagon::S2_pstorerdt_io:
369 case Hexagon::S2_pstorerdf_io: {
377 return MI.getOperand(3).getReg();
393 for (++MII; MII !=
MBB->instr_end() && MII->isInsideBundle(); ++MII)
411 for (++MII; MII !=
MBB->instr_end() && MII->isInsideBundle(); ++MII)
439 bool AllowModify)
const {
446 if (
I ==
MBB.instr_begin())
466 }
while (
I !=
MBB.instr_begin());
471 while (
I->isDebugInstr()) {
472 if (
I ==
MBB.instr_begin())
477 bool JumpToBlock =
I->getOpcode() == Hexagon::J2_jump &&
478 I->getOperand(0).isMBB();
480 if (AllowModify && JumpToBlock &&
481 MBB.isLayoutSuccessor(
I->getOperand(0).getMBB())) {
483 I->eraseFromParent();
485 if (
I ==
MBB.instr_begin())
489 if (!isUnpredicatedTerminator(*
I))
497 if (&*
I != LastInst && !
I->isBundle() && isUnpredicatedTerminator(*
I)) {
499 SecondLastInst = &*
I;
504 if (
I ==
MBB.instr_begin())
510 int SecLastOpcode = SecondLastInst ? SecondLastInst->
getOpcode() : 0;
513 if (LastOpcode == Hexagon::J2_jump && !LastInst->
getOperand(0).
isMBB())
515 if (SecLastOpcode == Hexagon::J2_jump &&
526 if (LastInst && !SecondLastInst) {
527 if (LastOpcode == Hexagon::J2_jump) {
537 if (LastOpcodeHasJMP_c) {
552 <<
" with one jump\n";);
559 if (SecLastOpcodeHasJMP_c && (LastOpcode == Hexagon::J2_jump)) {
570 if (SecLastOpcodeHasNVJump &&
572 (LastOpcode == Hexagon::J2_jump)) {
583 if (SecLastOpcode == Hexagon::J2_jump && LastOpcode == Hexagon::J2_jump) {
587 I->eraseFromParent();
592 if (
isEndLoopN(SecLastOpcode) && LastOpcode == Hexagon::J2_jump) {
600 <<
" with two jumps";);
606 int *BytesRemoved)
const {
607 assert(!BytesRemoved &&
"code size not handled");
612 while (
I !=
MBB.begin()) {
614 if (
I->isDebugInstr())
619 if (
Count && (
I->getOpcode() == Hexagon::J2_jump))
633 int *BytesAdded)
const {
634 unsigned BOpc = Hexagon::J2_jump;
635 unsigned BccOpc = Hexagon::J2_jumpt;
637 assert(
TBB &&
"insertBranch must not be told to insert a fallthrough");
638 assert(!BytesAdded &&
"code size not handled");
643 if (!
Cond.empty() &&
Cond[0].isImm())
644 BccOpc =
Cond[0].getImm();
654 auto Term =
MBB.getFirstTerminator();
664 int EndLoopOp =
Cond[0].getImm();
671 assert(
Loop !=
nullptr &&
"Inserting an ENDLOOP without a LOOP");
672 Loop->getOperand(0).setMBB(
TBB);
676 assert((
Cond.size() == 3) &&
"Only supporting rr/ri version of nvjump");
687 }
else if(
Cond[2].isImm()) {
693 assert((
Cond.size() == 2) &&
"Malformed cond vector");
701 "Cond. cannot be empty when multiple branchings are required");
703 "NV-jump cannot be inserted with another branch");
706 int EndLoopOp =
Cond[0].getImm();
713 assert(
Loop !=
nullptr &&
"Inserting an ENDLOOP without a LOOP");
714 Loop->getOperand(0).setMBB(
TBB);
743 TripCount =
Loop->getOpcode() == Hexagon::J2_loop0r
745 :
Loop->getOperand(1).getImm();
747 LoopCount =
Loop->getOperand(1).getReg();
750 bool shouldIgnoreForPipelining(
const MachineInstr *
MI)
const override {
752 return MI == EndLoop;
755 std::optional<bool> createTripCountGreaterCondition(
756 int TC, MachineBasicBlock &
MBB,
757 SmallVectorImpl<MachineOperand> &
Cond)
override {
758 if (TripCount == -1) {
762 TII->get(Hexagon::C2_cmpgtui),
Done)
770 return TripCount > TC;
773 void setPreheader(MachineBasicBlock *NewPreheader)
override {
778 void adjustTripCount(
int TripCountAdjust)
override {
781 if (Loop->
getOpcode() == Hexagon::J2_loop0i ||
782 Loop->
getOpcode() == Hexagon::J2_loop1i) {
784 assert(TripCount > 0 &&
"Can't create an empty or negative loop!");
794 TII->get(Hexagon::A2_addi), NewLoopCount)
800 void disposed(LiveIntervals *LIS)
override {
808std::unique_ptr<TargetInstrInfo::PipelinerLoopInfo>
816 LoopBB,
I->getOpcode(),
I->getOperand(0).getMBB(), VisitedBBs);
818 return std::make_unique<HexagonPipelinerLoopInfo>(LoopInst, &*
I);
824 unsigned NumCycles,
unsigned ExtraPredCycles,
838 return NumInstrs <= 4;
846 for (
auto I =
B.begin();
I !=
E; ++
I) {
856 for (
auto I =
B.rbegin();
I !=
E; ++
I)
865 bool RenamableSrc)
const {
869 if (Hexagon::IntRegsRegClass.
contains(SrcReg, DestReg)) {
871 .
addReg(SrcReg, KillFlag);
874 if (Hexagon::DoubleRegsRegClass.
contains(SrcReg, DestReg)) {
876 .
addReg(SrcReg, KillFlag);
879 if (Hexagon::PredRegsRegClass.
contains(SrcReg, DestReg)) {
885 if (Hexagon::CtrRegsRegClass.
contains(DestReg) &&
886 Hexagon::IntRegsRegClass.
contains(SrcReg)) {
888 .
addReg(SrcReg, KillFlag);
891 if (Hexagon::IntRegsRegClass.
contains(DestReg) &&
892 Hexagon::CtrRegsRegClass.
contains(SrcReg)) {
894 .
addReg(SrcReg, KillFlag);
897 if (Hexagon::ModRegsRegClass.
contains(DestReg) &&
898 Hexagon::IntRegsRegClass.
contains(SrcReg)) {
900 .
addReg(SrcReg, KillFlag);
903 if (Hexagon::PredRegsRegClass.
contains(SrcReg) &&
904 Hexagon::IntRegsRegClass.
contains(DestReg)) {
906 .
addReg(SrcReg, KillFlag);
909 if (Hexagon::IntRegsRegClass.
contains(SrcReg) &&
910 Hexagon::PredRegsRegClass.
contains(DestReg)) {
912 .
addReg(SrcReg, KillFlag);
915 if (Hexagon::PredRegsRegClass.
contains(SrcReg) &&
916 Hexagon::IntRegsRegClass.
contains(DestReg)) {
918 .
addReg(SrcReg, KillFlag);
921 if (Hexagon::HvxVRRegClass.
contains(SrcReg, DestReg)) {
923 addReg(SrcReg, KillFlag);
926 if (Hexagon::HvxWRRegClass.
contains(SrcReg, DestReg)) {
929 Register SrcLo = HRI.getSubReg(SrcReg, Hexagon::vsub_lo);
930 Register SrcHi = HRI.getSubReg(SrcReg, Hexagon::vsub_hi);
934 .
addReg(SrcHi, KillFlag | UndefHi)
935 .
addReg(SrcLo, KillFlag | UndefLo);
938 if (Hexagon::HvxQRRegClass.
contains(SrcReg, DestReg)) {
941 .
addReg(SrcReg, KillFlag);
944 if (Hexagon::HvxQRRegClass.
contains(SrcReg) &&
945 Hexagon::HvxVRRegClass.
contains(DestReg)) {
949 if (Hexagon::HvxQRRegClass.
contains(DestReg) &&
950 Hexagon::HvxVRRegClass.
contains(SrcReg)) {
965 Register SrcReg,
bool isKill,
int FI,
978 if (Hexagon::IntRegsRegClass.hasSubClassEq(RC)) {
982 }
else if (Hexagon::DoubleRegsRegClass.hasSubClassEq(RC)) {
986 }
else if (Hexagon::PredRegsRegClass.hasSubClassEq(RC)) {
990 }
else if (Hexagon::ModRegsRegClass.hasSubClassEq(RC)) {
994 }
else if (Hexagon::HvxQRRegClass.hasSubClassEq(RC)) {
998 }
else if (Hexagon::HvxVRRegClass.hasSubClassEq(RC)) {
1002 }
else if (Hexagon::HvxWRRegClass.hasSubClassEq(RC)) {
1025 if (Hexagon::IntRegsRegClass.hasSubClassEq(RC)) {
1028 }
else if (Hexagon::DoubleRegsRegClass.hasSubClassEq(RC)) {
1031 }
else if (Hexagon::PredRegsRegClass.hasSubClassEq(RC)) {
1034 }
else if (Hexagon::ModRegsRegClass.hasSubClassEq(RC)) {
1037 }
else if (Hexagon::HvxQRRegClass.hasSubClassEq(RC)) {
1040 }
else if (Hexagon::HvxVRRegClass.hasSubClassEq(RC)) {
1043 }
else if (Hexagon::HvxWRRegClass.hasSubClassEq(RC)) {
1064 unsigned Opc =
MI.getOpcode();
1066 auto RealCirc = [&](
unsigned Opc,
bool HasImm,
unsigned MxOp) {
1068 Register CSx = (Mx == Hexagon::M0 ? Hexagon::CS0 : Hexagon::CS1);
1070 .
add(
MI.getOperand((HasImm ? 5 : 4)));
1074 MIB.
add(
MI.getOperand(4));
1081 if (
MI.memoperands().empty())
1084 return MMO->getAlign() >= NeedAlign;
1089 case Hexagon::PS_call_instrprof_custom: {
1090 auto Op0 =
MI.getOperand(0);
1092 "First operand must be a global containing handler name.");
1096 StringRef NameStr = Arr->isCString() ? Arr->getAsCString() : Arr->getAsString();
1122 MIB.addExternalSymbol(cstr);
1126 case TargetOpcode::COPY: {
1132 std::prev(
MBBI)->copyImplicitOps(*
MBB.getParent(),
MI);
1137 case Hexagon::PS_aligna:
1140 .
addImm(-
MI.getOperand(1).getImm());
1143 case Hexagon::V6_vassignp: {
1146 Register SrcLo = HRI.getSubReg(SrcReg, Hexagon::vsub_lo);
1147 Register SrcHi = HRI.getSubReg(SrcReg, Hexagon::vsub_hi);
1154 .
addReg(SrcLo, Kill | UndefLo);
1158 case Hexagon::V6_lo: {
1161 Register SrcSubLo = HRI.getSubReg(SrcReg, Hexagon::vsub_lo);
1164 MRI.clearKillFlags(SrcSubLo);
1167 case Hexagon::V6_hi: {
1170 Register SrcSubHi = HRI.getSubReg(SrcReg, Hexagon::vsub_hi);
1173 MRI.clearKillFlags(SrcSubHi);
1176 case Hexagon::PS_vloadrv_ai: {
1180 int Offset =
MI.getOperand(2).getImm();
1181 Align NeedAlign = HRI.getSpillAlign(Hexagon::HvxVRRegClass);
1182 unsigned NewOpc = UseAligned(
MI, NeedAlign) ? Hexagon::V6_vL32b_ai
1183 : Hexagon::V6_vL32Ub_ai;
1191 case Hexagon::PS_vloadrw_ai: {
1195 int Offset =
MI.getOperand(2).getImm();
1196 unsigned VecOffset = HRI.getSpillSize(Hexagon::HvxVRRegClass);
1197 Align NeedAlign = HRI.getSpillAlign(Hexagon::HvxVRRegClass);
1198 unsigned NewOpc = UseAligned(
MI, NeedAlign) ? Hexagon::V6_vL32b_ai
1199 : Hexagon::V6_vL32Ub_ai;
1201 HRI.getSubReg(DstReg, Hexagon::vsub_lo))
1206 HRI.getSubReg(DstReg, Hexagon::vsub_hi))
1213 case Hexagon::PS_vstorerv_ai: {
1218 int Offset =
MI.getOperand(1).getImm();
1219 Align NeedAlign = HRI.getSpillAlign(Hexagon::HvxVRRegClass);
1220 unsigned NewOpc = UseAligned(
MI, NeedAlign) ? Hexagon::V6_vS32b_ai
1221 : Hexagon::V6_vS32Ub_ai;
1230 case Hexagon::PS_vstorerw_ai: {
1234 int Offset =
MI.getOperand(1).getImm();
1235 unsigned VecOffset = HRI.getSpillSize(Hexagon::HvxVRRegClass);
1236 Align NeedAlign = HRI.getSpillAlign(Hexagon::HvxVRRegClass);
1237 unsigned NewOpc = UseAligned(
MI, NeedAlign) ? Hexagon::V6_vS32b_ai
1238 : Hexagon::V6_vS32Ub_ai;
1242 .
addReg(HRI.getSubReg(SrcReg, Hexagon::vsub_lo))
1247 .
addReg(HRI.getSubReg(SrcReg, Hexagon::vsub_hi))
1252 case Hexagon::PS_true: {
1260 case Hexagon::PS_false: {
1268 case Hexagon::PS_qtrue: {
1275 case Hexagon::PS_qfalse: {
1282 case Hexagon::PS_vdd0: {
1290 case Hexagon::PS_vmulw: {
1293 Register Src1Reg =
MI.getOperand(1).getReg();
1294 Register Src2Reg =
MI.getOperand(2).getReg();
1295 Register Src1SubHi = HRI.getSubReg(Src1Reg, Hexagon::isub_hi);
1296 Register Src1SubLo = HRI.getSubReg(Src1Reg, Hexagon::isub_lo);
1297 Register Src2SubHi = HRI.getSubReg(Src2Reg, Hexagon::isub_hi);
1298 Register Src2SubLo = HRI.getSubReg(Src2Reg, Hexagon::isub_lo);
1300 HRI.getSubReg(DstReg, Hexagon::isub_hi))
1304 HRI.getSubReg(DstReg, Hexagon::isub_lo))
1308 MRI.clearKillFlags(Src1SubHi);
1309 MRI.clearKillFlags(Src1SubLo);
1310 MRI.clearKillFlags(Src2SubHi);
1311 MRI.clearKillFlags(Src2SubLo);
1314 case Hexagon::PS_vmulw_acc: {
1317 Register Src1Reg =
MI.getOperand(1).getReg();
1318 Register Src2Reg =
MI.getOperand(2).getReg();
1319 Register Src3Reg =
MI.getOperand(3).getReg();
1320 Register Src1SubHi = HRI.getSubReg(Src1Reg, Hexagon::isub_hi);
1321 Register Src1SubLo = HRI.getSubReg(Src1Reg, Hexagon::isub_lo);
1322 Register Src2SubHi = HRI.getSubReg(Src2Reg, Hexagon::isub_hi);
1323 Register Src2SubLo = HRI.getSubReg(Src2Reg, Hexagon::isub_lo);
1324 Register Src3SubHi = HRI.getSubReg(Src3Reg, Hexagon::isub_hi);
1325 Register Src3SubLo = HRI.getSubReg(Src3Reg, Hexagon::isub_lo);
1327 HRI.getSubReg(DstReg, Hexagon::isub_hi))
1332 HRI.getSubReg(DstReg, Hexagon::isub_lo))
1337 MRI.clearKillFlags(Src1SubHi);
1338 MRI.clearKillFlags(Src1SubLo);
1339 MRI.clearKillFlags(Src2SubHi);
1340 MRI.clearKillFlags(Src2SubLo);
1341 MRI.clearKillFlags(Src3SubHi);
1342 MRI.clearKillFlags(Src3SubLo);
1345 case Hexagon::PS_pselect: {
1360 .
addReg(Pu, (Rd == Rt) ? K1 : 0)
1369 case Hexagon::PS_vselect: {
1402 case Hexagon::PS_wselect: {
1442 case Hexagon::PS_crash: {
1458 void printCustom(
raw_ostream &OS)
const override {
1459 OS <<
"MisalignedCrash";
1463 static const CrashPseudoSourceValue CrashPSV(MF.
getTarget());
1475 case Hexagon::PS_tailcall_i:
1476 MI.setDesc(
get(Hexagon::J2_jump));
1478 case Hexagon::PS_tailcall_r:
1479 case Hexagon::PS_jmpret:
1480 MI.setDesc(
get(Hexagon::J2_jumpr));
1482 case Hexagon::PS_jmprett:
1483 MI.setDesc(
get(Hexagon::J2_jumprt));
1485 case Hexagon::PS_jmpretf:
1486 MI.setDesc(
get(Hexagon::J2_jumprf));
1488 case Hexagon::PS_jmprettnewpt:
1489 MI.setDesc(
get(Hexagon::J2_jumprtnewpt));
1491 case Hexagon::PS_jmpretfnewpt:
1492 MI.setDesc(
get(Hexagon::J2_jumprfnewpt));
1494 case Hexagon::PS_jmprettnew:
1495 MI.setDesc(
get(Hexagon::J2_jumprtnew));
1497 case Hexagon::PS_jmpretfnew:
1498 MI.setDesc(
get(Hexagon::J2_jumprfnew));
1501 case Hexagon::PS_loadrub_pci:
1502 return RealCirc(Hexagon::L2_loadrub_pci,
true, 4);
1503 case Hexagon::PS_loadrb_pci:
1504 return RealCirc(Hexagon::L2_loadrb_pci,
true, 4);
1505 case Hexagon::PS_loadruh_pci:
1506 return RealCirc(Hexagon::L2_loadruh_pci,
true, 4);
1507 case Hexagon::PS_loadrh_pci:
1508 return RealCirc(Hexagon::L2_loadrh_pci,
true, 4);
1509 case Hexagon::PS_loadri_pci:
1510 return RealCirc(Hexagon::L2_loadri_pci,
true, 4);
1511 case Hexagon::PS_loadrd_pci:
1512 return RealCirc(Hexagon::L2_loadrd_pci,
true, 4);
1513 case Hexagon::PS_loadrub_pcr:
1514 return RealCirc(Hexagon::L2_loadrub_pcr,
false, 3);
1515 case Hexagon::PS_loadrb_pcr:
1516 return RealCirc(Hexagon::L2_loadrb_pcr,
false, 3);
1517 case Hexagon::PS_loadruh_pcr:
1518 return RealCirc(Hexagon::L2_loadruh_pcr,
false, 3);
1519 case Hexagon::PS_loadrh_pcr:
1520 return RealCirc(Hexagon::L2_loadrh_pcr,
false, 3);
1521 case Hexagon::PS_loadri_pcr:
1522 return RealCirc(Hexagon::L2_loadri_pcr,
false, 3);
1523 case Hexagon::PS_loadrd_pcr:
1524 return RealCirc(Hexagon::L2_loadrd_pcr,
false, 3);
1525 case Hexagon::PS_storerb_pci:
1526 return RealCirc(Hexagon::S2_storerb_pci,
true, 3);
1527 case Hexagon::PS_storerh_pci:
1528 return RealCirc(Hexagon::S2_storerh_pci,
true, 3);
1529 case Hexagon::PS_storerf_pci:
1530 return RealCirc(Hexagon::S2_storerf_pci,
true, 3);
1531 case Hexagon::PS_storeri_pci:
1532 return RealCirc(Hexagon::S2_storeri_pci,
true, 3);
1533 case Hexagon::PS_storerd_pci:
1534 return RealCirc(Hexagon::S2_storerd_pci,
true, 3);
1535 case Hexagon::PS_storerb_pcr:
1536 return RealCirc(Hexagon::S2_storerb_pcr,
false, 2);
1537 case Hexagon::PS_storerh_pcr:
1538 return RealCirc(Hexagon::S2_storerh_pcr,
false, 2);
1539 case Hexagon::PS_storerf_pcr:
1540 return RealCirc(Hexagon::S2_storerf_pcr,
false, 2);
1541 case Hexagon::PS_storeri_pcr:
1542 return RealCirc(Hexagon::S2_storeri_pcr,
false, 2);
1543 case Hexagon::PS_storerd_pcr:
1544 return RealCirc(Hexagon::S2_storerd_pcr,
false, 2);
1554 unsigned Opc =
MI.getOpcode();
1558 case Hexagon::V6_vgather_vscatter_mh_pseudo:
1561 .
add(
MI.getOperand(2))
1562 .
add(
MI.getOperand(3))
1563 .
add(
MI.getOperand(4));
1565 .
add(
MI.getOperand(2))
1566 .
add(
MI.getOperand(3))
1567 .
add(
MI.getOperand(4))
1570 return First.getInstrIterator();
1571 case Hexagon::V6_vgathermh_pseudo:
1573 .
add(
MI.getOperand(2))
1574 .
add(
MI.getOperand(3))
1575 .
add(
MI.getOperand(4));
1577 .
add(
MI.getOperand(0))
1581 return First.getInstrIterator();
1583 case Hexagon::V6_vgathermw_pseudo:
1585 .
add(
MI.getOperand(2))
1586 .
add(
MI.getOperand(3))
1587 .
add(
MI.getOperand(4));
1589 .
add(
MI.getOperand(0))
1593 return First.getInstrIterator();
1595 case Hexagon::V6_vgathermhw_pseudo:
1597 .
add(
MI.getOperand(2))
1598 .
add(
MI.getOperand(3))
1599 .
add(
MI.getOperand(4));
1601 .
add(
MI.getOperand(0))
1605 return First.getInstrIterator();
1607 case Hexagon::V6_vgathermhq_pseudo:
1609 .
add(
MI.getOperand(2))
1610 .
add(
MI.getOperand(3))
1611 .
add(
MI.getOperand(4))
1612 .
add(
MI.getOperand(5));
1614 .
add(
MI.getOperand(0))
1618 return First.getInstrIterator();
1620 case Hexagon::V6_vgathermwq_pseudo:
1622 .
add(
MI.getOperand(2))
1623 .
add(
MI.getOperand(3))
1624 .
add(
MI.getOperand(4))
1625 .
add(
MI.getOperand(5));
1627 .
add(
MI.getOperand(0))
1631 return First.getInstrIterator();
1633 case Hexagon::V6_vgathermhwq_pseudo:
1635 .
add(
MI.getOperand(2))
1636 .
add(
MI.getOperand(3))
1637 .
add(
MI.getOperand(4))
1638 .
add(
MI.getOperand(5));
1640 .
add(
MI.getOperand(0))
1644 return First.getInstrIterator();
1647 return MI.getIterator();
1656 assert(
Cond[0].isImm() &&
"First entry in the cond vector not imm-val");
1657 unsigned opcode =
Cond[0].getImm();
1663 Cond[0].setImm(NewOpcode);
1697 int Opc =
MI.getOpcode();
1710 unsigned NOp = 0,
NumOps =
MI.getNumOperands();
1713 if (!
Op.isReg() || !
Op.isDef() ||
Op.isImplicit())
1720 unsigned PredRegPos, PredRegFlags;
1721 bool GotPredReg =
getPredReg(
Cond, PredReg, PredRegPos, PredRegFlags);
1724 T.addReg(PredReg, PredRegFlags);
1726 T.add(
MI.getOperand(NOp++));
1728 MI.setDesc(
get(PredOpc));
1729 while (
unsigned n =
MI.getNumOperands())
1730 MI.removeOperand(n-1);
1731 for (
unsigned i = 0, n =
T->getNumOperands(); i < n; ++i)
1732 MI.addOperand(
T->getOperand(i));
1738 MRI.clearKillFlags(PredReg);
1749 std::vector<MachineOperand> &Pred,
1750 bool SkipDead)
const {
1758 if (RC == &Hexagon::PredRegsRegClass) {
1763 }
else if (MO.isRegMask()) {
1764 for (
Register PR : Hexagon::PredRegsRegClass) {
1765 if (!
MI.modifiesRegister(PR, &HRI))
1776 if (!
MI.getDesc().isPredicable())
1780 if (!Subtarget.usePredicatedCalls())
1785 if (!Subtarget.hasV62Ops()) {
1786 switch (
MI.getOpcode()) {
1787 case Hexagon::V6_vL32b_ai:
1788 case Hexagon::V6_vL32b_pi:
1789 case Hexagon::V6_vL32b_ppu:
1790 case Hexagon::V6_vL32b_cur_ai:
1791 case Hexagon::V6_vL32b_cur_pi:
1792 case Hexagon::V6_vL32b_cur_ppu:
1793 case Hexagon::V6_vL32b_nt_ai:
1794 case Hexagon::V6_vL32b_nt_pi:
1795 case Hexagon::V6_vL32b_nt_ppu:
1796 case Hexagon::V6_vL32b_tmp_ai:
1797 case Hexagon::V6_vL32b_tmp_pi:
1798 case Hexagon::V6_vL32b_tmp_ppu:
1799 case Hexagon::V6_vL32b_nt_cur_ai:
1800 case Hexagon::V6_vL32b_nt_cur_pi:
1801 case Hexagon::V6_vL32b_nt_cur_ppu:
1802 case Hexagon::V6_vL32b_nt_tmp_ai:
1803 case Hexagon::V6_vL32b_nt_tmp_pi:
1804 case Hexagon::V6_vL32b_nt_tmp_ppu:
1820 if (
MI.isDebugInstr())
1830 for (
auto *
I :
MBB->successors())
1836 if (
MI.getDesc().isTerminator() ||
MI.isPosition())
1840 if (
MI.getOpcode() == TargetOpcode::INLINEASM_BR)
1864 bool atInsnStart =
true;
1867 for (; *Str; ++Str) {
1871 if (atInsnStart && !
isSpace(
static_cast<unsigned char>(*Str))) {
1873 atInsnStart =
false;
1877 atInsnStart =
false;
1900 int64_t &
Value)
const {
1901 unsigned Opc =
MI.getOpcode();
1905 case Hexagon::C2_cmpeq:
1906 case Hexagon::C2_cmpeqp:
1907 case Hexagon::C2_cmpgt:
1908 case Hexagon::C2_cmpgtp:
1909 case Hexagon::C2_cmpgtu:
1910 case Hexagon::C2_cmpgtup:
1911 case Hexagon::C4_cmpneq:
1912 case Hexagon::C4_cmplte:
1913 case Hexagon::C4_cmplteu:
1914 case Hexagon::C2_cmpeqi:
1915 case Hexagon::C2_cmpgti:
1916 case Hexagon::C2_cmpgtui:
1917 case Hexagon::C4_cmpneqi:
1918 case Hexagon::C4_cmplteui:
1919 case Hexagon::C4_cmpltei:
1920 SrcReg =
MI.getOperand(1).getReg();
1923 case Hexagon::A4_cmpbeq:
1924 case Hexagon::A4_cmpbgt:
1925 case Hexagon::A4_cmpbgtu:
1926 case Hexagon::A4_cmpbeqi:
1927 case Hexagon::A4_cmpbgti:
1928 case Hexagon::A4_cmpbgtui:
1929 SrcReg =
MI.getOperand(1).getReg();
1932 case Hexagon::A4_cmpheq:
1933 case Hexagon::A4_cmphgt:
1934 case Hexagon::A4_cmphgtu:
1935 case Hexagon::A4_cmpheqi:
1936 case Hexagon::A4_cmphgti:
1937 case Hexagon::A4_cmphgtui:
1938 SrcReg =
MI.getOperand(1).getReg();
1945 case Hexagon::C2_cmpeq:
1946 case Hexagon::C2_cmpeqp:
1947 case Hexagon::C2_cmpgt:
1948 case Hexagon::C2_cmpgtp:
1949 case Hexagon::C2_cmpgtu:
1950 case Hexagon::C2_cmpgtup:
1951 case Hexagon::A4_cmpbeq:
1952 case Hexagon::A4_cmpbgt:
1953 case Hexagon::A4_cmpbgtu:
1954 case Hexagon::A4_cmpheq:
1955 case Hexagon::A4_cmphgt:
1956 case Hexagon::A4_cmphgtu:
1957 case Hexagon::C4_cmpneq:
1958 case Hexagon::C4_cmplte:
1959 case Hexagon::C4_cmplteu:
1960 SrcReg2 =
MI.getOperand(2).getReg();
1964 case Hexagon::C2_cmpeqi:
1965 case Hexagon::C2_cmpgtui:
1966 case Hexagon::C2_cmpgti:
1967 case Hexagon::C4_cmpneqi:
1968 case Hexagon::C4_cmplteui:
1969 case Hexagon::C4_cmpltei:
1970 case Hexagon::A4_cmpbeqi:
1971 case Hexagon::A4_cmpbgti:
1972 case Hexagon::A4_cmpbgtui:
1973 case Hexagon::A4_cmpheqi:
1974 case Hexagon::A4_cmphgti:
1975 case Hexagon::A4_cmphgtui: {
1980 Value =
MI.getOperand(2).getImm();
1990 unsigned *PredCost)
const {
2016 unsigned BasePosA, OffsetPosA;
2024 unsigned BasePosB, OffsetPosB;
2031 if (BaseRegA != BaseRegB || BaseSubA != BaseSubB)
2049 if (OffsetA > OffsetB) {
2051 return SizeB <= OffDiff;
2053 if (OffsetA < OffsetB) {
2055 return SizeA <= OffDiff;
2065 unsigned BasePos = 0, OffsetPos = 0;
2073 }
else if (
MI.getOpcode() == Hexagon::A2_addi) {
2075 if (AddOp.isImm()) {
2076 Value = AddOp.getImm();
2084std::pair<unsigned, unsigned>
2094 static const std::pair<unsigned, const char*> Flags[] = {
2095 {MO_PCREL,
"hexagon-pcrel"},
2096 {MO_GOT,
"hexagon-got"},
2097 {MO_LO16,
"hexagon-lo16"},
2098 {MO_HI16,
"hexagon-hi16"},
2099 {MO_GPREL,
"hexagon-gprel"},
2100 {MO_GDGOT,
"hexagon-gdgot"},
2101 {MO_GDPLT,
"hexagon-gdplt"},
2102 {MO_IE,
"hexagon-ie"},
2103 {MO_IEGOT,
"hexagon-iegot"},
2104 {MO_TPREL,
"hexagon-tprel"}
2113 static const std::pair<unsigned, const char*> Flags[] = {
2114 {HMOTF_ConstExtended,
"hexagon-ext"}
2122 if (VT == MVT::i1) {
2123 TRC = &Hexagon::PredRegsRegClass;
2124 }
else if (VT == MVT::i32 || VT == MVT::f32) {
2125 TRC = &Hexagon::IntRegsRegClass;
2126 }
else if (VT == MVT::i64 || VT == MVT::f64) {
2127 TRC = &Hexagon::DoubleRegsRegClass;
2151 !
MI.getDesc().mayStore() &&
2152 MI.getDesc().getOpcode() != Hexagon::S2_allocframe &&
2153 MI.getDesc().getOpcode() != Hexagon::L2_deallocframe &&
2198 assert(MO.
isImm() &&
"Extendable operand must be Immediate type");
2202 int32_t SValue =
Value;
2205 return SValue < MinValue || SValue > MaxValue;
2210 return UValue < MinValue || UValue > MaxValue;
2214 switch (
MI.getOpcode()) {
2215 case Hexagon::L4_return:
2216 case Hexagon::L4_return_t:
2217 case Hexagon::L4_return_f:
2218 case Hexagon::L4_return_tnew_pnt:
2219 case Hexagon::L4_return_fnew_pnt:
2220 case Hexagon::L4_return_tnew_pt:
2221 case Hexagon::L4_return_fnew_pt:
2242 for (
auto &RegA : DefsA)
2243 for (
auto &RegB : UsesB) {
2260 switch (
MI.getOpcode()) {
2261 case Hexagon::V6_vL32b_cur_pi:
2262 case Hexagon::V6_vL32b_cur_ai:
2286 return (Opcode == Hexagon::ENDLOOP0 ||
2287 Opcode == Hexagon::ENDLOOP1);
2312 switch (
MI.getOpcode()) {
2314 case Hexagon::PS_fi:
2315 case Hexagon::PS_fia:
2340 unsigned Opcode =
MI.getOpcode();
2350 if (!
I.mayLoad() && !
I.mayStore())
2356 switch (
MI.getOpcode()) {
2357 case Hexagon::J2_callr:
2358 case Hexagon::J2_callrf:
2359 case Hexagon::J2_callrt:
2360 case Hexagon::PS_call_nr:
2367 switch (
MI.getOpcode()) {
2368 case Hexagon::L4_return:
2369 case Hexagon::L4_return_t:
2370 case Hexagon::L4_return_f:
2371 case Hexagon::L4_return_fnew_pnt:
2372 case Hexagon::L4_return_fnew_pt:
2373 case Hexagon::L4_return_tnew_pnt:
2374 case Hexagon::L4_return_tnew_pt:
2381 switch (
MI.getOpcode()) {
2382 case Hexagon::J2_jumpr:
2383 case Hexagon::J2_jumprt:
2384 case Hexagon::J2_jumprf:
2385 case Hexagon::J2_jumprtnewpt:
2386 case Hexagon::J2_jumprfnewpt:
2387 case Hexagon::J2_jumprtnew:
2388 case Hexagon::J2_jumprfnew:
2399 unsigned offset)
const {
2405 switch (
MI.getOpcode()) {
2409 case Hexagon::J2_jump:
2410 case Hexagon::J2_call:
2411 case Hexagon::PS_call_nr:
2413 case Hexagon::J2_jumpt:
2414 case Hexagon::J2_jumpf:
2415 case Hexagon::J2_jumptnew:
2416 case Hexagon::J2_jumptnewpt:
2417 case Hexagon::J2_jumpfnew:
2418 case Hexagon::J2_jumpfnewpt:
2419 case Hexagon::J2_callt:
2420 case Hexagon::J2_callf:
2422 case Hexagon::J2_loop0i:
2423 case Hexagon::J2_loop0iext:
2424 case Hexagon::J2_loop0r:
2425 case Hexagon::J2_loop0rext:
2426 case Hexagon::J2_loop1i:
2427 case Hexagon::J2_loop1iext:
2428 case Hexagon::J2_loop1r:
2429 case Hexagon::J2_loop1rext:
2432 case Hexagon::J4_cmpeqi_tp0_jump_nt:
2433 case Hexagon::J4_cmpeqi_tp1_jump_nt:
2434 case Hexagon::J4_cmpeqn1_tp0_jump_nt:
2435 case Hexagon::J4_cmpeqn1_tp1_jump_nt:
2447 unsigned Opcode =
MI.getOpcode();
2448 return Opcode == Hexagon::J2_loop0i ||
2449 Opcode == Hexagon::J2_loop0r ||
2450 Opcode == Hexagon::J2_loop0iext ||
2451 Opcode == Hexagon::J2_loop0rext ||
2452 Opcode == Hexagon::J2_loop1i ||
2453 Opcode == Hexagon::J2_loop1r ||
2454 Opcode == Hexagon::J2_loop1iext ||
2455 Opcode == Hexagon::J2_loop1rext;
2459 switch (
MI.getOpcode()) {
2460 default:
return false;
2461 case Hexagon::L4_iadd_memopw_io:
2462 case Hexagon::L4_isub_memopw_io:
2463 case Hexagon::L4_add_memopw_io:
2464 case Hexagon::L4_sub_memopw_io:
2465 case Hexagon::L4_and_memopw_io:
2466 case Hexagon::L4_or_memopw_io:
2467 case Hexagon::L4_iadd_memoph_io:
2468 case Hexagon::L4_isub_memoph_io:
2469 case Hexagon::L4_add_memoph_io:
2470 case Hexagon::L4_sub_memoph_io:
2471 case Hexagon::L4_and_memoph_io:
2472 case Hexagon::L4_or_memoph_io:
2473 case Hexagon::L4_iadd_memopb_io:
2474 case Hexagon::L4_isub_memopb_io:
2475 case Hexagon::L4_add_memopb_io:
2476 case Hexagon::L4_sub_memopb_io:
2477 case Hexagon::L4_and_memopb_io:
2478 case Hexagon::L4_or_memopb_io:
2479 case Hexagon::L4_ior_memopb_io:
2480 case Hexagon::L4_ior_memoph_io:
2481 case Hexagon::L4_ior_memopw_io:
2482 case Hexagon::L4_iand_memopb_io:
2483 case Hexagon::L4_iand_memoph_io:
2484 case Hexagon::L4_iand_memopw_io:
2524 unsigned OperandNum)
const {
2574 return MI.getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4 ||
2575 MI.getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4_EXT ||
2576 MI.getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4_PIC ||
2577 MI.getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4_EXT_PIC;
2581 switch (
MI.getOpcode()) {
2583 case Hexagon::L2_loadrb_io:
2584 case Hexagon::L4_loadrb_ur:
2585 case Hexagon::L4_loadrb_ap:
2586 case Hexagon::L2_loadrb_pr:
2587 case Hexagon::L2_loadrb_pbr:
2588 case Hexagon::L2_loadrb_pi:
2589 case Hexagon::L2_loadrb_pci:
2590 case Hexagon::L2_loadrb_pcr:
2591 case Hexagon::L2_loadbsw2_io:
2592 case Hexagon::L4_loadbsw2_ur:
2593 case Hexagon::L4_loadbsw2_ap:
2594 case Hexagon::L2_loadbsw2_pr:
2595 case Hexagon::L2_loadbsw2_pbr:
2596 case Hexagon::L2_loadbsw2_pi:
2597 case Hexagon::L2_loadbsw2_pci:
2598 case Hexagon::L2_loadbsw2_pcr:
2599 case Hexagon::L2_loadbsw4_io:
2600 case Hexagon::L4_loadbsw4_ur:
2601 case Hexagon::L4_loadbsw4_ap:
2602 case Hexagon::L2_loadbsw4_pr:
2603 case Hexagon::L2_loadbsw4_pbr:
2604 case Hexagon::L2_loadbsw4_pi:
2605 case Hexagon::L2_loadbsw4_pci:
2606 case Hexagon::L2_loadbsw4_pcr:
2607 case Hexagon::L4_loadrb_rr:
2608 case Hexagon::L2_ploadrbt_io:
2609 case Hexagon::L2_ploadrbt_pi:
2610 case Hexagon::L2_ploadrbf_io:
2611 case Hexagon::L2_ploadrbf_pi:
2612 case Hexagon::L2_ploadrbtnew_io:
2613 case Hexagon::L2_ploadrbfnew_io:
2614 case Hexagon::L4_ploadrbt_rr:
2615 case Hexagon::L4_ploadrbf_rr:
2616 case Hexagon::L4_ploadrbtnew_rr:
2617 case Hexagon::L4_ploadrbfnew_rr:
2618 case Hexagon::L2_ploadrbtnew_pi:
2619 case Hexagon::L2_ploadrbfnew_pi:
2620 case Hexagon::L4_ploadrbt_abs:
2621 case Hexagon::L4_ploadrbf_abs:
2622 case Hexagon::L4_ploadrbtnew_abs:
2623 case Hexagon::L4_ploadrbfnew_abs:
2624 case Hexagon::L2_loadrbgp:
2626 case Hexagon::L2_loadrh_io:
2627 case Hexagon::L4_loadrh_ur:
2628 case Hexagon::L4_loadrh_ap:
2629 case Hexagon::L2_loadrh_pr:
2630 case Hexagon::L2_loadrh_pbr:
2631 case Hexagon::L2_loadrh_pi:
2632 case Hexagon::L2_loadrh_pci:
2633 case Hexagon::L2_loadrh_pcr:
2634 case Hexagon::L4_loadrh_rr:
2635 case Hexagon::L2_ploadrht_io:
2636 case Hexagon::L2_ploadrht_pi:
2637 case Hexagon::L2_ploadrhf_io:
2638 case Hexagon::L2_ploadrhf_pi:
2639 case Hexagon::L2_ploadrhtnew_io:
2640 case Hexagon::L2_ploadrhfnew_io:
2641 case Hexagon::L4_ploadrht_rr:
2642 case Hexagon::L4_ploadrhf_rr:
2643 case Hexagon::L4_ploadrhtnew_rr:
2644 case Hexagon::L4_ploadrhfnew_rr:
2645 case Hexagon::L2_ploadrhtnew_pi:
2646 case Hexagon::L2_ploadrhfnew_pi:
2647 case Hexagon::L4_ploadrht_abs:
2648 case Hexagon::L4_ploadrhf_abs:
2649 case Hexagon::L4_ploadrhtnew_abs:
2650 case Hexagon::L4_ploadrhfnew_abs:
2651 case Hexagon::L2_loadrhgp:
2664 switch (
MI.getOpcode()) {
2665 case Hexagon::STriw_pred:
2666 case Hexagon::LDriw_pred:
2677 for (
auto &
Op :
MI.operands())
2678 if (
Op.isGlobal() ||
Op.isSymbol())
2685 unsigned SchedClass =
MI.getDesc().getSchedClass();
2686 return is_TC1(SchedClass);
2690 unsigned SchedClass =
MI.getDesc().getSchedClass();
2691 return is_TC2(SchedClass);
2695 unsigned SchedClass =
MI.getDesc().getSchedClass();
2700 unsigned SchedClass =
MI.getDesc().getSchedClass();
2711 for (
int I = 0;
I <
N;
I++)
2716 if (MI2.
getOpcode() == Hexagon::V6_vS32b_pi)
2777 case Hexagon::PS_vstorerq_ai:
2778 case Hexagon::PS_vstorerv_ai:
2779 case Hexagon::PS_vstorerw_ai:
2780 case Hexagon::PS_vstorerw_nt_ai:
2781 case Hexagon::PS_vloadrq_ai:
2782 case Hexagon::PS_vloadrv_ai:
2783 case Hexagon::PS_vloadrw_ai:
2784 case Hexagon::PS_vloadrw_nt_ai:
2785 case Hexagon::V6_vL32b_ai:
2786 case Hexagon::V6_vS32b_ai:
2787 case Hexagon::V6_vS32b_pred_ai:
2788 case Hexagon::V6_vS32b_npred_ai:
2789 case Hexagon::V6_vS32b_qpred_ai:
2790 case Hexagon::V6_vS32b_nqpred_ai:
2791 case Hexagon::V6_vS32b_new_ai:
2792 case Hexagon::V6_vS32b_new_pred_ai:
2793 case Hexagon::V6_vS32b_new_npred_ai:
2794 case Hexagon::V6_vS32b_nt_pred_ai:
2795 case Hexagon::V6_vS32b_nt_npred_ai:
2796 case Hexagon::V6_vS32b_nt_new_ai:
2797 case Hexagon::V6_vS32b_nt_new_pred_ai:
2798 case Hexagon::V6_vS32b_nt_new_npred_ai:
2799 case Hexagon::V6_vS32b_nt_qpred_ai:
2800 case Hexagon::V6_vS32b_nt_nqpred_ai:
2801 case Hexagon::V6_vL32b_nt_ai:
2802 case Hexagon::V6_vS32b_nt_ai:
2803 case Hexagon::V6_vL32Ub_ai:
2804 case Hexagon::V6_vS32Ub_ai:
2805 case Hexagon::V6_vL32b_cur_ai:
2806 case Hexagon::V6_vL32b_tmp_ai:
2807 case Hexagon::V6_vL32b_pred_ai:
2808 case Hexagon::V6_vL32b_npred_ai:
2809 case Hexagon::V6_vL32b_cur_pred_ai:
2810 case Hexagon::V6_vL32b_cur_npred_ai:
2811 case Hexagon::V6_vL32b_tmp_pred_ai:
2812 case Hexagon::V6_vL32b_tmp_npred_ai:
2813 case Hexagon::V6_vL32b_nt_cur_ai:
2814 case Hexagon::V6_vL32b_nt_tmp_ai:
2815 case Hexagon::V6_vL32b_nt_pred_ai:
2816 case Hexagon::V6_vL32b_nt_npred_ai:
2817 case Hexagon::V6_vL32b_nt_cur_pred_ai:
2818 case Hexagon::V6_vL32b_nt_cur_npred_ai:
2819 case Hexagon::V6_vL32b_nt_tmp_pred_ai:
2820 case Hexagon::V6_vL32b_nt_tmp_npred_ai:
2821 case Hexagon::V6_vS32Ub_npred_ai:
2822 case Hexagon::V6_vgathermh_pseudo:
2823 case Hexagon::V6_vgather_vscatter_mh_pseudo:
2824 case Hexagon::V6_vgathermw_pseudo:
2825 case Hexagon::V6_vgathermhw_pseudo:
2826 case Hexagon::V6_vgathermhq_pseudo:
2827 case Hexagon::V6_vgathermwq_pseudo:
2828 case Hexagon::V6_vgathermhwq_pseudo: {
2829 unsigned VectorSize =
TRI->getSpillSize(Hexagon::HvxVRRegClass);
2831 if (
Offset & (VectorSize-1))
2836 case Hexagon::J2_loop0i:
2837 case Hexagon::J2_loop1i:
2840 case Hexagon::S4_storeirb_io:
2841 case Hexagon::S4_storeirbt_io:
2842 case Hexagon::S4_storeirbf_io:
2845 case Hexagon::S4_storeirh_io:
2846 case Hexagon::S4_storeirht_io:
2847 case Hexagon::S4_storeirhf_io:
2850 case Hexagon::S4_storeiri_io:
2851 case Hexagon::S4_storeirit_io:
2852 case Hexagon::S4_storeirif_io:
2855 case Hexagon::A4_cmpbeqi:
2857 case Hexagon::A4_cmpbgti:
2865 case Hexagon::L2_loadri_io:
2866 case Hexagon::S2_storeri_io:
2870 case Hexagon::L2_loadrd_io:
2871 case Hexagon::S2_storerd_io:
2875 case Hexagon::L2_loadrh_io:
2876 case Hexagon::L2_loadruh_io:
2877 case Hexagon::S2_storerh_io:
2878 case Hexagon::S2_storerf_io:
2882 case Hexagon::L2_loadrb_io:
2883 case Hexagon::L2_loadrub_io:
2884 case Hexagon::S2_storerb_io:
2888 case Hexagon::A2_addi:
2892 case Hexagon::L4_iadd_memopw_io:
2893 case Hexagon::L4_isub_memopw_io:
2894 case Hexagon::L4_add_memopw_io:
2895 case Hexagon::L4_sub_memopw_io:
2896 case Hexagon::L4_iand_memopw_io:
2897 case Hexagon::L4_ior_memopw_io:
2898 case Hexagon::L4_and_memopw_io:
2899 case Hexagon::L4_or_memopw_io:
2902 case Hexagon::L4_iadd_memoph_io:
2903 case Hexagon::L4_isub_memoph_io:
2904 case Hexagon::L4_add_memoph_io:
2905 case Hexagon::L4_sub_memoph_io:
2906 case Hexagon::L4_iand_memoph_io:
2907 case Hexagon::L4_ior_memoph_io:
2908 case Hexagon::L4_and_memoph_io:
2909 case Hexagon::L4_or_memoph_io:
2912 case Hexagon::L4_iadd_memopb_io:
2913 case Hexagon::L4_isub_memopb_io:
2914 case Hexagon::L4_add_memopb_io:
2915 case Hexagon::L4_sub_memopb_io:
2916 case Hexagon::L4_iand_memopb_io:
2917 case Hexagon::L4_ior_memopb_io:
2918 case Hexagon::L4_and_memopb_io:
2919 case Hexagon::L4_or_memopb_io:
2924 case Hexagon::STriw_pred:
2925 case Hexagon::LDriw_pred:
2926 case Hexagon::STriw_ctr:
2927 case Hexagon::LDriw_ctr:
2930 case Hexagon::PS_fi:
2931 case Hexagon::PS_fia:
2932 case Hexagon::INLINEASM:
2935 case Hexagon::L2_ploadrbt_io:
2936 case Hexagon::L2_ploadrbf_io:
2937 case Hexagon::L2_ploadrubt_io:
2938 case Hexagon::L2_ploadrubf_io:
2939 case Hexagon::S2_pstorerbt_io:
2940 case Hexagon::S2_pstorerbf_io:
2943 case Hexagon::L2_ploadrht_io:
2944 case Hexagon::L2_ploadrhf_io:
2945 case Hexagon::L2_ploadruht_io:
2946 case Hexagon::L2_ploadruhf_io:
2947 case Hexagon::S2_pstorerht_io:
2948 case Hexagon::S2_pstorerhf_io:
2951 case Hexagon::L2_ploadrit_io:
2952 case Hexagon::L2_ploadrif_io:
2953 case Hexagon::S2_pstorerit_io:
2954 case Hexagon::S2_pstorerif_io:
2957 case Hexagon::L2_ploadrdt_io:
2958 case Hexagon::L2_ploadrdf_io:
2959 case Hexagon::S2_pstorerdt_io:
2960 case Hexagon::S2_pstorerdf_io:
2963 case Hexagon::L2_loadbsw2_io:
2964 case Hexagon::L2_loadbzw2_io:
2967 case Hexagon::L2_loadbsw4_io:
2968 case Hexagon::L2_loadbzw4_io:
2972 dbgs() <<
"Failed Opcode is : " << Opcode <<
" (" <<
getName(Opcode)
2975 "Please define it in the above switch statement!");
3005 switch (
MI.getOpcode()) {
3007 case Hexagon::L2_loadrub_io:
3008 case Hexagon::L4_loadrub_ur:
3009 case Hexagon::L4_loadrub_ap:
3010 case Hexagon::L2_loadrub_pr:
3011 case Hexagon::L2_loadrub_pbr:
3012 case Hexagon::L2_loadrub_pi:
3013 case Hexagon::L2_loadrub_pci:
3014 case Hexagon::L2_loadrub_pcr:
3015 case Hexagon::L2_loadbzw2_io:
3016 case Hexagon::L4_loadbzw2_ur:
3017 case Hexagon::L4_loadbzw2_ap:
3018 case Hexagon::L2_loadbzw2_pr:
3019 case Hexagon::L2_loadbzw2_pbr:
3020 case Hexagon::L2_loadbzw2_pi:
3021 case Hexagon::L2_loadbzw2_pci:
3022 case Hexagon::L2_loadbzw2_pcr:
3023 case Hexagon::L2_loadbzw4_io:
3024 case Hexagon::L4_loadbzw4_ur:
3025 case Hexagon::L4_loadbzw4_ap:
3026 case Hexagon::L2_loadbzw4_pr:
3027 case Hexagon::L2_loadbzw4_pbr:
3028 case Hexagon::L2_loadbzw4_pi:
3029 case Hexagon::L2_loadbzw4_pci:
3030 case Hexagon::L2_loadbzw4_pcr:
3031 case Hexagon::L4_loadrub_rr:
3032 case Hexagon::L2_ploadrubt_io:
3033 case Hexagon::L2_ploadrubt_pi:
3034 case Hexagon::L2_ploadrubf_io:
3035 case Hexagon::L2_ploadrubf_pi:
3036 case Hexagon::L2_ploadrubtnew_io:
3037 case Hexagon::L2_ploadrubfnew_io:
3038 case Hexagon::L4_ploadrubt_rr:
3039 case Hexagon::L4_ploadrubf_rr:
3040 case Hexagon::L4_ploadrubtnew_rr:
3041 case Hexagon::L4_ploadrubfnew_rr:
3042 case Hexagon::L2_ploadrubtnew_pi:
3043 case Hexagon::L2_ploadrubfnew_pi:
3044 case Hexagon::L4_ploadrubt_abs:
3045 case Hexagon::L4_ploadrubf_abs:
3046 case Hexagon::L4_ploadrubtnew_abs:
3047 case Hexagon::L4_ploadrubfnew_abs:
3048 case Hexagon::L2_loadrubgp:
3050 case Hexagon::L2_loadruh_io:
3051 case Hexagon::L4_loadruh_ur:
3052 case Hexagon::L4_loadruh_ap:
3053 case Hexagon::L2_loadruh_pr:
3054 case Hexagon::L2_loadruh_pbr:
3055 case Hexagon::L2_loadruh_pi:
3056 case Hexagon::L2_loadruh_pci:
3057 case Hexagon::L2_loadruh_pcr:
3058 case Hexagon::L4_loadruh_rr:
3059 case Hexagon::L2_ploadruht_io:
3060 case Hexagon::L2_ploadruht_pi:
3061 case Hexagon::L2_ploadruhf_io:
3062 case Hexagon::L2_ploadruhf_pi:
3063 case Hexagon::L2_ploadruhtnew_io:
3064 case Hexagon::L2_ploadruhfnew_io:
3065 case Hexagon::L4_ploadruht_rr:
3066 case Hexagon::L4_ploadruhf_rr:
3067 case Hexagon::L4_ploadruhtnew_rr:
3068 case Hexagon::L4_ploadruhfnew_rr:
3069 case Hexagon::L2_ploadruhtnew_pi:
3070 case Hexagon::L2_ploadruhfnew_pi:
3071 case Hexagon::L4_ploadruht_abs:
3072 case Hexagon::L4_ploadruhf_abs:
3073 case Hexagon::L4_ploadruhtnew_abs:
3074 case Hexagon::L4_ploadruhfnew_abs:
3075 case Hexagon::L2_loadruhgp:
3096 OffsetIsScalable =
false;
3098 if (!BaseOp || !BaseOp->
isReg())
3107 if (Second.
mayStore() &&
First.getOpcode() == Hexagon::S2_allocframe) {
3109 if (
Op.isReg() &&
Op.isUse() &&
Op.getReg() == Hexagon::R29)
3119 if (!Stored.
isReg())
3121 for (
unsigned i = 0, e =
First.getNumOperands(); i < e; ++i) {
3123 if (
Op.isReg() &&
Op.isDef() &&
Op.getReg() == Stored.
getReg())
3132 return Opc == Hexagon::PS_call_nr ||
Opc == Hexagon::PS_callr_nr;
3148 if (Hexagon::getRegForm(
MI.getOpcode()) >= 0)
3151 if (
MI.getDesc().mayLoad() ||
MI.getDesc().mayStore()) {
3158 NonExtOpcode = Hexagon::changeAddrMode_abs_io(
MI.getOpcode());
3164 NonExtOpcode = Hexagon::changeAddrMode_io_rr(
MI.getOpcode());
3167 NonExtOpcode = Hexagon::changeAddrMode_ur_rr(
MI.getOpcode());
3172 if (NonExtOpcode < 0)
3180 return Hexagon::getRealHWInstr(
MI.getOpcode(),
3181 Hexagon::InstrType_Pseudo) >= 0;
3199 Subtarget.hasV60Ops();
3204 if (
MI.mayStore() && !Subtarget.useNewValueStores())
3238 if (!MII->isBundle())
3241 for (++MII; MII != MIE && MII->isInsideBundle(); ++MII) {
3253 if (MO.isRegMask() && MO.clobbersPhysReg(PredReg))
3255 if (MO.isReg() && MO.isDef() && MO.isImplicit() && (MO.getReg() == PredReg))
3261 switch (
MI.getOpcode()) {
3262 case Hexagon::A4_addp_c:
3263 case Hexagon::A4_subp_c:
3264 case Hexagon::A4_tlbmatch:
3265 case Hexagon::A5_ACS:
3266 case Hexagon::F2_sfinvsqrta:
3267 case Hexagon::F2_sfrecipa:
3268 case Hexagon::J2_endloop0:
3269 case Hexagon::J2_endloop01:
3270 case Hexagon::J2_ploop1si:
3271 case Hexagon::J2_ploop1sr:
3272 case Hexagon::J2_ploop2si:
3273 case Hexagon::J2_ploop2sr:
3274 case Hexagon::J2_ploop3si:
3275 case Hexagon::J2_ploop3sr:
3276 case Hexagon::S2_cabacdecbin:
3277 case Hexagon::S2_storew_locked:
3278 case Hexagon::S4_stored_locked:
3285 return Opcode == Hexagon::J2_jumpt ||
3286 Opcode == Hexagon::J2_jumptpt ||
3287 Opcode == Hexagon::J2_jumpf ||
3288 Opcode == Hexagon::J2_jumpfpt ||
3289 Opcode == Hexagon::J2_jumptnew ||
3290 Opcode == Hexagon::J2_jumpfnew ||
3291 Opcode == Hexagon::J2_jumptnewpt ||
3292 Opcode == Hexagon::J2_jumpfnewpt;
3321 unsigned BasePos = 0, OffsetPos = 0;
3344 unsigned &BasePos,
unsigned &OffsetPos)
const {
3352 }
else if (
MI.mayStore()) {
3355 }
else if (
MI.mayLoad()) {
3370 if (!
MI.getOperand(BasePos).isReg() || !
MI.getOperand(OffsetPos).isImm())
3385 if (
I ==
MBB.instr_begin())
3404 }
while (
I !=
MBB.instr_begin());
3406 I =
MBB.instr_end();
3409 while (
I->isDebugInstr()) {
3410 if (
I ==
MBB.instr_begin())
3414 if (!isUnpredicatedTerminator(*
I))
3423 if (&*
I != LastInst && !
I->isBundle() && isUnpredicatedTerminator(*
I)) {
3424 if (!SecondLastInst) {
3425 SecondLastInst = &*
I;
3430 if (
I ==
MBB.instr_begin())
3447 Register DstReg, SrcReg, Src1Reg, Src2Reg;
3449 switch (
MI.getOpcode()) {
3458 case Hexagon::C2_cmpeq:
3459 case Hexagon::C2_cmpgt:
3460 case Hexagon::C2_cmpgtu:
3461 DstReg =
MI.getOperand(0).getReg();
3462 Src1Reg =
MI.getOperand(1).getReg();
3463 Src2Reg =
MI.getOperand(2).getReg();
3464 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3465 (Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
3469 case Hexagon::C2_cmpeqi:
3470 case Hexagon::C2_cmpgti:
3471 case Hexagon::C2_cmpgtui:
3473 DstReg =
MI.getOperand(0).getReg();
3474 SrcReg =
MI.getOperand(1).getReg();
3475 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3476 (Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
3479 (
MI.getOperand(2).getImm() == -1)))
3482 case Hexagon::A2_tfr:
3484 DstReg =
MI.getOperand(0).getReg();
3485 SrcReg =
MI.getOperand(1).getReg();
3489 case Hexagon::A2_tfrsi:
3493 DstReg =
MI.getOperand(0).getReg();
3497 case Hexagon::S2_tstbit_i:
3498 DstReg =
MI.getOperand(0).getReg();
3499 Src1Reg =
MI.getOperand(1).getReg();
3500 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3501 (Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
3502 MI.getOperand(2).isImm() &&
3510 case Hexagon::J2_jumptnew:
3511 case Hexagon::J2_jumpfnew:
3512 case Hexagon::J2_jumptnewpt:
3513 case Hexagon::J2_jumpfnewpt:
3514 Src1Reg =
MI.getOperand(0).getReg();
3515 if (Hexagon::PredRegsRegClass.
contains(Src1Reg) &&
3516 (Hexagon::P0 == Src1Reg || Hexagon::P1 == Src1Reg))
3523 case Hexagon::J2_jump:
3524 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4:
3525 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4_PIC:
3537 if ((GA.
getOpcode() != Hexagon::C2_cmpeqi) ||
3538 (GB.
getOpcode() != Hexagon::J2_jumptnew))
3543 if (DestReg != Hexagon::P0 && DestReg != Hexagon::P1)
3551 return DestReg == Hexagon::P0 ? Hexagon::J4_cmpeqn1_tp0_jump_nt
3552 : Hexagon::J4_cmpeqn1_tp1_jump_nt;
3555 return DestReg == Hexagon::P0 ? Hexagon::J4_cmpeqi_tp0_jump_nt
3556 : Hexagon::J4_cmpeqi_tp1_jump_nt;
3561 bool ForBigCore)
const {
3569 static const std::map<unsigned, unsigned> DupMap = {
3570 {Hexagon::A2_add, Hexagon::dup_A2_add},
3571 {Hexagon::A2_addi, Hexagon::dup_A2_addi},
3572 {Hexagon::A2_andir, Hexagon::dup_A2_andir},
3573 {Hexagon::A2_combineii, Hexagon::dup_A2_combineii},
3574 {Hexagon::A2_sxtb, Hexagon::dup_A2_sxtb},
3575 {Hexagon::A2_sxth, Hexagon::dup_A2_sxth},
3576 {Hexagon::A2_tfr, Hexagon::dup_A2_tfr},
3577 {Hexagon::A2_tfrsi, Hexagon::dup_A2_tfrsi},
3578 {Hexagon::A2_zxtb, Hexagon::dup_A2_zxtb},
3579 {Hexagon::A2_zxth, Hexagon::dup_A2_zxth},
3580 {Hexagon::A4_combineii, Hexagon::dup_A4_combineii},
3581 {Hexagon::A4_combineir, Hexagon::dup_A4_combineir},
3582 {Hexagon::A4_combineri, Hexagon::dup_A4_combineri},
3583 {Hexagon::C2_cmoveif, Hexagon::dup_C2_cmoveif},
3584 {Hexagon::C2_cmoveit, Hexagon::dup_C2_cmoveit},
3585 {Hexagon::C2_cmovenewif, Hexagon::dup_C2_cmovenewif},
3586 {Hexagon::C2_cmovenewit, Hexagon::dup_C2_cmovenewit},
3587 {Hexagon::C2_cmpeqi, Hexagon::dup_C2_cmpeqi},
3588 {Hexagon::L2_deallocframe, Hexagon::dup_L2_deallocframe},
3589 {Hexagon::L2_loadrb_io, Hexagon::dup_L2_loadrb_io},
3590 {Hexagon::L2_loadrd_io, Hexagon::dup_L2_loadrd_io},
3591 {Hexagon::L2_loadrh_io, Hexagon::dup_L2_loadrh_io},
3592 {Hexagon::L2_loadri_io, Hexagon::dup_L2_loadri_io},
3593 {Hexagon::L2_loadrub_io, Hexagon::dup_L2_loadrub_io},
3594 {Hexagon::L2_loadruh_io, Hexagon::dup_L2_loadruh_io},
3595 {Hexagon::S2_allocframe, Hexagon::dup_S2_allocframe},
3596 {Hexagon::S2_storerb_io, Hexagon::dup_S2_storerb_io},
3597 {Hexagon::S2_storerd_io, Hexagon::dup_S2_storerd_io},
3598 {Hexagon::S2_storerh_io, Hexagon::dup_S2_storerh_io},
3599 {Hexagon::S2_storeri_io, Hexagon::dup_S2_storeri_io},
3600 {Hexagon::S4_storeirb_io, Hexagon::dup_S4_storeirb_io},
3601 {Hexagon::S4_storeiri_io, Hexagon::dup_S4_storeiri_io},
3603 unsigned OpNum =
MI.getOpcode();
3606 auto Iter = DupMap.find(OpNum);
3607 if (Iter != DupMap.end())
3608 return Iter->second;
3610 for (
const auto &Iter : DupMap)
3611 if (Iter.second == OpNum)
3618 enum Hexagon::PredSense inPredSense;
3619 inPredSense = invertPredicate ? Hexagon::PredSense_false :
3620 Hexagon::PredSense_true;
3621 int CondOpcode = Hexagon::getPredOpcode(
Opc, inPredSense);
3622 if (CondOpcode >= 0)
3630 switch (
MI.getOpcode()) {
3632 case Hexagon::V6_vL32b_pi:
3633 return Hexagon::V6_vL32b_cur_pi;
3634 case Hexagon::V6_vL32b_ai:
3635 return Hexagon::V6_vL32b_cur_ai;
3636 case Hexagon::V6_vL32b_nt_pi:
3637 return Hexagon::V6_vL32b_nt_cur_pi;
3638 case Hexagon::V6_vL32b_nt_ai:
3639 return Hexagon::V6_vL32b_nt_cur_ai;
3640 case Hexagon::V6_vL32b_ppu:
3641 return Hexagon::V6_vL32b_cur_ppu;
3642 case Hexagon::V6_vL32b_nt_ppu:
3643 return Hexagon::V6_vL32b_nt_cur_ppu;
3650 switch (
MI.getOpcode()) {
3652 case Hexagon::V6_vL32b_cur_pi:
3653 return Hexagon::V6_vL32b_pi;
3654 case Hexagon::V6_vL32b_cur_ai:
3655 return Hexagon::V6_vL32b_ai;
3656 case Hexagon::V6_vL32b_nt_cur_pi:
3657 return Hexagon::V6_vL32b_nt_pi;
3658 case Hexagon::V6_vL32b_nt_cur_ai:
3659 return Hexagon::V6_vL32b_nt_ai;
3660 case Hexagon::V6_vL32b_cur_ppu:
3661 return Hexagon::V6_vL32b_ppu;
3662 case Hexagon::V6_vL32b_nt_cur_ppu:
3663 return Hexagon::V6_vL32b_nt_ppu;
3751 int NVOpcode = Hexagon::getNewValueOpcode(
MI.getOpcode());
3755 switch (
MI.getOpcode()) {
3758 std::to_string(
MI.getOpcode()));
3759 case Hexagon::S4_storerb_ur:
3760 return Hexagon::S4_storerbnew_ur;
3762 case Hexagon::S2_storerb_pci:
3763 return Hexagon::S2_storerb_pci;
3765 case Hexagon::S2_storeri_pci:
3766 return Hexagon::S2_storeri_pci;
3768 case Hexagon::S2_storerh_pci:
3769 return Hexagon::S2_storerh_pci;
3771 case Hexagon::S2_storerd_pci:
3772 return Hexagon::S2_storerd_pci;
3774 case Hexagon::S2_storerf_pci:
3775 return Hexagon::S2_storerf_pci;
3777 case Hexagon::V6_vS32b_ai:
3778 return Hexagon::V6_vS32b_new_ai;
3780 case Hexagon::V6_vS32b_pi:
3781 return Hexagon::V6_vS32b_new_pi;
3806 if (BrTarget.
isMBB()) {
3808 Taken = getEdgeProbability(Src, Dst) >= OneHalf;
3821 bool SawCond =
false, Bad =
false;
3825 if (
I.isConditionalBranch()) {
3832 if (
I.isUnconditionalBranch() && !SawCond) {
3840 if (NextIt ==
B.instr_end()) {
3843 if (!
B.isLayoutSuccessor(SB))
3845 Taken = getEdgeProbability(Src, SB) < OneHalf;
3849 assert(NextIt->isUnconditionalBranch());
3858 Taken =
BT && getEdgeProbability(Src,
BT) < OneHalf;
3865 switch (
MI.getOpcode()) {
3866 case Hexagon::J2_jumpt:
3867 return Taken ? Hexagon::J2_jumptnewpt : Hexagon::J2_jumptnew;
3868 case Hexagon::J2_jumpf:
3869 return Taken ? Hexagon::J2_jumpfnewpt : Hexagon::J2_jumpfnew;
3879 switch (
MI.getOpcode()) {
3881 case Hexagon::J2_jumpt:
3882 case Hexagon::J2_jumpf:
3886 int NewOpcode = Hexagon::getPredNewOpcode(
MI.getOpcode());
3893 int NewOp =
MI.getOpcode();
3895 NewOp = Hexagon::getPredOldOpcode(NewOp);
3899 if (!Subtarget.hasFeature(Hexagon::ArchV60)) {
3901 case Hexagon::J2_jumptpt:
3902 NewOp = Hexagon::J2_jumpt;
3904 case Hexagon::J2_jumpfpt:
3905 NewOp = Hexagon::J2_jumpf;
3907 case Hexagon::J2_jumprtpt:
3908 NewOp = Hexagon::J2_jumprt;
3910 case Hexagon::J2_jumprfpt:
3911 NewOp = Hexagon::J2_jumprf;
3916 "Couldn't change predicate new instruction to its old form.");
3920 NewOp = Hexagon::getNonNVStore(NewOp);
3921 assert(NewOp >= 0 &&
"Couldn't change new-value store to its old form.");
3924 if (Subtarget.hasV60Ops())
3929 case Hexagon::J2_jumpfpt:
3930 return Hexagon::J2_jumpf;
3931 case Hexagon::J2_jumptpt:
3932 return Hexagon::J2_jumpt;
3933 case Hexagon::J2_jumprfpt:
3934 return Hexagon::J2_jumprf;
3935 case Hexagon::J2_jumprtpt:
3936 return Hexagon::J2_jumprt;
3945 Register DstReg, SrcReg, Src1Reg, Src2Reg;
3948 switch (
MI.getOpcode()) {
3956 case Hexagon::L2_loadri_io:
3957 case Hexagon::dup_L2_loadri_io:
3958 DstReg =
MI.getOperand(0).getReg();
3959 SrcReg =
MI.getOperand(1).getReg();
3963 if (Hexagon::IntRegsRegClass.
contains(SrcReg) &&
3965 MI.getOperand(2).isImm() &&
3970 (
MI.getOperand(2).isImm() &&
3975 case Hexagon::L2_loadrub_io:
3976 case Hexagon::dup_L2_loadrub_io:
3978 DstReg =
MI.getOperand(0).getReg();
3979 SrcReg =
MI.getOperand(1).getReg();
3981 MI.getOperand(2).isImm() &&
isUInt<4>(
MI.getOperand(2).getImm()))
3994 case Hexagon::L2_loadrh_io:
3995 case Hexagon::L2_loadruh_io:
3996 case Hexagon::dup_L2_loadrh_io:
3997 case Hexagon::dup_L2_loadruh_io:
3999 DstReg =
MI.getOperand(0).getReg();
4000 SrcReg =
MI.getOperand(1).getReg();
4002 MI.getOperand(2).isImm() &&
4006 case Hexagon::L2_loadrb_io:
4007 case Hexagon::dup_L2_loadrb_io:
4009 DstReg =
MI.getOperand(0).getReg();
4010 SrcReg =
MI.getOperand(1).getReg();
4012 MI.getOperand(2).isImm() &&
4016 case Hexagon::L2_loadrd_io:
4017 case Hexagon::dup_L2_loadrd_io:
4019 DstReg =
MI.getOperand(0).getReg();
4020 SrcReg =
MI.getOperand(1).getReg();
4022 Hexagon::IntRegsRegClass.
contains(SrcReg) &&
4024 MI.getOperand(2).isImm() &&
4030 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4:
4031 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4_PIC:
4032 case Hexagon::L4_return:
4033 case Hexagon::L2_deallocframe:
4034 case Hexagon::dup_L2_deallocframe:
4036 case Hexagon::EH_RETURN_JMPR:
4037 case Hexagon::PS_jmpret:
4038 case Hexagon::SL2_jumpr31:
4041 DstReg =
MI.getOperand(0).getReg();
4042 if (Hexagon::IntRegsRegClass.
contains(DstReg) && (Hexagon::R31 == DstReg))
4045 case Hexagon::PS_jmprett:
4046 case Hexagon::PS_jmpretf:
4047 case Hexagon::PS_jmprettnewpt:
4048 case Hexagon::PS_jmpretfnewpt:
4049 case Hexagon::PS_jmprettnew:
4050 case Hexagon::PS_jmpretfnew:
4051 case Hexagon::SL2_jumpr31_t:
4052 case Hexagon::SL2_jumpr31_f:
4053 case Hexagon::SL2_jumpr31_tnew:
4054 case Hexagon::SL2_jumpr31_fnew:
4055 DstReg =
MI.getOperand(1).getReg();
4056 SrcReg =
MI.getOperand(0).getReg();
4058 if ((Hexagon::PredRegsRegClass.
contains(SrcReg) &&
4059 (Hexagon::P0 == SrcReg)) &&
4060 (Hexagon::IntRegsRegClass.
contains(DstReg) && (Hexagon::R31 == DstReg)))
4063 case Hexagon::L4_return_t:
4064 case Hexagon::L4_return_f:
4065 case Hexagon::L4_return_tnew_pnt:
4066 case Hexagon::L4_return_fnew_pnt:
4067 case Hexagon::L4_return_tnew_pt:
4068 case Hexagon::L4_return_fnew_pt:
4070 SrcReg =
MI.getOperand(0).getReg();
4071 if (Hexagon::PredRegsRegClass.
contains(SrcReg) && (Hexagon::P0 == SrcReg))
4079 case Hexagon::S2_storeri_io:
4080 case Hexagon::dup_S2_storeri_io:
4083 Src1Reg =
MI.getOperand(0).getReg();
4084 Src2Reg =
MI.getOperand(2).getReg();
4085 if (Hexagon::IntRegsRegClass.
contains(Src1Reg) &&
4092 MI.getOperand(1).isImm() &&
4096 case Hexagon::S2_storerb_io:
4097 case Hexagon::dup_S2_storerb_io:
4099 Src1Reg =
MI.getOperand(0).getReg();
4100 Src2Reg =
MI.getOperand(2).getReg();
4102 MI.getOperand(1).isImm() &&
isUInt<4>(
MI.getOperand(1).getImm()))
4114 case Hexagon::S2_storerh_io:
4115 case Hexagon::dup_S2_storerh_io:
4117 Src1Reg =
MI.getOperand(0).getReg();
4118 Src2Reg =
MI.getOperand(2).getReg();
4120 MI.getOperand(1).isImm() &&
4124 case Hexagon::S2_storerd_io:
4125 case Hexagon::dup_S2_storerd_io:
4127 Src1Reg =
MI.getOperand(0).getReg();
4128 Src2Reg =
MI.getOperand(2).getReg();
4130 Hexagon::IntRegsRegClass.
contains(Src1Reg) &&
4135 case Hexagon::S4_storeiri_io:
4136 case Hexagon::dup_S4_storeiri_io:
4138 Src1Reg =
MI.getOperand(0).getReg();
4141 MI.getOperand(2).isImm() &&
isUInt<1>(
MI.getOperand(2).getImm()))
4144 case Hexagon::S4_storeirb_io:
4145 case Hexagon::dup_S4_storeirb_io:
4147 Src1Reg =
MI.getOperand(0).getReg();
4149 MI.getOperand(1).isImm() &&
isUInt<4>(
MI.getOperand(1).getImm()) &&
4150 MI.getOperand(2).isImm() &&
isUInt<1>(
MI.getOperand(2).getImm()))
4153 case Hexagon::S2_allocframe:
4154 case Hexagon::dup_S2_allocframe:
4155 if (
MI.getOperand(2).isImm() &&
4177 case Hexagon::A2_addi:
4178 case Hexagon::dup_A2_addi:
4179 DstReg =
MI.getOperand(0).getReg();
4180 SrcReg =
MI.getOperand(1).getReg();
4183 if (Hexagon::IntRegsRegClass.
contains(SrcReg) &&
4188 if ((DstReg == SrcReg) &&
MI.getOperand(2).isImm() &&
4194 ((
MI.getOperand(2).getImm() == 1) ||
4195 (
MI.getOperand(2).getImm() == -1)))
4199 case Hexagon::A2_add:
4200 case Hexagon::dup_A2_add:
4202 DstReg =
MI.getOperand(0).getReg();
4203 Src1Reg =
MI.getOperand(1).getReg();
4204 Src2Reg =
MI.getOperand(2).getReg();
4209 case Hexagon::A2_andir:
4210 case Hexagon::dup_A2_andir:
4214 DstReg =
MI.getOperand(0).getReg();
4215 SrcReg =
MI.getOperand(1).getReg();
4217 MI.getOperand(2).isImm() &&
4218 ((
MI.getOperand(2).getImm() == 1) ||
4219 (
MI.getOperand(2).getImm() == 255)))
4222 case Hexagon::A2_tfr:
4223 case Hexagon::dup_A2_tfr:
4225 DstReg =
MI.getOperand(0).getReg();
4226 SrcReg =
MI.getOperand(1).getReg();
4230 case Hexagon::A2_tfrsi:
4231 case Hexagon::dup_A2_tfrsi:
4236 DstReg =
MI.getOperand(0).getReg();
4240 case Hexagon::C2_cmoveit:
4241 case Hexagon::C2_cmovenewit:
4242 case Hexagon::C2_cmoveif:
4243 case Hexagon::C2_cmovenewif:
4244 case Hexagon::dup_C2_cmoveit:
4245 case Hexagon::dup_C2_cmovenewit:
4246 case Hexagon::dup_C2_cmoveif:
4247 case Hexagon::dup_C2_cmovenewif:
4251 DstReg =
MI.getOperand(0).getReg();
4252 SrcReg =
MI.getOperand(1).getReg();
4254 Hexagon::PredRegsRegClass.
contains(SrcReg) && Hexagon::P0 == SrcReg &&
4255 MI.getOperand(2).isImm() &&
MI.getOperand(2).getImm() == 0)
4258 case Hexagon::C2_cmpeqi:
4259 case Hexagon::dup_C2_cmpeqi:
4261 DstReg =
MI.getOperand(0).getReg();
4262 SrcReg =
MI.getOperand(1).getReg();
4263 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
4265 MI.getOperand(2).isImm() &&
isUInt<2>(
MI.getOperand(2).getImm()))
4268 case Hexagon::A2_combineii:
4269 case Hexagon::A4_combineii:
4270 case Hexagon::dup_A2_combineii:
4271 case Hexagon::dup_A4_combineii:
4273 DstReg =
MI.getOperand(0).getReg();
4275 ((
MI.getOperand(1).isImm() &&
isUInt<2>(
MI.getOperand(1).getImm())) ||
4276 (
MI.getOperand(1).isGlobal() &&
4278 ((
MI.getOperand(2).isImm() &&
isUInt<2>(
MI.getOperand(2).getImm())) ||
4279 (
MI.getOperand(2).isGlobal() &&
4283 case Hexagon::A4_combineri:
4284 case Hexagon::dup_A4_combineri:
4287 DstReg =
MI.getOperand(0).getReg();
4288 SrcReg =
MI.getOperand(1).getReg();
4290 ((
MI.getOperand(2).isImm() &&
MI.getOperand(2).getImm() == 0) ||
4291 (
MI.getOperand(2).isGlobal() &&
MI.getOperand(2).getOffset() == 0)))
4294 case Hexagon::A4_combineir:
4295 case Hexagon::dup_A4_combineir:
4297 DstReg =
MI.getOperand(0).getReg();
4298 SrcReg =
MI.getOperand(2).getReg();
4300 ((
MI.getOperand(1).isImm() &&
MI.getOperand(1).getImm() == 0) ||
4301 (
MI.getOperand(1).isGlobal() &&
MI.getOperand(1).getOffset() == 0)))
4304 case Hexagon::A2_sxtb:
4305 case Hexagon::A2_sxth:
4306 case Hexagon::A2_zxtb:
4307 case Hexagon::A2_zxth:
4308 case Hexagon::dup_A2_sxtb:
4309 case Hexagon::dup_A2_sxth:
4310 case Hexagon::dup_A2_zxtb:
4311 case Hexagon::dup_A2_zxth:
4313 DstReg =
MI.getOperand(0).getReg();
4314 SrcReg =
MI.getOperand(1).getReg();
4324 return Hexagon::getRealHWInstr(
MI.getOpcode(), Hexagon::InstrType_Real);
4334 if (
MI.isTransient())
4358 int Idx =
DefMI.findRegisterDefOperandIdx(SR, &HRI,
false,
false);
4369 int Idx =
UseMI.findRegisterUseOperandIdx(SR, &HRI,
false);
4403 : Hexagon::getTruePredOpcode(
Opc);
4404 if (InvPredOpcode >= 0)
4405 return InvPredOpcode;
4419 return ~(-1U << (bits - 1));
4421 return ~(-1U << bits);
4426 switch (
MI.getOpcode()) {
4427 case Hexagon::L2_loadrbgp:
4428 case Hexagon::L2_loadrdgp:
4429 case Hexagon::L2_loadrhgp:
4430 case Hexagon::L2_loadrigp:
4431 case Hexagon::L2_loadrubgp:
4432 case Hexagon::L2_loadruhgp:
4433 case Hexagon::S2_storerbgp:
4434 case Hexagon::S2_storerbnewgp:
4435 case Hexagon::S2_storerhgp:
4436 case Hexagon::S2_storerhnewgp:
4437 case Hexagon::S2_storerigp:
4438 case Hexagon::S2_storerinewgp:
4439 case Hexagon::S2_storerdgp:
4440 case Hexagon::S2_storerfgp:
4458 if (
MI.getOpcode() == Hexagon::A4_ext)
4472 bool ToBigInstrs)
const {
4484 MII->setDesc(
get(Opcode));
4490 bool ToBigInstrs)
const {
4493 End = MB.instr_end();
4494 Instr != End; ++Instr)
4502 while ((MII !=
MBB->instr_end()) && MII->isInsideBundle()) {
4512 unsigned S = (
F >> MemAccessSizePos) & MemAccesSizeMask;
4513 unsigned Size = getMemAccessSizeInBytes(MemAccessSize(S));
4517 if (
MI.getOpcode() == Hexagon::Y2_dcfetchbo)
4524 return HRI.getSpillSize(Hexagon::HvxVRRegClass);
4539 return -1U << (bits - 1);
4548 short NonExtOpcode = Hexagon::getRegForm(
MI.getOpcode());
4549 if (NonExtOpcode >= 0)
4550 return NonExtOpcode;
4552 if (
MI.getDesc().mayLoad() ||
MI.getDesc().mayStore()) {
4556 return Hexagon::changeAddrMode_abs_io(
MI.getOpcode());
4558 return Hexagon::changeAddrMode_io_rr(
MI.getOpcode());
4560 return Hexagon::changeAddrMode_ur_rr(
MI.getOpcode());
4570 Register &PredReg,
unsigned &PredRegPos,
unsigned &PredRegFlags)
const {
4578 PredReg =
Cond[1].getReg();
4582 if (
Cond[1].isImplicit())
4590 return Hexagon::getRealHWInstr(
MI.getOpcode(), Hexagon::InstrType_Pseudo);
4594 return Hexagon::getRegForm(
MI.getOpcode());
4602 if (
MI.isDebugInstr() ||
MI.isPosition())
4605 unsigned Size =
MI.getDesc().getSize();
4621 unsigned NumDefs = 0;
4622 for (;
MI.getOperand(NumDefs).
isReg() &&
MI.getOperand(NumDefs).isDef();
4624 assert(NumDefs !=
MI.getNumOperands()-2 &&
"No asm string?");
4626 assert(
MI.getOperand(NumDefs).isSymbol() &&
"No asm string?");
4628 const char *AsmStr =
MI.getOperand(NumDefs).getSymbolName();
4642 const InstrStage &IS = *
II.beginStage(
MI.getDesc().getSchedClass());
4654 assert(BundleHead->isBundle() &&
"Not a bundle header");
4664 "Instruction must be extendable");
4670 "Branch with unknown extendable field type");
4682 int TargetPos =
MI.getNumOperands() - 1;
4685 while ((TargetPos > -1) && !
MI.getOperand(TargetPos).isMBB())
4687 assert((TargetPos >= 0) &&
MI.getOperand(TargetPos).isMBB());
4688 MI.getOperand(TargetPos).setMBB(NewTarget);
4692 MI.setDesc(
get(NewOpcode));
4704 for (
unsigned insn = TargetOpcode::GENERIC_OP_END+1;
4705 insn < Hexagon::INSTRUCTION_LIST_END; ++insn) {
4726 int PredRevOpcode = -1;
4728 PredRevOpcode = Hexagon::notTakenBranchPrediction(Opcode);
4730 PredRevOpcode = Hexagon::takenBranchPrediction(Opcode);
4731 assert(PredRevOpcode > 0);
4732 return PredRevOpcode;
4738 return Cond.empty() || (
Cond[0].isImm() && (
Cond.size() != 1));
4745 if (Operand.
isImm())
4746 Operand.
setImm(Operand.
getImm() | memShufDisabledMask);
4754 return (Operand.
isImm() && (Operand.
getImm() & memShufDisabledMask) != 0);
4758 return (
MI->getOpcode() == Hexagon::V6_vmpy_qf16_hf ||
4759 MI->getOpcode() == Hexagon::V6_vmpy_qf16_mix_hf ||
4760 MI->getOpcode() == Hexagon::V6_vmpy_qf32_hf ||
4761 MI->getOpcode() == Hexagon::V6_vmpy_qf32_mix_hf ||
4762 MI->getOpcode() == Hexagon::V6_vmpy_qf32_sf ||
4763 MI->getOpcode() == Hexagon::V6_vmpy_qf16_mix_hf ||
4764 MI->getOpcode() == Hexagon::V6_vmpy_qf16 ||
4765 MI->getOpcode() == Hexagon::V6_vmpy_qf32_mix_hf ||
4766 MI->getOpcode() == Hexagon::V6_vmpy_qf32_qf16 ||
4767 MI->getOpcode() == Hexagon::V6_vmpy_qf32);
4772 return Opc >= 0 ? Hexagon::changeAddrMode_abs_io(
Opc) :
Opc;
4776 return Opc >= 0 ? Hexagon::changeAddrMode_io_abs(
Opc) :
Opc;
4780 return Opc >= 0 ? Hexagon::changeAddrMode_io_pi(
Opc) :
Opc;
4784 return Opc >= 0 ? Hexagon::changeAddrMode_io_rr(
Opc) :
Opc;
4788 return Opc >= 0 ? Hexagon::changeAddrMode_pi_io(
Opc) :
Opc;
4792 return Opc >= 0 ? Hexagon::changeAddrMode_rr_io(
Opc) :
Opc;
4796 return Opc >= 0 ? Hexagon::changeAddrMode_rr_ur(
Opc) :
Opc;
4800 return Opc >= 0 ? Hexagon::changeAddrMode_ur_rr(
Opc) :
Opc;
unsigned const MachineRegisterInfo * MRI
MachineInstrBuilder & UseMI
MachineInstrBuilder MachineInstrBuilder & DefMI
static bool mayAlias(MachineInstr &MIa, SmallVectorImpl< MachineInstr * > &MemInsns, AliasAnalysis *AA)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static bool isConstant(const MachineInstr &MI)
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
static const Function * getParent(const Value *V)
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
DXIL Forward Handle Accesses
static bool isSigned(unsigned int Opcode)
const HexagonInstrInfo * TII
static cl::opt< bool > DisableNVSchedule("disable-hexagon-nv-schedule", cl::Hidden, cl::desc("Disable schedule adjustment for new value stores."))
const int Hexagon_MEMH_OFFSET_MAX
const int Hexagon_MEMB_OFFSET_MAX
const int Hexagon_MEMH_OFFSET_MIN
const int Hexagon_MEMD_OFFSET_MAX
static cl::opt< bool > EnableTimingClassLatency("enable-timing-class-latency", cl::Hidden, cl::init(false), cl::desc("Enable timing class latency"))
const int Hexagon_MEMD_OFFSET_MIN
const int Hexagon_ADDI_OFFSET_MAX
static cl::opt< bool > EnableACCForwarding("enable-acc-forwarding", cl::Hidden, cl::init(true), cl::desc("Enable vec acc forwarding"))
static void getLiveInRegsAt(LivePhysRegs &Regs, const MachineInstr &MI)
const int Hexagon_MEMW_OFFSET_MAX
Constants for Hexagon instructions.
const int Hexagon_MEMW_OFFSET_MIN
cl::opt< bool > ScheduleInlineAsm("hexagon-sched-inline-asm", cl::Hidden, cl::init(false), cl::desc("Do not consider inline-asm a scheduling/" "packetization boundary."))
const int Hexagon_ADDI_OFFSET_MIN
static cl::opt< bool > BranchRelaxAsmLarge("branch-relax-asm-large", cl::init(true), cl::Hidden, cl::desc("branch relax asm"))
static void parseOperands(const MachineInstr &MI, SmallVectorImpl< Register > &Defs, SmallVectorImpl< Register > &Uses)
Gather register def/uses from MI.
static cl::opt< bool > EnableALUForwarding("enable-alu-forwarding", cl::Hidden, cl::init(true), cl::desc("Enable vec alu forwarding"))
const int Hexagon_MEMB_OFFSET_MIN
static unsigned nonDbgMICount(MachineBasicBlock::const_instr_iterator MIB, MachineBasicBlock::const_instr_iterator MIE)
Calculate number of instructions excluding the debug instructions.
static cl::opt< bool > EnableBranchPrediction("hexagon-enable-branch-prediction", cl::Hidden, cl::init(true), cl::desc("Enable branch prediction"))
static bool isDblRegForSubInst(Register Reg, const HexagonRegisterInfo &HRI)
static void getLiveOutRegsAt(LivePhysRegs &Regs, const MachineInstr &MI)
static cl::opt< bool > UseDFAHazardRec("dfa-hazard-rec", cl::init(true), cl::Hidden, cl::desc("Use the DFA based hazard recognizer."))
static bool isIntRegForSubInst(Register Reg)
static bool isDuplexPairMatch(unsigned Ga, unsigned Gb)
#define HEXAGON_INSTR_SIZE
std::pair< Instruction::BinaryOps, Value * > OffsetOp
Find all possible pairs (BinOp, RHS) that BinOp V, RHS can be simplified.
const size_t AbstractManglingParser< Derived, Alloc >::NumOps
This file implements the LivePhysRegs utility for tracking liveness of physical registers.
static DebugLoc getDebugLoc(MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
Return the first DebugLoc that has line number information, given a range of instructions.
static bool isUndef(const MachineInstr &MI)
Register const TargetRegisterInfo * TRI
Promote Memory to Register
static unsigned getReg(const MCDisassembler *D, unsigned RC, unsigned RegNo)
static bool isReg(const MCInst &MI, unsigned OpNo)
uint64_t IntrinsicInst * II
PassBuilder PB(Machine, PassOpts->PTO, std::nullopt, &PIC)
static StringRef getName(Value *V)
static bool isBranch(unsigned Opcode)
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
const SmallVectorImpl< MachineOperand > & Cond
Remove Loads Into Fake Uses
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
This file defines the SmallPtrSet class.
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
const Constant * getInitializer() const
getInitializer - Return the initializer for this global variable.
short getEquivalentHWInstr(const MachineInstr &MI) const
int getDuplexOpcode(const MachineInstr &MI, bool ForBigCore=true) const
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
Remove the branching code at the end of the specific MBB.
bool isPredicated(const MachineInstr &MI) const override
Returns true if the instruction is already predicated.
bool isHVXMemWithAIndirect(const MachineInstr &I, const MachineInstr &J) const
short changeAddrMode_abs_io(short Opc) const
bool isRestrictNoSlot1Store(const MachineInstr &MI) const
short getRegForm(const MachineInstr &MI) const
bool isVecALU(const MachineInstr &MI) const
bool isCompoundBranchInstr(const MachineInstr &MI) const
bool isDuplexPair(const MachineInstr &MIa, const MachineInstr &MIb) const
Symmetrical. See if these two instructions are fit for duplex pair.
bool isJumpR(const MachineInstr &MI) const
ScheduleHazardRecognizer * CreateTargetPostRAHazardRecognizer(const InstrItineraryData *II, const ScheduleDAG *DAG) const override
Allocate and return a hazard recognizer to use for this target when scheduling the machine instructio...
std::pair< unsigned, unsigned > decomposeMachineOperandsTargetFlags(unsigned TF) const override
Decompose the machine operand's target flags into two values - the direct target flag value and any o...
bool producesStall(const MachineInstr &ProdMI, const MachineInstr &ConsMI) const
bool invertAndChangeJumpTarget(MachineInstr &MI, MachineBasicBlock *NewTarget) const
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, Register VReg, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
Store the specified register of the given register class to the specified stack frame index.
bool isPredictedTaken(unsigned Opcode) const
bool isSaveCalleeSavedRegsCall(const MachineInstr &MI) const
Register isLoadFromStackSlot(const MachineInstr &MI, int &FrameIndex) const override
TargetInstrInfo overrides.
unsigned nonDbgBundleSize(MachineBasicBlock::const_iterator BundleHead) const
int getDotNewPredOp(const MachineInstr &MI, const MachineBranchProbabilityInfo *MBPI) const
bool ClobbersPredicate(MachineInstr &MI, std::vector< MachineOperand > &Pred, bool SkipDead) const override
If the specified instruction defines any predicate or condition code register(s) used for predication...
unsigned getInvertedPredicatedOpcode(const int Opc) const
bool isPureSlot0(const MachineInstr &MI) const
bool doesNotReturn(const MachineInstr &CallMI) const
HexagonII::SubInstructionGroup getDuplexCandidateGroup(const MachineInstr &MI) const
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
Analyze the branching code at the end of MBB, returning true if it cannot be understood (e....
bool getPredReg(ArrayRef< MachineOperand > Cond, Register &PredReg, unsigned &PredRegPos, unsigned &PredRegFlags) const
bool isPredicatedNew(const MachineInstr &MI) const
bool isSignExtendingLoad(const MachineInstr &MI) const
bool isVecAcc(const MachineInstr &MI) const
bool reversePredSense(MachineInstr &MI) const
bool isQFPMul(const MachineInstr *MF) const
unsigned getAddrMode(const MachineInstr &MI) const
MCInst getNop() const override
bool isJumpWithinBranchRange(const MachineInstr &MI, unsigned offset) const
bool mayBeNewStore(const MachineInstr &MI) const
bool isOperandExtended(const MachineInstr &MI, unsigned OperandNum) const
bool canExecuteInBundle(const MachineInstr &First, const MachineInstr &Second) const
Can these instructions execute at the same time in a bundle.
std::optional< unsigned > getOperandLatency(const InstrItineraryData *ItinData, const MachineInstr &DefMI, unsigned DefIdx, const MachineInstr &UseMI, unsigned UseIdx) const override
getOperandLatency - Compute and return the use operand latency of a given pair of def and use.
bool isAddrModeWithOffset(const MachineInstr &MI) const
bool getMemOperandsWithOffsetWidth(const MachineInstr &LdSt, SmallVectorImpl< const MachineOperand * > &BaseOps, int64_t &Offset, bool &OffsetIsScalable, LocationSize &Width, const TargetRegisterInfo *TRI) const override
Get the base register and byte offset of a load/store instr.
bool isValidOffset(unsigned Opcode, int Offset, const TargetRegisterInfo *TRI, bool Extend=true) const
bool isBaseImmOffset(const MachineInstr &MI) const
bool isAbsoluteSet(const MachineInstr &MI) const
short changeAddrMode_io_pi(short Opc) const
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DestReg, Register SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) const override
Emit instructions to copy a pair of physical registers.
short changeAddrMode_pi_io(short Opc) const
bool analyzeCompare(const MachineInstr &MI, Register &SrcReg, Register &SrcReg2, int64_t &Mask, int64_t &Value) const override
For a comparison instruction, return the source registers in SrcReg and SrcReg2 if having two registe...
bool reverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const override
Reverses the branch condition of the specified condition list, returning false on success and true if...
std::unique_ptr< PipelinerLoopInfo > analyzeLoopForPipelining(MachineBasicBlock *LoopBB) const override
Analyze loop L, which must be a single-basic-block loop, and if the conditions can be understood enou...
bool isLoopN(const MachineInstr &MI) const
bool isSpillPredRegOp(const MachineInstr &MI) const
bool hasStoreToStackSlot(const MachineInstr &MI, SmallVectorImpl< const MachineMemOperand * > &Accesses) const override
Check if the instruction or the bundle of instructions has store to stack slots.
ArrayRef< std::pair< unsigned, const char * > > getSerializableDirectMachineOperandTargetFlags() const override
Return an array that contains the direct target flag values and their names.
bool isIndirectCall(const MachineInstr &MI) const
short changeAddrMode_ur_rr(short Opc) const
bool isValidAutoIncImm(const EVT VT, const int Offset) const
bool hasNonExtEquivalent(const MachineInstr &MI) const
bool isConstExtended(const MachineInstr &MI) const
bool getIncrementValue(const MachineInstr &MI, int &Value) const override
If the instruction is an increment of a constant value, return the amount.
int getCondOpcode(int Opc, bool sense) const
MachineInstr * findLoopInstr(MachineBasicBlock *BB, unsigned EndLoopOp, MachineBasicBlock *TargetBB, SmallPtrSet< MachineBasicBlock *, 8 > &Visited) const
Find the hardware loop instruction used to set-up the specified loop.
unsigned getInstrTimingClassLatency(const InstrItineraryData *ItinData, const MachineInstr &MI) const
bool isAccumulator(const MachineInstr &MI) const
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
Insert branch code into the end of the specified MachineBasicBlock.
unsigned getInstrLatency(const InstrItineraryData *ItinData, const MachineInstr &MI, unsigned *PredCost=nullptr) const override
Compute the instruction latency of a given instruction.
bool PredOpcodeHasJMP_c(unsigned Opcode) const
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register DestReg, int FrameIndex, const TargetRegisterClass *RC, Register VReg, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
Load the specified register of the given register class from the specified stack frame index.
bool isNewValue(const MachineInstr &MI) const
Register createVR(MachineFunction *MF, MVT VT) const
HexagonInstrInfo specifics.
bool isDotCurInst(const MachineInstr &MI) const
bool validateBranchCond(const ArrayRef< MachineOperand > &Cond) const
bool isExtended(const MachineInstr &MI) const
bool isProfitableToIfCvt(MachineBasicBlock &MBB, unsigned NumCycles, unsigned ExtraPredCycles, BranchProbability Probability) const override
Return true if it's profitable to predicate instructions with accumulated instruction latency of "Num...
bool isAsCheapAsAMove(const MachineInstr &MI) const override
int getMaxValue(const MachineInstr &MI) const
bool isPredicateLate(unsigned Opcode) const
short changeAddrMode_rr_ur(short Opc) const
bool hasPseudoInstrPair(const MachineInstr &MI) const
bool isNewValueInst(const MachineInstr &MI) const
unsigned getInlineAsmLength(const char *Str, const MCAsmInfo &MAI, const TargetSubtargetInfo *STI=nullptr) const override
Measure the specified inline asm to determine an approximation of its length.
bool areMemAccessesTriviallyDisjoint(const MachineInstr &MIa, const MachineInstr &MIb) const override
int getNonDotCurOp(const MachineInstr &MI) const
bool isIndirectL4Return(const MachineInstr &MI) const
unsigned reversePrediction(unsigned Opcode) const
ArrayRef< std::pair< unsigned, const char * > > getSerializableBitmaskMachineOperandTargetFlags() const override
Return an array that contains the bitmask target flag values and their names.
InstrStage::FuncUnits getUnits(const MachineInstr &MI) const
unsigned getMemAccessSize(const MachineInstr &MI) const
bool predOpcodeHasNot(ArrayRef< MachineOperand > Cond) const
bool isComplex(const MachineInstr &MI) const
bool isPostIncrement(const MachineInstr &MI) const override
Return true for post-incremented instructions.
void setBundleNoShuf(MachineBasicBlock::instr_iterator MIB) const
MachineBasicBlock::instr_iterator expandVGatherPseudo(MachineInstr &MI) const
int getDotNewOp(const MachineInstr &MI) const
void changeDuplexOpcode(MachineBasicBlock::instr_iterator MII, bool ToBigInstrs) const
bool isMemOp(const MachineInstr &MI) const
int getDotOldOp(const MachineInstr &MI) const
short getPseudoInstrPair(const MachineInstr &MI) const
bool hasUncondBranch(const MachineBasicBlock *B) const
short getNonExtOpcode(const MachineInstr &MI) const
bool isTailCall(const MachineInstr &MI) const override
void insertNoop(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override
Insert a noop into the instruction stream at the specified point.
bool isDeallocRet(const MachineInstr &MI) const
HexagonInstrInfo(const HexagonSubtarget &ST)
unsigned getCExtOpNum(const MachineInstr &MI) const
bool isSolo(const MachineInstr &MI) const
DFAPacketizer * CreateTargetScheduleState(const TargetSubtargetInfo &STI) const override
Create machine specific model for scheduling.
bool isLateSourceInstr(const MachineInstr &MI) const
bool isDotNewInst(const MachineInstr &MI) const
void translateInstrsForDup(MachineFunction &MF, bool ToBigInstrs=true) const
bool isTC1(const MachineInstr &MI) const
bool isSchedulingBoundary(const MachineInstr &MI, const MachineBasicBlock *MBB, const MachineFunction &MF) const override
Test if the given instruction should be considered a scheduling boundary.
bool predCanBeUsedAsDotNew(const MachineInstr &MI, Register PredReg) const
unsigned getSize(const MachineInstr &MI) const
bool isProfitableToDupForIfCvt(MachineBasicBlock &MBB, unsigned NumCycles, BranchProbability Probability) const override
Return true if it's profitable for if-converter to duplicate instructions of specified accumulated in...
short changeAddrMode_io_abs(short Opc) const
int getDotCurOp(const MachineInstr &MI) const
bool expandPostRAPseudo(MachineInstr &MI) const override
This function is called for all pseudo instructions that remain after register allocation.
bool isExpr(unsigned OpType) const
void genAllInsnTimingClasses(MachineFunction &MF) const
bool isTC2Early(const MachineInstr &MI) const
bool hasEHLabel(const MachineBasicBlock *B) const
bool shouldSink(const MachineInstr &MI) const override
bool isZeroExtendingLoad(const MachineInstr &MI) const
short changeAddrMode_rr_io(short Opc) const
bool isHVXVec(const MachineInstr &MI) const
bool isDependent(const MachineInstr &ProdMI, const MachineInstr &ConsMI) const
short changeAddrMode_io_rr(short Opc) const
bool SubsumesPredicate(ArrayRef< MachineOperand > Pred1, ArrayRef< MachineOperand > Pred2) const override
Returns true if the first specified predicate subsumes the second, e.g.
bool mayBeCurLoad(const MachineInstr &MI) const
bool getBundleNoShuf(const MachineInstr &MIB) const
bool isNewValueJump(const MachineInstr &MI) const
bool isTC4x(const MachineInstr &MI) const
bool PredicateInstruction(MachineInstr &MI, ArrayRef< MachineOperand > Cond) const override
Convert the instruction into a predicated instruction.
bool isFloat(const MachineInstr &MI) const
bool isToBeScheduledASAP(const MachineInstr &MI1, const MachineInstr &MI2) const
MachineOperand * getBaseAndOffset(const MachineInstr &MI, int64_t &Offset, LocationSize &AccessSize) const
bool getInvertedPredSense(SmallVectorImpl< MachineOperand > &Cond) const
unsigned nonDbgBBSize(const MachineBasicBlock *BB) const
getInstrTimingClassLatency - Compute the instruction latency of a given instruction using Timing Clas...
uint64_t getType(const MachineInstr &MI) const
bool isEndLoopN(unsigned Opcode) const
bool getBaseAndOffsetPosition(const MachineInstr &MI, unsigned &BasePos, unsigned &OffsetPos) const override
For instructions with a base and offset, return the position of the base register and offset operands...
bool isPredicable(const MachineInstr &MI) const override
Return true if the specified instruction can be predicated.
bool isExtendable(const MachineInstr &MI) const
void immediateExtend(MachineInstr &MI) const
immediateExtend - Changes the instruction in place to one using an immediate extender.
HexagonII::CompoundGroup getCompoundCandidateGroup(const MachineInstr &MI) const
bool hasLoadFromStackSlot(const MachineInstr &MI, SmallVectorImpl< const MachineMemOperand * > &Accesses) const override
Check if the instruction or the bundle of instructions has load from stack slots.
SmallVector< MachineInstr *, 2 > getBranchingInstrs(MachineBasicBlock &MBB) const
bool isPredicatedTrue(const MachineInstr &MI) const
bool isNewValueStore(const MachineInstr &MI) const
int getMinValue(const MachineInstr &MI) const
bool isVecUsableNextPacket(const MachineInstr &ProdMI, const MachineInstr &ConsMI) const
unsigned getCompoundOpcode(const MachineInstr &GA, const MachineInstr &GB) const
bool addLatencyToSchedule(const MachineInstr &MI1, const MachineInstr &MI2) const
Register isStoreToStackSlot(const MachineInstr &MI, int &FrameIndex) const override
If the specified machine instruction is a direct store to a stack slot, return the virtual or physica...
int getDotNewPredJumpOp(const MachineInstr &MI, const MachineBranchProbabilityInfo *MBPI) const
bool isTC2(const MachineInstr &MI) const
Register getStackRegister() const
Register getFrameRegister(const MachineFunction &MF) const override
Itinerary data supplied by a subtarget to be used by a target.
unsigned getStageLatency(unsigned ItinClassIndx) const
Return the total stage latency of the given class.
void RemoveMachineInstrFromMaps(MachineInstr &MI)
A set of physical registers with utility functions to track liveness when walking backward/forward th...
void stepForward(const MachineInstr &MI, SmallVectorImpl< std::pair< MCPhysReg, const MachineOperand * > > &Clobbers)
Simulates liveness when stepping forward over an instruction(bundle).
void stepBackward(const MachineInstr &MI)
Simulates liveness when stepping backwards over an instruction(bundle).
void addLiveIns(const MachineBasicBlock &MBB)
Adds all live-in registers of basic block MBB.
bool available(const MachineRegisterInfo &MRI, MCRegister Reg) const
Returns true if register Reg and no aliasing register is in the set.
void addLiveOuts(const MachineBasicBlock &MBB)
Adds all live-out registers of basic block MBB.
bool contains(MCRegister Reg) const
Returns true if register Reg is contained in the set.
static LocationSize precise(uint64_t Value)
Represents a single loop in the control flow graph.
This class is intended to be used as a base class for asm properties and features specific to the tar...
virtual unsigned getMaxInstLength(const MCSubtargetInfo *STI=nullptr) const
Returns the maximum possible encoded instruction size in bytes.
StringRef getCommentString() const
const char * getSeparatorString() const
MCInstBuilder & addInst(const MCInst *Val)
Add a new MCInst operand.
MCInstBuilder & addImm(int64_t Val)
Add a new integer immediate operand.
Instances of this class represent a single low-level machine instruction.
Describe properties that are true of each instruction in the target description file.
unsigned getSchedClass() const
Return the scheduling class for this instruction.
unsigned getNumDefs() const
Return the number of MachineOperands that are register definitions.
instr_iterator instr_begin()
MachineInstrBundleIterator< const MachineInstr > const_iterator
LLVM_ABI iterator getFirstTerminator()
Returns an iterator to the first terminator instruction of this basic block.
Instructions::iterator instr_iterator
instr_iterator instr_end()
Instructions::const_iterator const_instr_iterator
iterator_range< pred_iterator > predecessors()
void splice(iterator Where, MachineBasicBlock *Other, iterator From)
Take an instruction from MBB 'Other' at the position From, and insert it into this MBB right before '...
MachineInstrBundleIterator< MachineInstr > iterator
BranchProbability getEdgeProbability(const MachineBasicBlock *Src, const MachineBasicBlock *Dst) const
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
Align getObjectAlign(int ObjectIdx) const
Return the alignment of the specified stack object.
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, LLT MemTy, Align 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.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
const char * createExternalSymbolName(StringRef Name)
Allocate a string and populate it with the given external symbol name.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
BasicBlockListType::iterator iterator
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & add(const MachineOperand &MO) const
const MachineInstrBuilder & addFrameIndex(int Idx) const
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0) const
const MachineInstrBuilder & cloneMemRefs(const MachineInstr &OtherMI) const
const MachineInstrBuilder & addUse(Register RegNo, unsigned Flags=0, unsigned SubReg=0) const
Add a virtual register use operand.
const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const
const MachineInstrBuilder & addDef(Register RegNo, unsigned Flags=0, unsigned SubReg=0) const
Add a virtual register definition operand.
reverse_iterator getReverse() const
Get a reverse iterator to the same node.
instr_iterator getInstrIterator() const
Representation of each machine instruction.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const MachineBasicBlock * getParent() const
bool readsRegister(Register Reg, const TargetRegisterInfo *TRI) const
Return true if the MachineInstr reads the specified register.
unsigned getNumOperands() const
Retuns the total number of operands.
LLVM_ABI unsigned getNumExplicitOperands() const
Returns the number of non-implicit operands.
bool mayLoad(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly read memory.
const MCInstrDesc & getDesc() const
Returns the target instruction descriptor of this MachineInstr.
LLVM_ABI bool hasUnmodeledSideEffects() const
Return true if this instruction has side effects that are not modeled by mayLoad / mayStore,...
LLVM_ABI bool hasOrderedMemoryRef() const
Return true if this instruction may have an ordered or volatile memory reference, or if the informati...
bool mayStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly modify memory.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
LLVM_ABI void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
const MachineOperand & getOperand(unsigned i) const
bool isIndirectBranch(QueryType Type=AnyInBundle) const
Return true if this is an indirect branch, such as a branch through a register.
A description of a memory reference used in the backend.
@ MOVolatile
The memory access is volatile.
@ MOLoad
The memory access reads data.
@ MOStore
The memory access writes data.
MachineOperand class - Representation of each machine instruction operand.
unsigned getSubReg() const
void setImm(int64_t immVal)
bool isReg() const
isReg - Tests if this is a MO_Register operand.
MachineBasicBlock * getMBB() const
bool isCPI() const
isCPI - Tests if this is a MO_ConstantPoolIndex operand.
LLVM_ABI void setReg(Register Reg)
Change the register this operand corresponds to.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
bool isSymbol() const
isSymbol - Tests if this is a MO_ExternalSymbol operand.
bool isJTI() const
isJTI - Tests if this is a MO_JumpTableIndex operand.
unsigned getTargetFlags() const
static MachineOperand CreateImm(int64_t Val)
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
bool isBlockAddress() const
isBlockAddress - Tests if this is a MO_BlockAddress operand.
Register getReg() const
getReg - Returns the register number.
void addTargetFlag(unsigned F)
bool isFI() const
isFI - Tests if this is a MO_FrameIndex operand.
@ MO_ConstantPoolIndex
Address of indexed Constant in Constant Pool.
@ MO_GlobalAddress
Address of a global value.
@ MO_BlockAddress
Address of a basic block.
@ MO_MachineBasicBlock
MachineBasicBlock reference.
@ MO_ExternalSymbol
Name of external global symbol.
@ MO_JumpTableIndex
Address of indexed Jump Table for switch.
bool isFPImm() const
isFPImm - Tests if this is a MO_FPImmediate operand.
bool isMBB() const
isMBB - Tests if this is a MO_MachineBasicBlock operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Special value supplied for machine level alias analysis.
Wrapper class representing virtual and physical registers.
constexpr bool isPhysical() const
Return true if the specified register number is in the physical register namespace.
HazardRecognizer - This determines whether or not an instruction can be issued this cycle,...
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
constexpr size_t size() const
size - Get the string size.
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
size_t count(char C) const
Return the number of occurrences of C in the string.
Object returned by analyzeLoopForPipelining.
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...
virtual bool hasStoreToStackSlot(const MachineInstr &MI, SmallVectorImpl< const MachineMemOperand * > &Accesses) const
If the specified machine instruction has a store to a stack slot, return true along with the FrameInd...
virtual std::optional< unsigned > getOperandLatency(const InstrItineraryData *ItinData, SDNode *DefNode, unsigned DefIdx, SDNode *UseNode, unsigned UseIdx) const
virtual bool hasLoadFromStackSlot(const MachineInstr &MI, SmallVectorImpl< const MachineMemOperand * > &Accesses) const
If the specified machine instruction has a load from a stack slot, return true along with the FrameIn...
Primary interface to the complete machine description for the target machine.
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
TargetSubtargetInfo - Generic base class for all target subtargets.
virtual const InstrItineraryData * getInstrItineraryData() const
getInstrItineraryData - Returns instruction itinerary data for the target or specific subtarget.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM Value Representation.
self_iterator getIterator()
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
bool isSlot0Only(unsigned units)
HexagonII - This namespace holds all of the target specific flags that instruction info tracks.
unsigned const TypeCVI_LAST
@ RestrictNoSlot1StoreMask
@ RestrictNoSlot1StorePos
unsigned const TypeCVI_FIRST
@ Implicit
Not emitted register (e.g. carry, or temporary result).
@ InternalRead
Register reads a value that is defined inside the same instruction or bundle.
@ Kill
The last use of a register.
@ Undef
Value of the register doesn't matter.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
bool is_TC1(unsigned SchedClass)
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
auto reverse(ContainerTy &&C)
MachineInstr * getImm(const MachineOperand &MO, const MachineRegisterInfo *MRI)
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
MachineBasicBlock::instr_iterator getBundleEnd(MachineBasicBlock::instr_iterator I)
Returns an iterator pointing beyond the bundle containing I.
FunctionAddr VTableAddr Count
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
bool is_TC2(unsigned SchedClass)
unsigned getUndefRegState(bool B)
unsigned getRegState(const MachineOperand &RegOp)
Get all register state flags from machine operand RegOp.
bool is_TC2early(unsigned SchedClass)
unsigned getKillRegState(bool B)
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
constexpr bool isShiftedInt(int64_t x)
Checks if a signed integer is an N bit number shifted left by S.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
bool isSpace(char C)
Checks whether character C is whitespace in the "C" locale.
LLVM_ABI Printable printReg(Register Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubIdx=0, const MachineRegisterInfo *MRI=nullptr)
Prints virtual and physical registers with or without a TRI instance.
constexpr bool isShiftedUInt(uint64_t x)
Checks if a unsigned integer is an N bit number shifted left by S.
LLVM_ABI Printable printMBBReference(const MachineBasicBlock &MBB)
Prints a machine basic block reference.
bool is_TC4x(unsigned SchedClass)
This struct is a compact representation of a valid (non-zero power of two) alignment.
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
These values represent a non-pipelined step in the execution of an instruction.
uint64_t FuncUnits
Bitmask representing a set of functional units.
FuncUnits getUnits() const
Returns the choice of FUs.
This class contains a discriminated union of information about pointers in memory operands,...
static LLVM_ABI MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.