65#define DEBUG_TYPE "hexagon-instrinfo"
67#define GET_INSTRINFO_CTOR_DTOR
68#define GET_INSTRMAP_INFO
70#include "HexagonGenDFAPacketizer.inc"
71#include "HexagonGenInstrInfo.inc"
75 "packetization boundary."));
82 cl::desc(
"Disable schedule adjustment for new value stores."));
86 cl::desc(
"Enable timing class latency"));
90 cl::desc(
"Enable vec alu forwarding"));
94 cl::desc(
"Enable vec acc forwarding"));
102 cl::desc(
"Use the DFA based hazard recognizer."));
117void HexagonInstrInfo::anchor() {}
124namespace HexagonFUnits {
130 return (Reg >= Hexagon::R0 && Reg <= Hexagon::R7) ||
131 (Reg >= Hexagon::R16 && Reg <= Hexagon::R23);
143 for (; MIB != MIE; ++MIB) {
144 if (!MIB->isDebugInstr())
155 if (!(
MI.getMF()->getFunction().hasOptSize()))
156 return MI.isAsCheapAsAMove();
158 if (
MI.getOpcode() == Hexagon::A2_tfrsi) {
159 auto Op =
MI.getOperand(1);
167 int64_t Imm =
Op.getImm();
172 return MI.isAsCheapAsAMove();
187 if (
isFloat(
MI) &&
MI.hasRegisterImplicitUseOperand(Hexagon::USR))
201 if (EndLoopOp == Hexagon::ENDLOOP0) {
202 LOOPi = Hexagon::J2_loop0i;
203 LOOPr = Hexagon::J2_loop0r;
205 LOOPi = Hexagon::J2_loop1i;
206 LOOPr = Hexagon::J2_loop1r;
217 unsigned Opc =
I.getOpcode();
218 if (Opc == LOOPi || Opc == LOOPr)
222 if (Opc == EndLoopOp &&
I.getOperand(0).getMBB() != TargetBB)
249 Uses.push_back(MO.getReg());
288 int &FrameIndex)
const {
289 switch (
MI.getOpcode()) {
292 case Hexagon::L2_loadri_io:
293 case Hexagon::L2_loadrd_io:
294 case Hexagon::V6_vL32b_ai:
295 case Hexagon::V6_vL32b_nt_ai:
296 case Hexagon::V6_vL32Ub_ai:
297 case Hexagon::LDriw_pred:
298 case Hexagon::LDriw_ctr:
299 case Hexagon::PS_vloadrq_ai:
300 case Hexagon::PS_vloadrw_ai:
301 case Hexagon::PS_vloadrw_nt_ai: {
309 return MI.getOperand(0).getReg();
312 case Hexagon::L2_ploadrit_io:
313 case Hexagon::L2_ploadrif_io:
314 case Hexagon::L2_ploadrdt_io:
315 case Hexagon::L2_ploadrdf_io: {
323 return MI.getOperand(0).getReg();
336 int &FrameIndex)
const {
337 switch (
MI.getOpcode()) {
340 case Hexagon::S2_storerb_io:
341 case Hexagon::S2_storerh_io:
342 case Hexagon::S2_storeri_io:
343 case Hexagon::S2_storerd_io:
344 case Hexagon::V6_vS32b_ai:
345 case Hexagon::V6_vS32Ub_ai:
346 case Hexagon::STriw_pred:
347 case Hexagon::STriw_ctr:
348 case Hexagon::PS_vstorerq_ai:
349 case Hexagon::PS_vstorerw_ai: {
357 return MI.getOperand(2).getReg();
360 case Hexagon::S2_pstorerbt_io:
361 case Hexagon::S2_pstorerbf_io:
362 case Hexagon::S2_pstorerht_io:
363 case Hexagon::S2_pstorerhf_io:
364 case Hexagon::S2_pstorerit_io:
365 case Hexagon::S2_pstorerif_io:
366 case Hexagon::S2_pstorerdt_io:
367 case Hexagon::S2_pstorerdf_io: {
375 return MI.getOperand(3).getReg();
391 for (++MII; MII !=
MBB->
instr_end() && MII->isInsideBundle(); ++MII)
409 for (++MII; MII !=
MBB->
instr_end() && MII->isInsideBundle(); ++MII)
437 bool AllowModify)
const {
469 while (
I->isDebugInstr()) {
475 bool JumpToBlock =
I->getOpcode() == Hexagon::J2_jump &&
476 I->getOperand(0).isMBB();
478 if (AllowModify && JumpToBlock &&
481 I->eraseFromParent();
487 if (!isUnpredicatedTerminator(*
I))
495 if (&*
I != LastInst && !
I->isBundle() && isUnpredicatedTerminator(*
I)) {
497 SecondLastInst = &*
I;
508 int SecLastOpcode = SecondLastInst ? SecondLastInst->
getOpcode() : 0;
511 if (LastOpcode == Hexagon::J2_jump && !LastInst->
getOperand(0).
isMBB())
513 if (SecLastOpcode == Hexagon::J2_jump &&
524 if (LastInst && !SecondLastInst) {
525 if (LastOpcode == Hexagon::J2_jump) {
535 if (LastOpcodeHasJMP_c) {
550 <<
" with one jump\n";);
557 if (SecLastOpcodeHasJMP_c && (LastOpcode == Hexagon::J2_jump)) {
568 if (SecLastOpcodeHasNVJump &&
570 (LastOpcode == Hexagon::J2_jump)) {
581 if (SecLastOpcode == Hexagon::J2_jump && LastOpcode == Hexagon::J2_jump) {
585 I->eraseFromParent();
590 if (
isEndLoopN(SecLastOpcode) && LastOpcode == Hexagon::J2_jump) {
598 <<
" with two jumps";);
604 int *BytesRemoved)
const {
605 assert(!BytesRemoved &&
"code size not handled");
612 if (
I->isDebugInstr())
617 if (Count && (
I->getOpcode() == Hexagon::J2_jump))
631 int *BytesAdded)
const {
632 unsigned BOpc = Hexagon::J2_jump;
633 unsigned BccOpc = Hexagon::J2_jumpt;
635 assert(
TBB &&
"insertBranch must not be told to insert a fallthrough");
636 assert(!BytesAdded &&
"code size not handled");
641 if (!
Cond.empty() &&
Cond[0].isImm())
642 BccOpc =
Cond[0].getImm();
662 int EndLoopOp =
Cond[0].getImm();
669 assert(
Loop !=
nullptr &&
"Inserting an ENDLOOP without a LOOP");
670 Loop->getOperand(0).setMBB(
TBB);
674 assert((
Cond.size() == 3) &&
"Only supporting rr/ri version of nvjump");
691 assert((
Cond.size() == 2) &&
"Malformed cond vector");
699 "Cond. cannot be empty when multiple branchings are required");
701 "NV-jump cannot be inserted with another branch");
704 int EndLoopOp =
Cond[0].getImm();
711 assert(
Loop !=
nullptr &&
"Inserting an ENDLOOP without a LOOP");
712 Loop->getOperand(0).setMBB(
TBB);
741 TripCount =
Loop->getOpcode() == Hexagon::J2_loop0r
743 :
Loop->getOperand(1).getImm();
745 LoopCount =
Loop->getOperand(1).getReg();
748 bool shouldIgnoreForPipelining(
const MachineInstr *
MI)
const override {
750 return MI == EndLoop;
753 std::optional<bool> createTripCountGreaterCondition(
756 if (TripCount == -1) {
760 TII->get(Hexagon::C2_cmpgtui),
Done)
768 return TripCount > TC;
776 void adjustTripCount(
int TripCountAdjust)
override {
779 if (
Loop->getOpcode() == Hexagon::J2_loop0i ||
780 Loop->getOpcode() == Hexagon::J2_loop1i) {
781 int64_t TripCount =
Loop->getOperand(1).getImm() + TripCountAdjust;
782 assert(TripCount > 0 &&
"Can't create an empty or negative loop!");
783 Loop->getOperand(1).setImm(TripCount);
792 TII->get(Hexagon::A2_addi), NewLoopCount)
795 Loop->getOperand(1).setReg(NewLoopCount);
798 void disposed()
override {
Loop->eraseFromParent(); }
802std::unique_ptr<TargetInstrInfo::PipelinerLoopInfo>
810 LoopBB,
I->getOpcode(),
I->getOperand(0).getMBB(), VisitedBBs);
812 return std::make_unique<HexagonPipelinerLoopInfo>(LoopInst, &*
I);
818 unsigned NumCycles,
unsigned ExtraPredCycles,
832 return NumInstrs <= 4;
840 for (
auto I =
B.begin();
I != E; ++
I) {
850 for (
auto I =
B.rbegin();
I != E; ++
I)
859 bool RenamableSrc)
const {
863 if (Hexagon::IntRegsRegClass.
contains(SrcReg, DestReg)) {
865 .
addReg(SrcReg, KillFlag);
868 if (Hexagon::DoubleRegsRegClass.
contains(SrcReg, DestReg)) {
870 .
addReg(SrcReg, KillFlag);
873 if (Hexagon::PredRegsRegClass.
contains(SrcReg, DestReg)) {
879 if (Hexagon::CtrRegsRegClass.
contains(DestReg) &&
880 Hexagon::IntRegsRegClass.
contains(SrcReg)) {
882 .
addReg(SrcReg, KillFlag);
885 if (Hexagon::IntRegsRegClass.
contains(DestReg) &&
886 Hexagon::CtrRegsRegClass.
contains(SrcReg)) {
888 .
addReg(SrcReg, KillFlag);
891 if (Hexagon::ModRegsRegClass.
contains(DestReg) &&
892 Hexagon::IntRegsRegClass.
contains(SrcReg)) {
894 .
addReg(SrcReg, KillFlag);
897 if (Hexagon::PredRegsRegClass.
contains(SrcReg) &&
898 Hexagon::IntRegsRegClass.
contains(DestReg)) {
900 .
addReg(SrcReg, KillFlag);
903 if (Hexagon::IntRegsRegClass.
contains(SrcReg) &&
904 Hexagon::PredRegsRegClass.
contains(DestReg)) {
906 .
addReg(SrcReg, KillFlag);
909 if (Hexagon::PredRegsRegClass.
contains(SrcReg) &&
910 Hexagon::IntRegsRegClass.
contains(DestReg)) {
912 .
addReg(SrcReg, KillFlag);
915 if (Hexagon::HvxVRRegClass.
contains(SrcReg, DestReg)) {
917 addReg(SrcReg, KillFlag);
920 if (Hexagon::HvxWRRegClass.
contains(SrcReg, DestReg)) {
923 Register SrcLo = HRI.getSubReg(SrcReg, Hexagon::vsub_lo);
924 Register SrcHi = HRI.getSubReg(SrcReg, Hexagon::vsub_hi);
928 .
addReg(SrcHi, KillFlag | UndefHi)
929 .
addReg(SrcLo, KillFlag | UndefLo);
932 if (Hexagon::HvxQRRegClass.
contains(SrcReg, DestReg)) {
935 .
addReg(SrcReg, KillFlag);
938 if (Hexagon::HvxQRRegClass.
contains(SrcReg) &&
939 Hexagon::HvxVRRegClass.
contains(DestReg)) {
943 if (Hexagon::HvxQRRegClass.
contains(DestReg) &&
944 Hexagon::HvxVRRegClass.
contains(SrcReg)) {
959 Register SrcReg,
bool isKill,
int FI,
973 if (Hexagon::IntRegsRegClass.hasSubClassEq(RC)) {
977 }
else if (Hexagon::DoubleRegsRegClass.hasSubClassEq(RC)) {
981 }
else if (Hexagon::PredRegsRegClass.hasSubClassEq(RC)) {
985 }
else if (Hexagon::ModRegsRegClass.hasSubClassEq(RC)) {
989 }
else if (Hexagon::HvxQRRegClass.hasSubClassEq(RC)) {
993 }
else if (Hexagon::HvxVRRegClass.hasSubClassEq(RC)) {
997 }
else if (Hexagon::HvxWRRegClass.hasSubClassEq(RC)) {
1018 if (Hexagon::IntRegsRegClass.hasSubClassEq(RC)) {
1021 }
else if (Hexagon::DoubleRegsRegClass.hasSubClassEq(RC)) {
1024 }
else if (Hexagon::PredRegsRegClass.hasSubClassEq(RC)) {
1027 }
else if (Hexagon::ModRegsRegClass.hasSubClassEq(RC)) {
1030 }
else if (Hexagon::HvxQRRegClass.hasSubClassEq(RC)) {
1033 }
else if (Hexagon::HvxVRRegClass.hasSubClassEq(RC)) {
1036 }
else if (Hexagon::HvxWRRegClass.hasSubClassEq(RC)) {
1057 unsigned Opc =
MI.getOpcode();
1059 auto RealCirc = [&](
unsigned Opc,
bool HasImm,
unsigned MxOp) {
1061 Register CSx = (Mx == Hexagon::M0 ? Hexagon::CS0 : Hexagon::CS1);
1063 .
add(
MI.getOperand((HasImm ? 5 : 4)));
1067 MIB.
add(
MI.getOperand(4));
1074 if (
MI.memoperands().empty())
1077 return MMO->getAlign() >= NeedAlign;
1082 case Hexagon::PS_call_instrprof_custom: {
1083 auto Op0 =
MI.getOperand(0);
1085 "First operand must be a global containing handler name.");
1089 StringRef NameStr = Arr->isCString() ? Arr->getAsCString() : Arr->getAsString();
1115 MIB.addExternalSymbol(cstr);
1119 case TargetOpcode::COPY: {
1130 case Hexagon::PS_aligna:
1133 .
addImm(-
MI.getOperand(1).getImm());
1136 case Hexagon::V6_vassignp: {
1139 Register SrcLo = HRI.getSubReg(SrcReg, Hexagon::vsub_lo);
1140 Register SrcHi = HRI.getSubReg(SrcReg, Hexagon::vsub_hi);
1147 .
addReg(SrcLo, Kill | UndefLo);
1151 case Hexagon::V6_lo: {
1154 Register SrcSubLo = HRI.getSubReg(SrcReg, Hexagon::vsub_lo);
1157 MRI.clearKillFlags(SrcSubLo);
1160 case Hexagon::V6_hi: {
1163 Register SrcSubHi = HRI.getSubReg(SrcReg, Hexagon::vsub_hi);
1166 MRI.clearKillFlags(SrcSubHi);
1169 case Hexagon::PS_vloadrv_ai: {
1173 int Offset =
MI.getOperand(2).getImm();
1174 Align NeedAlign = HRI.getSpillAlign(Hexagon::HvxVRRegClass);
1175 unsigned NewOpc = UseAligned(
MI, NeedAlign) ? Hexagon::V6_vL32b_ai
1176 : Hexagon::V6_vL32Ub_ai;
1184 case Hexagon::PS_vloadrw_ai: {
1188 int Offset =
MI.getOperand(2).getImm();
1189 unsigned VecOffset = HRI.getSpillSize(Hexagon::HvxVRRegClass);
1190 Align NeedAlign = HRI.getSpillAlign(Hexagon::HvxVRRegClass);
1191 unsigned NewOpc = UseAligned(
MI, NeedAlign) ? Hexagon::V6_vL32b_ai
1192 : Hexagon::V6_vL32Ub_ai;
1194 HRI.getSubReg(DstReg, Hexagon::vsub_lo))
1199 HRI.getSubReg(DstReg, Hexagon::vsub_hi))
1206 case Hexagon::PS_vstorerv_ai: {
1211 int Offset =
MI.getOperand(1).getImm();
1212 Align NeedAlign = HRI.getSpillAlign(Hexagon::HvxVRRegClass);
1213 unsigned NewOpc = UseAligned(
MI, NeedAlign) ? Hexagon::V6_vS32b_ai
1214 : Hexagon::V6_vS32Ub_ai;
1223 case Hexagon::PS_vstorerw_ai: {
1227 int Offset =
MI.getOperand(1).getImm();
1228 unsigned VecOffset = HRI.getSpillSize(Hexagon::HvxVRRegClass);
1229 Align NeedAlign = HRI.getSpillAlign(Hexagon::HvxVRRegClass);
1230 unsigned NewOpc = UseAligned(
MI, NeedAlign) ? Hexagon::V6_vS32b_ai
1231 : Hexagon::V6_vS32Ub_ai;
1235 .
addReg(HRI.getSubReg(SrcReg, Hexagon::vsub_lo))
1240 .
addReg(HRI.getSubReg(SrcReg, Hexagon::vsub_hi))
1245 case Hexagon::PS_true: {
1253 case Hexagon::PS_false: {
1261 case Hexagon::PS_qtrue: {
1268 case Hexagon::PS_qfalse: {
1275 case Hexagon::PS_vdd0: {
1283 case Hexagon::PS_vmulw: {
1286 Register Src1Reg =
MI.getOperand(1).getReg();
1287 Register Src2Reg =
MI.getOperand(2).getReg();
1288 Register Src1SubHi = HRI.getSubReg(Src1Reg, Hexagon::isub_hi);
1289 Register Src1SubLo = HRI.getSubReg(Src1Reg, Hexagon::isub_lo);
1290 Register Src2SubHi = HRI.getSubReg(Src2Reg, Hexagon::isub_hi);
1291 Register Src2SubLo = HRI.getSubReg(Src2Reg, Hexagon::isub_lo);
1293 HRI.getSubReg(DstReg, Hexagon::isub_hi))
1297 HRI.getSubReg(DstReg, Hexagon::isub_lo))
1301 MRI.clearKillFlags(Src1SubHi);
1302 MRI.clearKillFlags(Src1SubLo);
1303 MRI.clearKillFlags(Src2SubHi);
1304 MRI.clearKillFlags(Src2SubLo);
1307 case Hexagon::PS_vmulw_acc: {
1310 Register Src1Reg =
MI.getOperand(1).getReg();
1311 Register Src2Reg =
MI.getOperand(2).getReg();
1312 Register Src3Reg =
MI.getOperand(3).getReg();
1313 Register Src1SubHi = HRI.getSubReg(Src1Reg, Hexagon::isub_hi);
1314 Register Src1SubLo = HRI.getSubReg(Src1Reg, Hexagon::isub_lo);
1315 Register Src2SubHi = HRI.getSubReg(Src2Reg, Hexagon::isub_hi);
1316 Register Src2SubLo = HRI.getSubReg(Src2Reg, Hexagon::isub_lo);
1317 Register Src3SubHi = HRI.getSubReg(Src3Reg, Hexagon::isub_hi);
1318 Register Src3SubLo = HRI.getSubReg(Src3Reg, Hexagon::isub_lo);
1320 HRI.getSubReg(DstReg, Hexagon::isub_hi))
1325 HRI.getSubReg(DstReg, Hexagon::isub_lo))
1330 MRI.clearKillFlags(Src1SubHi);
1331 MRI.clearKillFlags(Src1SubLo);
1332 MRI.clearKillFlags(Src2SubHi);
1333 MRI.clearKillFlags(Src2SubLo);
1334 MRI.clearKillFlags(Src3SubHi);
1335 MRI.clearKillFlags(Src3SubLo);
1338 case Hexagon::PS_pselect: {
1353 .
addReg(Pu, (Rd == Rt) ? K1 : 0)
1362 case Hexagon::PS_vselect: {
1374 unsigned S = Op0.
getReg() != Op3.
getReg() ? PState & ~RegState::Kill
1395 case Hexagon::PS_wselect: {
1407 unsigned S = Op0.
getReg() != Op3.
getReg() ? PState & ~RegState::Kill
1435 case Hexagon::PS_crash: {
1452 OS <<
"MisalignedCrash";
1456 static const CrashPseudoSourceValue CrashPSV(MF.
getTarget());
1468 case Hexagon::PS_tailcall_i:
1469 MI.setDesc(
get(Hexagon::J2_jump));
1471 case Hexagon::PS_tailcall_r:
1472 case Hexagon::PS_jmpret:
1473 MI.setDesc(
get(Hexagon::J2_jumpr));
1475 case Hexagon::PS_jmprett:
1476 MI.setDesc(
get(Hexagon::J2_jumprt));
1478 case Hexagon::PS_jmpretf:
1479 MI.setDesc(
get(Hexagon::J2_jumprf));
1481 case Hexagon::PS_jmprettnewpt:
1482 MI.setDesc(
get(Hexagon::J2_jumprtnewpt));
1484 case Hexagon::PS_jmpretfnewpt:
1485 MI.setDesc(
get(Hexagon::J2_jumprfnewpt));
1487 case Hexagon::PS_jmprettnew:
1488 MI.setDesc(
get(Hexagon::J2_jumprtnew));
1490 case Hexagon::PS_jmpretfnew:
1491 MI.setDesc(
get(Hexagon::J2_jumprfnew));
1494 case Hexagon::PS_loadrub_pci:
1495 return RealCirc(Hexagon::L2_loadrub_pci,
true, 4);
1496 case Hexagon::PS_loadrb_pci:
1497 return RealCirc(Hexagon::L2_loadrb_pci,
true, 4);
1498 case Hexagon::PS_loadruh_pci:
1499 return RealCirc(Hexagon::L2_loadruh_pci,
true, 4);
1500 case Hexagon::PS_loadrh_pci:
1501 return RealCirc(Hexagon::L2_loadrh_pci,
true, 4);
1502 case Hexagon::PS_loadri_pci:
1503 return RealCirc(Hexagon::L2_loadri_pci,
true, 4);
1504 case Hexagon::PS_loadrd_pci:
1505 return RealCirc(Hexagon::L2_loadrd_pci,
true, 4);
1506 case Hexagon::PS_loadrub_pcr:
1507 return RealCirc(Hexagon::L2_loadrub_pcr,
false, 3);
1508 case Hexagon::PS_loadrb_pcr:
1509 return RealCirc(Hexagon::L2_loadrb_pcr,
false, 3);
1510 case Hexagon::PS_loadruh_pcr:
1511 return RealCirc(Hexagon::L2_loadruh_pcr,
false, 3);
1512 case Hexagon::PS_loadrh_pcr:
1513 return RealCirc(Hexagon::L2_loadrh_pcr,
false, 3);
1514 case Hexagon::PS_loadri_pcr:
1515 return RealCirc(Hexagon::L2_loadri_pcr,
false, 3);
1516 case Hexagon::PS_loadrd_pcr:
1517 return RealCirc(Hexagon::L2_loadrd_pcr,
false, 3);
1518 case Hexagon::PS_storerb_pci:
1519 return RealCirc(Hexagon::S2_storerb_pci,
true, 3);
1520 case Hexagon::PS_storerh_pci:
1521 return RealCirc(Hexagon::S2_storerh_pci,
true, 3);
1522 case Hexagon::PS_storerf_pci:
1523 return RealCirc(Hexagon::S2_storerf_pci,
true, 3);
1524 case Hexagon::PS_storeri_pci:
1525 return RealCirc(Hexagon::S2_storeri_pci,
true, 3);
1526 case Hexagon::PS_storerd_pci:
1527 return RealCirc(Hexagon::S2_storerd_pci,
true, 3);
1528 case Hexagon::PS_storerb_pcr:
1529 return RealCirc(Hexagon::S2_storerb_pcr,
false, 2);
1530 case Hexagon::PS_storerh_pcr:
1531 return RealCirc(Hexagon::S2_storerh_pcr,
false, 2);
1532 case Hexagon::PS_storerf_pcr:
1533 return RealCirc(Hexagon::S2_storerf_pcr,
false, 2);
1534 case Hexagon::PS_storeri_pcr:
1535 return RealCirc(Hexagon::S2_storeri_pcr,
false, 2);
1536 case Hexagon::PS_storerd_pcr:
1537 return RealCirc(Hexagon::S2_storerd_pcr,
false, 2);
1547 unsigned Opc =
MI.getOpcode();
1551 case Hexagon::V6_vgathermh_pseudo:
1553 .
add(
MI.getOperand(2))
1554 .
add(
MI.getOperand(3))
1555 .
add(
MI.getOperand(4));
1557 .
add(
MI.getOperand(0))
1561 return First.getInstrIterator();
1563 case Hexagon::V6_vgathermw_pseudo:
1565 .
add(
MI.getOperand(2))
1566 .
add(
MI.getOperand(3))
1567 .
add(
MI.getOperand(4));
1569 .
add(
MI.getOperand(0))
1573 return First.getInstrIterator();
1575 case Hexagon::V6_vgathermhw_pseudo:
1577 .
add(
MI.getOperand(2))
1578 .
add(
MI.getOperand(3))
1579 .
add(
MI.getOperand(4));
1581 .
add(
MI.getOperand(0))
1585 return First.getInstrIterator();
1587 case Hexagon::V6_vgathermhq_pseudo:
1589 .
add(
MI.getOperand(2))
1590 .
add(
MI.getOperand(3))
1591 .
add(
MI.getOperand(4))
1592 .
add(
MI.getOperand(5));
1594 .
add(
MI.getOperand(0))
1598 return First.getInstrIterator();
1600 case Hexagon::V6_vgathermwq_pseudo:
1602 .
add(
MI.getOperand(2))
1603 .
add(
MI.getOperand(3))
1604 .
add(
MI.getOperand(4))
1605 .
add(
MI.getOperand(5));
1607 .
add(
MI.getOperand(0))
1611 return First.getInstrIterator();
1613 case Hexagon::V6_vgathermhwq_pseudo:
1615 .
add(
MI.getOperand(2))
1616 .
add(
MI.getOperand(3))
1617 .
add(
MI.getOperand(4))
1618 .
add(
MI.getOperand(5));
1620 .
add(
MI.getOperand(0))
1624 return First.getInstrIterator();
1627 return MI.getIterator();
1636 assert(
Cond[0].
isImm() &&
"First entry in the cond vector not imm-val");
1637 unsigned opcode =
Cond[0].getImm();
1643 Cond[0].setImm(NewOpcode);
1677 int Opc =
MI.getOpcode();
1690 unsigned NOp = 0, NumOps =
MI.getNumOperands();
1691 while (NOp < NumOps) {
1693 if (!
Op.isReg() || !
Op.isDef() ||
Op.isImplicit())
1700 unsigned PredRegPos, PredRegFlags;
1701 bool GotPredReg =
getPredReg(
Cond, PredReg, PredRegPos, PredRegFlags);
1704 T.addReg(PredReg, PredRegFlags);
1705 while (NOp < NumOps)
1706 T.add(
MI.getOperand(NOp++));
1708 MI.setDesc(
get(PredOpc));
1709 while (
unsigned n =
MI.getNumOperands())
1710 MI.removeOperand(n-1);
1711 for (
unsigned i = 0, n =
T->getNumOperands(); i < n; ++i)
1712 MI.addOperand(
T->getOperand(i));
1718 MRI.clearKillFlags(PredReg);
1729 std::vector<MachineOperand> &Pred,
1730 bool SkipDead)
const {
1738 if (RC == &Hexagon::PredRegsRegClass) {
1743 }
else if (MO.isRegMask()) {
1744 for (
Register PR : Hexagon::PredRegsRegClass) {
1745 if (!
MI.modifiesRegister(PR, &HRI))
1756 if (!
MI.getDesc().isPredicable())
1766 switch (
MI.getOpcode()) {
1767 case Hexagon::V6_vL32b_ai:
1768 case Hexagon::V6_vL32b_pi:
1769 case Hexagon::V6_vL32b_ppu:
1770 case Hexagon::V6_vL32b_cur_ai:
1771 case Hexagon::V6_vL32b_cur_pi:
1772 case Hexagon::V6_vL32b_cur_ppu:
1773 case Hexagon::V6_vL32b_nt_ai:
1774 case Hexagon::V6_vL32b_nt_pi:
1775 case Hexagon::V6_vL32b_nt_ppu:
1776 case Hexagon::V6_vL32b_tmp_ai:
1777 case Hexagon::V6_vL32b_tmp_pi:
1778 case Hexagon::V6_vL32b_tmp_ppu:
1779 case Hexagon::V6_vL32b_nt_cur_ai:
1780 case Hexagon::V6_vL32b_nt_cur_pi:
1781 case Hexagon::V6_vL32b_nt_cur_ppu:
1782 case Hexagon::V6_vL32b_nt_tmp_ai:
1783 case Hexagon::V6_vL32b_nt_tmp_pi:
1784 case Hexagon::V6_vL32b_nt_tmp_ppu:
1800 if (
MI.isDebugInstr())
1816 if (
MI.getDesc().isTerminator() ||
MI.isPosition())
1820 if (
MI.getOpcode() == TargetOpcode::INLINEASM_BR)
1844 bool atInsnStart =
true;
1847 for (; *Str; ++Str) {
1851 if (atInsnStart && !isSpace(
static_cast<unsigned char>(*Str))) {
1853 atInsnStart =
false;
1857 atInsnStart =
false;
1880 int64_t &
Value)
const {
1881 unsigned Opc =
MI.getOpcode();
1885 case Hexagon::C2_cmpeq:
1886 case Hexagon::C2_cmpeqp:
1887 case Hexagon::C2_cmpgt:
1888 case Hexagon::C2_cmpgtp:
1889 case Hexagon::C2_cmpgtu:
1890 case Hexagon::C2_cmpgtup:
1891 case Hexagon::C4_cmpneq:
1892 case Hexagon::C4_cmplte:
1893 case Hexagon::C4_cmplteu:
1894 case Hexagon::C2_cmpeqi:
1895 case Hexagon::C2_cmpgti:
1896 case Hexagon::C2_cmpgtui:
1897 case Hexagon::C4_cmpneqi:
1898 case Hexagon::C4_cmplteui:
1899 case Hexagon::C4_cmpltei:
1900 SrcReg =
MI.getOperand(1).getReg();
1903 case Hexagon::A4_cmpbeq:
1904 case Hexagon::A4_cmpbgt:
1905 case Hexagon::A4_cmpbgtu:
1906 case Hexagon::A4_cmpbeqi:
1907 case Hexagon::A4_cmpbgti:
1908 case Hexagon::A4_cmpbgtui:
1909 SrcReg =
MI.getOperand(1).getReg();
1912 case Hexagon::A4_cmpheq:
1913 case Hexagon::A4_cmphgt:
1914 case Hexagon::A4_cmphgtu:
1915 case Hexagon::A4_cmpheqi:
1916 case Hexagon::A4_cmphgti:
1917 case Hexagon::A4_cmphgtui:
1918 SrcReg =
MI.getOperand(1).getReg();
1925 case Hexagon::C2_cmpeq:
1926 case Hexagon::C2_cmpeqp:
1927 case Hexagon::C2_cmpgt:
1928 case Hexagon::C2_cmpgtp:
1929 case Hexagon::C2_cmpgtu:
1930 case Hexagon::C2_cmpgtup:
1931 case Hexagon::A4_cmpbeq:
1932 case Hexagon::A4_cmpbgt:
1933 case Hexagon::A4_cmpbgtu:
1934 case Hexagon::A4_cmpheq:
1935 case Hexagon::A4_cmphgt:
1936 case Hexagon::A4_cmphgtu:
1937 case Hexagon::C4_cmpneq:
1938 case Hexagon::C4_cmplte:
1939 case Hexagon::C4_cmplteu:
1940 SrcReg2 =
MI.getOperand(2).getReg();
1944 case Hexagon::C2_cmpeqi:
1945 case Hexagon::C2_cmpgtui:
1946 case Hexagon::C2_cmpgti:
1947 case Hexagon::C4_cmpneqi:
1948 case Hexagon::C4_cmplteui:
1949 case Hexagon::C4_cmpltei:
1950 case Hexagon::A4_cmpbeqi:
1951 case Hexagon::A4_cmpbgti:
1952 case Hexagon::A4_cmpbgtui:
1953 case Hexagon::A4_cmpheqi:
1954 case Hexagon::A4_cmphgti:
1955 case Hexagon::A4_cmphgtui: {
1960 Value =
MI.getOperand(2).getImm();
1970 unsigned *PredCost)
const {
1996 unsigned BasePosA, OffsetPosA;
2004 unsigned BasePosB, OffsetPosB;
2011 if (BaseRegA != BaseRegB || BaseSubA != BaseSubB)
2029 if (OffsetA > OffsetB) {
2031 return SizeB <= OffDiff;
2033 if (OffsetA < OffsetB) {
2035 return SizeA <= OffDiff;
2045 unsigned BasePos = 0, OffsetPos = 0;
2049 if (OffsetOp.
isImm()) {
2053 }
else if (
MI.getOpcode() == Hexagon::A2_addi) {
2055 if (AddOp.
isImm()) {
2064std::pair<unsigned, unsigned>
2072 using namespace HexagonII;
2074 static const std::pair<unsigned, const char*> Flags[] = {
2075 {MO_PCREL,
"hexagon-pcrel"},
2076 {MO_GOT,
"hexagon-got"},
2077 {MO_LO16,
"hexagon-lo16"},
2078 {MO_HI16,
"hexagon-hi16"},
2079 {MO_GPREL,
"hexagon-gprel"},
2080 {MO_GDGOT,
"hexagon-gdgot"},
2081 {MO_GDPLT,
"hexagon-gdplt"},
2082 {MO_IE,
"hexagon-ie"},
2083 {MO_IEGOT,
"hexagon-iegot"},
2084 {MO_TPREL,
"hexagon-tprel"}
2091 using namespace HexagonII;
2093 static const std::pair<unsigned, const char*> Flags[] = {
2094 {HMOTF_ConstExtended,
"hexagon-ext"}
2102 if (VT == MVT::i1) {
2103 TRC = &Hexagon::PredRegsRegClass;
2104 }
else if (VT == MVT::i32 || VT == MVT::f32) {
2105 TRC = &Hexagon::IntRegsRegClass;
2106 }
else if (VT == MVT::i64 || VT == MVT::f64) {
2107 TRC = &Hexagon::DoubleRegsRegClass;
2131 !
MI.getDesc().mayStore() &&
2132 MI.getDesc().getOpcode() != Hexagon::S2_allocframe &&
2133 MI.getDesc().getOpcode() != Hexagon::L2_deallocframe &&
2178 assert(MO.
isImm() &&
"Extendable operand must be Immediate type");
2182 int32_t SValue =
Value;
2185 return SValue < MinValue || SValue > MaxValue;
2190 return UValue < MinValue || UValue > MaxValue;
2194 switch (
MI.getOpcode()) {
2195 case Hexagon::L4_return:
2196 case Hexagon::L4_return_t:
2197 case Hexagon::L4_return_f:
2198 case Hexagon::L4_return_tnew_pnt:
2199 case Hexagon::L4_return_fnew_pnt:
2200 case Hexagon::L4_return_tnew_pt:
2201 case Hexagon::L4_return_fnew_pt:
2222 for (
auto &RegA : DefsA)
2223 for (
auto &RegB : UsesB) {
2240 switch (
MI.getOpcode()) {
2241 case Hexagon::V6_vL32b_cur_pi:
2242 case Hexagon::V6_vL32b_cur_ai:
2266 return (Opcode == Hexagon::ENDLOOP0 ||
2267 Opcode == Hexagon::ENDLOOP1);
2292 switch (
MI.getOpcode()) {
2294 case Hexagon::PS_fi:
2295 case Hexagon::PS_fia:
2320 unsigned Opcode =
MI.getOpcode();
2330 if (!
I.mayLoad() && !
I.mayStore())
2336 switch (
MI.getOpcode()) {
2337 case Hexagon::J2_callr:
2338 case Hexagon::J2_callrf:
2339 case Hexagon::J2_callrt:
2340 case Hexagon::PS_call_nr:
2347 switch (
MI.getOpcode()) {
2348 case Hexagon::L4_return:
2349 case Hexagon::L4_return_t:
2350 case Hexagon::L4_return_f:
2351 case Hexagon::L4_return_fnew_pnt:
2352 case Hexagon::L4_return_fnew_pt:
2353 case Hexagon::L4_return_tnew_pnt:
2354 case Hexagon::L4_return_tnew_pt:
2361 switch (
MI.getOpcode()) {
2362 case Hexagon::J2_jumpr:
2363 case Hexagon::J2_jumprt:
2364 case Hexagon::J2_jumprf:
2365 case Hexagon::J2_jumprtnewpt:
2366 case Hexagon::J2_jumprfnewpt:
2367 case Hexagon::J2_jumprtnew:
2368 case Hexagon::J2_jumprfnew:
2379 unsigned offset)
const {
2383 return isInt<11>(offset);
2385 switch (
MI.getOpcode()) {
2389 case Hexagon::J2_jump:
2390 case Hexagon::J2_call:
2391 case Hexagon::PS_call_nr:
2392 return isInt<24>(offset);
2393 case Hexagon::J2_jumpt:
2394 case Hexagon::J2_jumpf:
2395 case Hexagon::J2_jumptnew:
2396 case Hexagon::J2_jumptnewpt:
2397 case Hexagon::J2_jumpfnew:
2398 case Hexagon::J2_jumpfnewpt:
2399 case Hexagon::J2_callt:
2400 case Hexagon::J2_callf:
2401 return isInt<17>(offset);
2402 case Hexagon::J2_loop0i:
2403 case Hexagon::J2_loop0iext:
2404 case Hexagon::J2_loop0r:
2405 case Hexagon::J2_loop0rext:
2406 case Hexagon::J2_loop1i:
2407 case Hexagon::J2_loop1iext:
2408 case Hexagon::J2_loop1r:
2409 case Hexagon::J2_loop1rext:
2410 return isInt<9>(offset);
2412 case Hexagon::J4_cmpeqi_tp0_jump_nt:
2413 case Hexagon::J4_cmpeqi_tp1_jump_nt:
2414 case Hexagon::J4_cmpeqn1_tp0_jump_nt:
2415 case Hexagon::J4_cmpeqn1_tp1_jump_nt:
2416 return isInt<11>(offset);
2427 unsigned Opcode =
MI.getOpcode();
2428 return Opcode == Hexagon::J2_loop0i ||
2429 Opcode == Hexagon::J2_loop0r ||
2430 Opcode == Hexagon::J2_loop0iext ||
2431 Opcode == Hexagon::J2_loop0rext ||
2432 Opcode == Hexagon::J2_loop1i ||
2433 Opcode == Hexagon::J2_loop1r ||
2434 Opcode == Hexagon::J2_loop1iext ||
2435 Opcode == Hexagon::J2_loop1rext;
2439 switch (
MI.getOpcode()) {
2440 default:
return false;
2441 case Hexagon::L4_iadd_memopw_io:
2442 case Hexagon::L4_isub_memopw_io:
2443 case Hexagon::L4_add_memopw_io:
2444 case Hexagon::L4_sub_memopw_io:
2445 case Hexagon::L4_and_memopw_io:
2446 case Hexagon::L4_or_memopw_io:
2447 case Hexagon::L4_iadd_memoph_io:
2448 case Hexagon::L4_isub_memoph_io:
2449 case Hexagon::L4_add_memoph_io:
2450 case Hexagon::L4_sub_memoph_io:
2451 case Hexagon::L4_and_memoph_io:
2452 case Hexagon::L4_or_memoph_io:
2453 case Hexagon::L4_iadd_memopb_io:
2454 case Hexagon::L4_isub_memopb_io:
2455 case Hexagon::L4_add_memopb_io:
2456 case Hexagon::L4_sub_memopb_io:
2457 case Hexagon::L4_and_memopb_io:
2458 case Hexagon::L4_or_memopb_io:
2459 case Hexagon::L4_ior_memopb_io:
2460 case Hexagon::L4_ior_memoph_io:
2461 case Hexagon::L4_ior_memopw_io:
2462 case Hexagon::L4_iand_memopb_io:
2463 case Hexagon::L4_iand_memoph_io:
2464 case Hexagon::L4_iand_memopw_io:
2504 unsigned OperandNum)
const {
2554 return MI.getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4 ||
2555 MI.getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4_EXT ||
2556 MI.getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4_PIC ||
2557 MI.getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4_EXT_PIC;
2561 switch (
MI.getOpcode()) {
2563 case Hexagon::L2_loadrb_io:
2564 case Hexagon::L4_loadrb_ur:
2565 case Hexagon::L4_loadrb_ap:
2566 case Hexagon::L2_loadrb_pr:
2567 case Hexagon::L2_loadrb_pbr:
2568 case Hexagon::L2_loadrb_pi:
2569 case Hexagon::L2_loadrb_pci:
2570 case Hexagon::L2_loadrb_pcr:
2571 case Hexagon::L2_loadbsw2_io:
2572 case Hexagon::L4_loadbsw2_ur:
2573 case Hexagon::L4_loadbsw2_ap:
2574 case Hexagon::L2_loadbsw2_pr:
2575 case Hexagon::L2_loadbsw2_pbr:
2576 case Hexagon::L2_loadbsw2_pi:
2577 case Hexagon::L2_loadbsw2_pci:
2578 case Hexagon::L2_loadbsw2_pcr:
2579 case Hexagon::L2_loadbsw4_io:
2580 case Hexagon::L4_loadbsw4_ur:
2581 case Hexagon::L4_loadbsw4_ap:
2582 case Hexagon::L2_loadbsw4_pr:
2583 case Hexagon::L2_loadbsw4_pbr:
2584 case Hexagon::L2_loadbsw4_pi:
2585 case Hexagon::L2_loadbsw4_pci:
2586 case Hexagon::L2_loadbsw4_pcr:
2587 case Hexagon::L4_loadrb_rr:
2588 case Hexagon::L2_ploadrbt_io:
2589 case Hexagon::L2_ploadrbt_pi:
2590 case Hexagon::L2_ploadrbf_io:
2591 case Hexagon::L2_ploadrbf_pi:
2592 case Hexagon::L2_ploadrbtnew_io:
2593 case Hexagon::L2_ploadrbfnew_io:
2594 case Hexagon::L4_ploadrbt_rr:
2595 case Hexagon::L4_ploadrbf_rr:
2596 case Hexagon::L4_ploadrbtnew_rr:
2597 case Hexagon::L4_ploadrbfnew_rr:
2598 case Hexagon::L2_ploadrbtnew_pi:
2599 case Hexagon::L2_ploadrbfnew_pi:
2600 case Hexagon::L4_ploadrbt_abs:
2601 case Hexagon::L4_ploadrbf_abs:
2602 case Hexagon::L4_ploadrbtnew_abs:
2603 case Hexagon::L4_ploadrbfnew_abs:
2604 case Hexagon::L2_loadrbgp:
2606 case Hexagon::L2_loadrh_io:
2607 case Hexagon::L4_loadrh_ur:
2608 case Hexagon::L4_loadrh_ap:
2609 case Hexagon::L2_loadrh_pr:
2610 case Hexagon::L2_loadrh_pbr:
2611 case Hexagon::L2_loadrh_pi:
2612 case Hexagon::L2_loadrh_pci:
2613 case Hexagon::L2_loadrh_pcr:
2614 case Hexagon::L4_loadrh_rr:
2615 case Hexagon::L2_ploadrht_io:
2616 case Hexagon::L2_ploadrht_pi:
2617 case Hexagon::L2_ploadrhf_io:
2618 case Hexagon::L2_ploadrhf_pi:
2619 case Hexagon::L2_ploadrhtnew_io:
2620 case Hexagon::L2_ploadrhfnew_io:
2621 case Hexagon::L4_ploadrht_rr:
2622 case Hexagon::L4_ploadrhf_rr:
2623 case Hexagon::L4_ploadrhtnew_rr:
2624 case Hexagon::L4_ploadrhfnew_rr:
2625 case Hexagon::L2_ploadrhtnew_pi:
2626 case Hexagon::L2_ploadrhfnew_pi:
2627 case Hexagon::L4_ploadrht_abs:
2628 case Hexagon::L4_ploadrhf_abs:
2629 case Hexagon::L4_ploadrhtnew_abs:
2630 case Hexagon::L4_ploadrhfnew_abs:
2631 case Hexagon::L2_loadrhgp:
2644 switch (
MI.getOpcode()) {
2645 case Hexagon::STriw_pred:
2646 case Hexagon::LDriw_pred:
2657 for (
auto &
Op :
MI.operands())
2658 if (
Op.isGlobal() ||
Op.isSymbol())
2665 unsigned SchedClass =
MI.getDesc().getSchedClass();
2666 return is_TC1(SchedClass);
2670 unsigned SchedClass =
MI.getDesc().getSchedClass();
2671 return is_TC2(SchedClass);
2675 unsigned SchedClass =
MI.getDesc().getSchedClass();
2680 unsigned SchedClass =
MI.getDesc().getSchedClass();
2691 for (
int I = 0;
I <
N;
I++)
2696 if (MI2.
getOpcode() == Hexagon::V6_vS32b_pi)
2728 return isInt<4>(Count);
2738 return isInt<3>(Count);
2757 case Hexagon::PS_vstorerq_ai:
2758 case Hexagon::PS_vstorerv_ai:
2759 case Hexagon::PS_vstorerw_ai:
2760 case Hexagon::PS_vstorerw_nt_ai:
2761 case Hexagon::PS_vloadrq_ai:
2762 case Hexagon::PS_vloadrv_ai:
2763 case Hexagon::PS_vloadrw_ai:
2764 case Hexagon::PS_vloadrw_nt_ai:
2765 case Hexagon::V6_vL32b_ai:
2766 case Hexagon::V6_vS32b_ai:
2767 case Hexagon::V6_vS32b_pred_ai:
2768 case Hexagon::V6_vS32b_npred_ai:
2769 case Hexagon::V6_vS32b_qpred_ai:
2770 case Hexagon::V6_vS32b_nqpred_ai:
2771 case Hexagon::V6_vS32b_new_ai:
2772 case Hexagon::V6_vS32b_new_pred_ai:
2773 case Hexagon::V6_vS32b_new_npred_ai:
2774 case Hexagon::V6_vS32b_nt_pred_ai:
2775 case Hexagon::V6_vS32b_nt_npred_ai:
2776 case Hexagon::V6_vS32b_nt_new_ai:
2777 case Hexagon::V6_vS32b_nt_new_pred_ai:
2778 case Hexagon::V6_vS32b_nt_new_npred_ai:
2779 case Hexagon::V6_vS32b_nt_qpred_ai:
2780 case Hexagon::V6_vS32b_nt_nqpred_ai:
2781 case Hexagon::V6_vL32b_nt_ai:
2782 case Hexagon::V6_vS32b_nt_ai:
2783 case Hexagon::V6_vL32Ub_ai:
2784 case Hexagon::V6_vS32Ub_ai:
2785 case Hexagon::V6_vL32b_cur_ai:
2786 case Hexagon::V6_vL32b_tmp_ai:
2787 case Hexagon::V6_vL32b_pred_ai:
2788 case Hexagon::V6_vL32b_npred_ai:
2789 case Hexagon::V6_vL32b_cur_pred_ai:
2790 case Hexagon::V6_vL32b_cur_npred_ai:
2791 case Hexagon::V6_vL32b_tmp_pred_ai:
2792 case Hexagon::V6_vL32b_tmp_npred_ai:
2793 case Hexagon::V6_vL32b_nt_cur_ai:
2794 case Hexagon::V6_vL32b_nt_tmp_ai:
2795 case Hexagon::V6_vL32b_nt_pred_ai:
2796 case Hexagon::V6_vL32b_nt_npred_ai:
2797 case Hexagon::V6_vL32b_nt_cur_pred_ai:
2798 case Hexagon::V6_vL32b_nt_cur_npred_ai:
2799 case Hexagon::V6_vL32b_nt_tmp_pred_ai:
2800 case Hexagon::V6_vL32b_nt_tmp_npred_ai:
2801 case Hexagon::V6_vgathermh_pseudo:
2802 case Hexagon::V6_vgathermw_pseudo:
2803 case Hexagon::V6_vgathermhw_pseudo:
2804 case Hexagon::V6_vgathermhq_pseudo:
2805 case Hexagon::V6_vgathermwq_pseudo:
2806 case Hexagon::V6_vgathermhwq_pseudo: {
2807 unsigned VectorSize =
TRI->getSpillSize(Hexagon::HvxVRRegClass);
2809 if (
Offset & (VectorSize-1))
2814 case Hexagon::J2_loop0i:
2815 case Hexagon::J2_loop1i:
2816 return isUInt<10>(
Offset);
2818 case Hexagon::S4_storeirb_io:
2819 case Hexagon::S4_storeirbt_io:
2820 case Hexagon::S4_storeirbf_io:
2821 return isUInt<6>(
Offset);
2823 case Hexagon::S4_storeirh_io:
2824 case Hexagon::S4_storeirht_io:
2825 case Hexagon::S4_storeirhf_io:
2826 return isShiftedUInt<6,1>(
Offset);
2828 case Hexagon::S4_storeiri_io:
2829 case Hexagon::S4_storeirit_io:
2830 case Hexagon::S4_storeirif_io:
2831 return isShiftedUInt<6,2>(
Offset);
2833 case Hexagon::A4_cmpbeqi:
2834 return isUInt<8>(
Offset);
2835 case Hexagon::A4_cmpbgti:
2843 case Hexagon::L2_loadri_io:
2844 case Hexagon::S2_storeri_io:
2848 case Hexagon::L2_loadrd_io:
2849 case Hexagon::S2_storerd_io:
2853 case Hexagon::L2_loadrh_io:
2854 case Hexagon::L2_loadruh_io:
2855 case Hexagon::S2_storerh_io:
2856 case Hexagon::S2_storerf_io:
2860 case Hexagon::L2_loadrb_io:
2861 case Hexagon::L2_loadrub_io:
2862 case Hexagon::S2_storerb_io:
2866 case Hexagon::A2_addi:
2870 case Hexagon::L4_iadd_memopw_io:
2871 case Hexagon::L4_isub_memopw_io:
2872 case Hexagon::L4_add_memopw_io:
2873 case Hexagon::L4_sub_memopw_io:
2874 case Hexagon::L4_iand_memopw_io:
2875 case Hexagon::L4_ior_memopw_io:
2876 case Hexagon::L4_and_memopw_io:
2877 case Hexagon::L4_or_memopw_io:
2880 case Hexagon::L4_iadd_memoph_io:
2881 case Hexagon::L4_isub_memoph_io:
2882 case Hexagon::L4_add_memoph_io:
2883 case Hexagon::L4_sub_memoph_io:
2884 case Hexagon::L4_iand_memoph_io:
2885 case Hexagon::L4_ior_memoph_io:
2886 case Hexagon::L4_and_memoph_io:
2887 case Hexagon::L4_or_memoph_io:
2890 case Hexagon::L4_iadd_memopb_io:
2891 case Hexagon::L4_isub_memopb_io:
2892 case Hexagon::L4_add_memopb_io:
2893 case Hexagon::L4_sub_memopb_io:
2894 case Hexagon::L4_iand_memopb_io:
2895 case Hexagon::L4_ior_memopb_io:
2896 case Hexagon::L4_and_memopb_io:
2897 case Hexagon::L4_or_memopb_io:
2902 case Hexagon::STriw_pred:
2903 case Hexagon::LDriw_pred:
2904 case Hexagon::STriw_ctr:
2905 case Hexagon::LDriw_ctr:
2908 case Hexagon::PS_fi:
2909 case Hexagon::PS_fia:
2910 case Hexagon::INLINEASM:
2913 case Hexagon::L2_ploadrbt_io:
2914 case Hexagon::L2_ploadrbf_io:
2915 case Hexagon::L2_ploadrubt_io:
2916 case Hexagon::L2_ploadrubf_io:
2917 case Hexagon::S2_pstorerbt_io:
2918 case Hexagon::S2_pstorerbf_io:
2919 return isUInt<6>(
Offset);
2921 case Hexagon::L2_ploadrht_io:
2922 case Hexagon::L2_ploadrhf_io:
2923 case Hexagon::L2_ploadruht_io:
2924 case Hexagon::L2_ploadruhf_io:
2925 case Hexagon::S2_pstorerht_io:
2926 case Hexagon::S2_pstorerhf_io:
2927 return isShiftedUInt<6,1>(
Offset);
2929 case Hexagon::L2_ploadrit_io:
2930 case Hexagon::L2_ploadrif_io:
2931 case Hexagon::S2_pstorerit_io:
2932 case Hexagon::S2_pstorerif_io:
2933 return isShiftedUInt<6,2>(
Offset);
2935 case Hexagon::L2_ploadrdt_io:
2936 case Hexagon::L2_ploadrdf_io:
2937 case Hexagon::S2_pstorerdt_io:
2938 case Hexagon::S2_pstorerdf_io:
2939 return isShiftedUInt<6,3>(
Offset);
2941 case Hexagon::L2_loadbsw2_io:
2942 case Hexagon::L2_loadbzw2_io:
2943 return isShiftedInt<11,1>(
Offset);
2945 case Hexagon::L2_loadbsw4_io:
2946 case Hexagon::L2_loadbzw4_io:
2947 return isShiftedInt<11,2>(
Offset);
2950 dbgs() <<
"Failed Opcode is : " << Opcode <<
" (" <<
getName(Opcode)
2953 "Please define it in the above switch statement!");
2983 switch (
MI.getOpcode()) {
2985 case Hexagon::L2_loadrub_io:
2986 case Hexagon::L4_loadrub_ur:
2987 case Hexagon::L4_loadrub_ap:
2988 case Hexagon::L2_loadrub_pr:
2989 case Hexagon::L2_loadrub_pbr:
2990 case Hexagon::L2_loadrub_pi:
2991 case Hexagon::L2_loadrub_pci:
2992 case Hexagon::L2_loadrub_pcr:
2993 case Hexagon::L2_loadbzw2_io:
2994 case Hexagon::L4_loadbzw2_ur:
2995 case Hexagon::L4_loadbzw2_ap:
2996 case Hexagon::L2_loadbzw2_pr:
2997 case Hexagon::L2_loadbzw2_pbr:
2998 case Hexagon::L2_loadbzw2_pi:
2999 case Hexagon::L2_loadbzw2_pci:
3000 case Hexagon::L2_loadbzw2_pcr:
3001 case Hexagon::L2_loadbzw4_io:
3002 case Hexagon::L4_loadbzw4_ur:
3003 case Hexagon::L4_loadbzw4_ap:
3004 case Hexagon::L2_loadbzw4_pr:
3005 case Hexagon::L2_loadbzw4_pbr:
3006 case Hexagon::L2_loadbzw4_pi:
3007 case Hexagon::L2_loadbzw4_pci:
3008 case Hexagon::L2_loadbzw4_pcr:
3009 case Hexagon::L4_loadrub_rr:
3010 case Hexagon::L2_ploadrubt_io:
3011 case Hexagon::L2_ploadrubt_pi:
3012 case Hexagon::L2_ploadrubf_io:
3013 case Hexagon::L2_ploadrubf_pi:
3014 case Hexagon::L2_ploadrubtnew_io:
3015 case Hexagon::L2_ploadrubfnew_io:
3016 case Hexagon::L4_ploadrubt_rr:
3017 case Hexagon::L4_ploadrubf_rr:
3018 case Hexagon::L4_ploadrubtnew_rr:
3019 case Hexagon::L4_ploadrubfnew_rr:
3020 case Hexagon::L2_ploadrubtnew_pi:
3021 case Hexagon::L2_ploadrubfnew_pi:
3022 case Hexagon::L4_ploadrubt_abs:
3023 case Hexagon::L4_ploadrubf_abs:
3024 case Hexagon::L4_ploadrubtnew_abs:
3025 case Hexagon::L4_ploadrubfnew_abs:
3026 case Hexagon::L2_loadrubgp:
3028 case Hexagon::L2_loadruh_io:
3029 case Hexagon::L4_loadruh_ur:
3030 case Hexagon::L4_loadruh_ap:
3031 case Hexagon::L2_loadruh_pr:
3032 case Hexagon::L2_loadruh_pbr:
3033 case Hexagon::L2_loadruh_pi:
3034 case Hexagon::L2_loadruh_pci:
3035 case Hexagon::L2_loadruh_pcr:
3036 case Hexagon::L4_loadruh_rr:
3037 case Hexagon::L2_ploadruht_io:
3038 case Hexagon::L2_ploadruht_pi:
3039 case Hexagon::L2_ploadruhf_io:
3040 case Hexagon::L2_ploadruhf_pi:
3041 case Hexagon::L2_ploadruhtnew_io:
3042 case Hexagon::L2_ploadruhfnew_io:
3043 case Hexagon::L4_ploadruht_rr:
3044 case Hexagon::L4_ploadruhf_rr:
3045 case Hexagon::L4_ploadruhtnew_rr:
3046 case Hexagon::L4_ploadruhfnew_rr:
3047 case Hexagon::L2_ploadruhtnew_pi:
3048 case Hexagon::L2_ploadruhfnew_pi:
3049 case Hexagon::L4_ploadruht_abs:
3050 case Hexagon::L4_ploadruhf_abs:
3051 case Hexagon::L4_ploadruhtnew_abs:
3052 case Hexagon::L4_ploadruhfnew_abs:
3053 case Hexagon::L2_loadruhgp:
3074 OffsetIsScalable =
false;
3076 if (!BaseOp || !BaseOp->
isReg())
3085 if (Second.
mayStore() &&
First.getOpcode() == Hexagon::S2_allocframe) {
3087 if (
Op.isReg() &&
Op.isUse() &&
Op.getReg() == Hexagon::R29)
3097 if (!Stored.
isReg())
3099 for (
unsigned i = 0, e =
First.getNumOperands(); i < e; ++i) {
3101 if (
Op.isReg() &&
Op.isDef() &&
Op.getReg() == Stored.
getReg())
3110 return Opc == Hexagon::PS_call_nr || Opc == Hexagon::PS_callr_nr;
3126 if (Hexagon::getRegForm(
MI.getOpcode()) >= 0)
3129 if (
MI.getDesc().mayLoad() ||
MI.getDesc().mayStore()) {
3136 NonExtOpcode = Hexagon::changeAddrMode_abs_io(
MI.getOpcode());
3142 NonExtOpcode = Hexagon::changeAddrMode_io_rr(
MI.getOpcode());
3145 NonExtOpcode = Hexagon::changeAddrMode_ur_rr(
MI.getOpcode());
3150 if (NonExtOpcode < 0)
3158 return Hexagon::getRealHWInstr(
MI.getOpcode(),
3159 Hexagon::InstrType_Pseudo) >= 0;
3216 if (!MII->isBundle())
3219 for (++MII; MII != MIE && MII->isInsideBundle(); ++MII) {
3231 if (MO.isRegMask() && MO.clobbersPhysReg(PredReg))
3233 if (MO.isReg() && MO.isDef() && MO.isImplicit() && (MO.getReg() == PredReg))
3239 switch (
MI.getOpcode()) {
3240 case Hexagon::A4_addp_c:
3241 case Hexagon::A4_subp_c:
3242 case Hexagon::A4_tlbmatch:
3243 case Hexagon::A5_ACS:
3244 case Hexagon::F2_sfinvsqrta:
3245 case Hexagon::F2_sfrecipa:
3246 case Hexagon::J2_endloop0:
3247 case Hexagon::J2_endloop01:
3248 case Hexagon::J2_ploop1si:
3249 case Hexagon::J2_ploop1sr:
3250 case Hexagon::J2_ploop2si:
3251 case Hexagon::J2_ploop2sr:
3252 case Hexagon::J2_ploop3si:
3253 case Hexagon::J2_ploop3sr:
3254 case Hexagon::S2_cabacdecbin:
3255 case Hexagon::S2_storew_locked:
3256 case Hexagon::S4_stored_locked:
3263 return Opcode == Hexagon::J2_jumpt ||
3264 Opcode == Hexagon::J2_jumptpt ||
3265 Opcode == Hexagon::J2_jumpf ||
3266 Opcode == Hexagon::J2_jumpfpt ||
3267 Opcode == Hexagon::J2_jumptnew ||
3268 Opcode == Hexagon::J2_jumpfnew ||
3269 Opcode == Hexagon::J2_jumptnewpt ||
3270 Opcode == Hexagon::J2_jumpfnewpt;
3299 unsigned BasePos = 0, OffsetPos = 0;
3309 if (!OffsetOp.
isImm())
3322 unsigned &BasePos,
unsigned &OffsetPos)
const {
3330 }
else if (
MI.mayStore()) {
3333 }
else if (
MI.mayLoad()) {
3348 if (!
MI.getOperand(BasePos).isReg() || !
MI.getOperand(OffsetPos).isImm())
3387 while (
I->isDebugInstr()) {
3392 if (!isUnpredicatedTerminator(*
I))
3401 if (&*
I != LastInst && !
I->isBundle() && isUnpredicatedTerminator(*
I)) {
3402 if (!SecondLastInst) {
3403 SecondLastInst = &*
I;
3425 Register DstReg, SrcReg, Src1Reg, Src2Reg;
3427 switch (
MI.getOpcode()) {
3436 case Hexagon::C2_cmpeq:
3437 case Hexagon::C2_cmpgt:
3438 case Hexagon::C2_cmpgtu:
3439 DstReg =
MI.getOperand(0).getReg();
3440 Src1Reg =
MI.getOperand(1).getReg();
3441 Src2Reg =
MI.getOperand(2).getReg();
3442 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3443 (Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
3447 case Hexagon::C2_cmpeqi:
3448 case Hexagon::C2_cmpgti:
3449 case Hexagon::C2_cmpgtui:
3451 DstReg =
MI.getOperand(0).getReg();
3452 SrcReg =
MI.getOperand(1).getReg();
3453 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3454 (Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
3456 ((isUInt<5>(
MI.getOperand(2).getImm())) ||
3457 (
MI.getOperand(2).getImm() == -1)))
3460 case Hexagon::A2_tfr:
3462 DstReg =
MI.getOperand(0).getReg();
3463 SrcReg =
MI.getOperand(1).getReg();
3467 case Hexagon::A2_tfrsi:
3471 DstReg =
MI.getOperand(0).getReg();
3475 case Hexagon::S2_tstbit_i:
3476 DstReg =
MI.getOperand(0).getReg();
3477 Src1Reg =
MI.getOperand(1).getReg();
3478 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3479 (Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
3480 MI.getOperand(2).isImm() &&
3488 case Hexagon::J2_jumptnew:
3489 case Hexagon::J2_jumpfnew:
3490 case Hexagon::J2_jumptnewpt:
3491 case Hexagon::J2_jumpfnewpt:
3492 Src1Reg =
MI.getOperand(0).getReg();
3493 if (Hexagon::PredRegsRegClass.
contains(Src1Reg) &&
3494 (Hexagon::P0 == Src1Reg || Hexagon::P1 == Src1Reg))
3501 case Hexagon::J2_jump:
3502 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4:
3503 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4_PIC:
3515 if ((GA.
getOpcode() != Hexagon::C2_cmpeqi) ||
3516 (GB.
getOpcode() != Hexagon::J2_jumptnew))
3521 if (DestReg != Hexagon::P0 && DestReg != Hexagon::P1)
3529 return DestReg == Hexagon::P0 ? Hexagon::J4_cmpeqn1_tp0_jump_nt
3530 : Hexagon::J4_cmpeqn1_tp1_jump_nt;
3533 return DestReg == Hexagon::P0 ? Hexagon::J4_cmpeqi_tp0_jump_nt
3534 : Hexagon::J4_cmpeqi_tp1_jump_nt;
3539 bool ForBigCore)
const {
3547 static const std::map<unsigned, unsigned> DupMap = {
3548 {Hexagon::A2_add, Hexagon::dup_A2_add},
3549 {Hexagon::A2_addi, Hexagon::dup_A2_addi},
3550 {Hexagon::A2_andir, Hexagon::dup_A2_andir},
3551 {Hexagon::A2_combineii, Hexagon::dup_A2_combineii},
3552 {Hexagon::A2_sxtb, Hexagon::dup_A2_sxtb},
3553 {Hexagon::A2_sxth, Hexagon::dup_A2_sxth},
3554 {Hexagon::A2_tfr, Hexagon::dup_A2_tfr},
3555 {Hexagon::A2_tfrsi, Hexagon::dup_A2_tfrsi},
3556 {Hexagon::A2_zxtb, Hexagon::dup_A2_zxtb},
3557 {Hexagon::A2_zxth, Hexagon::dup_A2_zxth},
3558 {Hexagon::A4_combineii, Hexagon::dup_A4_combineii},
3559 {Hexagon::A4_combineir, Hexagon::dup_A4_combineir},
3560 {Hexagon::A4_combineri, Hexagon::dup_A4_combineri},
3561 {Hexagon::C2_cmoveif, Hexagon::dup_C2_cmoveif},
3562 {Hexagon::C2_cmoveit, Hexagon::dup_C2_cmoveit},
3563 {Hexagon::C2_cmovenewif, Hexagon::dup_C2_cmovenewif},
3564 {Hexagon::C2_cmovenewit, Hexagon::dup_C2_cmovenewit},
3565 {Hexagon::C2_cmpeqi, Hexagon::dup_C2_cmpeqi},
3566 {Hexagon::L2_deallocframe, Hexagon::dup_L2_deallocframe},
3567 {Hexagon::L2_loadrb_io, Hexagon::dup_L2_loadrb_io},
3568 {Hexagon::L2_loadrd_io, Hexagon::dup_L2_loadrd_io},
3569 {Hexagon::L2_loadrh_io, Hexagon::dup_L2_loadrh_io},
3570 {Hexagon::L2_loadri_io, Hexagon::dup_L2_loadri_io},
3571 {Hexagon::L2_loadrub_io, Hexagon::dup_L2_loadrub_io},
3572 {Hexagon::L2_loadruh_io, Hexagon::dup_L2_loadruh_io},
3573 {Hexagon::S2_allocframe, Hexagon::dup_S2_allocframe},
3574 {Hexagon::S2_storerb_io, Hexagon::dup_S2_storerb_io},
3575 {Hexagon::S2_storerd_io, Hexagon::dup_S2_storerd_io},
3576 {Hexagon::S2_storerh_io, Hexagon::dup_S2_storerh_io},
3577 {Hexagon::S2_storeri_io, Hexagon::dup_S2_storeri_io},
3578 {Hexagon::S4_storeirb_io, Hexagon::dup_S4_storeirb_io},
3579 {Hexagon::S4_storeiri_io, Hexagon::dup_S4_storeiri_io},
3581 unsigned OpNum =
MI.getOpcode();
3584 auto Iter = DupMap.find(OpNum);
3585 if (Iter != DupMap.end())
3586 return Iter->second;
3588 for (
const auto &Iter : DupMap)
3589 if (Iter.second == OpNum)
3596 enum Hexagon::PredSense inPredSense;
3597 inPredSense = invertPredicate ? Hexagon::PredSense_false :
3598 Hexagon::PredSense_true;
3599 int CondOpcode = Hexagon::getPredOpcode(Opc, inPredSense);
3600 if (CondOpcode >= 0)
3608 switch (
MI.getOpcode()) {
3610 case Hexagon::V6_vL32b_pi:
3611 return Hexagon::V6_vL32b_cur_pi;
3612 case Hexagon::V6_vL32b_ai:
3613 return Hexagon::V6_vL32b_cur_ai;
3614 case Hexagon::V6_vL32b_nt_pi:
3615 return Hexagon::V6_vL32b_nt_cur_pi;
3616 case Hexagon::V6_vL32b_nt_ai:
3617 return Hexagon::V6_vL32b_nt_cur_ai;
3618 case Hexagon::V6_vL32b_ppu:
3619 return Hexagon::V6_vL32b_cur_ppu;
3620 case Hexagon::V6_vL32b_nt_ppu:
3621 return Hexagon::V6_vL32b_nt_cur_ppu;
3628 switch (
MI.getOpcode()) {
3630 case Hexagon::V6_vL32b_cur_pi:
3631 return Hexagon::V6_vL32b_pi;
3632 case Hexagon::V6_vL32b_cur_ai:
3633 return Hexagon::V6_vL32b_ai;
3634 case Hexagon::V6_vL32b_nt_cur_pi:
3635 return Hexagon::V6_vL32b_nt_pi;
3636 case Hexagon::V6_vL32b_nt_cur_ai:
3637 return Hexagon::V6_vL32b_nt_ai;
3638 case Hexagon::V6_vL32b_cur_ppu:
3639 return Hexagon::V6_vL32b_ppu;
3640 case Hexagon::V6_vL32b_nt_cur_ppu:
3641 return Hexagon::V6_vL32b_nt_ppu;
3729 int NVOpcode = Hexagon::getNewValueOpcode(
MI.getOpcode());
3733 switch (
MI.getOpcode()) {
3736 std::to_string(
MI.getOpcode()));
3737 case Hexagon::S4_storerb_ur:
3738 return Hexagon::S4_storerbnew_ur;
3740 case Hexagon::S2_storerb_pci:
3741 return Hexagon::S2_storerb_pci;
3743 case Hexagon::S2_storeri_pci:
3744 return Hexagon::S2_storeri_pci;
3746 case Hexagon::S2_storerh_pci:
3747 return Hexagon::S2_storerh_pci;
3749 case Hexagon::S2_storerd_pci:
3750 return Hexagon::S2_storerd_pci;
3752 case Hexagon::S2_storerf_pci:
3753 return Hexagon::S2_storerf_pci;
3755 case Hexagon::V6_vS32b_ai:
3756 return Hexagon::V6_vS32b_new_ai;
3758 case Hexagon::V6_vS32b_pi:
3759 return Hexagon::V6_vS32b_new_pi;
3784 if (BrTarget.
isMBB()) {
3786 Taken = getEdgeProbability(Src, Dst) >= OneHalf;
3799 bool SawCond =
false, Bad =
false;
3803 if (
I.isConditionalBranch()) {
3810 if (
I.isUnconditionalBranch() && !SawCond) {
3818 if (NextIt ==
B.instr_end()) {
3821 if (!
B.isLayoutSuccessor(SB))
3823 Taken = getEdgeProbability(Src, SB) < OneHalf;
3827 assert(NextIt->isUnconditionalBranch());
3836 Taken =
BT && getEdgeProbability(Src,
BT) < OneHalf;
3843 switch (
MI.getOpcode()) {
3844 case Hexagon::J2_jumpt:
3845 return Taken ? Hexagon::J2_jumptnewpt : Hexagon::J2_jumptnew;
3846 case Hexagon::J2_jumpf:
3847 return Taken ? Hexagon::J2_jumpfnewpt : Hexagon::J2_jumpfnew;
3857 switch (
MI.getOpcode()) {
3859 case Hexagon::J2_jumpt:
3860 case Hexagon::J2_jumpf:
3864 int NewOpcode = Hexagon::getPredNewOpcode(
MI.getOpcode());
3871 int NewOp =
MI.getOpcode();
3873 NewOp = Hexagon::getPredOldOpcode(NewOp);
3877 if (!Subtarget.hasFeature(Hexagon::ArchV60)) {
3879 case Hexagon::J2_jumptpt:
3880 NewOp = Hexagon::J2_jumpt;
3882 case Hexagon::J2_jumpfpt:
3883 NewOp = Hexagon::J2_jumpf;
3885 case Hexagon::J2_jumprtpt:
3886 NewOp = Hexagon::J2_jumprt;
3888 case Hexagon::J2_jumprfpt:
3889 NewOp = Hexagon::J2_jumprf;
3894 "Couldn't change predicate new instruction to its old form.");
3898 NewOp = Hexagon::getNonNVStore(NewOp);
3899 assert(NewOp >= 0 &&
"Couldn't change new-value store to its old form.");
3907 case Hexagon::J2_jumpfpt:
3908 return Hexagon::J2_jumpf;
3909 case Hexagon::J2_jumptpt:
3910 return Hexagon::J2_jumpt;
3911 case Hexagon::J2_jumprfpt:
3912 return Hexagon::J2_jumprf;
3913 case Hexagon::J2_jumprtpt:
3914 return Hexagon::J2_jumprt;
3923 Register DstReg, SrcReg, Src1Reg, Src2Reg;
3926 switch (
MI.getOpcode()) {
3934 case Hexagon::L2_loadri_io:
3935 case Hexagon::dup_L2_loadri_io:
3936 DstReg =
MI.getOperand(0).getReg();
3937 SrcReg =
MI.getOperand(1).getReg();
3941 if (Hexagon::IntRegsRegClass.
contains(SrcReg) &&
3943 MI.getOperand(2).isImm() &&
3944 isShiftedUInt<5,2>(
MI.getOperand(2).getImm()))
3948 (
MI.getOperand(2).isImm() &&
3949 isShiftedUInt<4,2>(
MI.getOperand(2).getImm())))
3953 case Hexagon::L2_loadrub_io:
3954 case Hexagon::dup_L2_loadrub_io:
3956 DstReg =
MI.getOperand(0).getReg();
3957 SrcReg =
MI.getOperand(1).getReg();
3959 MI.getOperand(2).isImm() && isUInt<4>(
MI.getOperand(2).getImm()))
3972 case Hexagon::L2_loadrh_io:
3973 case Hexagon::L2_loadruh_io:
3974 case Hexagon::dup_L2_loadrh_io:
3975 case Hexagon::dup_L2_loadruh_io:
3977 DstReg =
MI.getOperand(0).getReg();
3978 SrcReg =
MI.getOperand(1).getReg();
3980 MI.getOperand(2).isImm() &&
3981 isShiftedUInt<3,1>(
MI.getOperand(2).getImm()))
3984 case Hexagon::L2_loadrb_io:
3985 case Hexagon::dup_L2_loadrb_io:
3987 DstReg =
MI.getOperand(0).getReg();
3988 SrcReg =
MI.getOperand(1).getReg();
3990 MI.getOperand(2).isImm() &&
3991 isUInt<3>(
MI.getOperand(2).getImm()))
3994 case Hexagon::L2_loadrd_io:
3995 case Hexagon::dup_L2_loadrd_io:
3997 DstReg =
MI.getOperand(0).getReg();
3998 SrcReg =
MI.getOperand(1).getReg();
4000 Hexagon::IntRegsRegClass.
contains(SrcReg) &&
4002 MI.getOperand(2).isImm() &&
4003 isShiftedUInt<5,3>(
MI.getOperand(2).getImm()))
4008 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4:
4009 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4_PIC:
4010 case Hexagon::L4_return:
4011 case Hexagon::L2_deallocframe:
4012 case Hexagon::dup_L2_deallocframe:
4014 case Hexagon::EH_RETURN_JMPR:
4015 case Hexagon::PS_jmpret:
4016 case Hexagon::SL2_jumpr31:
4019 DstReg =
MI.getOperand(0).getReg();
4020 if (Hexagon::IntRegsRegClass.
contains(DstReg) && (Hexagon::R31 == DstReg))
4023 case Hexagon::PS_jmprett:
4024 case Hexagon::PS_jmpretf:
4025 case Hexagon::PS_jmprettnewpt:
4026 case Hexagon::PS_jmpretfnewpt:
4027 case Hexagon::PS_jmprettnew:
4028 case Hexagon::PS_jmpretfnew:
4029 case Hexagon::SL2_jumpr31_t:
4030 case Hexagon::SL2_jumpr31_f:
4031 case Hexagon::SL2_jumpr31_tnew:
4032 case Hexagon::SL2_jumpr31_fnew:
4033 DstReg =
MI.getOperand(1).getReg();
4034 SrcReg =
MI.getOperand(0).getReg();
4036 if ((Hexagon::PredRegsRegClass.
contains(SrcReg) &&
4037 (Hexagon::P0 == SrcReg)) &&
4038 (Hexagon::IntRegsRegClass.
contains(DstReg) && (Hexagon::R31 == DstReg)))
4041 case Hexagon::L4_return_t:
4042 case Hexagon::L4_return_f:
4043 case Hexagon::L4_return_tnew_pnt:
4044 case Hexagon::L4_return_fnew_pnt:
4045 case Hexagon::L4_return_tnew_pt:
4046 case Hexagon::L4_return_fnew_pt:
4048 SrcReg =
MI.getOperand(0).getReg();
4049 if (Hexagon::PredRegsRegClass.
contains(SrcReg) && (Hexagon::P0 == SrcReg))
4057 case Hexagon::S2_storeri_io:
4058 case Hexagon::dup_S2_storeri_io:
4061 Src1Reg =
MI.getOperand(0).getReg();
4062 Src2Reg =
MI.getOperand(2).getReg();
4063 if (Hexagon::IntRegsRegClass.
contains(Src1Reg) &&
4066 isShiftedUInt<5,2>(
MI.getOperand(1).getImm()))
4070 MI.getOperand(1).isImm() &&
4071 isShiftedUInt<4,2>(
MI.getOperand(1).getImm()))
4074 case Hexagon::S2_storerb_io:
4075 case Hexagon::dup_S2_storerb_io:
4077 Src1Reg =
MI.getOperand(0).getReg();
4078 Src2Reg =
MI.getOperand(2).getReg();
4080 MI.getOperand(1).isImm() && isUInt<4>(
MI.getOperand(1).getImm()))
4092 case Hexagon::S2_storerh_io:
4093 case Hexagon::dup_S2_storerh_io:
4095 Src1Reg =
MI.getOperand(0).getReg();
4096 Src2Reg =
MI.getOperand(2).getReg();
4098 MI.getOperand(1).isImm() &&
4099 isShiftedUInt<3,1>(
MI.getOperand(1).getImm()))
4102 case Hexagon::S2_storerd_io:
4103 case Hexagon::dup_S2_storerd_io:
4105 Src1Reg =
MI.getOperand(0).getReg();
4106 Src2Reg =
MI.getOperand(2).getReg();
4108 Hexagon::IntRegsRegClass.
contains(Src1Reg) &&
4110 isShiftedInt<6,3>(
MI.getOperand(1).getImm()))
4113 case Hexagon::S4_storeiri_io:
4114 case Hexagon::dup_S4_storeiri_io:
4116 Src1Reg =
MI.getOperand(0).getReg();
4118 isShiftedUInt<4,2>(
MI.getOperand(1).getImm()) &&
4119 MI.getOperand(2).isImm() && isUInt<1>(
MI.getOperand(2).getImm()))
4122 case Hexagon::S4_storeirb_io:
4123 case Hexagon::dup_S4_storeirb_io:
4125 Src1Reg =
MI.getOperand(0).getReg();
4127 MI.getOperand(1).isImm() && isUInt<4>(
MI.getOperand(1).getImm()) &&
4128 MI.getOperand(2).isImm() && isUInt<1>(
MI.getOperand(2).getImm()))
4131 case Hexagon::S2_allocframe:
4132 case Hexagon::dup_S2_allocframe:
4133 if (
MI.getOperand(2).isImm() &&
4134 isShiftedUInt<5,3>(
MI.getOperand(2).getImm()))
4155 case Hexagon::A2_addi:
4156 case Hexagon::dup_A2_addi:
4157 DstReg =
MI.getOperand(0).getReg();
4158 SrcReg =
MI.getOperand(1).getReg();
4161 if (Hexagon::IntRegsRegClass.
contains(SrcReg) &&
4163 isShiftedUInt<6,2>(
MI.getOperand(2).getImm()))
4166 if ((DstReg == SrcReg) &&
MI.getOperand(2).isImm() &&
4167 isInt<7>(
MI.getOperand(2).getImm()))
4172 ((
MI.getOperand(2).getImm() == 1) ||
4173 (
MI.getOperand(2).getImm() == -1)))
4177 case Hexagon::A2_add:
4178 case Hexagon::dup_A2_add:
4180 DstReg =
MI.getOperand(0).getReg();
4181 Src1Reg =
MI.getOperand(1).getReg();
4182 Src2Reg =
MI.getOperand(2).getReg();
4187 case Hexagon::A2_andir:
4188 case Hexagon::dup_A2_andir:
4192 DstReg =
MI.getOperand(0).getReg();
4193 SrcReg =
MI.getOperand(1).getReg();
4195 MI.getOperand(2).isImm() &&
4196 ((
MI.getOperand(2).getImm() == 1) ||
4197 (
MI.getOperand(2).getImm() == 255)))
4200 case Hexagon::A2_tfr:
4201 case Hexagon::dup_A2_tfr:
4203 DstReg =
MI.getOperand(0).getReg();
4204 SrcReg =
MI.getOperand(1).getReg();
4208 case Hexagon::A2_tfrsi:
4209 case Hexagon::dup_A2_tfrsi:
4214 DstReg =
MI.getOperand(0).getReg();
4218 case Hexagon::C2_cmoveit:
4219 case Hexagon::C2_cmovenewit:
4220 case Hexagon::C2_cmoveif:
4221 case Hexagon::C2_cmovenewif:
4222 case Hexagon::dup_C2_cmoveit:
4223 case Hexagon::dup_C2_cmovenewit:
4224 case Hexagon::dup_C2_cmoveif:
4225 case Hexagon::dup_C2_cmovenewif:
4229 DstReg =
MI.getOperand(0).getReg();
4230 SrcReg =
MI.getOperand(1).getReg();
4232 Hexagon::PredRegsRegClass.
contains(SrcReg) && Hexagon::P0 == SrcReg &&
4233 MI.getOperand(2).isImm() &&
MI.getOperand(2).getImm() == 0)
4236 case Hexagon::C2_cmpeqi:
4237 case Hexagon::dup_C2_cmpeqi:
4239 DstReg =
MI.getOperand(0).getReg();
4240 SrcReg =
MI.getOperand(1).getReg();
4241 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
4243 MI.getOperand(2).isImm() && isUInt<2>(
MI.getOperand(2).getImm()))
4246 case Hexagon::A2_combineii:
4247 case Hexagon::A4_combineii:
4248 case Hexagon::dup_A2_combineii:
4249 case Hexagon::dup_A4_combineii:
4251 DstReg =
MI.getOperand(0).getReg();
4253 ((
MI.getOperand(1).isImm() && isUInt<2>(
MI.getOperand(1).getImm())) ||
4254 (
MI.getOperand(1).isGlobal() &&
4255 isUInt<2>(
MI.getOperand(1).getOffset()))) &&
4256 ((
MI.getOperand(2).isImm() && isUInt<2>(
MI.getOperand(2).getImm())) ||
4257 (
MI.getOperand(2).isGlobal() &&
4258 isUInt<2>(
MI.getOperand(2).getOffset()))))
4261 case Hexagon::A4_combineri:
4262 case Hexagon::dup_A4_combineri:
4265 DstReg =
MI.getOperand(0).getReg();
4266 SrcReg =
MI.getOperand(1).getReg();
4268 ((
MI.getOperand(2).isImm() &&
MI.getOperand(2).getImm() == 0) ||
4269 (
MI.getOperand(2).isGlobal() &&
MI.getOperand(2).getOffset() == 0)))
4272 case Hexagon::A4_combineir:
4273 case Hexagon::dup_A4_combineir:
4275 DstReg =
MI.getOperand(0).getReg();
4276 SrcReg =
MI.getOperand(2).getReg();
4278 ((
MI.getOperand(1).isImm() &&
MI.getOperand(1).getImm() == 0) ||
4279 (
MI.getOperand(1).isGlobal() &&
MI.getOperand(1).getOffset() == 0)))
4282 case Hexagon::A2_sxtb:
4283 case Hexagon::A2_sxth:
4284 case Hexagon::A2_zxtb:
4285 case Hexagon::A2_zxth:
4286 case Hexagon::dup_A2_sxtb:
4287 case Hexagon::dup_A2_sxth:
4288 case Hexagon::dup_A2_zxtb:
4289 case Hexagon::dup_A2_zxth:
4291 DstReg =
MI.getOperand(0).getReg();
4292 SrcReg =
MI.getOperand(1).getReg();
4302 return Hexagon::getRealHWInstr(
MI.getOpcode(), Hexagon::InstrType_Real);
4312 if (
MI.isTransient())
4336 int Idx =
DefMI.findRegisterDefOperandIdx(SR, &HRI,
false,
false);
4347 int Idx =
UseMI.findRegisterUseOperandIdx(SR, &HRI,
false);
4374 Cond[0].setImm(Opc);
4381 : Hexagon::getTruePredOpcode(Opc);
4382 if (InvPredOpcode >= 0)
4383 return InvPredOpcode;
4397 return ~(-1U << (bits - 1));
4399 return ~(-1U << bits);
4404 switch (
MI.getOpcode()) {
4405 case Hexagon::L2_loadrbgp:
4406 case Hexagon::L2_loadrdgp:
4407 case Hexagon::L2_loadrhgp:
4408 case Hexagon::L2_loadrigp:
4409 case Hexagon::L2_loadrubgp:
4410 case Hexagon::L2_loadruhgp:
4411 case Hexagon::S2_storerbgp:
4412 case Hexagon::S2_storerbnewgp:
4413 case Hexagon::S2_storerhgp:
4414 case Hexagon::S2_storerhnewgp:
4415 case Hexagon::S2_storerigp:
4416 case Hexagon::S2_storerinewgp:
4417 case Hexagon::S2_storerdgp:
4418 case Hexagon::S2_storerfgp:
4436 if (
MI.getOpcode() == Hexagon::A4_ext)
4450 bool ToBigInstrs)
const {
4462 MII->setDesc(
get(Opcode));
4468 bool ToBigInstrs)
const {
4471 End = MB.instr_end();
4472 Instr !=
End; ++Instr)
4480 while ((MII !=
MBB->
instr_end()) && MII->isInsideBundle()) {
4487 using namespace HexagonII;
4490 unsigned S = (
F >> MemAccessSizePos) & MemAccesSizeMask;
4491 unsigned Size = getMemAccessSizeInBytes(MemAccessSize(S));
4495 if (
MI.getOpcode() == Hexagon::Y2_dcfetchbo)
4502 return HRI.getSpillSize(Hexagon::HvxVRRegClass);
4517 return -1U << (bits - 1);
4526 short NonExtOpcode = Hexagon::getRegForm(
MI.getOpcode());
4527 if (NonExtOpcode >= 0)
4528 return NonExtOpcode;
4530 if (
MI.getDesc().mayLoad() ||
MI.getDesc().mayStore()) {
4534 return Hexagon::changeAddrMode_abs_io(
MI.getOpcode());
4536 return Hexagon::changeAddrMode_io_rr(
MI.getOpcode());
4538 return Hexagon::changeAddrMode_ur_rr(
MI.getOpcode());
4548 Register &PredReg,
unsigned &PredRegPos,
unsigned &PredRegFlags)
const {
4556 PredReg =
Cond[1].getReg();
4560 if (
Cond[1].isImplicit())
4568 return Hexagon::getRealHWInstr(
MI.getOpcode(), Hexagon::InstrType_Pseudo);
4572 return Hexagon::getRegForm(
MI.getOpcode());
4580 if (
MI.isDebugInstr() ||
MI.isPosition())
4583 unsigned Size =
MI.getDesc().getSize();
4599 unsigned NumDefs = 0;
4600 for (;
MI.getOperand(NumDefs).
isReg() &&
MI.getOperand(NumDefs).isDef();
4602 assert(NumDefs !=
MI.getNumOperands()-2 &&
"No asm string?");
4604 assert(
MI.getOperand(NumDefs).isSymbol() &&
"No asm string?");
4606 const char *AsmStr =
MI.getOperand(NumDefs).getSymbolName();
4620 const InstrStage &IS = *
II.beginStage(
MI.getDesc().getSchedClass());
4632 assert(BundleHead->isBundle() &&
"Not a bundle header");
4642 "Instruction must be extendable");
4648 "Branch with unknown extendable field type");
4660 int TargetPos =
MI.getNumOperands() - 1;
4663 while ((TargetPos > -1) && !
MI.getOperand(TargetPos).isMBB())
4665 assert((TargetPos >= 0) &&
MI.getOperand(TargetPos).isMBB());
4666 MI.getOperand(TargetPos).setMBB(NewTarget);
4670 MI.setDesc(
get(NewOpcode));
4682 for (
unsigned insn = TargetOpcode::GENERIC_OP_END+1;
4683 insn < Hexagon::INSTRUCTION_LIST_END; ++insn) {
4704 int PredRevOpcode = -1;
4706 PredRevOpcode = Hexagon::notTakenBranchPrediction(Opcode);
4708 PredRevOpcode = Hexagon::takenBranchPrediction(Opcode);
4709 assert(PredRevOpcode > 0);
4710 return PredRevOpcode;
4716 return Cond.empty() || (
Cond[0].isImm() && (
Cond.size() != 1));
4723 if (Operand.
isImm())
4724 Operand.
setImm(Operand.
getImm() | memShufDisabledMask);
4732 return (Operand.
isImm() && (Operand.
getImm() & memShufDisabledMask) != 0);
4737 return Opc >= 0 ? Hexagon::changeAddrMode_abs_io(Opc) : Opc;
4741 return Opc >= 0 ? Hexagon::changeAddrMode_io_abs(Opc) : Opc;
4745 return Opc >= 0 ? Hexagon::changeAddrMode_io_pi(Opc) : Opc;
4749 return Opc >= 0 ? Hexagon::changeAddrMode_io_rr(Opc) : Opc;
4753 return Opc >= 0 ? Hexagon::changeAddrMode_pi_io(Opc) : Opc;
4757 return Opc >= 0 ? Hexagon::changeAddrMode_rr_io(Opc) : Opc;
4761 return Opc >= 0 ? Hexagon::changeAddrMode_rr_ur(Opc) : Opc;
4765 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)
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< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
static bool isSigned(unsigned int Opcode)
const HexagonInstrInfo * TII
static bool isUndef(ArrayRef< int > Mask)
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
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 found DebugLoc that has a DILocation, given a range of instructions.
unsigned const TargetRegisterInfo * TRI
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
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool isImm(const MachineOperand &MO, MachineRegisterInfo *MRI)
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),...
This class represents an Operation in the Expression.
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
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
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
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
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
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, 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 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
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.
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) const override
Emit instructions to copy a pair of physical registers.
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
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, 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 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
HexagonInstrInfo(HexagonSubtarget &ST)
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
const InstrItineraryData * getInstrItineraryData() const override
getInstrItins - Return the instruction itineraries based on subtarget selection.
bool usePredicatedCalls() const
const HexagonRegisterInfo * getRegisterInfo() const override
bool useNewValueStores() const
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.
A set of physical registers with utility functions to track liveness when walking backward/forward th...
bool contains(MCPhysReg Reg) const
Returns true if register Reg is contained in the set.
void stepForward(const MachineInstr &MI, SmallVectorImpl< std::pair< MCPhysReg, const MachineOperand * > > &Clobbers)
Simulates liveness when stepping forward over an instruction(bundle).
bool available(const MachineRegisterInfo &MRI, MCPhysReg Reg) const
Returns true if register Reg and no aliasing register is in the set.
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.
void addLiveOuts(const MachineBasicBlock &MBB)
Adds all live-out registers of basic block MBB.
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.
Wrapper class representing physical registers. Should be passed by value.
instr_iterator instr_begin()
MachineInstrBundleIterator< const MachineInstr > const_iterator
iterator getFirstTerminator()
Returns an iterator to the first terminator instruction of this basic block.
DebugLoc findDebugLoc(instr_iterator MBBI)
Find the next valid DebugLoc starting at MBBI, skipping any debug instructions.
Instructions::iterator instr_iterator
bool isLayoutSuccessor(const MachineBasicBlock *MBB) const
Return true if the specified MBB will be emitted immediately after this block, such that if this bloc...
instr_iterator instr_end()
Instructions::const_iterator const_instr_iterator
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
iterator_range< succ_iterator > successors()
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 '...
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.
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.
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.
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.
bool hasUnmodeledSideEffects() const
Return true if this instruction has side effects that are not modeled by mayLoad / mayStore,...
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.
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.
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)
unsigned const TypeCVI_LAST
unsigned const TypeCVI_FIRST
@ RestrictNoSlot1StoreMask
@ RestrictNoSlot1StorePos
@ 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.
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)
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)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
MachineBasicBlock::instr_iterator getBundleEnd(MachineBasicBlock::instr_iterator I)
Returns an iterator pointing beyond the bundle containing I.
@ 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)
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
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.
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.
FuncUnits getUnits() const
Returns the choice of FUs.
This class contains a discriminated union of information about pointers in memory operands,...
static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.