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"));
101 cl::desc(
"Use the DFA based hazard recognizer."));
116 void HexagonInstrInfo::anchor() {}
123 return (Reg >= Hexagon::R0 && Reg <= Hexagon::R7) ||
124 (Reg >= Hexagon::R16 && Reg <= Hexagon::R23);
136 for (; MIB != MIE; ++MIB) {
137 if (!MIB->isDebugInstr())
152 if (EndLoopOp == Hexagon::ENDLOOP0) {
153 LOOPi = Hexagon::J2_loop0i;
154 LOOPr = Hexagon::J2_loop0r;
156 LOOPi = Hexagon::J2_loop1i;
157 LOOPr = Hexagon::J2_loop1r;
163 if (!Visited.
insert(PB).second)
167 for (
auto I = PB->instr_rbegin(),
E = PB->instr_rend();
I !=
E; ++
I) {
168 unsigned Opc =
I->getOpcode();
169 if (Opc == LOOPi || Opc == LOOPr)
173 if (Opc == EndLoopOp &&
I->getOperand(0).getMBB() != TargetBB)
245 case Hexagon::L2_loadri_io:
246 case Hexagon::L2_loadrd_io:
247 case Hexagon::V6_vL32b_ai:
248 case Hexagon::V6_vL32b_nt_ai:
249 case Hexagon::V6_vL32Ub_ai:
250 case Hexagon::LDriw_pred:
251 case Hexagon::LDriw_ctr:
252 case Hexagon::PS_vloadrq_ai:
253 case Hexagon::PS_vloadrw_ai:
254 case Hexagon::PS_vloadrw_nt_ai: {
265 case Hexagon::L2_ploadrit_io:
266 case Hexagon::L2_ploadrif_io:
267 case Hexagon::L2_ploadrdt_io:
268 case Hexagon::L2_ploadrdf_io: {
293 case Hexagon::S2_storerb_io:
294 case Hexagon::S2_storerh_io:
295 case Hexagon::S2_storeri_io:
296 case Hexagon::S2_storerd_io:
297 case Hexagon::V6_vS32b_ai:
298 case Hexagon::V6_vS32Ub_ai:
299 case Hexagon::STriw_pred:
300 case Hexagon::STriw_ctr:
301 case Hexagon::PS_vstorerq_ai:
302 case Hexagon::PS_vstorerw_ai: {
313 case Hexagon::S2_pstorerbt_io:
314 case Hexagon::S2_pstorerbf_io:
315 case Hexagon::S2_pstorerht_io:
316 case Hexagon::S2_pstorerhf_io:
317 case Hexagon::S2_pstorerit_io:
318 case Hexagon::S2_pstorerif_io:
319 case Hexagon::S2_pstorerdt_io:
320 case Hexagon::S2_pstorerdf_io: {
344 for (++MII; MII != MBB->
instr_end() && MII->isInsideBundle(); ++MII)
362 for (++MII; MII != MBB->
instr_end() && MII->isInsideBundle(); ++MII)
390 bool AllowModify)
const {
422 while (I->isDebugInstr()) {
428 bool JumpToBlock = I->getOpcode() == Hexagon::J2_jump &&
429 I->getOperand(0).isMBB();
431 if (AllowModify && JumpToBlock &&
434 I->eraseFromParent();
440 if (!isUnpredicatedTerminator(*I))
448 if (&*I != LastInst && !I->isBundle() && isUnpredicatedTerminator(*I)) {
450 SecondLastInst = &*
I;
461 int SecLastOpcode = SecondLastInst ? SecondLastInst->
getOpcode() : 0;
464 if (LastOpcode == Hexagon::J2_jump && !LastInst->
getOperand(0).
isMBB())
466 if (SecLastOpcode == Hexagon::J2_jump &&
477 if (LastInst && !SecondLastInst) {
478 if (LastOpcode == Hexagon::J2_jump) {
488 if (LastOpcodeHasJMP_c) {
503 <<
" with one jump\n";);
510 if (SecLastOpcodeHasJMP_c && (LastOpcode == Hexagon::J2_jump)) {
521 if (SecLastOpcodeHasNVJump &&
523 (LastOpcode == Hexagon::J2_jump)) {
534 if (SecLastOpcode == Hexagon::J2_jump && LastOpcode == Hexagon::J2_jump) {
538 I->eraseFromParent();
543 if (
isEndLoopN(SecLastOpcode) && LastOpcode == Hexagon::J2_jump) {
551 <<
" with two jumps";);
557 int *BytesRemoved)
const {
558 assert(!BytesRemoved &&
"code size not handled");
563 while (I != MBB.
begin()) {
565 if (I->isDebugInstr())
570 if (Count && (I->getOpcode() == Hexagon::J2_jump))
584 int *BytesAdded)
const {
585 unsigned BOpc = Hexagon::J2_jump;
586 unsigned BccOpc = Hexagon::J2_jumpt;
588 assert(TBB &&
"insertBranch must not be told to insert a fallthrough");
589 assert(!BytesAdded &&
"code size not handled");
594 if (!Cond.
empty() && Cond[0].isImm())
595 BccOpc = Cond[0].getImm();
615 int EndLoopOp = Cond[0].getImm();
622 assert(Loop !=
nullptr &&
"Inserting an ENDLOOP without a LOOP");
627 assert((Cond.
size() == 3) &&
"Only supporting rr/ri version of nvjump");
634 if (Cond[2].
isReg()) {
638 }
else if(Cond[2].isImm()) {
640 addImm(Cond[2].getImm()).
addMBB(TBB);
644 assert((Cond.
size() == 2) &&
"Malformed cond vector");
652 "Cond. cannot be empty when multiple branchings are required");
654 "NV-jump cannot be inserted with another branch");
657 int EndLoopOp = Cond[0].getImm();
664 assert(Loop !=
nullptr &&
"Inserting an ENDLOOP without a LOOP");
691 IndVarInst =
nullptr;
705 unsigned Iter,
unsigned MaxIter)
const {
709 &&
"Expecting a hardware loop");
719 if (Loop->
getOpcode() == Hexagon::J2_loop0i ||
720 Loop->
getOpcode() == Hexagon::J2_loop1i) {
730 assert(Loop->
getOpcode() == Hexagon::J2_loop0r &&
"Unexpected instruction");
735 addReg(LoopCount).
addImm(1);
738 addReg(LoopCount).
addImm(-1);
742 E = PrevInsts.
end();
I !=
E; ++
I)
743 (*I)->substituteRegister(LoopCount, NewLoopCount, 0, HRI);
750 BuildMI(&MBB, DL,
get(Hexagon::J2_loop0r)).
761 unsigned NumCycles,
unsigned ExtraPredCycles,
775 return NumInstrs <= 4;
780 const DebugLoc &DL,
unsigned DestReg,
781 unsigned SrcReg,
bool KillSrc)
const {
785 if (Hexagon::IntRegsRegClass.
contains(SrcReg, DestReg)) {
786 BuildMI(MBB, I, DL,
get(Hexagon::A2_tfr), DestReg)
787 .
addReg(SrcReg, KillFlag);
790 if (Hexagon::DoubleRegsRegClass.
contains(SrcReg, DestReg)) {
791 BuildMI(MBB, I, DL,
get(Hexagon::A2_tfrp), DestReg)
792 .
addReg(SrcReg, KillFlag);
795 if (Hexagon::PredRegsRegClass.
contains(SrcReg, DestReg)) {
797 BuildMI(MBB, I, DL,
get(Hexagon::C2_or), DestReg)
801 if (Hexagon::CtrRegsRegClass.
contains(DestReg) &&
802 Hexagon::IntRegsRegClass.
contains(SrcReg)) {
803 BuildMI(MBB, I, DL,
get(Hexagon::A2_tfrrcr), DestReg)
804 .
addReg(SrcReg, KillFlag);
807 if (Hexagon::IntRegsRegClass.
contains(DestReg) &&
808 Hexagon::CtrRegsRegClass.
contains(SrcReg)) {
809 BuildMI(MBB, I, DL,
get(Hexagon::A2_tfrcrr), DestReg)
810 .
addReg(SrcReg, KillFlag);
813 if (Hexagon::ModRegsRegClass.
contains(DestReg) &&
814 Hexagon::IntRegsRegClass.
contains(SrcReg)) {
815 BuildMI(MBB, I, DL,
get(Hexagon::A2_tfrrcr), DestReg)
816 .
addReg(SrcReg, KillFlag);
819 if (Hexagon::PredRegsRegClass.
contains(SrcReg) &&
820 Hexagon::IntRegsRegClass.
contains(DestReg)) {
821 BuildMI(MBB, I, DL,
get(Hexagon::C2_tfrpr), DestReg)
822 .
addReg(SrcReg, KillFlag);
825 if (Hexagon::IntRegsRegClass.
contains(SrcReg) &&
826 Hexagon::PredRegsRegClass.
contains(DestReg)) {
827 BuildMI(MBB, I, DL,
get(Hexagon::C2_tfrrp), DestReg)
828 .
addReg(SrcReg, KillFlag);
831 if (Hexagon::PredRegsRegClass.
contains(SrcReg) &&
832 Hexagon::IntRegsRegClass.
contains(DestReg)) {
833 BuildMI(MBB, I, DL,
get(Hexagon::C2_tfrpr), DestReg)
834 .
addReg(SrcReg, KillFlag);
837 if (Hexagon::HvxVRRegClass.
contains(SrcReg, DestReg)) {
838 BuildMI(MBB, I, DL,
get(Hexagon::V6_vassign), DestReg).
839 addReg(SrcReg, KillFlag);
842 if (Hexagon::HvxWRRegClass.
contains(SrcReg, DestReg)) {
843 unsigned LoSrc = HRI.getSubReg(SrcReg, Hexagon::vsub_lo);
844 unsigned HiSrc = HRI.getSubReg(SrcReg, Hexagon::vsub_hi);
845 BuildMI(MBB, I, DL,
get(Hexagon::V6_vcombine), DestReg)
850 if (Hexagon::HvxQRRegClass.
contains(SrcReg, DestReg)) {
851 BuildMI(MBB, I, DL,
get(Hexagon::V6_pred_and), DestReg)
853 .
addReg(SrcReg, KillFlag);
856 if (Hexagon::HvxQRRegClass.
contains(SrcReg) &&
857 Hexagon::HvxVRRegClass.
contains(DestReg)) {
861 if (Hexagon::HvxQRRegClass.
contains(DestReg) &&
862 Hexagon::HvxVRRegClass.
contains(SrcReg)) {
891 if (Hexagon::IntRegsRegClass.hasSubClassEq(RC)) {
892 BuildMI(MBB, I, DL,
get(Hexagon::S2_storeri_io))
895 }
else if (Hexagon::DoubleRegsRegClass.hasSubClassEq(RC)) {
896 BuildMI(MBB, I, DL,
get(Hexagon::S2_storerd_io))
899 }
else if (Hexagon::PredRegsRegClass.hasSubClassEq(RC)) {
900 BuildMI(MBB, I, DL,
get(Hexagon::STriw_pred))
903 }
else if (Hexagon::ModRegsRegClass.hasSubClassEq(RC)) {
904 BuildMI(MBB, I, DL,
get(Hexagon::STriw_ctr))
907 }
else if (Hexagon::HvxQRRegClass.hasSubClassEq(RC)) {
908 BuildMI(MBB, I, DL,
get(Hexagon::PS_vstorerq_ai))
911 }
else if (Hexagon::HvxVRRegClass.hasSubClassEq(RC)) {
915 unsigned Opc = SlotAlign < RegAlign ? Hexagon::V6_vS32Ub_ai
916 : Hexagon::V6_vS32b_ai;
923 }
else if (Hexagon::HvxWRRegClass.hasSubClassEq(RC)) {
927 unsigned Opc = SlotAlign < RegAlign ? Hexagon::PS_vstorerwu_ai
928 : Hexagon::PS_vstorerw_ai;
956 if (Hexagon::IntRegsRegClass.hasSubClassEq(RC)) {
957 BuildMI(MBB, I, DL,
get(Hexagon::L2_loadri_io), DestReg)
959 }
else if (Hexagon::DoubleRegsRegClass.hasSubClassEq(RC)) {
960 BuildMI(MBB, I, DL,
get(Hexagon::L2_loadrd_io), DestReg)
962 }
else if (Hexagon::PredRegsRegClass.hasSubClassEq(RC)) {
963 BuildMI(MBB, I, DL,
get(Hexagon::LDriw_pred), DestReg)
965 }
else if (Hexagon::ModRegsRegClass.hasSubClassEq(RC)) {
966 BuildMI(MBB, I, DL,
get(Hexagon::LDriw_ctr), DestReg)
968 }
else if (Hexagon::HvxQRRegClass.hasSubClassEq(RC)) {
969 BuildMI(MBB, I, DL,
get(Hexagon::PS_vloadrq_ai), DestReg)
971 }
else if (Hexagon::HvxVRRegClass.hasSubClassEq(RC)) {
975 unsigned Opc = SlotAlign < RegAlign ? Hexagon::V6_vL32Ub_ai
976 : Hexagon::V6_vL32b_ai;
980 BuildMI(MBB, I, DL,
get(Opc), DestReg)
982 }
else if (Hexagon::HvxWRRegClass.hasSubClassEq(RC)) {
986 unsigned Opc = SlotAlign < RegAlign ? Hexagon::PS_vloadrwu_ai
987 : Hexagon::PS_vloadrw_ai;
991 BuildMI(MBB, I, DL,
get(Opc), DestReg)
1020 auto RealCirc = [&](
unsigned Opc,
bool HasImm,
unsigned MxOp) {
1022 unsigned CSx = (Mx == Hexagon::M0 ? Hexagon::CS0 : Hexagon::CS1);
1023 BuildMI(MBB, MI, DL,
get(Hexagon::A2_tfrrcr), CSx)
1035 case TargetOpcode::COPY: {
1041 std::prev(MBBI)->copyImplicitOps(*MBB.
getParent(),
MI);
1046 case Hexagon::PS_aligna:
1052 case Hexagon::V6_vassignp: {
1056 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vcombine), DstReg)
1057 .
addReg(HRI.getSubReg(SrcReg, Hexagon::vsub_hi),
Kill)
1058 .addReg(HRI.getSubReg(SrcReg, Hexagon::vsub_lo),
Kill);
1062 case Hexagon::V6_lo: {
1065 unsigned SrcSubLo = HRI.getSubReg(SrcReg, Hexagon::vsub_lo);
1071 case Hexagon::V6_hi: {
1074 unsigned SrcSubHi = HRI.getSubReg(SrcReg, Hexagon::vsub_hi);
1080 case Hexagon::PS_vstorerw_ai:
1081 case Hexagon::PS_vstorerwu_ai: {
1082 bool Aligned = Opc == Hexagon::PS_vstorerw_ai;
1084 unsigned SrcSubHi = HRI.getSubReg(SrcReg, Hexagon::vsub_hi);
1085 unsigned SrcSubLo = HRI.getSubReg(SrcReg, Hexagon::vsub_lo);
1086 unsigned NewOpc = Aligned ? Hexagon::V6_vS32b_ai : Hexagon::V6_vS32Ub_ai;
1087 unsigned Offset = HRI.getSpillSize(Hexagon::HvxVRRegClass);
1090 BuildMI(MBB, MI, DL,
get(NewOpc))
1096 BuildMI(MBB, MI, DL,
get(NewOpc))
1105 case Hexagon::PS_vloadrw_ai:
1106 case Hexagon::PS_vloadrwu_ai: {
1107 bool Aligned = Opc == Hexagon::PS_vloadrw_ai;
1109 unsigned NewOpc = Aligned ? Hexagon::V6_vL32b_ai : Hexagon::V6_vL32Ub_ai;
1110 unsigned Offset = HRI.getSpillSize(Hexagon::HvxVRRegClass);
1113 HRI.getSubReg(DstReg, Hexagon::vsub_lo))
1118 BuildMI(MBB, MI, DL,
get(NewOpc), HRI.getSubReg(DstReg, Hexagon::vsub_hi))
1126 case Hexagon::PS_true: {
1128 BuildMI(MBB, MI, DL,
get(Hexagon::C2_orn), Reg)
1134 case Hexagon::PS_false: {
1136 BuildMI(MBB, MI, DL,
get(Hexagon::C2_andn), Reg)
1142 case Hexagon::PS_qtrue: {
1149 case Hexagon::PS_qfalse: {
1156 case Hexagon::PS_vdd0: {
1158 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vsubw_dv), Vd)
1164 case Hexagon::PS_vmulw: {
1169 unsigned Src1SubHi = HRI.getSubReg(Src1Reg, Hexagon::isub_hi);
1170 unsigned Src1SubLo = HRI.getSubReg(Src1Reg, Hexagon::isub_lo);
1171 unsigned Src2SubHi = HRI.getSubReg(Src2Reg, Hexagon::isub_hi);
1172 unsigned Src2SubLo = HRI.getSubReg(Src2Reg, Hexagon::isub_lo);
1174 HRI.getSubReg(DstReg, Hexagon::isub_hi))
1178 HRI.getSubReg(DstReg, Hexagon::isub_lo))
1188 case Hexagon::PS_vmulw_acc: {
1194 unsigned Src1SubHi = HRI.getSubReg(Src1Reg, Hexagon::isub_hi);
1195 unsigned Src1SubLo = HRI.getSubReg(Src1Reg, Hexagon::isub_lo);
1196 unsigned Src2SubHi = HRI.getSubReg(Src2Reg, Hexagon::isub_hi);
1197 unsigned Src2SubLo = HRI.getSubReg(Src2Reg, Hexagon::isub_lo);
1198 unsigned Src3SubHi = HRI.getSubReg(Src3Reg, Hexagon::isub_hi);
1199 unsigned Src3SubLo = HRI.getSubReg(Src3Reg, Hexagon::isub_lo);
1201 HRI.getSubReg(DstReg, Hexagon::isub_hi))
1206 HRI.getSubReg(DstReg, Hexagon::isub_lo))
1219 case Hexagon::PS_pselect: {
1224 unsigned Rd = Op0.
getReg();
1225 unsigned Pu = Op1.
getReg();
1226 unsigned Rs = Op2.
getReg();
1227 unsigned Rt = Op3.
getReg();
1233 BuildMI(MBB, MI, DL,
get(Hexagon::A2_tfrpt), Rd)
1234 .
addReg(Pu, (Rd == Rt) ? K1 : 0)
1237 BuildMI(MBB, MI, DL,
get(Hexagon::A2_tfrpf), Rd)
1243 case Hexagon::PS_vselect: {
1251 unsigned PReg = Op1.
getReg();
1258 auto T =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vcmov))
1267 auto T =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vncmov))
1277 case Hexagon::PS_wselect: {
1285 unsigned PReg = Op1.
getReg();
1292 unsigned SrcLo = HRI.getSubReg(Op2.
getReg(), Hexagon::vsub_lo);
1293 unsigned SrcHi = HRI.getSubReg(Op2.
getReg(), Hexagon::vsub_hi);
1294 auto T =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vccombine))
1305 unsigned SrcLo = HRI.getSubReg(Op3.
getReg(), Hexagon::vsub_lo);
1306 unsigned SrcHi = HRI.getSubReg(Op3.
getReg(), Hexagon::vsub_hi);
1307 auto T =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vnccombine))
1319 case Hexagon::PS_tailcall_i:
1320 MI.
setDesc(
get(Hexagon::J2_jump));
1322 case Hexagon::PS_tailcall_r:
1323 case Hexagon::PS_jmpret:
1324 MI.
setDesc(
get(Hexagon::J2_jumpr));
1326 case Hexagon::PS_jmprett:
1327 MI.
setDesc(
get(Hexagon::J2_jumprt));
1329 case Hexagon::PS_jmpretf:
1330 MI.
setDesc(
get(Hexagon::J2_jumprf));
1332 case Hexagon::PS_jmprettnewpt:
1333 MI.
setDesc(
get(Hexagon::J2_jumprtnewpt));
1335 case Hexagon::PS_jmpretfnewpt:
1336 MI.
setDesc(
get(Hexagon::J2_jumprfnewpt));
1338 case Hexagon::PS_jmprettnew:
1339 MI.
setDesc(
get(Hexagon::J2_jumprtnew));
1341 case Hexagon::PS_jmpretfnew:
1342 MI.
setDesc(
get(Hexagon::J2_jumprfnew));
1345 case Hexagon::V6_vgathermh_pseudo:
1346 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vgathermh))
1350 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vS32b_new_ai))
1357 case Hexagon::V6_vgathermw_pseudo:
1358 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vgathermw))
1362 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vS32b_new_ai))
1369 case Hexagon::V6_vgathermhw_pseudo:
1370 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vgathermhw))
1374 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vS32b_new_ai))
1381 case Hexagon::V6_vgathermhq_pseudo:
1382 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vgathermhq))
1387 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vS32b_new_ai))
1394 case Hexagon::V6_vgathermwq_pseudo:
1395 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vgathermwq))
1400 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vS32b_new_ai))
1407 case Hexagon::V6_vgathermhwq_pseudo:
1408 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vgathermhwq))
1413 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vS32b_new_ai))
1420 case Hexagon::PS_loadrub_pci:
1421 return RealCirc(Hexagon::L2_loadrub_pci,
true, 4);
1422 case Hexagon::PS_loadrb_pci:
1423 return RealCirc(Hexagon::L2_loadrb_pci,
true, 4);
1424 case Hexagon::PS_loadruh_pci:
1425 return RealCirc(Hexagon::L2_loadruh_pci,
true, 4);
1426 case Hexagon::PS_loadrh_pci:
1427 return RealCirc(Hexagon::L2_loadrh_pci,
true, 4);
1428 case Hexagon::PS_loadri_pci:
1429 return RealCirc(Hexagon::L2_loadri_pci,
true, 4);
1430 case Hexagon::PS_loadrd_pci:
1431 return RealCirc(Hexagon::L2_loadrd_pci,
true, 4);
1432 case Hexagon::PS_loadrub_pcr:
1433 return RealCirc(Hexagon::L2_loadrub_pcr,
false, 3);
1434 case Hexagon::PS_loadrb_pcr:
1435 return RealCirc(Hexagon::L2_loadrb_pcr,
false, 3);
1436 case Hexagon::PS_loadruh_pcr:
1437 return RealCirc(Hexagon::L2_loadruh_pcr,
false, 3);
1438 case Hexagon::PS_loadrh_pcr:
1439 return RealCirc(Hexagon::L2_loadrh_pcr,
false, 3);
1440 case Hexagon::PS_loadri_pcr:
1441 return RealCirc(Hexagon::L2_loadri_pcr,
false, 3);
1442 case Hexagon::PS_loadrd_pcr:
1443 return RealCirc(Hexagon::L2_loadrd_pcr,
false, 3);
1444 case Hexagon::PS_storerb_pci:
1445 return RealCirc(Hexagon::S2_storerb_pci,
true, 3);
1446 case Hexagon::PS_storerh_pci:
1447 return RealCirc(Hexagon::S2_storerh_pci,
true, 3);
1448 case Hexagon::PS_storerf_pci:
1449 return RealCirc(Hexagon::S2_storerf_pci,
true, 3);
1450 case Hexagon::PS_storeri_pci:
1451 return RealCirc(Hexagon::S2_storeri_pci,
true, 3);
1452 case Hexagon::PS_storerd_pci:
1453 return RealCirc(Hexagon::S2_storerd_pci,
true, 3);
1454 case Hexagon::PS_storerb_pcr:
1455 return RealCirc(Hexagon::S2_storerb_pcr,
false, 2);
1456 case Hexagon::PS_storerh_pcr:
1457 return RealCirc(Hexagon::S2_storerh_pcr,
false, 2);
1458 case Hexagon::PS_storerf_pcr:
1459 return RealCirc(Hexagon::S2_storerf_pcr,
false, 2);
1460 case Hexagon::PS_storeri_pcr:
1461 return RealCirc(Hexagon::S2_storeri_pcr,
false, 2);
1462 case Hexagon::PS_storerd_pcr:
1463 return RealCirc(Hexagon::S2_storerd_pcr,
false, 2);
1475 assert(Cond[0].isImm() &&
"First entry in the cond vector not imm-val");
1476 unsigned opcode = Cond[0].getImm();
1478 assert(
get(opcode).
isBranch() &&
"Should be a branching condition.");
1482 Cond[0].setImm(NewOpcode);
1489 BuildMI(MBB, MI, DL,
get(Hexagon::A2_nop));
1530 while (NOp < NumOps) {
1538 unsigned PredReg, PredRegPos, PredRegFlags;
1539 bool GotPredReg =
getPredReg(Cond, PredReg, PredRegPos, PredRegFlags);
1542 T.
addReg(PredReg, PredRegFlags);
1543 while (NOp < NumOps)
1567 std::vector<MachineOperand> &Pred)
const {
1576 if (RC == &Hexagon::PredRegsRegClass) {
1582 for (
unsigned PR : Hexagon::PredRegsRegClass) {
1605 case Hexagon::V6_vL32b_ai:
1606 case Hexagon::V6_vL32b_pi:
1607 case Hexagon::V6_vL32b_ppu:
1608 case Hexagon::V6_vL32b_cur_ai:
1609 case Hexagon::V6_vL32b_cur_pi:
1610 case Hexagon::V6_vL32b_cur_ppu:
1611 case Hexagon::V6_vL32b_nt_ai:
1612 case Hexagon::V6_vL32b_nt_pi:
1613 case Hexagon::V6_vL32b_nt_ppu:
1614 case Hexagon::V6_vL32b_tmp_ai:
1615 case Hexagon::V6_vL32b_tmp_pi:
1616 case Hexagon::V6_vL32b_tmp_ppu:
1617 case Hexagon::V6_vL32b_nt_cur_ai:
1618 case Hexagon::V6_vL32b_nt_cur_pi:
1619 case Hexagon::V6_vL32b_nt_cur_ppu:
1620 case Hexagon::V6_vL32b_nt_tmp_ai:
1621 case Hexagon::V6_vL32b_nt_tmp_pi:
1622 case Hexagon::V6_vL32b_nt_tmp_ppu:
1677 bool atInsnStart =
true;
1678 unsigned Length = 0;
1679 for (; *Str; ++Str) {
1683 if (atInsnStart && !std::isspace(static_cast<unsigned char>(*Str))) {
1685 atInsnStart =
false;
1689 atInsnStart =
false;
1694 Length += AStr.
count(Occ)*4;
1711 unsigned &SrcReg2,
int &
Mask,
1717 case Hexagon::C2_cmpeq:
1718 case Hexagon::C2_cmpeqp:
1719 case Hexagon::C2_cmpgt:
1720 case Hexagon::C2_cmpgtp:
1721 case Hexagon::C2_cmpgtu:
1722 case Hexagon::C2_cmpgtup:
1723 case Hexagon::C4_cmpneq:
1724 case Hexagon::C4_cmplte:
1725 case Hexagon::C4_cmplteu:
1726 case Hexagon::C2_cmpeqi:
1727 case Hexagon::C2_cmpgti:
1728 case Hexagon::C2_cmpgtui:
1729 case Hexagon::C4_cmpneqi:
1730 case Hexagon::C4_cmplteui:
1731 case Hexagon::C4_cmpltei:
1735 case Hexagon::A4_cmpbeq:
1736 case Hexagon::A4_cmpbgt:
1737 case Hexagon::A4_cmpbgtu:
1738 case Hexagon::A4_cmpbeqi:
1739 case Hexagon::A4_cmpbgti:
1740 case Hexagon::A4_cmpbgtui:
1744 case Hexagon::A4_cmpheq:
1745 case Hexagon::A4_cmphgt:
1746 case Hexagon::A4_cmphgtu:
1747 case Hexagon::A4_cmpheqi:
1748 case Hexagon::A4_cmphgti:
1749 case Hexagon::A4_cmphgtui:
1757 case Hexagon::C2_cmpeq:
1758 case Hexagon::C2_cmpeqp:
1759 case Hexagon::C2_cmpgt:
1760 case Hexagon::C2_cmpgtp:
1761 case Hexagon::C2_cmpgtu:
1762 case Hexagon::C2_cmpgtup:
1763 case Hexagon::A4_cmpbeq:
1764 case Hexagon::A4_cmpbgt:
1765 case Hexagon::A4_cmpbgtu:
1766 case Hexagon::A4_cmpheq:
1767 case Hexagon::A4_cmphgt:
1768 case Hexagon::A4_cmphgtu:
1769 case Hexagon::C4_cmpneq:
1770 case Hexagon::C4_cmplte:
1771 case Hexagon::C4_cmplteu:
1775 case Hexagon::C2_cmpeqi:
1776 case Hexagon::C2_cmpgtui:
1777 case Hexagon::C2_cmpgti:
1778 case Hexagon::C4_cmpneqi:
1779 case Hexagon::C4_cmplteui:
1780 case Hexagon::C4_cmpltei:
1781 case Hexagon::A4_cmpbeqi:
1782 case Hexagon::A4_cmpbgti:
1783 case Hexagon::A4_cmpbgtui:
1784 case Hexagon::A4_cmpheqi:
1785 case Hexagon::A4_cmphgti:
1786 case Hexagon::A4_cmphgtui: {
1801 unsigned *PredCost)
const {
1827 unsigned BasePosA, OffsetPosA;
1831 unsigned BaseRegA = BaseA.
getReg();
1835 unsigned BasePosB, OffsetPosB;
1839 unsigned BaseRegB = BaseB.
getReg();
1842 if (BaseRegA != BaseRegB || BaseSubA != BaseSubB)
1860 if (OffsetA > OffsetB) {
1861 uint64_t OffDiff = (uint64_t)((int64_t)OffsetA - (int64_t)OffsetB);
1862 return SizeB <= OffDiff;
1864 if (OffsetA < OffsetB) {
1865 uint64_t OffDiff = (uint64_t)((int64_t)OffsetB - (int64_t)OffsetA);
1866 return SizeA <= OffDiff;
1876 unsigned BasePos = 0, OffsetPos = 0;
1880 if (OffsetOp.
isImm()) {
1881 Value = OffsetOp.
getImm();
1884 }
else if (MI.
getOpcode() == Hexagon::A2_addi) {
1886 if (AddOp.
isImm()) {
1895 std::pair<unsigned, unsigned>
1903 using namespace HexagonII;
1905 static const std::pair<unsigned, const char*> Flags[] = {
1913 {
MO_IE,
"hexagon-ie"},
1922 using namespace HexagonII;
1924 static const std::pair<unsigned, const char*> Flags[] = {
1934 TRC = &Hexagon::PredRegsRegClass;
1936 TRC = &Hexagon::IntRegsRegClass;
1938 TRC = &Hexagon::DoubleRegsRegClass;
2009 assert(MO.
isImm() &&
"Extendable operand must be Immediate type");
2013 int ImmValue = MO.
getImm();
2015 return (ImmValue < MinValue || ImmValue > MaxValue);
2020 case Hexagon::L4_return:
2021 case Hexagon::L4_return_t:
2022 case Hexagon::L4_return_f:
2023 case Hexagon::L4_return_tnew_pnt:
2024 case Hexagon::L4_return_fnew_pnt:
2025 case Hexagon::L4_return_tnew_pt:
2026 case Hexagon::L4_return_fnew_pt:
2047 for (
auto &RegA : DefsA)
2048 for (
auto &RegB : UsesB) {
2055 if (RegB == *SubRegs)
2060 if (RegA == *SubRegs)
2070 case Hexagon::V6_vL32b_cur_pi:
2071 case Hexagon::V6_vL32b_cur_ai:
2104 return (Opcode == Hexagon::ENDLOOP0 ||
2105 Opcode == Hexagon::ENDLOOP1);
2132 case Hexagon::PS_fi:
2133 case Hexagon::PS_fia:
2159 const uint64_t
F =
get(Opcode).TSFlags;
2175 case Hexagon::J2_callr:
2176 case Hexagon::J2_callrf:
2177 case Hexagon::J2_callrt:
2178 case Hexagon::PS_call_nr:
2186 case Hexagon::L4_return:
2187 case Hexagon::L4_return_t:
2188 case Hexagon::L4_return_f:
2189 case Hexagon::L4_return_fnew_pnt:
2190 case Hexagon::L4_return_fnew_pt:
2191 case Hexagon::L4_return_tnew_pnt:
2192 case Hexagon::L4_return_tnew_pt:
2200 case Hexagon::J2_jumpr:
2201 case Hexagon::J2_jumprt:
2202 case Hexagon::J2_jumprf:
2203 case Hexagon::J2_jumprtnewpt:
2204 case Hexagon::J2_jumprfnewpt:
2205 case Hexagon::J2_jumprtnew:
2206 case Hexagon::J2_jumprfnew:
2217 unsigned offset)
const {
2221 return isInt<11>(offset);
2227 case Hexagon::J2_jump:
2228 case Hexagon::J2_call:
2229 case Hexagon::PS_call_nr:
2230 return isInt<24>(offset);
2231 case Hexagon::J2_jumpt:
2232 case Hexagon::J2_jumpf:
2233 case Hexagon::J2_jumptnew:
2234 case Hexagon::J2_jumptnewpt:
2235 case Hexagon::J2_jumpfnew:
2236 case Hexagon::J2_jumpfnewpt:
2237 case Hexagon::J2_callt:
2238 case Hexagon::J2_callf:
2239 return isInt<17>(offset);
2240 case Hexagon::J2_loop0i:
2241 case Hexagon::J2_loop0iext:
2242 case Hexagon::J2_loop0r:
2243 case Hexagon::J2_loop0rext:
2244 case Hexagon::J2_loop1i:
2245 case Hexagon::J2_loop1iext:
2246 case Hexagon::J2_loop1r:
2247 case Hexagon::J2_loop1rext:
2248 return isInt<9>(offset);
2250 case Hexagon::J4_cmpeqi_tp0_jump_nt:
2251 case Hexagon::J4_cmpeqi_tp1_jump_nt:
2252 case Hexagon::J4_cmpeqn1_tp0_jump_nt:
2253 case Hexagon::J4_cmpeqn1_tp1_jump_nt:
2254 return isInt<11>(offset);
2268 if (isLate && isEarly) {
2278 case TargetOpcode::EXTRACT_SUBREG:
2279 case TargetOpcode::INSERT_SUBREG:
2280 case TargetOpcode::SUBREG_TO_REG:
2281 case TargetOpcode::REG_SEQUENCE:
2282 case TargetOpcode::IMPLICIT_DEF:
2283 case TargetOpcode::COPY:
2285 case TargetOpcode::PHI:
2292 return !
is_TC1(SchedClass);
2303 return Opcode == Hexagon::J2_loop0i ||
2304 Opcode == Hexagon::J2_loop0r ||
2305 Opcode == Hexagon::J2_loop0iext ||
2306 Opcode == Hexagon::J2_loop0rext ||
2307 Opcode == Hexagon::J2_loop1i ||
2308 Opcode == Hexagon::J2_loop1r ||
2309 Opcode == Hexagon::J2_loop1iext ||
2310 Opcode == Hexagon::J2_loop1rext;
2315 default:
return false;
2316 case Hexagon::L4_iadd_memopw_io:
2317 case Hexagon::L4_isub_memopw_io:
2318 case Hexagon::L4_add_memopw_io:
2319 case Hexagon::L4_sub_memopw_io:
2320 case Hexagon::L4_and_memopw_io:
2321 case Hexagon::L4_or_memopw_io:
2322 case Hexagon::L4_iadd_memoph_io:
2323 case Hexagon::L4_isub_memoph_io:
2324 case Hexagon::L4_add_memoph_io:
2325 case Hexagon::L4_sub_memoph_io:
2326 case Hexagon::L4_and_memoph_io:
2327 case Hexagon::L4_or_memoph_io:
2328 case Hexagon::L4_iadd_memopb_io:
2329 case Hexagon::L4_isub_memopb_io:
2330 case Hexagon::L4_add_memopb_io:
2331 case Hexagon::L4_sub_memopb_io:
2332 case Hexagon::L4_and_memopb_io:
2333 case Hexagon::L4_or_memopb_io:
2334 case Hexagon::L4_ior_memopb_io:
2335 case Hexagon::L4_ior_memoph_io:
2336 case Hexagon::L4_ior_memopw_io:
2337 case Hexagon::L4_iand_memopb_io:
2338 case Hexagon::L4_iand_memoph_io:
2339 case Hexagon::L4_iand_memopw_io:
2351 const uint64_t
F =
get(Opcode).TSFlags;
2373 const uint64_t
F =
get(Opcode).TSFlags;
2379 unsigned OperandNum)
const {
2392 const uint64_t
F =
get(Opcode).TSFlags;
2404 const uint64_t
F =
get(Opcode).TSFlags;
2412 const uint64_t
F =
get(Opcode).TSFlags;
2417 const uint64_t
F =
get(Opcode).TSFlags;
2422 const uint64_t
F =
get(Opcode).TSFlags;
2429 return MI.
getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4 ||
2430 MI.
getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4_EXT ||
2431 MI.
getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4_PIC ||
2432 MI.
getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4_EXT_PIC;
2438 case Hexagon::L2_loadrb_io:
2439 case Hexagon::L4_loadrb_ur:
2440 case Hexagon::L4_loadrb_ap:
2441 case Hexagon::L2_loadrb_pr:
2442 case Hexagon::L2_loadrb_pbr:
2443 case Hexagon::L2_loadrb_pi:
2444 case Hexagon::L2_loadrb_pci:
2445 case Hexagon::L2_loadrb_pcr:
2446 case Hexagon::L2_loadbsw2_io:
2447 case Hexagon::L4_loadbsw2_ur:
2448 case Hexagon::L4_loadbsw2_ap:
2449 case Hexagon::L2_loadbsw2_pr:
2450 case Hexagon::L2_loadbsw2_pbr:
2451 case Hexagon::L2_loadbsw2_pi:
2452 case Hexagon::L2_loadbsw2_pci:
2453 case Hexagon::L2_loadbsw2_pcr:
2454 case Hexagon::L2_loadbsw4_io:
2455 case Hexagon::L4_loadbsw4_ur:
2456 case Hexagon::L4_loadbsw4_ap:
2457 case Hexagon::L2_loadbsw4_pr:
2458 case Hexagon::L2_loadbsw4_pbr:
2459 case Hexagon::L2_loadbsw4_pi:
2460 case Hexagon::L2_loadbsw4_pci:
2461 case Hexagon::L2_loadbsw4_pcr:
2462 case Hexagon::L4_loadrb_rr:
2463 case Hexagon::L2_ploadrbt_io:
2464 case Hexagon::L2_ploadrbt_pi:
2465 case Hexagon::L2_ploadrbf_io:
2466 case Hexagon::L2_ploadrbf_pi:
2467 case Hexagon::L2_ploadrbtnew_io:
2468 case Hexagon::L2_ploadrbfnew_io:
2469 case Hexagon::L4_ploadrbt_rr:
2470 case Hexagon::L4_ploadrbf_rr:
2471 case Hexagon::L4_ploadrbtnew_rr:
2472 case Hexagon::L4_ploadrbfnew_rr:
2473 case Hexagon::L2_ploadrbtnew_pi:
2474 case Hexagon::L2_ploadrbfnew_pi:
2475 case Hexagon::L4_ploadrbt_abs:
2476 case Hexagon::L4_ploadrbf_abs:
2477 case Hexagon::L4_ploadrbtnew_abs:
2478 case Hexagon::L4_ploadrbfnew_abs:
2479 case Hexagon::L2_loadrbgp:
2481 case Hexagon::L2_loadrh_io:
2482 case Hexagon::L4_loadrh_ur:
2483 case Hexagon::L4_loadrh_ap:
2484 case Hexagon::L2_loadrh_pr:
2485 case Hexagon::L2_loadrh_pbr:
2486 case Hexagon::L2_loadrh_pi:
2487 case Hexagon::L2_loadrh_pci:
2488 case Hexagon::L2_loadrh_pcr:
2489 case Hexagon::L4_loadrh_rr:
2490 case Hexagon::L2_ploadrht_io:
2491 case Hexagon::L2_ploadrht_pi:
2492 case Hexagon::L2_ploadrhf_io:
2493 case Hexagon::L2_ploadrhf_pi:
2494 case Hexagon::L2_ploadrhtnew_io:
2495 case Hexagon::L2_ploadrhfnew_io:
2496 case Hexagon::L4_ploadrht_rr:
2497 case Hexagon::L4_ploadrhf_rr:
2498 case Hexagon::L4_ploadrhtnew_rr:
2499 case Hexagon::L4_ploadrhfnew_rr:
2500 case Hexagon::L2_ploadrhtnew_pi:
2501 case Hexagon::L2_ploadrhfnew_pi:
2502 case Hexagon::L4_ploadrht_abs:
2503 case Hexagon::L4_ploadrhf_abs:
2504 case Hexagon::L4_ploadrhtnew_abs:
2505 case Hexagon::L4_ploadrhfnew_abs:
2506 case Hexagon::L2_loadrhgp:
2520 case Hexagon::STriw_pred:
2521 case Hexagon::LDriw_pred:
2533 if (
Op.isGlobal() ||
Op.isSymbol())
2541 return is_TC1(SchedClass);
2546 return is_TC2(SchedClass);
2566 for (
int I = 0;
I <
N;
I++)
2571 if (MI2.
getOpcode() == Hexagon::V6_vS32b_pi)
2579 const uint64_t V =
getType(MI);
2586 if (Offset % Size != 0)
2588 int Count = Offset /
Size;
2603 return isInt<4>(Count);
2613 return isInt<3>(Count);
2632 case Hexagon::PS_vstorerq_ai:
2633 case Hexagon::PS_vstorerw_ai:
2634 case Hexagon::PS_vstorerw_nt_ai:
2635 case Hexagon::PS_vloadrq_ai:
2636 case Hexagon::PS_vloadrw_ai:
2637 case Hexagon::PS_vloadrw_nt_ai:
2638 case Hexagon::V6_vL32b_ai:
2639 case Hexagon::V6_vS32b_ai:
2640 case Hexagon::V6_vL32b_nt_ai:
2641 case Hexagon::V6_vS32b_nt_ai:
2642 case Hexagon::V6_vL32Ub_ai:
2643 case Hexagon::V6_vS32Ub_ai: {
2644 unsigned VectorSize = TRI->
getSpillSize(Hexagon::HvxVRRegClass);
2646 if (Offset & (VectorSize-1))
2648 return isInt<4>(Offset >>
Log2_32(VectorSize));
2651 case Hexagon::J2_loop0i:
2652 case Hexagon::J2_loop1i:
2653 return isUInt<10>(
Offset);
2655 case Hexagon::S4_storeirb_io:
2656 case Hexagon::S4_storeirbt_io:
2657 case Hexagon::S4_storeirbf_io:
2658 return isUInt<6>(
Offset);
2660 case Hexagon::S4_storeirh_io:
2661 case Hexagon::S4_storeirht_io:
2662 case Hexagon::S4_storeirhf_io:
2663 return isShiftedUInt<6,1>(
Offset);
2665 case Hexagon::S4_storeiri_io:
2666 case Hexagon::S4_storeirit_io:
2667 case Hexagon::S4_storeirif_io:
2668 return isShiftedUInt<6,2>(
Offset);
2675 case Hexagon::L2_loadri_io:
2676 case Hexagon::S2_storeri_io:
2677 return (Offset >= Hexagon_MEMW_OFFSET_MIN) &&
2680 case Hexagon::L2_loadrd_io:
2681 case Hexagon::S2_storerd_io:
2682 return (Offset >= Hexagon_MEMD_OFFSET_MIN) &&
2685 case Hexagon::L2_loadrh_io:
2686 case Hexagon::L2_loadruh_io:
2687 case Hexagon::S2_storerh_io:
2688 case Hexagon::S2_storerf_io:
2689 return (Offset >= Hexagon_MEMH_OFFSET_MIN) &&
2692 case Hexagon::L2_loadrb_io:
2693 case Hexagon::L2_loadrub_io:
2694 case Hexagon::S2_storerb_io:
2695 return (Offset >= Hexagon_MEMB_OFFSET_MIN) &&
2698 case Hexagon::A2_addi:
2699 return (Offset >= Hexagon_ADDI_OFFSET_MIN) &&
2702 case Hexagon::L4_iadd_memopw_io:
2703 case Hexagon::L4_isub_memopw_io:
2704 case Hexagon::L4_add_memopw_io:
2705 case Hexagon::L4_sub_memopw_io:
2706 case Hexagon::L4_and_memopw_io:
2707 case Hexagon::L4_or_memopw_io:
2708 return (0 <= Offset && Offset <= 255);
2710 case Hexagon::L4_iadd_memoph_io:
2711 case Hexagon::L4_isub_memoph_io:
2712 case Hexagon::L4_add_memoph_io:
2713 case Hexagon::L4_sub_memoph_io:
2714 case Hexagon::L4_and_memoph_io:
2715 case Hexagon::L4_or_memoph_io:
2716 return (0 <= Offset && Offset <= 127);
2718 case Hexagon::L4_iadd_memopb_io:
2719 case Hexagon::L4_isub_memopb_io:
2720 case Hexagon::L4_add_memopb_io:
2721 case Hexagon::L4_sub_memopb_io:
2722 case Hexagon::L4_and_memopb_io:
2723 case Hexagon::L4_or_memopb_io:
2724 return (0 <= Offset && Offset <= 63);
2728 case Hexagon::STriw_pred:
2729 case Hexagon::LDriw_pred:
2730 case Hexagon::STriw_ctr:
2731 case Hexagon::LDriw_ctr:
2734 case Hexagon::PS_fi:
2735 case Hexagon::PS_fia:
2739 case Hexagon::L2_ploadrbt_io:
2740 case Hexagon::L2_ploadrbf_io:
2741 case Hexagon::L2_ploadrubt_io:
2742 case Hexagon::L2_ploadrubf_io:
2743 case Hexagon::S2_pstorerbt_io:
2744 case Hexagon::S2_pstorerbf_io:
2745 return isUInt<6>(
Offset);
2747 case Hexagon::L2_ploadrht_io:
2748 case Hexagon::L2_ploadrhf_io:
2749 case Hexagon::L2_ploadruht_io:
2750 case Hexagon::L2_ploadruhf_io:
2751 case Hexagon::S2_pstorerht_io:
2752 case Hexagon::S2_pstorerhf_io:
2753 return isShiftedUInt<6,1>(
Offset);
2755 case Hexagon::L2_ploadrit_io:
2756 case Hexagon::L2_ploadrif_io:
2757 case Hexagon::S2_pstorerit_io:
2758 case Hexagon::S2_pstorerif_io:
2759 return isShiftedUInt<6,2>(
Offset);
2761 case Hexagon::L2_ploadrdt_io:
2762 case Hexagon::L2_ploadrdf_io:
2763 case Hexagon::S2_pstorerdt_io:
2764 case Hexagon::S2_pstorerdf_io:
2765 return isShiftedUInt<6,3>(
Offset);
2769 "Please define it in the above switch statement!");
2777 const uint64_t
F =
get(MI.
getOpcode()).TSFlags;
2801 case Hexagon::L2_loadrub_io:
2802 case Hexagon::L4_loadrub_ur:
2803 case Hexagon::L4_loadrub_ap:
2804 case Hexagon::L2_loadrub_pr:
2805 case Hexagon::L2_loadrub_pbr:
2806 case Hexagon::L2_loadrub_pi:
2807 case Hexagon::L2_loadrub_pci:
2808 case Hexagon::L2_loadrub_pcr:
2809 case Hexagon::L2_loadbzw2_io:
2810 case Hexagon::L4_loadbzw2_ur:
2811 case Hexagon::L4_loadbzw2_ap:
2812 case Hexagon::L2_loadbzw2_pr:
2813 case Hexagon::L2_loadbzw2_pbr:
2814 case Hexagon::L2_loadbzw2_pi:
2815 case Hexagon::L2_loadbzw2_pci:
2816 case Hexagon::L2_loadbzw2_pcr:
2817 case Hexagon::L2_loadbzw4_io:
2818 case Hexagon::L4_loadbzw4_ur:
2819 case Hexagon::L4_loadbzw4_ap:
2820 case Hexagon::L2_loadbzw4_pr:
2821 case Hexagon::L2_loadbzw4_pbr:
2822 case Hexagon::L2_loadbzw4_pi:
2823 case Hexagon::L2_loadbzw4_pci:
2824 case Hexagon::L2_loadbzw4_pcr:
2825 case Hexagon::L4_loadrub_rr:
2826 case Hexagon::L2_ploadrubt_io:
2827 case Hexagon::L2_ploadrubt_pi:
2828 case Hexagon::L2_ploadrubf_io:
2829 case Hexagon::L2_ploadrubf_pi:
2830 case Hexagon::L2_ploadrubtnew_io:
2831 case Hexagon::L2_ploadrubfnew_io:
2832 case Hexagon::L4_ploadrubt_rr:
2833 case Hexagon::L4_ploadrubf_rr:
2834 case Hexagon::L4_ploadrubtnew_rr:
2835 case Hexagon::L4_ploadrubfnew_rr:
2836 case Hexagon::L2_ploadrubtnew_pi:
2837 case Hexagon::L2_ploadrubfnew_pi:
2838 case Hexagon::L4_ploadrubt_abs:
2839 case Hexagon::L4_ploadrubf_abs:
2840 case Hexagon::L4_ploadrubtnew_abs:
2841 case Hexagon::L4_ploadrubfnew_abs:
2842 case Hexagon::L2_loadrubgp:
2844 case Hexagon::L2_loadruh_io:
2845 case Hexagon::L4_loadruh_ur:
2846 case Hexagon::L4_loadruh_ap:
2847 case Hexagon::L2_loadruh_pr:
2848 case Hexagon::L2_loadruh_pbr:
2849 case Hexagon::L2_loadruh_pi:
2850 case Hexagon::L2_loadruh_pci:
2851 case Hexagon::L2_loadruh_pcr:
2852 case Hexagon::L4_loadruh_rr:
2853 case Hexagon::L2_ploadruht_io:
2854 case Hexagon::L2_ploadruht_pi:
2855 case Hexagon::L2_ploadruhf_io:
2856 case Hexagon::L2_ploadruhf_pi:
2857 case Hexagon::L2_ploadruhtnew_io:
2858 case Hexagon::L2_ploadruhfnew_io:
2859 case Hexagon::L4_ploadruht_rr:
2860 case Hexagon::L4_ploadruhf_rr:
2861 case Hexagon::L4_ploadruhtnew_rr:
2862 case Hexagon::L4_ploadruhfnew_rr:
2863 case Hexagon::L2_ploadruhtnew_pi:
2864 case Hexagon::L2_ploadruhfnew_pi:
2865 case Hexagon::L4_ploadruht_abs:
2866 case Hexagon::L4_ploadruhf_abs:
2867 case Hexagon::L4_ploadruhtnew_abs:
2868 case Hexagon::L4_ploadruhfnew_abs:
2869 case Hexagon::L2_loadruhgp:
2889 unsigned AccessSize = 0;
2893 return BaseReg != 0;
2911 if (!Stored.
isReg())
2924 return Opc == Hexagon::PS_call_nr || Opc == Hexagon::PS_callr_nr;
2940 if (Hexagon::getRegForm(MI.
getOpcode()) >= 0)
2950 NonExtOpcode = Hexagon::changeAddrMode_abs_io(MI.
getOpcode());
2956 NonExtOpcode = Hexagon::changeAddrMode_io_rr(MI.
getOpcode());
2959 NonExtOpcode = Hexagon::changeAddrMode_ur_rr(MI.
getOpcode());
2964 if (NonExtOpcode < 0)
2972 return Hexagon::getRealHWInstr(MI.
getOpcode(),
2973 Hexagon::InstrType_Pseudo) >= 0;
2991 Subtarget.hasV60Ops();
2996 if (MI.
mayStore() && !Subtarget.useNewValueStores())
3030 if (!MII->isBundle())
3033 for (++MII; MII != MIE && MII->isInsideBundle(); ++MII) {
3042 unsigned PredReg)
const {
3045 if (MO.isRegMask() && MO.clobbersPhysReg(PredReg))
3047 if (MO.isReg() && MO.isDef() && MO.isImplicit() && (MO.getReg() == PredReg))
3054 case Hexagon::A4_addp_c:
3055 case Hexagon::A4_subp_c:
3056 case Hexagon::A4_tlbmatch:
3057 case Hexagon::A5_ACS:
3058 case Hexagon::F2_sfinvsqrta:
3059 case Hexagon::F2_sfrecipa:
3060 case Hexagon::J2_endloop0:
3061 case Hexagon::J2_endloop01:
3062 case Hexagon::J2_ploop1si:
3063 case Hexagon::J2_ploop1sr:
3064 case Hexagon::J2_ploop2si:
3065 case Hexagon::J2_ploop2sr:
3066 case Hexagon::J2_ploop3si:
3067 case Hexagon::J2_ploop3sr:
3068 case Hexagon::S2_cabacdecbin:
3069 case Hexagon::S2_storew_locked:
3070 case Hexagon::S4_stored_locked:
3077 return Opcode == Hexagon::J2_jumpt ||
3078 Opcode == Hexagon::J2_jumptpt ||
3079 Opcode == Hexagon::J2_jumpf ||
3080 Opcode == Hexagon::J2_jumpfpt ||
3081 Opcode == Hexagon::J2_jumptnew ||
3082 Opcode == Hexagon::J2_jumpfnew ||
3083 Opcode == Hexagon::J2_jumptnewpt ||
3084 Opcode == Hexagon::J2_jumpfnewpt;
3103 int &
Offset,
unsigned &AccessSize)
const {
3112 unsigned BasePos = 0, OffsetPos = 0;
3122 if (!OffsetOp.
isImm())
3124 Offset = OffsetOp.
getImm();
3135 unsigned &BasePos,
unsigned &OffsetPos)
const {
3200 while (I->isDebugInstr()) {
3205 if (!isUnpredicatedTerminator(*I))
3214 if (&*I != LastInst && !I->isBundle() && isUnpredicatedTerminator(*I)) {
3215 if (!SecondLastInst) {
3216 SecondLastInst = &*
I;
3238 unsigned DstReg, SrcReg, Src1Reg, Src2Reg;
3249 case Hexagon::C2_cmpeq:
3250 case Hexagon::C2_cmpgt:
3251 case Hexagon::C2_cmpgtu:
3255 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3256 (Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
3260 case Hexagon::C2_cmpeqi:
3261 case Hexagon::C2_cmpgti:
3262 case Hexagon::C2_cmpgtui:
3266 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3267 (Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
3273 case Hexagon::A2_tfr:
3280 case Hexagon::A2_tfrsi:
3288 case Hexagon::S2_tstbit_i:
3291 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3292 (Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
3301 case Hexagon::J2_jumptnew:
3302 case Hexagon::J2_jumpfnew:
3303 case Hexagon::J2_jumptnewpt:
3304 case Hexagon::J2_jumpfnewpt:
3306 if (Hexagon::PredRegsRegClass.
contains(Src1Reg) &&
3307 (Hexagon::P0 == Src1Reg || Hexagon::P1 == Src1Reg))
3314 case Hexagon::J2_jump:
3315 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4:
3316 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4_PIC:
3328 if ((GA.
getOpcode() != Hexagon::C2_cmpeqi) ||
3329 (GB.
getOpcode() != Hexagon::J2_jumptnew))
3334 if (DestReg != Hexagon::P0 && DestReg != Hexagon::P1)
3342 return DestReg == Hexagon::P0 ? Hexagon::J4_cmpeqn1_tp0_jump_nt
3343 : Hexagon::J4_cmpeqn1_tp1_jump_nt;
3346 return DestReg == Hexagon::P0 ? Hexagon::J4_cmpeqi_tp0_jump_nt
3347 : Hexagon::J4_cmpeqi_tp1_jump_nt;
3351 enum Hexagon::PredSense inPredSense;
3352 inPredSense = invertPredicate ? Hexagon::PredSense_false :
3353 Hexagon::PredSense_true;
3354 int CondOpcode = Hexagon::getPredOpcode(Opc, inPredSense);
3355 if (CondOpcode >= 0)
3365 case Hexagon::V6_vL32b_pi:
3366 return Hexagon::V6_vL32b_cur_pi;
3367 case Hexagon::V6_vL32b_ai:
3368 return Hexagon::V6_vL32b_cur_ai;
3369 case Hexagon::V6_vL32b_nt_pi:
3370 return Hexagon::V6_vL32b_nt_cur_pi;
3371 case Hexagon::V6_vL32b_nt_ai:
3372 return Hexagon::V6_vL32b_nt_cur_ai;
3381 case Hexagon::V6_vL32b_cur_pi:
3382 return Hexagon::V6_vL32b_pi;
3383 case Hexagon::V6_vL32b_cur_ai:
3384 return Hexagon::V6_vL32b_ai;
3385 case Hexagon::V6_vL32b_nt_cur_pi:
3386 return Hexagon::V6_vL32b_nt_pi;
3387 case Hexagon::V6_vL32b_nt_cur_ai:
3388 return Hexagon::V6_vL32b_nt_ai;
3476 int NVOpcode = Hexagon::getNewValueOpcode(MI.
getOpcode());
3484 case Hexagon::S4_storerb_ur:
3485 return Hexagon::S4_storerbnew_ur;
3487 case Hexagon::S2_storerb_pci:
3488 return Hexagon::S2_storerb_pci;
3490 case Hexagon::S2_storeri_pci:
3491 return Hexagon::S2_storeri_pci;
3493 case Hexagon::S2_storerh_pci:
3494 return Hexagon::S2_storerh_pci;
3496 case Hexagon::S2_storerd_pci:
3497 return Hexagon::S2_storerd_pci;
3499 case Hexagon::S2_storerf_pci:
3500 return Hexagon::S2_storerf_pci;
3502 case Hexagon::V6_vS32b_ai:
3503 return Hexagon::V6_vS32b_new_ai;
3505 case Hexagon::V6_vS32b_pi:
3506 return Hexagon::V6_vS32b_new_pi;
3531 if (BrTarget.
isMBB()) {
3533 Taken = getEdgeProbability(Src, Dst) >= OneHalf;
3546 bool SawCond =
false, Bad =
false;
3550 if (
I.isConditionalBranch()) {
3557 if (
I.isUnconditionalBranch() && !SawCond) {
3565 if (NextIt == B.instr_end()) {
3568 if (!B.isLayoutSuccessor(SB))
3570 Taken = getEdgeProbability(Src, SB) < OneHalf;
3574 assert(NextIt->isUnconditionalBranch());
3583 Taken = BT && getEdgeProbability(Src, BT) < OneHalf;
3591 case Hexagon::J2_jumpt:
3592 return Taken ? Hexagon::J2_jumptnewpt : Hexagon::J2_jumptnew;
3593 case Hexagon::J2_jumpf:
3594 return Taken ? Hexagon::J2_jumpfnewpt : Hexagon::J2_jumpfnew;
3606 case Hexagon::J2_jumpt:
3607 case Hexagon::J2_jumpf:
3611 int NewOpcode = Hexagon::getPredNewOpcode(MI.
getOpcode());
3620 NewOp = Hexagon::getPredOldOpcode(NewOp);
3624 if (!Subtarget.getFeatureBits()[Hexagon::ArchV60]) {
3626 case Hexagon::J2_jumptpt:
3627 NewOp = Hexagon::J2_jumpt;
3629 case Hexagon::J2_jumpfpt:
3630 NewOp = Hexagon::J2_jumpf;
3632 case Hexagon::J2_jumprtpt:
3633 NewOp = Hexagon::J2_jumprt;
3635 case Hexagon::J2_jumprfpt:
3636 NewOp = Hexagon::J2_jumprf;
3641 "Couldn't change predicate new instruction to its old form.");
3645 NewOp = Hexagon::getNonNVStore(NewOp);
3646 assert(NewOp >= 0 &&
"Couldn't change new-value store to its old form.");
3649 if (Subtarget.hasV60Ops())
3654 case Hexagon::J2_jumpfpt:
3655 return Hexagon::J2_jumpf;
3656 case Hexagon::J2_jumptpt:
3657 return Hexagon::J2_jumpt;
3658 case Hexagon::J2_jumprfpt:
3659 return Hexagon::J2_jumprf;
3660 case Hexagon::J2_jumprtpt:
3661 return Hexagon::J2_jumprt;
3670 unsigned DstReg, SrcReg, Src1Reg, Src2Reg;
3681 case Hexagon::L2_loadri_io:
3687 if (Hexagon::IntRegsRegClass.
contains(SrcReg) &&
3699 case Hexagon::L2_loadrub_io:
3717 case Hexagon::L2_loadrh_io:
3718 case Hexagon::L2_loadruh_io:
3727 case Hexagon::L2_loadrb_io:
3736 case Hexagon::L2_loadrd_io:
3741 Hexagon::IntRegsRegClass.
contains(SrcReg) &&
3749 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4:
3750 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4_PIC:
3751 case Hexagon::L4_return:
3752 case Hexagon::L2_deallocframe:
3754 case Hexagon::EH_RETURN_JMPR:
3755 case Hexagon::PS_jmpret:
3756 case Hexagon::SL2_jumpr31:
3760 if (Hexagon::IntRegsRegClass.
contains(DstReg) && (Hexagon::R31 == DstReg))
3763 case Hexagon::PS_jmprett:
3764 case Hexagon::PS_jmpretf:
3765 case Hexagon::PS_jmprettnewpt:
3766 case Hexagon::PS_jmpretfnewpt:
3767 case Hexagon::PS_jmprettnew:
3768 case Hexagon::PS_jmpretfnew:
3769 case Hexagon::SL2_jumpr31_t:
3770 case Hexagon::SL2_jumpr31_f:
3771 case Hexagon::SL2_jumpr31_tnew:
3775 if ((Hexagon::PredRegsRegClass.
contains(SrcReg) &&
3776 (Hexagon::P0 == SrcReg)) &&
3777 (Hexagon::IntRegsRegClass.
contains(DstReg) && (Hexagon::R31 == DstReg)))
3780 case Hexagon::L4_return_t:
3781 case Hexagon::L4_return_f:
3782 case Hexagon::L4_return_tnew_pnt:
3783 case Hexagon::L4_return_fnew_pnt:
3784 case Hexagon::L4_return_tnew_pt:
3785 case Hexagon::L4_return_fnew_pt:
3788 if (Hexagon::PredRegsRegClass.
contains(SrcReg) && (Hexagon::P0 == SrcReg))
3796 case Hexagon::S2_storeri_io:
3801 if (Hexagon::IntRegsRegClass.
contains(Src1Reg) &&
3812 case Hexagon::S2_storerb_io:
3829 case Hexagon::S2_storerh_io:
3838 case Hexagon::S2_storerd_io:
3843 Hexagon::IntRegsRegClass.
contains(Src1Reg) &&
3848 case Hexagon::S4_storeiri_io:
3856 case Hexagon::S4_storeirb_io:
3864 case Hexagon::S2_allocframe:
3887 case Hexagon::A2_addi:
3892 if (Hexagon::IntRegsRegClass.
contains(SrcReg) &&
3908 case Hexagon::A2_add:
3917 case Hexagon::A2_andir:
3929 case Hexagon::A2_tfr:
3936 case Hexagon::A2_tfrsi:
3945 case Hexagon::C2_cmoveit:
3946 case Hexagon::C2_cmovenewit:
3947 case Hexagon::C2_cmoveif:
3948 case Hexagon::C2_cmovenewif:
3955 Hexagon::PredRegsRegClass.
contains(SrcReg) && Hexagon::P0 == SrcReg &&
3959 case Hexagon::C2_cmpeqi:
3963 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3968 case Hexagon::A2_combineii:
3969 case Hexagon::A4_combineii:
3981 case Hexagon::A4_combineri:
3990 case Hexagon::A4_combineir:
3999 case Hexagon::A2_sxtb:
4000 case Hexagon::A2_sxth:
4001 case Hexagon::A2_zxtb:
4002 case Hexagon::A2_zxth:
4015 return Hexagon::getRealHWInstr(MI.
getOpcode(), Hexagon::InstrType_Real);
4042 unsigned UseIdx)
const {
4048 if (DefMO.
isReg() && HRI.isPhysicalRegister(DefMO.
getReg())) {
4089 Cond[0].setImm(Opc);
4096 : Hexagon::getTruePredOpcode(Opc);
4097 if (InvPredOpcode >= 0)
4098 return InvPredOpcode;
4112 return ~(-1U << (bits - 1));
4114 return ~(-1U <<
bits);
4120 case Hexagon::L2_loadrbgp:
4121 case Hexagon::L2_loadrdgp:
4122 case Hexagon::L2_loadrhgp:
4123 case Hexagon::L2_loadrigp:
4124 case Hexagon::L2_loadrubgp:
4125 case Hexagon::L2_loadruhgp:
4126 case Hexagon::S2_storerbgp:
4127 case Hexagon::S2_storerbnewgp:
4128 case Hexagon::S2_storerhgp:
4129 case Hexagon::S2_storerhnewgp:
4130 case Hexagon::S2_storerigp:
4131 case Hexagon::S2_storerinewgp:
4132 case Hexagon::S2_storerdgp:
4133 case Hexagon::S2_storerfgp:
4147 using namespace HexagonII;
4159 return HRI.getSpillSize(Hexagon::HvxVRRegClass);
4174 return -1U << (bits - 1);
4183 short NonExtOpcode = Hexagon::getRegForm(MI.
getOpcode());
4184 if (NonExtOpcode >= 0)
4185 return NonExtOpcode;
4191 return Hexagon::changeAddrMode_abs_io(MI.
getOpcode());
4193 return Hexagon::changeAddrMode_io_rr(MI.
getOpcode());
4195 return Hexagon::changeAddrMode_ur_rr(MI.
getOpcode());
4205 unsigned &PredReg,
unsigned &PredRegPos,
unsigned &PredRegFlags)
const {
4213 PredReg = Cond[1].getReg();
4217 if (Cond[1].isImplicit())
4225 return Hexagon::getRealHWInstr(MI.
getOpcode(), Hexagon::InstrType_Pseudo);
4229 return Hexagon::getRegForm(MI.
getOpcode());
4256 unsigned NumDefs = 0;
4289 assert(BundleHead->isBundle() &&
"Not a bundle header");
4299 "Instruction must be extendable");
4305 "Branch with unknown extendable field type");
4339 for (
unsigned insn = TargetOpcode::GENERIC_OP_END+1;
4340 insn < Hexagon::INSTRUCTION_LIST_END; ++insn) {
4341 NewMI =
BuildMI(B, I, DL,
get(insn));
4361 int PredRevOpcode = -1;
4363 PredRevOpcode = Hexagon::notTakenBranchPrediction(Opcode);
4365 PredRevOpcode = Hexagon::takenBranchPrediction(Opcode);
4366 assert(PredRevOpcode > 0);
4367 return PredRevOpcode;
4373 return Cond.
empty() || (Cond[0].isImm() && (Cond.
size() != 1));
4380 if (Operand.isImm())
4381 Operand.setImm(Operand.getImm() | memShufDisabledMask);
4389 return (Operand.isImm() && (Operand.getImm() & memShufDisabledMask) != 0);
4394 return Opc >= 0 ? Hexagon::changeAddrMode_abs_io(Opc) : Opc;
4398 return Opc >= 0 ? Hexagon::changeAddrMode_io_abs(Opc) : Opc;
4402 return Opc >= 0 ? Hexagon::changeAddrMode_io_pi(Opc) : Opc;
4406 return Opc >= 0 ? Hexagon::changeAddrMode_io_rr(Opc) : Opc;
4410 return Opc >= 0 ? Hexagon::changeAddrMode_pi_io(Opc) : Opc;
4414 return Opc >= 0 ? Hexagon::changeAddrMode_rr_io(Opc) : Opc;
4418 return Opc >= 0 ? Hexagon::changeAddrMode_rr_ur(Opc) : Opc;
4422 return Opc >= 0 ? Hexagon::changeAddrMode_ur_rr(Opc) : Opc;
static bool isReg(const MCInst &MI, unsigned OpNo)
unsigned getTargetFlags() const
bool isRegMask() const
isRegMask - Tests if this is a MO_RegisterMask operand.
short getNonExtOpcode(const MachineInstr &MI) const
ArrayRef< std::pair< unsigned, const char * > > getSerializableDirectMachineOperandTargetFlags() const override
Return an array that contains the direct target flag values and their names.
bool isVecALU(const MachineInstr &MI) const
void push_back(const T &Elt)
const MachineInstrBuilder & add(const MachineOperand &MO) const
bool DefinesPredicate(MachineInstr &MI, std::vector< MachineOperand > &Pred) const override
If the specified instruction defines any predicate or condition code register(s) used for predication...
This class is the base class for the comparison instructions.
short changeAddrMode_rr_io(short Opc) const
bool modifiesRegister(unsigned Reg, const TargetRegisterInfo *TRI) const
Return true if the MachineInstr modifies (fully define or partially define) the specified register...
instr_iterator instr_begin()
const int Hexagon_MEMH_OFFSET_MAX
bool is_TC2early(unsigned SchedClass)
bool isCall(QueryType Type=AnyInBundle) const
unsigned nonDbgBBSize(const MachineBasicBlock *BB) const
getInstrTimingClassLatency - Compute the instruction latency of a given instruction using Timing Clas...
instr_iterator instr_end()
MachineBasicBlock * getMBB() const
const int Hexagon_ADDI_OFFSET_MAX
unsigned getFrameRegister(const MachineFunction &MF) const override
unsigned getRegState(const MachineOperand &RegOp)
Get all register state flags from machine operand RegOp.
const int Hexagon_MEMH_OFFSET_MIN
bool available(const MachineRegisterInfo &MRI, unsigned Reg) const
Returns true if register Reg and no aliasing register is in the set.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Compute iterated dominance frontiers using a linear time algorithm.
const InstrStage * beginStage(unsigned ItinClassIndx) const
Return the first stage of the itinerary.
static void parseOperands(const MachineInstr &MI, SmallVector< unsigned, 4 > &Defs, SmallVector< unsigned, 8 > &Uses)
Gather register def/uses from MI.
static cl::opt< bool > UseDFAHazardRec("dfa-hazard-rec", cl::init(true), cl::Hidden, cl::ZeroOrMore, cl::desc("Use the DFA based hazard recognizer."))
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
Store the specified register of the given register class to the specified stack frame index...
void setBundleNoShuf(MachineBasicBlock::instr_iterator MIB) const
short getEquivalentHWInstr(const MachineInstr &MI) const
DFAPacketizer * CreateTargetScheduleState(const TargetSubtargetInfo &STI) const override
Create machine specific model for scheduling.
bool isAbsoluteSet(const MachineInstr &MI) const
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
bool isJumpR(const MachineInstr &MI) const
iterator getFirstTerminator()
Returns an iterator to the first terminator instruction of this basic block.
bool SubsumesPredicate(ArrayRef< MachineOperand > Pred1, ArrayRef< MachineOperand > Pred2) const override
Returns true if the first specified predicate subsumes the second, e.g.
Describe properties that are true of each instruction in the target description file.
unsigned getUnits() const
Returns the choice of FUs.
bool isConstExtended(const MachineInstr &MI) const
unsigned getReg() const
getReg - Returns the register number.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
bool getInvertedPredSense(SmallVectorImpl< MachineOperand > &Cond) const
Address of indexed Jump Table for switch.
unsigned nonDbgBundleSize(MachineBasicBlock::const_iterator BundleHead) const
unsigned getSubReg() const
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
bool reverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const override
Reverses the branch condition of the specified condition list, returning false on success and true if...
int getMaxValue(const MachineInstr &MI) const
ArrayRef< std::pair< unsigned, const char * > > getSerializableBitmaskMachineOperandTargetFlags() const override
Return an array that contains the bitmask target flag values and their names.
const int Hexagon_ADDI_OFFSET_MIN
bool reversePredSense(MachineInstr &MI) const
bool hasStoreToStackSlot(const MachineInstr &MI, const MachineMemOperand *&MMO, int &FrameIndex) const override
Check if the instruction or the bundle of instructions has store to stack slots.
int getDotNewPredOp(const MachineInstr &MI, const MachineBranchProbabilityInfo *MBPI) const
bool isTransient() const
Return true if this is a transient instruction that is either very likely to be eliminated during reg...
MachineBasicBlock reference.
bool isExpr(unsigned OpType) const
bool isTailCall(const MachineInstr &MI) const override
unsigned const TargetRegisterInfo * TRI
unsigned reduceLoopCount(MachineBasicBlock &MBB, MachineInstr *IndVar, MachineInstr &Cmp, SmallVectorImpl< MachineOperand > &Cond, SmallVectorImpl< MachineInstr *> &PrevInsts, unsigned Iter, unsigned MaxIter) const override
Generate code to reduce the loop iteration by one and check if the loop is finished.
bool isCPI() const
isCPI - Tests if this is a MO_ConstantPoolIndex operand.
bool producesStall(const MachineInstr &ProdMI, const MachineInstr &ConsMI) const
MachineInstrBundleIterator< const MachineInstr > const_iterator
const HexagonFrameLowering * getFrameLowering() const override
unsigned getMemAccessSize(const MachineInstr &MI) const
const int Hexagon_MEMD_OFFSET_MAX
unsigned getSize(const MachineInstr &MI) const
int getDotCurOp(const MachineInstr &MI) const
bool mayLoad() const
Return true if this instruction could possibly read memory.
bool isLateResultInstr(const MachineInstr &MI) const
iterator_range< mop_iterator > operands()
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
bool is_TC1(unsigned SchedClass)
void immediateExtend(MachineInstr &MI) const
immediateExtend - Changes the instruction in place to one using an immediate extender.
unsigned getStackRegister() const
int getDotNewPredJumpOp(const MachineInstr &MI, const MachineBranchProbabilityInfo *MBPI) const
short changeAddrMode_ur_rr(short Opc) const
unsigned getSpillSize(const TargetRegisterClass &RC) const
Return the size in bytes of the stack slot allocated to hold a spilled copy of a register from class ...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
return AArch64::GPR64RegClass contains(Reg)
iterator_range< succ_iterator > successors()
bool isToBeScheduledASAP(const MachineInstr &MI1, const MachineInstr &MI2) const
void insertNoop(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override
Insert a noop into the instruction stream at the specified point.
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 isHVXVec(const MachineInstr &MI) const
static cl::opt< bool > BranchRelaxAsmLarge("branch-relax-asm-large", cl::init(true), cl::Hidden, cl::ZeroOrMore, cl::desc("branch relax asm"))
bool isComplex(const MachineInstr &MI) const
unsigned getSpillAlignment(const TargetRegisterClass &RC) const
Return the minimum required alignment in bytes for a spill slot for a register of this class...
static cl::opt< bool > DisableNVSchedule("disable-hexagon-nv-schedule", cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::desc("Disable schedule adjustment for new value stores."))
A description of a memory reference used in the backend.
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
Load the specified register of the given register class from the specified stack frame index...
unsigned getInvertedPredicatedOpcode(const int Opc) const
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
MCSuperRegIterator enumerates all super-registers of Reg.
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...
Printable printMBBReference(const MachineBasicBlock &MBB)
Prints a machine basic block reference.
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
unsigned getNumOperands() const
Access to explicit operands of the instruction.
Printable printReg(unsigned Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubIdx=0, const MachineRegisterInfo *MRI=nullptr)
Prints virtual and physical registers with or without a TRI instance.
LLVM_NODISCARD size_t count(char C) const
Return the number of occurrences of C in the string.
unsigned getCompoundOpcode(const MachineInstr &GA, const MachineInstr &GB) const
bool isPredicatedNew(const MachineInstr &MI) const
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
bool canExecuteInBundle(const MachineInstr &First, const MachineInstr &Second) const
Can these instructions execute at the same time in a bundle.
bool predOpcodeHasNot(ArrayRef< MachineOperand > Cond) const
const HexagonRegisterInfo * getRegisterInfo() const override
MachineBasicBlock * getBottomBlock()
Return the "bottom" block in the loop, which is the last block in the linear layout, ignoring any parts of the loop not contiguous with the part that contains the header.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
bool isVecUsableNextPacket(const MachineInstr &ProdMI, const MachineInstr &ConsMI) const
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
Name of external global symbol.
static StringRef getName(Value *V)
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
bool isDotNewInst(const MachineInstr &MI) const
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
bool isDeallocRet(const MachineInstr &MI) const
bool isExtended(const MachineInstr &MI) const
const char * getSymbolName() const
bool is_TC2(unsigned SchedClass)
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, uint64_t s, unsigned base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
INLINEASM - Represents an inline asm block.
bool isSolo(const MachineInstr &MI) const
bool isLateInstrFeedsEarlyInstr(const MachineInstr &LRMI, const MachineInstr &ESMI) const
bool expandPostRAPseudo(MachineInstr &MI) const override
This function is called for all pseudo instructions that remain after register allocation.
bool PredicateInstruction(MachineInstr &MI, ArrayRef< MachineOperand > Cond) const override
Convert the instruction into a predicated instruction.
bool predCanBeUsedAsDotNew(const MachineInstr &MI, unsigned PredReg) 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.
SmallVector< MachineInstr *, 2 > getBranchingInstrs(MachineBasicBlock &MBB) const
bool doesNotReturn(const MachineInstr &CallMI) const
unsigned getSizeInBits() const
Return the size of the specified value type in bits.
const MCInstrDesc & getDesc() const
Returns the target instruction descriptor of this MachineInstr.
bool isIndirectBranch(QueryType Type=AnyInBundle) const
Return true if this is an indirect branch, such as a branch through a register.
bool isEndLoopN(unsigned Opcode) const
unsigned getBaseAndOffset(const MachineInstr &MI, int &Offset, unsigned &AccessSize) const
bool isCompoundBranchInstr(const MachineInstr &MI) const
void clearKillFlags(unsigned Reg) const
clearKillFlags - Iterate over all the uses of the given register and clear the kill flag from the Mac...
MO_GOT - This flag indicates that a symbol operand represents the address of the GOT entry for the sy...
short changeAddrMode_io_rr(short Opc) const
bool isPredictedTaken(unsigned Opcode) const
instr_iterator getInstrIterator() const
int getMinValue(const MachineInstr &MI) const
bool getBundleNoShuf(const MachineInstr &MIB) const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
bool isFPImm() const
isFPImm - Tests if this is a MO_FPImmediate operand.
Itinerary data supplied by a subtarget to be used by a target.
short changeAddrMode_io_pi(short Opc) const
bool isTC1(const MachineInstr &MI) const
unsigned getUndefRegState(bool B)
unsigned getInstrLatency(const InstrItineraryData *ItinData, const MachineInstr &MI, unsigned *PredCost=nullptr) const override
Compute the instruction latency of a given instruction.
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
unsigned getStageLatency(unsigned ItinClassIndx) const
Return the total stage latency of the given class.
short changeAddrMode_rr_ur(short Opc) const
reverse_iterator rbegin()
bool isBranch(QueryType Type=AnyInBundle) const
Returns true if this is a conditional, unconditional, or indirect branch.
bool getPredReg(ArrayRef< MachineOperand > Cond, unsigned &PredReg, unsigned &PredRegPos, unsigned &PredRegFlags) const
BasicBlockListType::iterator iterator
unsigned getKillRegState(bool B)
virtual const InstrItineraryData * getInstrItineraryData() const
getInstrItineraryData - Returns instruction itinerary data for the target or specific subtarget...
unsigned getCExtOpNum(const MachineInstr &MI) const
const int Hexagon_MEMD_OFFSET_MIN
bool isReturn(QueryType Type=AnyInBundle) const
bool is_TC3x(unsigned SchedClass)
This class is intended to be used as a base class for asm properties and features specific to the tar...
static cl::opt< bool > EnableBranchPrediction("hexagon-enable-branch-prediction", cl::Hidden, cl::init(true), cl::desc("Enable branch prediction"))
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...
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
unsigned getSchedClass() const
Return the scheduling class for this instruction.
unsigned getObjectAlignment(int ObjectIdx) const
Return the alignment of the specified stack object.
bool mayStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly modify memory.
Address of a global value.
initializer< Ty > init(const Ty &Val)
const int Hexagon_MEMW_OFFSET_MAX
Constants for Hexagon instructions.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
unsigned const MachineRegisterInfo * MRI
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
static cl::opt< bool > EnableALUForwarding("enable-alu-forwarding", cl::Hidden, cl::init(true), cl::desc("Enable vec alu forwarding"))
HazardRecognizer - This determines whether or not an instruction can be issued this cycle...
bool getIncrementValue(const MachineInstr &MI, int &Value) const override
If the instruction is an increment of a constant value, return the amount.
bool isCompare(QueryType Type=IgnoreBundle) const
Return true if this instruction is a comparison.
bool analyzeCompare(const MachineInstr &MI, unsigned &SrcReg, unsigned &SrcReg2, int &Mask, int &Value) const override
For a comparison instruction, return the source registers in SrcReg and SrcReg2 if having two registe...
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
bool validateBranchCond(const ArrayRef< MachineOperand > &Cond) const
MachineInstrBuilder & UseMI
size_t size() const
size - Get the array size.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const char * getSeparatorString() const
bool isPredicable(const MachineInstr &MI) const override
Return true if the specified instruction can be predicated.
void addLiveOuts(const MachineBasicBlock &MBB)
Adds all live-out registers of basic block MBB.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
DebugLoc findDebugLoc(instr_iterator MBBI)
Find the next valid DebugLoc starting at MBBI, skipping any DBG_VALUE and DBG_LABEL instructions...
bool isAccumulator(const MachineInstr &MI) 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 isZeroExtendingLoad(const MachineInstr &MI) const
short changeAddrMode_io_abs(short Opc) const
bool hasUncondBranch(const MachineBasicBlock *B) const
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
short changeAddrMode_abs_io(short Opc) const
unsigned getAddrMode(const MachineInstr &MI) const
int getNonDotCurOp(const MachineInstr &MI) const
bool invertAndChangeJumpTarget(MachineInstr &MI, MachineBasicBlock *NewTarget) const
void setMBB(MachineBasicBlock *MBB)
bool isTC2Early(const MachineInstr &MI) const
void stepBackward(const MachineInstr &MI)
Simulates liveness when stepping backwards over an instruction(bundle).
Address of a basic block.
static bool isDblRegForSubInst(unsigned Reg, const HexagonRegisterInfo &HRI)
bool isValidAutoIncImm(const EVT VT, const int Offset) const
StringRef getCommentString() const
bool isFloat(const MachineInstr &MI) const
void setImm(int64_t immVal)
self_iterator getIterator()
bool isPredicable() const
Return true if this instruction has a predicate operand that controls execution.
iterator_range< pred_iterator > predecessors()
HexagonII::SubInstructionGroup getDuplexCandidateGroup(const MachineInstr &MI) const
void genAllInsnTimingClasses(MachineFunction &MF) const
const MachineInstrBuilder & addFrameIndex(int Idx) const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
short getPseudoInstrPair(const MachineInstr &MI) const
MCSubRegIterator enumerates all sub-registers of Reg.
This file implements the LivePhysRegs utility for tracking liveness of physical registers.
bool isEarlySourceInstr(const MachineInstr &MI) const
bool isPostIncrement(const MachineInstr &MI) const override
Return true for post-incremented instructions.
bool isDebugInstr() const
bool isExtendable(const MachineInstr &MI) const
unsigned getStackAlignment() const
getStackAlignment - This method returns the number of bytes to which the stack pointer must be aligne...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
MO_LO16 - On a symbol operand, this represents a relocation containing lower 16 bit of the address...
unsigned getNumExplicitOperands() const
Returns the number of non-implicit operands.
static cl::opt< bool > EnableACCForwarding("enable-acc-forwarding", cl::Hidden, cl::init(true), cl::desc("Enable vec acc forwarding"))
bool isPredicated(const MachineInstr &MI) const override
Returns true if the instruction is already predicated.
void setIsKill(bool Val=true)
bool hasPseudoInstrPair(const MachineInstr &MI) const
The memory access writes data.
bool isIndirectCall(const MachineInstr &MI) const
bool isTC4x(const MachineInstr &MI) const
bool isDotCurInst(const MachineInstr &MI) const
static bool isUndef(ArrayRef< int > Mask)
static bool isIntRegForSubInst(unsigned Reg)
bool isConditionalBranch(QueryType Type=AnyInBundle) const
Return true if this is a branch which may fall through to the next instruction or may transfer contro...
Iterator for intrusive lists based on ilist_node.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
bool isJTI() const
isJTI - Tests if this is a MO_JumpTableIndex operand.
void setDesc(const MCInstrDesc &tid)
Replace the instruction descriptor (thus opcode) of the current instruction with a new one...
bool isNewValueStore(const MachineInstr &MI) const
HexagonInstrInfo(HexagonSubtarget &ST)
void addOperand(MachineFunction &MF, const MachineOperand &Op)
Add the specified operand to the instruction.
virtual bool hasLoadFromStackSlot(const MachineInstr &MI, const MachineMemOperand *&MMO, int &FrameIndex) const
If the specified machine instruction has a load from a stack slot, return true along with the FrameIn...
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
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...
mmo_iterator memoperands_begin() const
Access to memory operands of the instruction.
bool usePredicatedCalls() const
bool isNewValueInst(const MachineInstr &MI) const
MachineOperand class - Representation of each machine instruction operand.
bool isVecAcc(const MachineInstr &MI) const
MachineInstrBuilder MachineInstrBuilder & DefMI
bool hasEHLabel(const MachineBasicBlock *B) const
bool isJumpWithinBranchRange(const MachineInstr &MI, unsigned offset) const
const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const
unsigned getUnits(const MachineInstr &MI) const
short getRegForm(const MachineInstr &MI) const
unsigned 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...
static void getLiveRegsAt(LivePhysRegs &Regs, const MachineInstr &MI)
MO_PCREL - On a symbol operand, indicates a PC-relative relocation Used for computing a global addres...
uint64_t getType(const MachineInstr &MI) const
bool hasOrderedMemoryRef() const
Return true if this instruction may have an ordered or volatile memory reference, or if the informati...
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.
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 isSignExtendingLoad(const MachineInstr &MI) const
unsigned getNumDefs() const
Return the number of MachineOperands that are register definitions.
bool isOperandExtended(const MachineInstr &MI, unsigned OperandNum) const
unsigned getInlineAsmLength(const char *Str, const MCAsmInfo &MAI) const override
Measure the specified inline asm to determine an approximation of its length.
bool isLayoutSuccessor(const MachineBasicBlock *MBB) const
Return true if the specified MBB will be emitted immediately after this block, such that if this bloc...
bool isDuplexPair(const MachineInstr &MIa, const MachineInstr &MIb) const
Symmetrical. See if these two instructions are fit for duplex pair.
bool isBlockAddress() const
isBlockAddress - Tests if this is a MO_BlockAddress operand.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
bool isLateSourceInstr(const MachineInstr &MI) const
bool isSpillPredRegOp(const MachineInstr &MI) const
unsigned getMaxInstLength() const
static bool isDuplexPairMatch(unsigned Ga, unsigned Gb)
unsigned const TypeCVI_FIRST
unsigned createVR(MachineFunction *MF, MVT VT) const
HexagonInstrInfo specifics.
bool isSchedulingBoundary(const MachineInstr &MI, const MachineBasicBlock *MBB, const MachineFunction &MF) const override
Test if the given instruction should be considered a scheduling boundary.
unsigned reversePrediction(unsigned Opcode) const
virtual bool hasStoreToStackSlot(const MachineInstr &MI, const MachineMemOperand *&MMO, int &FrameIndex) const
If the specified machine instruction has a store to a stack slot, return true along with the FrameInd...
bool isValid() const
isValid - returns true if this iterator is not yet at the end.
bool isNewValue(const MachineInstr &MI) const
int findRegisterDefOperandIdx(unsigned Reg, bool isDead=false, bool Overlap=false, const TargetRegisterInfo *TRI=nullptr) const
Returns the operand index that is a def of the specified register or -1 if it is not found...
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
bool isSaveCalleeSavedRegsCall(const MachineInstr &MI) const
bool readsRegister(unsigned Reg, const TargetRegisterInfo *TRI=nullptr) const
Return true if the MachineInstr reads the specified register.
static LLVM_ATTRIBUTE_UNUSED unsigned getMemAccessSizeInBytes(MemAccessSize S)
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
Remove the branching code at the end of the specific MBB.
bool mayStore() const
Return true if this instruction could possibly modify memory.
unsigned const TypeCVI_LAST
unsigned isLoadFromStackSlot(const MachineInstr &MI, int &FrameIndex) const override
TargetInstrInfo overrides.
unsigned succ_size() const
int getDotNewOp(const MachineInstr &MI) const
const MachineBasicBlock * getParent() const
int getCondOpcode(int Opc, bool sense) const
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const override
Emit instructions to copy a pair of physical registers.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
The memory access reads data.
TargetSubtargetInfo - Generic base class for all target subtargets.
static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
BranchProbability getEdgeProbability(const MachineBasicBlock *Src, const MachineBasicBlock *Dst) const
bool isPredicateLate(unsigned Opcode) const
Representation of each machine instruction.
bool addLatencyToSchedule(const MachineInstr &MI1, const MachineInstr &MI2) const
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
bool isDependent(const MachineInstr &ProdMI, const MachineInstr &ConsMI) const
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
void addTargetFlag(unsigned F)
static unsigned nonDbgMICount(MachineBasicBlock::const_instr_iterator MIB, MachineBasicBlock::const_instr_iterator MIE)
Calculate number of instructions excluding the debug instructions.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const int Hexagon_MEMB_OFFSET_MAX
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
A set of physical registers with utility functions to track liveness when walking backward/forward th...
LLVM_NODISCARD bool empty() const
bool hasLoadFromStackSlot(const MachineInstr &MI, const MachineMemOperand *&MMO, int &FrameIndex) const override
Check if the instruction or the bundle of instructions has load from stack slots. ...
These values represent a non-pipelined step in the execution of an instruction.
Represents a single loop in the control flow graph.
int getDotOldOp(const MachineInstr &MI) const
static bool isSigned(Value *V)
Can the given value generate sign bits.
int64_t getOffset() const
Return the offset from the symbol in this operand.
bool isValidOffset(unsigned Opcode, int Offset, const TargetRegisterInfo *TRI, bool Extend=true) const
static MachineOperand CreateImm(int64_t Val)
bool mayBeNewStore(const MachineInstr &MI) const
bool isFI() const
isFI - Tests if this is a MO_FrameIndex operand.
bool isPredicatedTrue(const MachineInstr &MI) const
const int Hexagon_MEMW_OFFSET_MIN
bool isNewValueJump(const MachineInstr &MI) const
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
bool hasNonExtEquivalent(const MachineInstr &MI) const
unsigned getInstrTimingClassLatency(const InstrItineraryData *ItinData, const MachineInstr &MI) const
int 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 isSymbol() const
isSymbol - Tests if this is a MO_ExternalSymbol operand.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
const std::string to_string(const T &Value)
bool isTC2(const MachineInstr &MI) const
bool mayLoad(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly read memory.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool isBranch(unsigned Opcode)
bool is_TC4x(unsigned SchedClass)
#define HEXAGON_INSTR_SIZE
bool isLoopN(const MachineInstr &MI) const
bool isHVXMemWithAIndirect(const MachineInstr &I, const MachineInstr &J) const
bool isTerminator() const
Returns true if this instruction part of the terminator for a basic block.
LLVM Value Representation.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
bool PredOpcodeHasJMP_c(unsigned Opcode) const
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
bool mayBeCurLoad(const MachineInstr &MI) const
bool isAddrModeWithOffset(const MachineInstr &MI) const
unsigned getOpcode() const
Return the opcode number for this descriptor.
static cl::opt< bool > EnableTimingClassLatency("enable-timing-class-latency", cl::Hidden, cl::init(false), cl::desc("Enable timing class latency"))
short changeAddrMode_pi_io(short Opc) const
bool hasUnmodeledSideEffects() const
Return true if this instruction has side effects that are not modeled by mayLoad / mayStore...
StringRef - Represent a constant reference to a string, i.e.
bool isMBB() const
isMBB - Tests if this is a MO_MachineBasicBlock operand.
void RemoveOperand(unsigned OpNo)
Erase an operand from an instruction, leaving it with one fewer operand than it started with...
Address of indexed Constant in Constant Pool.
bool isMemOp(const MachineInstr &MI) const
MachineBasicBlock::instr_iterator getBundleEnd(MachineBasicBlock::instr_iterator I)
Returns an iterator pointing beyond the bundle containing I.
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned char TargetFlags=0) const
const MachineInstrBuilder & setMemRefs(MachineInstr::mmo_iterator b, MachineInstr::mmo_iterator e) const
bool getMemOpBaseRegImmOfs(MachineInstr &LdSt, unsigned &BaseReg, int64_t &Offset, const TargetRegisterInfo *TRI) const override
Get the base register and byte offset of a load/store instr.
const MachineOperand & getOperand(unsigned i) const
bool isBaseImmOffset(const MachineInstr &MI) const
bool analyzeLoop(MachineLoop &L, MachineInstr *&IndVarInst, MachineInstr *&CmpInst) const override
Analyze the loop code, return true if it cannot be understood.
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...
int findRegisterUseOperandIdx(unsigned Reg, bool isKill=false, const TargetRegisterInfo *TRI=nullptr) const
Returns the operand index that is a use of the specific register or -1 if it is not found...
virtual int getOperandLatency(const InstrItineraryData *ItinData, SDNode *DefNode, unsigned DefIdx, SDNode *UseNode, unsigned UseIdx) const
bool isIndirectL4Return(const MachineInstr &MI) const
bool areMemAccessesTriviallyDisjoint(MachineInstr &MIa, MachineInstr &MIb, AliasAnalysis *AA=nullptr) const override
unsigned createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
MO_HI16 - On a symbol operand, this represents a relocation containing higher 16 bit of the address...
bool empty() const
empty - Check if the array is empty.
const int Hexagon_MEMB_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."))
unsigned getSize() const
Return the number of bytes in the encoding of this instruction, or zero if the encoding size cannot b...
mmo_iterator memoperands_end() const
HexagonII::CompoundGroup getCompoundCandidateGroup(const MachineInstr &MI) const