56 #define DEBUG_TYPE "hexagon-instrinfo"
58 #define GET_INSTRINFO_CTOR_DTOR
59 #define GET_INSTRMAP_INFO
61 #include "HexagonGenDFAPacketizer.inc"
62 #include "HexagonGenInstrInfo.inc"
66 "packetization boundary."));
73 cl::desc(
"Disable schedule adjustment for new value stores."));
77 cl::desc(
"Enable timing class latency"));
81 cl::desc(
"Enable vec alu forwarding"));
85 cl::desc(
"Enable vec acc forwarding"));
92 cl::desc(
"Use the DFA based hazard recognizer."));
121 void HexagonInstrInfo::anchor() {}
128 return (Reg >= Hexagon::R0 && Reg <= Hexagon::R7) ||
129 (Reg >= Hexagon::R16 && Reg <= Hexagon::R23);
141 for (; MIB != MIE; ++MIB) {
142 if (!MIB->isDebugValue())
157 if (EndLoopOp == Hexagon::ENDLOOP0) {
158 LOOPi = Hexagon::J2_loop0i;
159 LOOPr = Hexagon::J2_loop0r;
161 LOOPi = Hexagon::J2_loop1i;
162 LOOPr = Hexagon::J2_loop1r;
168 if (!Visited.
insert(PB).second)
172 for (
auto I = PB->instr_rbegin(),
E = PB->instr_rend();
I !=
E; ++
I) {
173 unsigned Opc =
I->getOpcode();
174 if (Opc == LOOPi || Opc == LOOPr)
178 if (Opc == EndLoopOp &&
I->getOperand(0).getMBB() != TargetBB)
250 case Hexagon::L2_loadri_io:
251 case Hexagon::L2_loadrd_io:
252 case Hexagon::V6_vL32b_ai:
253 case Hexagon::V6_vL32b_nt_ai:
254 case Hexagon::V6_vL32b_ai_128B:
255 case Hexagon::V6_vL32b_nt_ai_128B:
256 case Hexagon::V6_vL32Ub_ai:
257 case Hexagon::V6_vL32Ub_ai_128B:
258 case Hexagon::LDriw_pred:
259 case Hexagon::LDriw_mod:
260 case Hexagon::PS_vloadrq_ai:
261 case Hexagon::PS_vloadrw_ai:
262 case Hexagon::PS_vloadrw_nt_ai:
263 case Hexagon::PS_vloadrq_ai_128B:
264 case Hexagon::PS_vloadrw_ai_128B:
265 case Hexagon::PS_vloadrw_nt_ai_128B: {
276 case Hexagon::L2_ploadrit_io:
277 case Hexagon::L2_ploadrif_io:
278 case Hexagon::L2_ploadrdt_io:
279 case Hexagon::L2_ploadrdf_io: {
304 case Hexagon::S2_storerb_io:
305 case Hexagon::S2_storerh_io:
306 case Hexagon::S2_storeri_io:
307 case Hexagon::S2_storerd_io:
308 case Hexagon::V6_vS32b_ai:
309 case Hexagon::V6_vS32b_ai_128B:
310 case Hexagon::V6_vS32Ub_ai:
311 case Hexagon::V6_vS32Ub_ai_128B:
312 case Hexagon::STriw_pred:
313 case Hexagon::STriw_mod:
314 case Hexagon::PS_vstorerq_ai:
315 case Hexagon::PS_vstorerw_ai:
316 case Hexagon::PS_vstorerq_ai_128B:
317 case Hexagon::PS_vstorerw_ai_128B: {
328 case Hexagon::S2_pstorerbt_io:
329 case Hexagon::S2_pstorerbf_io:
330 case Hexagon::S2_pstorerht_io:
331 case Hexagon::S2_pstorerhf_io:
332 case Hexagon::S2_pstorerit_io:
333 case Hexagon::S2_pstorerif_io:
334 case Hexagon::S2_pstorerdt_io:
335 case Hexagon::S2_pstorerdf_io: {
370 bool AllowModify)
const {
402 while (I->isDebugValue()) {
408 bool JumpToBlock = I->getOpcode() == Hexagon::J2_jump &&
409 I->getOperand(0).isMBB();
411 if (AllowModify && JumpToBlock &&
413 DEBUG(
dbgs() <<
"\nErasing the jump to successor block\n";);
414 I->eraseFromParent();
420 if (!isUnpredicatedTerminator(*I))
428 if (&*I != LastInst && !I->
isBundle() && isUnpredicatedTerminator(*I)) {
430 SecondLastInst = &*
I;
441 int SecLastOpcode = SecondLastInst ? SecondLastInst->
getOpcode() : 0;
444 if (LastOpcode == Hexagon::J2_jump && !LastInst->
getOperand(0).
isMBB())
446 if (SecLastOpcode == Hexagon::J2_jump &&
457 if (LastInst && !SecondLastInst) {
458 if (LastOpcode == Hexagon::J2_jump) {
468 if (LastOpcodeHasJMP_c) {
483 <<
" with one jump\n";);
490 if (SecLastOpcodeHasJMP_c && (LastOpcode == Hexagon::J2_jump)) {
501 if (SecLastOpcodeHasNVJump &&
503 (LastOpcode == Hexagon::J2_jump)) {
514 if (SecLastOpcode == Hexagon::J2_jump && LastOpcode == Hexagon::J2_jump) {
518 I->eraseFromParent();
523 if (
isEndLoopN(SecLastOpcode) && LastOpcode == Hexagon::J2_jump) {
531 <<
" with two jumps";);
537 int *BytesRemoved)
const {
538 assert(!BytesRemoved &&
"code size not handled");
543 while (I != MBB.
begin()) {
545 if (I->isDebugValue())
550 if (Count && (I->getOpcode() == Hexagon::J2_jump))
564 int *BytesAdded)
const {
565 unsigned BOpc = Hexagon::J2_jump;
566 unsigned BccOpc = Hexagon::J2_jumpt;
568 assert(TBB &&
"insertBranch must not be told to insert a fallthrough");
569 assert(!BytesAdded &&
"code size not handled");
574 if (!Cond.
empty() && Cond[0].isImm())
575 BccOpc = Cond[0].getImm();
595 int EndLoopOp = Cond[0].getImm();
602 assert(Loop != 0 &&
"Inserting an ENDLOOP without a LOOP");
607 assert((Cond.
size() == 3) &&
"Only supporting rr/ri version of nvjump");
613 if (Cond[2].
isReg()) {
617 }
else if(Cond[2].isImm()) {
619 addImm(Cond[2].getImm()).
addMBB(TBB);
623 assert((Cond.
size() == 2) &&
"Malformed cond vector");
631 "Cond. cannot be empty when multiple branchings are required");
633 "NV-jump cannot be inserted with another branch");
636 int EndLoopOp = Cond[0].getImm();
643 assert(Loop != 0 &&
"Inserting an ENDLOOP without a LOOP");
670 IndVarInst =
nullptr;
684 unsigned Iter,
unsigned MaxIter)
const {
688 &&
"Expecting a hardware loop");
698 if (Loop->
getOpcode() == Hexagon::J2_loop0i ||
699 Loop->
getOpcode() == Hexagon::J2_loop1i) {
709 assert(Loop->
getOpcode() == Hexagon::J2_loop0r &&
"Unexpected instruction");
714 addReg(LoopCount).
addImm(1);
717 addReg(LoopCount).
addImm(-1);
720 E = PrevInsts.
end();
I !=
E; ++
I)
728 BuildMI(&MBB, DL,
get(Hexagon::J2_loop0r)).
739 unsigned NumCycles,
unsigned ExtraPredCycles,
753 return NumInstrs <= 4;
759 unsigned SrcReg,
bool KillSrc)
const {
763 if (Hexagon::IntRegsRegClass.
contains(SrcReg, DestReg)) {
764 BuildMI(MBB, I, DL,
get(Hexagon::A2_tfr), DestReg)
765 .
addReg(SrcReg, KillFlag);
768 if (Hexagon::DoubleRegsRegClass.
contains(SrcReg, DestReg)) {
769 BuildMI(MBB, I, DL,
get(Hexagon::A2_tfrp), DestReg)
770 .
addReg(SrcReg, KillFlag);
773 if (Hexagon::PredRegsRegClass.
contains(SrcReg, DestReg)) {
775 BuildMI(MBB, I, DL,
get(Hexagon::C2_or), DestReg)
779 if (Hexagon::CtrRegsRegClass.
contains(DestReg) &&
780 Hexagon::IntRegsRegClass.
contains(SrcReg)) {
781 BuildMI(MBB, I, DL,
get(Hexagon::A2_tfrrcr), DestReg)
782 .
addReg(SrcReg, KillFlag);
785 if (Hexagon::IntRegsRegClass.
contains(DestReg) &&
786 Hexagon::CtrRegsRegClass.
contains(SrcReg)) {
787 BuildMI(MBB, I, DL,
get(Hexagon::A2_tfrcrr), DestReg)
788 .
addReg(SrcReg, KillFlag);
791 if (Hexagon::ModRegsRegClass.
contains(DestReg) &&
792 Hexagon::IntRegsRegClass.
contains(SrcReg)) {
793 BuildMI(MBB, I, DL,
get(Hexagon::A2_tfrrcr), DestReg)
794 .
addReg(SrcReg, KillFlag);
797 if (Hexagon::PredRegsRegClass.
contains(SrcReg) &&
798 Hexagon::IntRegsRegClass.
contains(DestReg)) {
799 BuildMI(MBB, I, DL,
get(Hexagon::C2_tfrpr), DestReg)
800 .
addReg(SrcReg, KillFlag);
803 if (Hexagon::IntRegsRegClass.
contains(SrcReg) &&
804 Hexagon::PredRegsRegClass.
contains(DestReg)) {
805 BuildMI(MBB, I, DL,
get(Hexagon::C2_tfrrp), DestReg)
806 .
addReg(SrcReg, KillFlag);
809 if (Hexagon::PredRegsRegClass.
contains(SrcReg) &&
810 Hexagon::IntRegsRegClass.
contains(DestReg)) {
811 BuildMI(MBB, I, DL,
get(Hexagon::C2_tfrpr), DestReg)
812 .
addReg(SrcReg, KillFlag);
815 if (Hexagon::VectorRegsRegClass.
contains(SrcReg, DestReg)) {
816 BuildMI(MBB, I, DL,
get(Hexagon::V6_vassign), DestReg).
817 addReg(SrcReg, KillFlag);
820 if (Hexagon::VecDblRegsRegClass.
contains(SrcReg, DestReg)) {
821 unsigned LoSrc = HRI.getSubReg(SrcReg, Hexagon::vsub_lo);
822 unsigned HiSrc = HRI.getSubReg(SrcReg, Hexagon::vsub_hi);
823 BuildMI(MBB, I, DL,
get(Hexagon::V6_vcombine), DestReg)
828 if (Hexagon::VecPredRegsRegClass.
contains(SrcReg, DestReg)) {
829 BuildMI(MBB, I, DL,
get(Hexagon::V6_pred_and), DestReg)
831 .
addReg(SrcReg, KillFlag);
834 if (Hexagon::VecPredRegsRegClass.
contains(SrcReg) &&
835 Hexagon::VectorRegsRegClass.
contains(DestReg)) {
839 if (Hexagon::VecPredRegsRegClass.
contains(DestReg) &&
840 Hexagon::VectorRegsRegClass.
contains(SrcReg)) {
844 if (Hexagon::VecPredRegs128BRegClass.
contains(SrcReg, DestReg)) {
845 unsigned HiDst = HRI.getSubReg(DestReg, Hexagon::vsub_hi);
846 unsigned LoDst = HRI.getSubReg(DestReg, Hexagon::vsub_lo);
847 unsigned HiSrc = HRI.getSubReg(SrcReg, Hexagon::vsub_hi);
848 unsigned LoSrc = HRI.getSubReg(SrcReg, Hexagon::vsub_lo);
849 BuildMI(MBB, I, DL,
get(Hexagon::V6_pred_and), HiDst)
851 BuildMI(MBB, I, DL,
get(Hexagon::V6_pred_and), LoDst)
858 dbgs() <<
"Invalid registers for copy in BB#" << MBB.
getNumber()
860 <<
" = " <<
PrintReg(SrcReg, &HRI) <<
'\n';
881 if (Hexagon::IntRegsRegClass.hasSubClassEq(RC)) {
882 BuildMI(MBB, I, DL,
get(Hexagon::S2_storeri_io))
885 }
else if (Hexagon::DoubleRegsRegClass.hasSubClassEq(RC)) {
886 BuildMI(MBB, I, DL,
get(Hexagon::S2_storerd_io))
889 }
else if (Hexagon::PredRegsRegClass.hasSubClassEq(RC)) {
890 BuildMI(MBB, I, DL,
get(Hexagon::STriw_pred))
893 }
else if (Hexagon::ModRegsRegClass.hasSubClassEq(RC)) {
894 BuildMI(MBB, I, DL,
get(Hexagon::STriw_mod))
897 }
else if (Hexagon::VecPredRegs128BRegClass.hasSubClassEq(RC)) {
898 BuildMI(MBB, I, DL,
get(Hexagon::PS_vstorerq_ai_128B))
901 }
else if (Hexagon::VecPredRegsRegClass.hasSubClassEq(RC)) {
902 BuildMI(MBB, I, DL,
get(Hexagon::PS_vstorerq_ai))
905 }
else if (Hexagon::VectorRegs128BRegClass.hasSubClassEq(RC)) {
908 Align = HFI.getStackAlignment();
909 unsigned Opc = Align < 128 ? Hexagon::V6_vS32Ub_ai_128B
910 : Hexagon::V6_vS32b_ai_128B;
914 }
else if (Hexagon::VectorRegsRegClass.hasSubClassEq(RC)) {
917 Align = HFI.getStackAlignment();
918 unsigned Opc = Align < 64 ? Hexagon::V6_vS32Ub_ai
919 : Hexagon::V6_vS32b_ai;
923 }
else if (Hexagon::VecDblRegsRegClass.hasSubClassEq(RC)) {
926 Align = HFI.getStackAlignment();
927 unsigned Opc = Align < 64 ? Hexagon::PS_vstorerwu_ai
928 : Hexagon::PS_vstorerw_ai;
932 }
else if (Hexagon::VecDblRegs128BRegClass.hasSubClassEq(RC)) {
935 Align = HFI.getStackAlignment();
936 unsigned Opc = Align < 128 ? Hexagon::PS_vstorerwu_ai_128B
937 : Hexagon::PS_vstorerw_ai_128B;
962 if (Hexagon::IntRegsRegClass.hasSubClassEq(RC)) {
963 BuildMI(MBB, I, DL,
get(Hexagon::L2_loadri_io), DestReg)
965 }
else if (Hexagon::DoubleRegsRegClass.hasSubClassEq(RC)) {
966 BuildMI(MBB, I, DL,
get(Hexagon::L2_loadrd_io), DestReg)
968 }
else if (Hexagon::PredRegsRegClass.hasSubClassEq(RC)) {
969 BuildMI(MBB, I, DL,
get(Hexagon::LDriw_pred), DestReg)
971 }
else if (Hexagon::ModRegsRegClass.hasSubClassEq(RC)) {
972 BuildMI(MBB, I, DL,
get(Hexagon::LDriw_mod), DestReg)
974 }
else if (Hexagon::VecPredRegs128BRegClass.hasSubClassEq(RC)) {
975 BuildMI(MBB, I, DL,
get(Hexagon::PS_vloadrq_ai_128B), DestReg)
977 }
else if (Hexagon::VecPredRegsRegClass.hasSubClassEq(RC)) {
978 BuildMI(MBB, I, DL,
get(Hexagon::PS_vloadrq_ai), DestReg)
980 }
else if (Hexagon::VecDblRegs128BRegClass.hasSubClassEq(RC)) {
983 Align = HFI.getStackAlignment();
984 unsigned Opc = Align < 128 ? Hexagon::PS_vloadrwu_ai_128B
985 : Hexagon::PS_vloadrw_ai_128B;
986 BuildMI(MBB, I, DL,
get(Opc), DestReg)
988 }
else if (Hexagon::VectorRegs128BRegClass.hasSubClassEq(RC)) {
991 Align = HFI.getStackAlignment();
992 unsigned Opc = Align < 128 ? Hexagon::V6_vL32Ub_ai_128B
993 : Hexagon::V6_vL32b_ai_128B;
994 BuildMI(MBB, I, DL,
get(Opc), DestReg)
996 }
else if (Hexagon::VectorRegsRegClass.hasSubClassEq(RC)) {
999 Align = HFI.getStackAlignment();
1000 unsigned Opc = Align < 64 ? Hexagon::V6_vL32Ub_ai
1001 : Hexagon::V6_vL32b_ai;
1002 BuildMI(MBB, I, DL,
get(Opc), DestReg)
1004 }
else if (Hexagon::VecDblRegsRegClass.hasSubClassEq(RC)) {
1007 Align = HFI.getStackAlignment();
1008 unsigned Opc = Align < 64 ? Hexagon::PS_vloadrwu_ai
1009 : Hexagon::PS_vloadrw_ai;
1010 BuildMI(MBB, I, DL,
get(Opc), DestReg)
1037 const unsigned VecOffset = 1;
1040 case TargetOpcode::COPY: {
1046 std::prev(MBBI)->copyImplicitOps(*MBB.
getParent(),
MI);
1051 case Hexagon::PS_aligna:
1057 case Hexagon::V6_vassignp_128B:
1058 case Hexagon::V6_vassignp: {
1062 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vcombine), DstReg)
1063 .
addReg(HRI.getSubReg(SrcReg, Hexagon::vsub_hi),
Kill)
1064 .addReg(HRI.getSubReg(SrcReg, Hexagon::vsub_lo),
Kill);
1068 case Hexagon::V6_lo_128B:
1069 case Hexagon::V6_lo: {
1072 unsigned SrcSubLo = HRI.getSubReg(SrcReg, Hexagon::vsub_lo);
1078 case Hexagon::V6_hi_128B:
1079 case Hexagon::V6_hi: {
1082 unsigned SrcSubHi = HRI.getSubReg(SrcReg, Hexagon::vsub_hi);
1088 case Hexagon::PS_vstorerw_ai:
1089 case Hexagon::PS_vstorerwu_ai:
1090 case Hexagon::PS_vstorerw_ai_128B:
1091 case Hexagon::PS_vstorerwu_ai_128B: {
1092 bool Is128B = (Opc == Hexagon::PS_vstorerw_ai_128B ||
1093 Opc == Hexagon::PS_vstorerwu_ai_128B);
1094 bool Aligned = (Opc == Hexagon::PS_vstorerw_ai ||
1095 Opc == Hexagon::PS_vstorerw_ai_128B);
1097 unsigned SrcSubHi = HRI.getSubReg(SrcReg, Hexagon::vsub_hi);
1098 unsigned SrcSubLo = HRI.getSubReg(SrcReg, Hexagon::vsub_lo);
1101 NewOpc = Is128B ? Hexagon::V6_vS32b_ai_128B
1102 : Hexagon::V6_vS32b_ai;
1104 NewOpc = Is128B ? Hexagon::V6_vS32Ub_ai_128B
1105 : Hexagon::V6_vS32Ub_ai;
1107 unsigned Offset = Is128B ? VecOffset << 7 : VecOffset << 6;
1109 BuildMI(MBB, MI, DL,
get(NewOpc))
1115 BuildMI(MBB, MI, DL,
get(NewOpc))
1124 case Hexagon::PS_vloadrw_ai:
1125 case Hexagon::PS_vloadrwu_ai:
1126 case Hexagon::PS_vloadrw_ai_128B:
1127 case Hexagon::PS_vloadrwu_ai_128B: {
1128 bool Is128B = (Opc == Hexagon::PS_vloadrw_ai_128B ||
1129 Opc == Hexagon::PS_vloadrwu_ai_128B);
1130 bool Aligned = (Opc == Hexagon::PS_vloadrw_ai ||
1131 Opc == Hexagon::PS_vloadrw_ai_128B);
1134 NewOpc = Is128B ? Hexagon::V6_vL32b_ai_128B
1135 : Hexagon::V6_vL32b_ai;
1137 NewOpc = Is128B ? Hexagon::V6_vL32Ub_ai_128B
1138 : Hexagon::V6_vL32Ub_ai;
1141 unsigned Offset = Is128B ? VecOffset << 7 : VecOffset << 6;
1143 HRI.getSubReg(DstReg, Hexagon::vsub_lo))
1148 BuildMI(MBB, MI, DL,
get(NewOpc), HRI.getSubReg(DstReg, Hexagon::vsub_hi))
1156 case Hexagon::PS_true: {
1158 BuildMI(MBB, MI, DL,
get(Hexagon::C2_orn), Reg)
1164 case Hexagon::PS_false: {
1166 BuildMI(MBB, MI, DL,
get(Hexagon::C2_andn), Reg)
1172 case Hexagon::PS_vmulw: {
1177 unsigned Src1SubHi = HRI.getSubReg(Src1Reg, Hexagon::isub_hi);
1178 unsigned Src1SubLo = HRI.getSubReg(Src1Reg, Hexagon::isub_lo);
1179 unsigned Src2SubHi = HRI.getSubReg(Src2Reg, Hexagon::isub_hi);
1180 unsigned Src2SubLo = HRI.getSubReg(Src2Reg, Hexagon::isub_lo);
1182 HRI.getSubReg(DstReg, Hexagon::isub_hi))
1186 HRI.getSubReg(DstReg, Hexagon::isub_lo))
1196 case Hexagon::PS_vmulw_acc: {
1202 unsigned Src1SubHi = HRI.getSubReg(Src1Reg, Hexagon::isub_hi);
1203 unsigned Src1SubLo = HRI.getSubReg(Src1Reg, Hexagon::isub_lo);
1204 unsigned Src2SubHi = HRI.getSubReg(Src2Reg, Hexagon::isub_hi);
1205 unsigned Src2SubLo = HRI.getSubReg(Src2Reg, Hexagon::isub_lo);
1206 unsigned Src3SubHi = HRI.getSubReg(Src3Reg, Hexagon::isub_hi);
1207 unsigned Src3SubLo = HRI.getSubReg(Src3Reg, Hexagon::isub_lo);
1209 HRI.getSubReg(DstReg, Hexagon::isub_hi))
1214 HRI.getSubReg(DstReg, Hexagon::isub_lo))
1227 case Hexagon::PS_pselect: {
1232 unsigned Rd = Op0.
getReg();
1233 unsigned Pu = Op1.
getReg();
1234 unsigned Rs = Op2.
getReg();
1235 unsigned Rt = Op3.
getReg();
1241 BuildMI(MBB, MI, DL,
get(Hexagon::A2_tfrpt), Rd)
1242 .
addReg(Pu, (Rd == Rt) ? K1 : 0)
1245 BuildMI(MBB, MI, DL,
get(Hexagon::A2_tfrpf), Rd)
1251 case Hexagon::PS_vselect:
1252 case Hexagon::PS_vselect_128B: {
1260 unsigned PReg = Op1.
getReg();
1267 auto T =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vcmov))
1276 auto T =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vncmov))
1286 case Hexagon::PS_wselect:
1287 case Hexagon::PS_wselect_128B: {
1295 unsigned PReg = Op1.
getReg();
1302 unsigned SrcLo = HRI.getSubReg(Op2.
getReg(), Hexagon::vsub_lo);
1303 unsigned SrcHi = HRI.getSubReg(Op2.
getReg(), Hexagon::vsub_hi);
1304 auto T =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vccombine))
1315 unsigned SrcLo = HRI.getSubReg(Op3.
getReg(), Hexagon::vsub_lo);
1316 unsigned SrcHi = HRI.getSubReg(Op3.
getReg(), Hexagon::vsub_hi);
1317 auto T =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vnccombine))
1328 case Hexagon::PS_tailcall_i:
1329 MI.
setDesc(
get(Hexagon::J2_jump));
1331 case Hexagon::PS_tailcall_r:
1332 case Hexagon::PS_jmpret:
1333 MI.
setDesc(
get(Hexagon::J2_jumpr));
1335 case Hexagon::PS_jmprett:
1336 MI.
setDesc(
get(Hexagon::J2_jumprt));
1338 case Hexagon::PS_jmpretf:
1339 MI.
setDesc(
get(Hexagon::J2_jumprf));
1341 case Hexagon::PS_jmprettnewpt:
1342 MI.
setDesc(
get(Hexagon::J2_jumprtnewpt));
1344 case Hexagon::PS_jmpretfnewpt:
1345 MI.
setDesc(
get(Hexagon::J2_jumprfnewpt));
1347 case Hexagon::PS_jmprettnew:
1348 MI.
setDesc(
get(Hexagon::J2_jumprtnew));
1350 case Hexagon::PS_jmpretfnew:
1351 MI.
setDesc(
get(Hexagon::J2_jumprfnew));
1364 assert(Cond[0].isImm() &&
"First entry in the cond vector not imm-val");
1365 unsigned opcode = Cond[0].getImm();
1367 assert(
get(opcode).
isBranch() &&
"Should be a branching condition.");
1371 Cond[0].setImm(NewOpcode);
1378 BuildMI(MBB, MI, DL,
get(Hexagon::A2_nop));
1419 while (NOp < NumOps) {
1427 unsigned PredReg, PredRegPos, PredRegFlags;
1428 bool GotPredReg =
getPredReg(Cond, PredReg, PredRegPos, PredRegFlags);
1431 T.
addReg(PredReg, PredRegFlags);
1432 while (NOp < NumOps)
1464 if (RC == &Hexagon::PredRegsRegClass) {
1470 for (
unsigned PR : Hexagon::PredRegsRegClass) {
1541 bool atInsnStart =
true;
1542 unsigned Length = 0;
1543 for (; *Str; ++Str) {
1547 if (atInsnStart && !std::isspace(static_cast<unsigned char>(*Str))) {
1549 atInsnStart =
false;
1553 atInsnStart =
false;
1558 Length += AStr.
count(Occ)*4;
1577 unsigned &SrcReg2,
int &
Mask,
1583 case Hexagon::C2_cmpeq:
1584 case Hexagon::C2_cmpeqp:
1585 case Hexagon::C2_cmpgt:
1586 case Hexagon::C2_cmpgtp:
1587 case Hexagon::C2_cmpgtu:
1588 case Hexagon::C2_cmpgtup:
1589 case Hexagon::C4_cmpneq:
1590 case Hexagon::C4_cmplte:
1591 case Hexagon::C4_cmplteu:
1592 case Hexagon::C2_cmpeqi:
1593 case Hexagon::C2_cmpgti:
1594 case Hexagon::C2_cmpgtui:
1595 case Hexagon::C4_cmpneqi:
1596 case Hexagon::C4_cmplteui:
1597 case Hexagon::C4_cmpltei:
1601 case Hexagon::A4_cmpbeq:
1602 case Hexagon::A4_cmpbgt:
1603 case Hexagon::A4_cmpbgtu:
1604 case Hexagon::A4_cmpbeqi:
1605 case Hexagon::A4_cmpbgti:
1606 case Hexagon::A4_cmpbgtui:
1610 case Hexagon::A4_cmpheq:
1611 case Hexagon::A4_cmphgt:
1612 case Hexagon::A4_cmphgtu:
1613 case Hexagon::A4_cmpheqi:
1614 case Hexagon::A4_cmphgti:
1615 case Hexagon::A4_cmphgtui:
1623 case Hexagon::C2_cmpeq:
1624 case Hexagon::C2_cmpeqp:
1625 case Hexagon::C2_cmpgt:
1626 case Hexagon::C2_cmpgtp:
1627 case Hexagon::C2_cmpgtu:
1628 case Hexagon::C2_cmpgtup:
1629 case Hexagon::A4_cmpbeq:
1630 case Hexagon::A4_cmpbgt:
1631 case Hexagon::A4_cmpbgtu:
1632 case Hexagon::A4_cmpheq:
1633 case Hexagon::A4_cmphgt:
1634 case Hexagon::A4_cmphgtu:
1635 case Hexagon::C4_cmpneq:
1636 case Hexagon::C4_cmplte:
1637 case Hexagon::C4_cmplteu:
1641 case Hexagon::C2_cmpeqi:
1642 case Hexagon::C2_cmpgtui:
1643 case Hexagon::C2_cmpgti:
1644 case Hexagon::C4_cmpneqi:
1645 case Hexagon::C4_cmplteui:
1646 case Hexagon::C4_cmpltei:
1647 case Hexagon::A4_cmpbeqi:
1648 case Hexagon::A4_cmpbgti:
1649 case Hexagon::A4_cmpbgtui:
1650 case Hexagon::A4_cmpheqi:
1651 case Hexagon::A4_cmphgti:
1652 case Hexagon::A4_cmphgtui:
1663 unsigned *PredCost)
const {
1680 int OffsetA = 0, OffsetB = 0;
1681 unsigned SizeA = 0, SizeB = 0;
1694 if (!BaseRegA || !SizeA)
1699 if (!BaseRegB || !SizeB)
1702 if (BaseRegA != BaseRegB)
1707 if (OffsetA > OffsetB) {
1708 uint64_t offDiff = (uint64_t)((int64_t)OffsetA - (int64_t)OffsetB);
1709 return (SizeB <= offDiff);
1710 }
else if (OffsetA < OffsetB) {
1711 uint64_t offDiff = (uint64_t)((int64_t)OffsetB - (int64_t)OffsetA);
1712 return (SizeA <= offDiff);
1722 unsigned AccessSize;
1725 if (MI.
getOpcode() == Hexagon::A2_addi) {
1733 std::pair<unsigned, unsigned>
1741 using namespace HexagonII;
1742 static const std::pair<unsigned, const char*>
Flags[] = {
1750 {
MO_IE,
"hexagon-ie"},
1759 using namespace HexagonII;
1760 static const std::pair<unsigned, const char*>
Flags[] = {
1770 TRC = &Hexagon::PredRegsRegClass;
1772 TRC = &Hexagon::IntRegsRegClass;
1774 TRC = &Hexagon::DoubleRegsRegClass;
1853 assert(MO.
isImm() &&
"Extendable operand must be Immediate type");
1857 int ImmValue = MO.
getImm();
1859 return (ImmValue < MinValue || ImmValue > MaxValue);
1864 case Hexagon::L4_return :
1865 case Hexagon::L4_return_t :
1866 case Hexagon::L4_return_f :
1867 case Hexagon::L4_return_tnew_pnt :
1868 case Hexagon::L4_return_fnew_pnt :
1869 case Hexagon::L4_return_tnew_pt :
1870 case Hexagon::L4_return_fnew_pt :
1892 for (
auto &RegA : DefsA)
1893 for (
auto &RegB : UsesB) {
1900 if (RegB == *SubRegs)
1905 if (RegA == *SubRegs)
1915 case Hexagon::V6_vL32b_cur_pi:
1916 case Hexagon::V6_vL32b_cur_ai:
1917 case Hexagon::V6_vL32b_cur_pi_128B:
1918 case Hexagon::V6_vL32b_cur_ai_128B:
1951 return (Opcode == Hexagon::ENDLOOP0 ||
1952 Opcode == Hexagon::ENDLOOP1);
1979 case Hexagon::PS_fi:
1980 case Hexagon::PS_fia:
2006 const uint64_t
F =
get(Opcode).TSFlags;
2022 case Hexagon::J2_callr :
2023 case Hexagon::J2_callrf :
2024 case Hexagon::J2_callrt :
2025 case Hexagon::PS_call_nr :
2033 case Hexagon::L4_return :
2034 case Hexagon::L4_return_t :
2035 case Hexagon::L4_return_f :
2036 case Hexagon::L4_return_fnew_pnt :
2037 case Hexagon::L4_return_fnew_pt :
2038 case Hexagon::L4_return_tnew_pnt :
2039 case Hexagon::L4_return_tnew_pt :
2047 case Hexagon::J2_jumpr :
2048 case Hexagon::J2_jumprt :
2049 case Hexagon::J2_jumprf :
2050 case Hexagon::J2_jumprtnewpt :
2051 case Hexagon::J2_jumprfnewpt :
2052 case Hexagon::J2_jumprtnew :
2053 case Hexagon::J2_jumprfnew :
2064 unsigned offset)
const {
2068 return isInt<11>(offset);
2074 case Hexagon::J2_jump:
2075 case Hexagon::J2_call:
2076 case Hexagon::PS_call_nr:
2077 return isInt<24>(offset);
2078 case Hexagon::J2_jumpt:
2079 case Hexagon::J2_jumpf:
2080 case Hexagon::J2_jumptnew:
2081 case Hexagon::J2_jumptnewpt:
2082 case Hexagon::J2_jumpfnew:
2083 case Hexagon::J2_jumpfnewpt:
2084 case Hexagon::J2_callt:
2085 case Hexagon::J2_callf:
2086 return isInt<17>(offset);
2087 case Hexagon::J2_loop0i:
2088 case Hexagon::J2_loop0iext:
2089 case Hexagon::J2_loop0r:
2090 case Hexagon::J2_loop0rext:
2091 case Hexagon::J2_loop1i:
2092 case Hexagon::J2_loop1iext:
2093 case Hexagon::J2_loop1r:
2094 case Hexagon::J2_loop1rext:
2095 return isInt<9>(offset);
2097 case Hexagon::J4_cmpeqi_tp0_jump_nt:
2098 case Hexagon::J4_cmpeqi_tp1_jump_nt:
2099 return isInt<11>(offset);
2108 DEBUG(
dbgs() <<
"V60" << (isLate ?
"-LR " :
" -- "));
2110 DEBUG(
dbgs() <<
"V60" << (isEarly ?
"-ES " :
" -- "));
2113 if (isLate && isEarly) {
2114 DEBUG(
dbgs() <<
"++Is Late Result feeding Early Source\n");
2123 case TargetOpcode::EXTRACT_SUBREG:
2124 case TargetOpcode::INSERT_SUBREG:
2125 case TargetOpcode::SUBREG_TO_REG:
2126 case TargetOpcode::REG_SEQUENCE:
2127 case TargetOpcode::IMPLICIT_DEF:
2128 case TargetOpcode::COPY:
2130 case TargetOpcode::PHI:
2137 return !
is_TC1(SchedClass);
2148 return Opcode == Hexagon::J2_loop0i ||
2149 Opcode == Hexagon::J2_loop0r ||
2150 Opcode == Hexagon::J2_loop0iext ||
2151 Opcode == Hexagon::J2_loop0rext ||
2152 Opcode == Hexagon::J2_loop1i ||
2153 Opcode == Hexagon::J2_loop1r ||
2154 Opcode == Hexagon::J2_loop1iext ||
2155 Opcode == Hexagon::J2_loop1rext;
2160 default:
return false;
2161 case Hexagon::L4_iadd_memopw_io :
2162 case Hexagon::L4_isub_memopw_io :
2163 case Hexagon::L4_add_memopw_io :
2164 case Hexagon::L4_sub_memopw_io :
2165 case Hexagon::L4_and_memopw_io :
2166 case Hexagon::L4_or_memopw_io :
2167 case Hexagon::L4_iadd_memoph_io :
2168 case Hexagon::L4_isub_memoph_io :
2169 case Hexagon::L4_add_memoph_io :
2170 case Hexagon::L4_sub_memoph_io :
2171 case Hexagon::L4_and_memoph_io :
2172 case Hexagon::L4_or_memoph_io :
2173 case Hexagon::L4_iadd_memopb_io :
2174 case Hexagon::L4_isub_memopb_io :
2175 case Hexagon::L4_add_memopb_io :
2176 case Hexagon::L4_sub_memopb_io :
2177 case Hexagon::L4_and_memopb_io :
2178 case Hexagon::L4_or_memopb_io :
2179 case Hexagon::L4_ior_memopb_io:
2180 case Hexagon::L4_ior_memoph_io:
2181 case Hexagon::L4_ior_memopw_io:
2182 case Hexagon::L4_iand_memopb_io:
2183 case Hexagon::L4_iand_memoph_io:
2184 case Hexagon::L4_iand_memopw_io:
2196 const uint64_t
F =
get(Opcode).TSFlags;
2218 const uint64_t
F =
get(Opcode).TSFlags;
2224 unsigned OperandNum)
const {
2237 const uint64_t
F =
get(Opcode).TSFlags;
2249 const uint64_t
F =
get(Opcode).TSFlags;
2257 const uint64_t
F =
get(Opcode).TSFlags;
2262 const uint64_t
F =
get(Opcode).TSFlags;
2267 const uint64_t
F =
get(Opcode).TSFlags;
2274 return MI.
getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4 ||
2275 MI.
getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4_EXT ||
2276 MI.
getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4_PIC ||
2277 MI.
getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4_EXT_PIC;
2283 case Hexagon::L2_loadrb_io:
2284 case Hexagon::L4_loadrb_ur:
2285 case Hexagon::L4_loadrb_ap:
2286 case Hexagon::L2_loadrb_pr:
2287 case Hexagon::L2_loadrb_pbr:
2288 case Hexagon::L2_loadrb_pi:
2289 case Hexagon::L2_loadrb_pci:
2290 case Hexagon::L2_loadrb_pcr:
2291 case Hexagon::L2_loadbsw2_io:
2292 case Hexagon::L4_loadbsw2_ur:
2293 case Hexagon::L4_loadbsw2_ap:
2294 case Hexagon::L2_loadbsw2_pr:
2295 case Hexagon::L2_loadbsw2_pbr:
2296 case Hexagon::L2_loadbsw2_pi:
2297 case Hexagon::L2_loadbsw2_pci:
2298 case Hexagon::L2_loadbsw2_pcr:
2299 case Hexagon::L2_loadbsw4_io:
2300 case Hexagon::L4_loadbsw4_ur:
2301 case Hexagon::L4_loadbsw4_ap:
2302 case Hexagon::L2_loadbsw4_pr:
2303 case Hexagon::L2_loadbsw4_pbr:
2304 case Hexagon::L2_loadbsw4_pi:
2305 case Hexagon::L2_loadbsw4_pci:
2306 case Hexagon::L2_loadbsw4_pcr:
2307 case Hexagon::L4_loadrb_rr:
2308 case Hexagon::L2_ploadrbt_io:
2309 case Hexagon::L2_ploadrbt_pi:
2310 case Hexagon::L2_ploadrbf_io:
2311 case Hexagon::L2_ploadrbf_pi:
2312 case Hexagon::L2_ploadrbtnew_io:
2313 case Hexagon::L2_ploadrbfnew_io:
2314 case Hexagon::L4_ploadrbt_rr:
2315 case Hexagon::L4_ploadrbf_rr:
2316 case Hexagon::L4_ploadrbtnew_rr:
2317 case Hexagon::L4_ploadrbfnew_rr:
2318 case Hexagon::L2_ploadrbtnew_pi:
2319 case Hexagon::L2_ploadrbfnew_pi:
2320 case Hexagon::L4_ploadrbt_abs:
2321 case Hexagon::L4_ploadrbf_abs:
2322 case Hexagon::L4_ploadrbtnew_abs:
2323 case Hexagon::L4_ploadrbfnew_abs:
2324 case Hexagon::L2_loadrbgp:
2326 case Hexagon::L2_loadrh_io:
2327 case Hexagon::L4_loadrh_ur:
2328 case Hexagon::L4_loadrh_ap:
2329 case Hexagon::L2_loadrh_pr:
2330 case Hexagon::L2_loadrh_pbr:
2331 case Hexagon::L2_loadrh_pi:
2332 case Hexagon::L2_loadrh_pci:
2333 case Hexagon::L2_loadrh_pcr:
2334 case Hexagon::L4_loadrh_rr:
2335 case Hexagon::L2_ploadrht_io:
2336 case Hexagon::L2_ploadrht_pi:
2337 case Hexagon::L2_ploadrhf_io:
2338 case Hexagon::L2_ploadrhf_pi:
2339 case Hexagon::L2_ploadrhtnew_io:
2340 case Hexagon::L2_ploadrhfnew_io:
2341 case Hexagon::L4_ploadrht_rr:
2342 case Hexagon::L4_ploadrhf_rr:
2343 case Hexagon::L4_ploadrhtnew_rr:
2344 case Hexagon::L4_ploadrhfnew_rr:
2345 case Hexagon::L2_ploadrhtnew_pi:
2346 case Hexagon::L2_ploadrhfnew_pi:
2347 case Hexagon::L4_ploadrht_abs:
2348 case Hexagon::L4_ploadrhf_abs:
2349 case Hexagon::L4_ploadrhtnew_abs:
2350 case Hexagon::L4_ploadrhfnew_abs:
2351 case Hexagon::L2_loadrhgp:
2365 case Hexagon::STriw_pred :
2366 case Hexagon::LDriw_pred :
2378 if (
Op.isGlobal() ||
Op.isSymbol())
2386 return is_TC1(SchedClass);
2391 return is_TC2(SchedClass);
2411 for (
int I = 0;
I <
N;
I++)
2416 if (MI2.
getOpcode() == Hexagon::V6_vS32b_pi)
2424 const uint64_t V =
getType(MI);
2435 (Offset & 0x3f) == 0);
2442 (Offset & 0x7f) == 0);
2447 (Offset & 0x7) == 0);
2452 (Offset & 0x3) == 0);
2457 (Offset & 0x1) == 0);
2467 bool Extend)
const {
2478 case Hexagon::PS_vstorerq_ai:
2479 case Hexagon::PS_vstorerw_ai:
2480 case Hexagon::PS_vstorerw_nt_ai:
2481 case Hexagon::PS_vloadrq_ai:
2482 case Hexagon::PS_vloadrw_ai:
2483 case Hexagon::PS_vloadrw_nt_ai:
2484 case Hexagon::V6_vL32b_ai:
2485 case Hexagon::V6_vS32b_ai:
2486 case Hexagon::V6_vL32b_nt_ai:
2487 case Hexagon::V6_vS32b_nt_ai:
2488 case Hexagon::V6_vL32Ub_ai:
2489 case Hexagon::V6_vS32Ub_ai:
2490 return isShiftedInt<4,6>(
Offset);
2492 case Hexagon::PS_vstorerq_ai_128B:
2493 case Hexagon::PS_vstorerw_ai_128B:
2494 case Hexagon::PS_vstorerw_nt_ai_128B:
2495 case Hexagon::PS_vloadrq_ai_128B:
2496 case Hexagon::PS_vloadrw_ai_128B:
2497 case Hexagon::PS_vloadrw_nt_ai_128B:
2498 case Hexagon::V6_vL32b_ai_128B:
2499 case Hexagon::V6_vS32b_ai_128B:
2500 case Hexagon::V6_vL32b_nt_ai_128B:
2501 case Hexagon::V6_vS32b_nt_ai_128B:
2502 case Hexagon::V6_vL32Ub_ai_128B:
2503 case Hexagon::V6_vS32Ub_ai_128B:
2504 return isShiftedInt<4,7>(
Offset);
2506 case Hexagon::J2_loop0i:
2507 case Hexagon::J2_loop1i:
2508 return isUInt<10>(
Offset);
2510 case Hexagon::S4_storeirb_io:
2511 case Hexagon::S4_storeirbt_io:
2512 case Hexagon::S4_storeirbf_io:
2513 return isUInt<6>(
Offset);
2515 case Hexagon::S4_storeirh_io:
2516 case Hexagon::S4_storeirht_io:
2517 case Hexagon::S4_storeirhf_io:
2518 return isShiftedUInt<6,1>(
Offset);
2520 case Hexagon::S4_storeiri_io:
2521 case Hexagon::S4_storeirit_io:
2522 case Hexagon::S4_storeirif_io:
2523 return isShiftedUInt<6,2>(
Offset);
2530 case Hexagon::L2_loadri_io:
2531 case Hexagon::S2_storeri_io:
2535 case Hexagon::L2_loadrd_io:
2536 case Hexagon::S2_storerd_io:
2540 case Hexagon::L2_loadrh_io:
2541 case Hexagon::L2_loadruh_io:
2542 case Hexagon::S2_storerh_io:
2543 case Hexagon::S2_storerf_io:
2547 case Hexagon::L2_loadrb_io:
2548 case Hexagon::L2_loadrub_io:
2549 case Hexagon::S2_storerb_io:
2553 case Hexagon::A2_addi:
2557 case Hexagon::L4_iadd_memopw_io :
2558 case Hexagon::L4_isub_memopw_io :
2559 case Hexagon::L4_add_memopw_io :
2560 case Hexagon::L4_sub_memopw_io :
2561 case Hexagon::L4_and_memopw_io :
2562 case Hexagon::L4_or_memopw_io :
2563 return (0 <= Offset && Offset <= 255);
2565 case Hexagon::L4_iadd_memoph_io :
2566 case Hexagon::L4_isub_memoph_io :
2567 case Hexagon::L4_add_memoph_io :
2568 case Hexagon::L4_sub_memoph_io :
2569 case Hexagon::L4_and_memoph_io :
2570 case Hexagon::L4_or_memoph_io :
2571 return (0 <= Offset && Offset <= 127);
2573 case Hexagon::L4_iadd_memopb_io :
2574 case Hexagon::L4_isub_memopb_io :
2575 case Hexagon::L4_add_memopb_io :
2576 case Hexagon::L4_sub_memopb_io :
2577 case Hexagon::L4_and_memopb_io :
2578 case Hexagon::L4_or_memopb_io :
2579 return (0 <= Offset && Offset <= 63);
2583 case Hexagon::STriw_pred:
2584 case Hexagon::LDriw_pred:
2585 case Hexagon::STriw_mod:
2586 case Hexagon::LDriw_mod:
2589 case Hexagon::PS_fi:
2590 case Hexagon::PS_fia:
2594 case Hexagon::L2_ploadrbt_io:
2595 case Hexagon::L2_ploadrbf_io:
2596 case Hexagon::L2_ploadrubt_io:
2597 case Hexagon::L2_ploadrubf_io:
2598 case Hexagon::S2_pstorerbt_io:
2599 case Hexagon::S2_pstorerbf_io:
2600 return isUInt<6>(
Offset);
2602 case Hexagon::L2_ploadrht_io:
2603 case Hexagon::L2_ploadrhf_io:
2604 case Hexagon::L2_ploadruht_io:
2605 case Hexagon::L2_ploadruhf_io:
2606 case Hexagon::S2_pstorerht_io:
2607 case Hexagon::S2_pstorerhf_io:
2608 return isShiftedUInt<6,1>(
Offset);
2610 case Hexagon::L2_ploadrit_io:
2611 case Hexagon::L2_ploadrif_io:
2612 case Hexagon::S2_pstorerit_io:
2613 case Hexagon::S2_pstorerif_io:
2614 return isShiftedUInt<6,2>(
Offset);
2616 case Hexagon::L2_ploadrdt_io:
2617 case Hexagon::L2_ploadrdf_io:
2618 case Hexagon::S2_pstorerdt_io:
2619 case Hexagon::S2_pstorerdf_io:
2620 return isShiftedUInt<6,3>(
Offset);
2624 "Please define it in the above switch statement!");
2632 const uint64_t
F =
get(MI.
getOpcode()).TSFlags;
2656 case Hexagon::L2_loadrub_io:
2657 case Hexagon::L4_loadrub_ur:
2658 case Hexagon::L4_loadrub_ap:
2659 case Hexagon::L2_loadrub_pr:
2660 case Hexagon::L2_loadrub_pbr:
2661 case Hexagon::L2_loadrub_pi:
2662 case Hexagon::L2_loadrub_pci:
2663 case Hexagon::L2_loadrub_pcr:
2664 case Hexagon::L2_loadbzw2_io:
2665 case Hexagon::L4_loadbzw2_ur:
2666 case Hexagon::L4_loadbzw2_ap:
2667 case Hexagon::L2_loadbzw2_pr:
2668 case Hexagon::L2_loadbzw2_pbr:
2669 case Hexagon::L2_loadbzw2_pi:
2670 case Hexagon::L2_loadbzw2_pci:
2671 case Hexagon::L2_loadbzw2_pcr:
2672 case Hexagon::L2_loadbzw4_io:
2673 case Hexagon::L4_loadbzw4_ur:
2674 case Hexagon::L4_loadbzw4_ap:
2675 case Hexagon::L2_loadbzw4_pr:
2676 case Hexagon::L2_loadbzw4_pbr:
2677 case Hexagon::L2_loadbzw4_pi:
2678 case Hexagon::L2_loadbzw4_pci:
2679 case Hexagon::L2_loadbzw4_pcr:
2680 case Hexagon::L4_loadrub_rr:
2681 case Hexagon::L2_ploadrubt_io:
2682 case Hexagon::L2_ploadrubt_pi:
2683 case Hexagon::L2_ploadrubf_io:
2684 case Hexagon::L2_ploadrubf_pi:
2685 case Hexagon::L2_ploadrubtnew_io:
2686 case Hexagon::L2_ploadrubfnew_io:
2687 case Hexagon::L4_ploadrubt_rr:
2688 case Hexagon::L4_ploadrubf_rr:
2689 case Hexagon::L4_ploadrubtnew_rr:
2690 case Hexagon::L4_ploadrubfnew_rr:
2691 case Hexagon::L2_ploadrubtnew_pi:
2692 case Hexagon::L2_ploadrubfnew_pi:
2693 case Hexagon::L4_ploadrubt_abs:
2694 case Hexagon::L4_ploadrubf_abs:
2695 case Hexagon::L4_ploadrubtnew_abs:
2696 case Hexagon::L4_ploadrubfnew_abs:
2697 case Hexagon::L2_loadrubgp:
2699 case Hexagon::L2_loadruh_io:
2700 case Hexagon::L4_loadruh_ur:
2701 case Hexagon::L4_loadruh_ap:
2702 case Hexagon::L2_loadruh_pr:
2703 case Hexagon::L2_loadruh_pbr:
2704 case Hexagon::L2_loadruh_pi:
2705 case Hexagon::L2_loadruh_pci:
2706 case Hexagon::L2_loadruh_pcr:
2707 case Hexagon::L4_loadruh_rr:
2708 case Hexagon::L2_ploadruht_io:
2709 case Hexagon::L2_ploadruht_pi:
2710 case Hexagon::L2_ploadruhf_io:
2711 case Hexagon::L2_ploadruhf_pi:
2712 case Hexagon::L2_ploadruhtnew_io:
2713 case Hexagon::L2_ploadruhfnew_io:
2714 case Hexagon::L4_ploadruht_rr:
2715 case Hexagon::L4_ploadruhf_rr:
2716 case Hexagon::L4_ploadruhtnew_rr:
2717 case Hexagon::L4_ploadruhfnew_rr:
2718 case Hexagon::L2_ploadruhtnew_pi:
2719 case Hexagon::L2_ploadruhfnew_pi:
2720 case Hexagon::L4_ploadruht_abs:
2721 case Hexagon::L4_ploadruhf_abs:
2722 case Hexagon::L4_ploadruhtnew_abs:
2723 case Hexagon::L4_ploadruhfnew_abs:
2724 case Hexagon::L2_loadruhgp:
2744 unsigned AccessSize = 0;
2748 return BaseReg != 0;
2766 if (!Stored.
isReg())
2779 return Opc == Hexagon::PS_call_nr || Opc == Hexagon::PS_callr_nr;
2795 if (Hexagon::getRegForm(MI.
getOpcode()) >= 0)
2805 NonExtOpcode = Hexagon::getBaseWithImmOffset(MI.
getOpcode());
2811 NonExtOpcode = Hexagon::getBaseWithRegOffset(MI.
getOpcode());
2814 NonExtOpcode = Hexagon::getRegShlForm(MI.
getOpcode());
2819 if (NonExtOpcode < 0)
2827 return Hexagon::getRealHWInstr(MI.
getOpcode(),
2828 Hexagon::InstrType_Pseudo) >= 0;
2883 if (!(*MII).isBundle()) {
2888 for (++MII; MII != MIE && MII->isInsideBundle(); ++MII) {
2897 unsigned PredReg)
const {
2900 if (MO.isRegMask() && MO.clobbersPhysReg(PredReg))
2902 if (MO.isReg() && MO.isDef() && MO.isImplicit() && (MO.getReg() == PredReg))
2909 return MI.
getOpcode() != Hexagon::A4_tlbmatch;
2913 return Opcode == Hexagon::J2_jumpt ||
2914 Opcode == Hexagon::J2_jumptpt ||
2915 Opcode == Hexagon::J2_jumpf ||
2916 Opcode == Hexagon::J2_jumpfpt ||
2917 Opcode == Hexagon::J2_jumptnew ||
2918 Opcode == Hexagon::J2_jumpfnew ||
2919 Opcode == Hexagon::J2_jumptnewpt ||
2920 Opcode == Hexagon::J2_jumpfnewpt;
2930 return Hexagon::getAbsoluteForm(MI.
getOpcode());
2941 int &
Offset,
unsigned &AccessSize)
const {
2951 "BaseImmOffset or BaseLongOffset or MemOp without accessSize");
2959 unsigned basePos = 0, offsetPos = 0;
2976 unsigned &BasePos,
unsigned &OffsetPos)
const {
3038 while (I->isDebugValue()) {
3043 if (!isUnpredicatedTerminator(*I))
3052 if (&*I != LastInst && !I->
isBundle() && isUnpredicatedTerminator(*I)) {
3053 if (!SecondLastInst) {
3054 SecondLastInst = &*
I;
3069 return Hexagon::getBaseWithLongOffset(Opcode);
3073 return Hexagon::getBaseWithLongOffset(MI.
getOpcode());
3077 return Hexagon::getBaseWithRegOffset(MI.
getOpcode());
3090 unsigned DstReg, SrcReg, Src1Reg, Src2Reg;
3101 case Hexagon::C2_cmpeq:
3102 case Hexagon::C2_cmpgt:
3103 case Hexagon::C2_cmpgtu:
3107 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3108 (Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
3112 case Hexagon::C2_cmpeqi:
3113 case Hexagon::C2_cmpgti:
3114 case Hexagon::C2_cmpgtui:
3118 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3119 (Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
3125 case Hexagon::A2_tfr:
3132 case Hexagon::A2_tfrsi:
3140 case Hexagon::S2_tstbit_i:
3143 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3144 (Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
3153 case Hexagon::J2_jumptnew:
3154 case Hexagon::J2_jumpfnew:
3155 case Hexagon::J2_jumptnewpt:
3156 case Hexagon::J2_jumpfnewpt:
3158 if (Hexagon::PredRegsRegClass.
contains(Src1Reg) &&
3159 (Hexagon::P0 == Src1Reg || Hexagon::P1 == Src1Reg))
3166 case Hexagon::J2_jump:
3167 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4:
3168 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4_PIC:
3181 if ((GA.
getOpcode() != Hexagon::C2_cmpeqi) ||
3182 (GB.
getOpcode() != Hexagon::J2_jumptnew))
3187 if (DestReg == Hexagon::P0)
3188 return Hexagon::J4_cmpeqi_tp0_jump_nt;
3189 if (DestReg == Hexagon::P1)
3190 return Hexagon::J4_cmpeqi_tp1_jump_nt;
3195 enum Hexagon::PredSense inPredSense;
3196 inPredSense = invertPredicate ? Hexagon::PredSense_false :
3197 Hexagon::PredSense_true;
3198 int CondOpcode = Hexagon::getPredOpcode(Opc, inPredSense);
3199 if (CondOpcode >= 0)
3209 case Hexagon::V6_vL32b_pi:
3210 return Hexagon::V6_vL32b_cur_pi;
3211 case Hexagon::V6_vL32b_ai:
3212 return Hexagon::V6_vL32b_cur_ai;
3213 case Hexagon::V6_vL32b_nt_pi:
3214 return Hexagon::V6_vL32b_nt_cur_pi;
3215 case Hexagon::V6_vL32b_nt_ai:
3216 return Hexagon::V6_vL32b_nt_cur_ai;
3218 case Hexagon::V6_vL32b_pi_128B:
3219 return Hexagon::V6_vL32b_cur_pi_128B;
3220 case Hexagon::V6_vL32b_ai_128B:
3221 return Hexagon::V6_vL32b_cur_ai_128B;
3222 case Hexagon::V6_vL32b_nt_pi_128B:
3223 return Hexagon::V6_vL32b_nt_cur_pi_128B;
3224 case Hexagon::V6_vL32b_nt_ai_128B:
3225 return Hexagon::V6_vL32b_nt_cur_ai_128B;
3234 case Hexagon::V6_vL32b_cur_pi:
3235 return Hexagon::V6_vL32b_pi;
3236 case Hexagon::V6_vL32b_cur_ai:
3237 return Hexagon::V6_vL32b_ai;
3238 case Hexagon::V6_vL32b_nt_cur_pi:
3239 return Hexagon::V6_vL32b_nt_pi;
3240 case Hexagon::V6_vL32b_nt_cur_ai:
3241 return Hexagon::V6_vL32b_nt_ai;
3243 case Hexagon::V6_vL32b_cur_pi_128B:
3244 return Hexagon::V6_vL32b_pi_128B;
3245 case Hexagon::V6_vL32b_cur_ai_128B:
3246 return Hexagon::V6_vL32b_ai_128B;
3247 case Hexagon::V6_vL32b_nt_cur_pi_128B:
3248 return Hexagon::V6_vL32b_nt_pi_128B;
3249 case Hexagon::V6_vL32b_nt_cur_ai_128B:
3250 return Hexagon::V6_vL32b_nt_ai_128B;
3339 int NVOpcode = Hexagon::getNewValueOpcode(MI.
getOpcode());
3347 case Hexagon::S4_storerb_ur:
3348 return Hexagon::S4_storerbnew_ur;
3350 case Hexagon::S2_storerb_pci:
3351 return Hexagon::S2_storerb_pci;
3353 case Hexagon::S2_storeri_pci:
3354 return Hexagon::S2_storeri_pci;
3356 case Hexagon::S2_storerh_pci:
3357 return Hexagon::S2_storerh_pci;
3359 case Hexagon::S2_storerd_pci:
3360 return Hexagon::S2_storerd_pci;
3362 case Hexagon::S2_storerf_pci:
3363 return Hexagon::S2_storerf_pci;
3365 case Hexagon::V6_vS32b_ai:
3366 return Hexagon::V6_vS32b_new_ai;
3368 case Hexagon::V6_vS32b_pi:
3369 return Hexagon::V6_vS32b_new_pi;
3372 case Hexagon::V6_vS32b_ai_128B:
3373 return Hexagon::V6_vS32b_new_ai_128B;
3375 case Hexagon::V6_vS32b_pi_128B:
3376 return Hexagon::V6_vS32b_new_pi_128B;
3401 if (BrTarget.
isMBB()) {
3403 Taken = getEdgeProbability(Src, Dst) >= OneHalf;
3416 bool SawCond =
false, Bad =
false;
3420 if (
I.isConditionalBranch()) {
3427 if (
I.isUnconditionalBranch() && !SawCond) {
3435 if (NextIt == B.instr_end()) {
3438 if (!B.isLayoutSuccessor(
SB))
3440 Taken = getEdgeProbability(Src,
SB) < OneHalf;
3444 assert(NextIt->isUnconditionalBranch());
3453 Taken = BT && getEdgeProbability(Src, BT) < OneHalf;
3461 case Hexagon::J2_jumpt:
3462 return Taken ? Hexagon::J2_jumptnewpt : Hexagon::J2_jumptnew;
3463 case Hexagon::J2_jumpf:
3464 return Taken ? Hexagon::J2_jumpfnewpt : Hexagon::J2_jumpfnew;
3476 case Hexagon::J2_jumpt:
3477 case Hexagon::J2_jumpf:
3481 int NewOpcode = Hexagon::getPredNewOpcode(MI.
getOpcode());
3492 NewOp = Hexagon::getPredOldOpcode(NewOp);
3496 if (!HST.getFeatureBits()[Hexagon::ArchV60]) {
3498 case Hexagon::J2_jumptpt:
3499 NewOp = Hexagon::J2_jumpt;
3501 case Hexagon::J2_jumpfpt:
3502 NewOp = Hexagon::J2_jumpf;
3504 case Hexagon::J2_jumprtpt:
3505 NewOp = Hexagon::J2_jumprt;
3507 case Hexagon::J2_jumprfpt:
3508 NewOp = Hexagon::J2_jumprf;
3513 "Couldn't change predicate new instruction to its old form.");
3517 NewOp = Hexagon::getNonNVStore(NewOp);
3518 assert(NewOp >= 0 &&
"Couldn't change new-value store to its old form.");
3526 case Hexagon::J2_jumpfpt:
3527 return Hexagon::J2_jumpf;
3528 case Hexagon::J2_jumptpt:
3529 return Hexagon::J2_jumpt;
3530 case Hexagon::J2_jumprfpt:
3531 return Hexagon::J2_jumprf;
3532 case Hexagon::J2_jumprtpt:
3533 return Hexagon::J2_jumprt;
3542 unsigned DstReg, SrcReg, Src1Reg, Src2Reg;
3553 case Hexagon::L2_loadri_io:
3559 if (Hexagon::IntRegsRegClass.
contains(SrcReg) &&
3560 HRI.getStackRegister() == SrcReg &&
3571 case Hexagon::L2_loadrub_io:
3589 case Hexagon::L2_loadrh_io:
3590 case Hexagon::L2_loadruh_io:
3599 case Hexagon::L2_loadrb_io:
3608 case Hexagon::L2_loadrd_io:
3613 Hexagon::IntRegsRegClass.
contains(SrcReg) &&
3614 HRI.getStackRegister() == SrcReg &&
3621 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4:
3622 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4_PIC:
3623 case Hexagon::L4_return:
3624 case Hexagon::L2_deallocframe:
3626 case Hexagon::EH_RETURN_JMPR:
3627 case Hexagon::PS_jmpret:
3631 if (Hexagon::IntRegsRegClass.
contains(DstReg) && (Hexagon::R31 == DstReg))
3634 case Hexagon::PS_jmprett:
3635 case Hexagon::PS_jmpretf:
3636 case Hexagon::PS_jmprettnewpt:
3637 case Hexagon::PS_jmpretfnewpt:
3638 case Hexagon::PS_jmprettnew:
3639 case Hexagon::PS_jmpretfnew:
3643 if ((Hexagon::PredRegsRegClass.
contains(SrcReg) &&
3644 (Hexagon::P0 == SrcReg)) &&
3645 (Hexagon::IntRegsRegClass.
contains(DstReg) && (Hexagon::R31 == DstReg)))
3648 case Hexagon::L4_return_t :
3649 case Hexagon::L4_return_f :
3650 case Hexagon::L4_return_tnew_pnt :
3651 case Hexagon::L4_return_fnew_pnt :
3652 case Hexagon::L4_return_tnew_pt :
3653 case Hexagon::L4_return_fnew_pt :
3656 if (Hexagon::PredRegsRegClass.
contains(SrcReg) && (Hexagon::P0 == SrcReg))
3664 case Hexagon::S2_storeri_io:
3669 if (Hexagon::IntRegsRegClass.
contains(Src1Reg) &&
3680 case Hexagon::S2_storerb_io:
3697 case Hexagon::S2_storerh_io:
3706 case Hexagon::S2_storerd_io:
3711 Hexagon::IntRegsRegClass.
contains(Src1Reg) &&
3716 case Hexagon::S4_storeiri_io:
3724 case Hexagon::S4_storeirb_io:
3732 case Hexagon::S2_allocframe:
3755 case Hexagon::A2_addi:
3760 if (Hexagon::IntRegsRegClass.
contains(SrcReg) &&
3776 case Hexagon::A2_add:
3785 case Hexagon::A2_andir:
3797 case Hexagon::A2_tfr:
3804 case Hexagon::A2_tfrsi:
3813 case Hexagon::C2_cmoveit:
3814 case Hexagon::C2_cmovenewit:
3815 case Hexagon::C2_cmoveif:
3816 case Hexagon::C2_cmovenewif:
3823 Hexagon::PredRegsRegClass.
contains(SrcReg) && Hexagon::P0 == SrcReg &&
3827 case Hexagon::C2_cmpeqi:
3831 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3836 case Hexagon::A2_combineii:
3837 case Hexagon::A4_combineii:
3849 case Hexagon::A4_combineri:
3858 case Hexagon::A4_combineir:
3867 case Hexagon::A2_sxtb:
3868 case Hexagon::A2_sxth:
3869 case Hexagon::A2_zxtb:
3870 case Hexagon::A2_zxth:
3883 return Hexagon::getRealHWInstr(MI.
getOpcode(), Hexagon::InstrType_Real);
3910 unsigned UseIdx)
const {
3915 if (RI.isPhysicalRegister(DefMO.
getReg())) {
3950 Cond[0].setImm(Opc);
3957 : Hexagon::getTruePredOpcode(Opc);
3958 if (InvPredOpcode >= 0)
3959 return InvPredOpcode;
3973 return ~(-1U << (bits - 1));
3975 return ~(-1U <<
bits);
3992 return -1U << (bits - 1);
4001 short NonExtOpcode = Hexagon::getRegForm(MI.
getOpcode());
4002 if (NonExtOpcode >= 0)
4003 return NonExtOpcode;
4009 return Hexagon::getBaseWithImmOffset(MI.
getOpcode());
4011 return Hexagon::getBaseWithRegOffset(MI.
getOpcode());
4013 return Hexagon::getRegShlForm(MI.
getOpcode());
4023 unsigned &PredReg,
unsigned &PredRegPos,
unsigned &PredRegFlags)
const {
4028 DEBUG(
dbgs() <<
"No predregs for new-value jumps/endloop");
4031 PredReg = Cond[1].getReg();
4035 if (Cond[1].isImplicit())
4037 if (Cond[1].isUndef())
4043 return Hexagon::getRealHWInstr(MI.
getOpcode(), Hexagon::InstrType_Pseudo);
4047 return Hexagon::getRegForm(MI.
getOpcode());
4074 unsigned NumDefs = 0;
4108 assert(BundleHead->isBundle() &&
"Not a bundle header");
4118 "Instruction must be extendable");
4124 "Branch with unknown extendable field type");
4131 DEBUG(
dbgs() <<
"\n[invertAndChangeJumpTarget] to BB#"
4157 for (
unsigned insn = TargetOpcode::GENERIC_OP_END+1;
4158 insn < Hexagon::INSTRUCTION_LIST_END; ++insn) {
4159 NewMI =
BuildMI(B, I, DL,
get(insn));
4171 DEBUG(
dbgs() <<
"\nTrying to reverse pred. sense of:"; MI.
dump());
4178 int PredRevOpcode = -1;
4180 PredRevOpcode = Hexagon::notTakenBranchPrediction(Opcode);
4182 PredRevOpcode = Hexagon::takenBranchPrediction(Opcode);
4183 assert(PredRevOpcode > 0);
4184 return PredRevOpcode;
4190 return Cond.
empty() || (Cond[0].isImm() && (Cond.
size() != 1));
4194 return Hexagon::xformRegToImmOffset(MI.
getOpcode());
static bool isReg(const MCInst &MI, unsigned OpNo)
bool hasPseudoInstrPair(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.
unsigned succ_size() const
void push_back(const T &Elt)
bool isJumpWithinBranchRange(const MachineInstr &MI, unsigned offset) const
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
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...
bool isIndirectCall(const MachineInstr &MI) const
This class is the base class for the comparison instructions.
short getBaseWithLongOffset(short Opcode) const
static bool is_TC3x(unsigned SchedClass)
instr_iterator instr_begin()
const int Hexagon_MEMH_OFFSET_MAX
unsigned reversePrediction(unsigned Opcode) const
instr_iterator instr_end()
const int Hexagon_ADDI_OFFSET_MAX
bool isTC1(const MachineInstr &MI) const
unsigned getFrameRegister(const MachineFunction &MF) const override
bool isBranch(QueryType Type=AnyInBundle) const
Returns true if this is a conditional, unconditional, or indirect branch.
unsigned getRegState(const MachineOperand &RegOp)
Get all register state flags from machine operand RegOp.
const int Hexagon_MEMH_OFFSET_MIN
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
bool isIndirectL4Return(const MachineInstr &MI) const
bool isValid() const
isValid - returns true if this iterator is not yet at the end.
static void parseOperands(const MachineInstr &MI, SmallVector< unsigned, 4 > &Defs, SmallVector< unsigned, 8 > &Uses)
Gather register def/uses from MI.
MachineBasicBlock * getMBB() const
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
static cl::opt< bool > UseDFAHazardRec("dfa-hazard-rec", cl::init(true), cl::Hidden, cl::ZeroOrMore, cl::desc("Use the DFA based hazard recognizer."))
static bool is_TC1(unsigned SchedClass)
unsigned getNumDefs() const
Return the number of MachineOperands that are register definitions.
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...
bool isNewValueInst(const MachineInstr &MI) const
unsigned createVirtualRegister(const TargetRegisterClass *RegClass)
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
int getDotOldOp(const MachineInstr &MI) const
bool isPredicateLate(unsigned Opcode) const
DFAPacketizer * CreateTargetScheduleState(const TargetSubtargetInfo &STI) const override
Create machine specific model for scheduling.
short getPseudoInstrPair(const MachineInstr &MI) const
bool mayStore() const
Return true if this instruction could possibly modify memory.
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.
short getNonExtOpcode(const MachineInstr &MI) const
bool isPredicatedTrue(const MachineInstr &MI) const
bool mayStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly modify memory.
Address of indexed Jump Table for switch.
const MachineInstrBuilder & add(const MachineOperand &MO) const
bool PredOpcodeHasJMP_c(unsigned Opcode) const
bool hasOrderedMemoryRef() const
Return true if this instruction may have an ordered or volatile memory reference, or if the informati...
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...
bool reverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const override
Reverses the branch condition of the specified condition list, returning false on success and true if...
ArrayRef< std::pair< unsigned, const char * > > getSerializableBitmaskMachineOperandTargetFlags() const override
Return an array that contains the bitmask target flag values and their names.
bool validateBranchCond(const ArrayRef< MachineOperand > &Cond) const
const int Hexagon_ADDI_OFFSET_MIN
static bool is_TC2early(unsigned SchedClass)
bool isBlockAddress() const
isBlockAddress - Tests if this is a MO_BlockAddress operand.
const MCInstrDesc & getDesc() const
Returns the target instruction descriptor of this MachineInstr.
bool isMemOp(const MachineInstr &MI) const
MachineBasicBlock reference.
unsigned getCompoundOpcode(const MachineInstr &GA, const MachineInstr &GB) const
const char * getSymbolName() const
bool isNewValue(const MachineInstr &MI) const
bool isTailCall(const MachineInstr &MI) const override
MachineInstrBundleIterator< const MachineInstr > const_iterator
const int Hexagon_MEMV_AUTOINC_MIN
bool usePredicatedCalls() const
const int Hexagon_MEMD_OFFSET_MAX
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_range< mop_iterator > operands()
return AArch64::GPR64RegClass contains(Reg)
iterator_range< succ_iterator > successors()
bool isVecAcc(const MachineInstr &MI) const
ScheduleHazardRecognizer * CreateTargetPostRAHazardRecognizer(const InstrItineraryData *, const ScheduleDAG *DAG) const override
Allocate and return a hazard recognizer to use for this target when scheduling the machine instructio...
MachineFunction & MF
Machine function.
StringRef getCommentString() const
bool isLateInstrFeedsEarlyInstr(const MachineInstr &LRMI, const MachineInstr &ESMI) 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...
static cl::opt< bool > BranchRelaxAsmLarge("branch-relax-asm-large", cl::init(true), cl::Hidden, cl::ZeroOrMore, cl::desc("branch relax asm"))
bool isJTI() const
isJTI - Tests if this is a MO_JumpTableIndex operand.
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."))
bool isAbsoluteSet(const MachineInstr &MI) const
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...
HexagonII::SubInstructionGroup getDuplexCandidateGroup(const MachineInstr &MI) const
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
MCSuperRegIterator enumerates all super-registers of Reg.
const HexagonInstrInfo * TII
bool isExpr(unsigned OpType) const
bool isDependent(const MachineInstr &ProdMI, const MachineInstr &ConsMI) const
static bool is_TC2(unsigned SchedClass)
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
const InstrStage * beginStage(unsigned ItinClassIndx) const
Return the first stage of the itinerary.
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.
bool isTC4x(const MachineInstr &MI) const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
bool isReg() const
isReg - Tests if this is a MO_Register operand.
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
bool mayLoad(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly read memory.
short getAbsoluteForm(const MachineInstr &MI) const
Name of external global symbol.
Reg
All possible values of the reg field in the ModR/M byte.
static StringRef getName(Value *V)
bool isSpillPredRegOp(const MachineInstr &MI) const
unsigned getUnits() const
Returns the choice of FUs.
bool isLateResultInstr(const MachineInstr &MI) const
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
short xformRegToImmOffset(const MachineInstr &MI) const
bool isTerminator() const
Returns true if this instruction part of the terminator for a basic block.
bool predOpcodeHasNot(ArrayRef< MachineOperand > Cond) const
const int Hexagon_MEMH_AUTOINC_MIN
bool isHVXMemWithAIndirect(const MachineInstr &I, const MachineInstr &J) const
bool isLoopN(const MachineInstr &MI) const
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, uint64_t s, unsigned base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
const int Hexagon_MEMB_AUTOINC_MAX
int getMaxValue(const MachineInstr &MI) const
virtual const InstrItineraryData * getInstrItineraryData() const
getInstrItineraryData - Returns instruction itinerary data for the target or specific subtarget...
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
INLINEASM - Represents an inline asm block.
static MachineInstr * findLoopInstr(MachineBasicBlock *BB, unsigned EndLoopOp, MachineBasicBlock *TargetBB, SmallPtrSet< MachineBasicBlock *, 8 > &Visited)
Find the hardware loop instruction used to set-up the specified loop.
LLVM_NODISCARD bool empty() const
unsigned getNumOperands() const
Access to explicit operands of the instruction.
bool isPredicable() const
Return true if this instruction has a predicate operand that controls execution.
bool isCPI() const
isCPI - Tests if this is a MO_ConstantPoolIndex operand.
bool expandPostRAPseudo(MachineInstr &MI) const override
This function is called for all pseudo instructions that remain after register allocation.
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
bool PredicateInstruction(MachineInstr &MI, ArrayRef< MachineOperand > Cond) const override
Convert the instruction into a predicated instruction.
void RemoveOperand(unsigned i)
Erase an operand from an instruction, leaving it with one fewer operand than it started with...
const HexagonRegisterInfo & getRegisterInfo() const
HexagonInstrInfo specifics.
void genAllInsnTimingClasses(MachineFunction &MF) const
bool isFI() const
isFI - Tests if this is a MO_FrameIndex operand.
MO_GOT - This flag indicates that a symbol operand represents the address of the GOT entry for the sy...
bool isComplex(const MachineInstr &MI) const
bool isAccumulator(const MachineInstr &MI) const
bool canExecuteInBundle(const MachineInstr &First, const MachineInstr &Second) const
Can these instructions execute at the same time in a bundle.
bool isPredictedTaken(unsigned Opcode) const
unsigned nonDbgBundleSize(MachineBasicBlock::const_iterator BundleHead) const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
const int Hexagon_MEMD_AUTOINC_MIN
unsigned getInstrTimingClassLatency(const InstrItineraryData *ItinData, const MachineInstr &MI) const
Itinerary data supplied by a subtarget to be used by a target.
bool isSaveCalleeSavedRegsCall(const MachineInstr &MI) const
bool invertAndChangeJumpTarget(MachineInstr &MI, MachineBasicBlock *NewTarget) const
bool isEarlySourceInstr(const MachineInstr &MI) const
const int Hexagon_MEMV_AUTOINC_MAX
unsigned getInvertedPredicatedOpcode(const int Opc) const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
Printable PrintReg(unsigned Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubRegIdx=0)
Prints virtual and physical registers with or without a TRI instance.
unsigned getUndefRegState(bool B)
HexagonII::CompoundGroup getCompoundCandidateGroup(const MachineInstr &MI) const
unsigned getInstrLatency(const InstrItineraryData *ItinData, const MachineInstr &MI, unsigned *PredCost=nullptr) const override
Compute the instruction latency of a given instruction.
bool isJumpR(const MachineInstr &MI) const
size_t size() const
size - Get the array size.
const int Hexagon_MEMW_AUTOINC_MAX
reverse_iterator rbegin()
BasicBlockListType::iterator iterator
unsigned getKillRegState(bool B)
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const int Hexagon_MEMD_OFFSET_MIN
int getNonDotCurOp(const MachineInstr &MI) const
const MachineBasicBlock * getParent() const
TargetInstrInfo - Interface to description of machine instruction set.
static bool is_TC4x(unsigned SchedClass)
bool isDebugValue() const
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"))
mmo_iterator memoperands_end() const
INITIALIZE_PASS(HexagonEarlyIfConversion,"hexagon-eif","Hexagon early if conversion", false, false) bool HexagonEarlyIfConversion MachineBasicBlock * SB
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...
bool isVecALU(const MachineInstr &MI) const
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
Address of a global value.
initializer< Ty > init(const Ty &Val)
unsigned getTargetFlags() const
bool isReturn(QueryType Type=AnyInBundle) const
const MachineInstrBuilder & setMemRefs(MachineInstr::mmo_iterator b, MachineInstr::mmo_iterator e) const
const int Hexagon_MEMW_OFFSET_MAX
Constants for Hexagon instructions.
const int Hexagon_MEMH_AUTOINC_MAX
unsigned getCExtOpNum(const MachineInstr &MI) const
unsigned const MachineRegisterInfo * MRI
int getDotNewPredOp(const MachineInstr &MI, const MachineBranchProbabilityInfo *MBPI) const
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 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...
bool reversePredSense(MachineInstr &MI) const
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
MachineInstrBuilder & UseMI
bool isPredicable(const MachineInstr &MI) const override
Return true if the specified instruction can be predicated.
bool isLateSourceInstr(const MachineInstr &MI) const
void addLiveOuts(const MachineBasicBlock &MBB)
Adds all live-out registers of basic block MBB.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
int findRegisterDefOperandIdx(unsigned Reg, bool isDead=false, bool Overlap=false, const TargetRegisterInfo *TRI=nullptr) const
Returns the operand index that is a def of the specified register or -1 if it is not found...
DebugLoc findDebugLoc(instr_iterator MBBI)
Find the next valid DebugLoc starting at MBBI, skipping any DBG_VALUE instructions.
const MachineOperand & getOperand(unsigned i) 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 isNewValueStore(const MachineInstr &MI) const
unsigned getSize() const
Return the number of bytes in the encoding of this instruction, or zero if the encoding size cannot b...
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
unsigned getStageLatency(unsigned ItinClassIndx) const
Return the total stage latency of the given class.
bool isIndirectBranch(QueryType Type=AnyInBundle) const
Return true if this is an indirect branch, such as a branch through a register.
void setMBB(MachineBasicBlock *MBB)
void stepBackward(const MachineInstr &MI)
Simulates liveness when stepping backwards over an instruction(bundle).
unsigned getNumExplicitOperands() const
Returns the number of non-implicit operands.
bool isSymbol() const
isSymbol - Tests if this is a MO_ExternalSymbol operand.
LLVM_NODISCARD size_t count(char C) const
Return the number of occurrences of C in the string.
Address of a basic block.
static bool isDblRegForSubInst(unsigned Reg, const HexagonRegisterInfo &HRI)
unsigned getSize(const MachineInstr &MI) const
void setImm(int64_t immVal)
unsigned createVR(MachineFunction *MF, MVT VT) const
bool hasUnmodeledSideEffects() const
Return true if this instruction has side effects that are not modeled by mayLoad / mayStore...
int64_t getOffset() const
Return the offset from the symbol in this operand.
self_iterator getIterator()
bool isVecUsableNextPacket(const MachineInstr &ProdMI, const MachineInstr &ConsMI) const
iterator_range< pred_iterator > predecessors()
bool empty() const
empty - Check if the array is empty.
bool isTC2(const MachineInstr &MI) const
unsigned getSubReg() const
bool isToBeScheduledASAP(const MachineInstr &MI1, const MachineInstr &MI2) const
bool isDotCurInst(const MachineInstr &MI) const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
bool isExtended(const MachineInstr &MI) const
MCSubRegIterator enumerates all sub-registers of Reg.
This file implements the LivePhysRegs utility for tracking liveness of physical registers.
bool getPredReg(ArrayRef< MachineOperand > Cond, unsigned &PredReg, unsigned &PredRegPos, unsigned &PredRegFlags) const
cl::opt< bool > ScheduleInlineAsm("hexagon-sched-inline-asm", cl::Hidden, cl::init(false), cl::desc("Do not consider inline-asm a scheduling/""packetization boundary."))
bool isPostIncrement(const MachineInstr &MI) const override
Return true for post-incremented instructions.
MO_LO16 - On a symbol operand, this represents a relocation containing lower 16 bit of the address...
bool hasUncondBranch(const MachineBasicBlock *B) const
bool hasNonExtEquivalent(const MachineInstr &MI) const
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 isRegMask() const
isRegMask - Tests if this is a MO_RegisterMask operand.
unsigned getOpcode() const
Return the opcode number for this descriptor.
The memory access writes data.
short getEquivalentHWInstr(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 readsRegister(unsigned Reg, const TargetRegisterInfo *TRI=nullptr) const
Return true if the MachineInstr reads the specified register.
unsigned getMemAccessSize(const MachineInstr &MI) const
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 isZeroExtendingLoad(const MachineInstr &MI) const
static bool isIntRegForSubInst(unsigned Reg)
bool hasEHLabel(const MachineBasicBlock *B) const
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...
Iterator for intrusive lists based on ilist_node.
SmallVectorImpl< T >::const_pointer c_str(SmallVectorImpl< T > &str)
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
void setDesc(const MCInstrDesc &tid)
Replace the instruction descriptor (thus opcode) of the current instruction with a new one...
void substituteRegister(unsigned FromReg, unsigned ToReg, unsigned SubIdx, const TargetRegisterInfo &RegInfo)
Replace all occurrences of FromReg with ToReg:SubIdx, properly composing subreg indices where necessa...
const int Hexagon_MEMW_AUTOINC_MIN
HexagonInstrInfo(HexagonSubtarget &ST)
void addOperand(MachineFunction &MF, const MachineOperand &Op)
Add the specified operand to the instruction.
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 predCanBeUsedAsDotNew(const MachineInstr &MI, unsigned PredReg) const
MachineOperand class - Representation of each machine instruction operand.
unsigned getObjectAlignment(int ObjectIdx) const
Return the alignment of the specified stack object.
bool isCompoundBranchInstr(const MachineInstr &MI) const
int getCondOpcode(int Opc, bool sense) const
bool addLatencyToSchedule(const MachineInstr &MI1, const MachineInstr &MI2) const
bool isTC2Early(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...
bool mayLoad() const
Return true if this instruction could possibly read memory.
instr_iterator getInstrIterator() 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.
bool isMBB() const
isMBB - Tests if this is a MO_MachineBasicBlock operand.
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...
const MachineInstrBuilder & addFrameIndex(int Idx) const
bool isTransient() const
Return true if this is a transient instruction that is either very likely to be eliminated during reg...
bool isCompare(QueryType Type=IgnoreBundle) const
Return true if this instruction is a comparison.
unsigned getInlineAsmLength(const char *Str, const MCAsmInfo &MAI) const override
Measure the specified inline asm to determine an approximation of its length.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
bool isFPImm() const
isFPImm - Tests if this is a MO_FPImmediate operand.
static bool isDuplexPairMatch(unsigned Ga, unsigned Gb)
bool getInvertedPredSense(SmallVectorImpl< MachineOperand > &Cond) const
unsigned getBaseAndOffset(const MachineInstr &MI, int &Offset, unsigned &AccessSize) const
unsigned const TypeCVI_FIRST
bool isSchedulingBoundary(const MachineInstr &MI, const MachineBasicBlock *MBB, const MachineFunction &MF) const override
Test if the given instruction should be considered a scheduling boundary.
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
bool isEndLoopN(unsigned Opcode) const
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
Remove the branching code at the end of the specific MBB.
unsigned const TypeCVI_LAST
bool isSignExtendingLoad(const MachineInstr &MI) const
unsigned isLoadFromStackSlot(const MachineInstr &MI, int &FrameIndex) const override
TargetInstrInfo overrides.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
bool isPredicatedNew(const MachineInstr &MI) const
bool isDeallocRet(const MachineInstr &MI) const
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
llvm_unreachable("Unknown RegBank!")
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.
bool isFloat(const MachineInstr &MI) const
static std::vector< std::string > Flags
Representation of each machine instruction.
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
bool isHVXVec(const MachineInstr &MI) const
unsigned getAddrMode(const MachineInstr &MI) const
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
unsigned getSchedClass() const
Return the scheduling class for this instruction.
void addTargetFlag(unsigned F)
bool isDotNewInst(const MachineInstr &MI) const
static unsigned nonDbgMICount(MachineBasicBlock::const_instr_iterator MIB, MachineBasicBlock::const_instr_iterator MIE)
Calculate number of instructions excluding the debug instructions.
unsigned nonDbgBBSize(const MachineBasicBlock *BB) const
getInstrTimingClassLatency - Compute the instruction latency of a given instruction using Timing Clas...
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...
bool isValidAutoIncImm(const EVT VT, const int Offset) const
bool isExtendable(const MachineInstr &MI) const
int getDotNewOp(const MachineInstr &MI) const
short getRegForm(const MachineInstr &MI) const
These values represent a non-pipelined step in the execution of an instruction.
Represents a single loop in the control flow graph.
short getBaseWithRegOffset(const MachineInstr &MI) const
const char * getSeparatorString() const
const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const
static MachineOperand CreateImm(int64_t Val)
bool isCall(QueryType Type=AnyInBundle) const
void immediateExtend(MachineInstr &MI) const
immediateExtend - Changes the instruction in place to one using an immediate extender.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
void clearKillFlags(unsigned Reg) const
clearKillFlags - Iterate over all the uses of the given register and clear the kill flag from the Mac...
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
virtual int getOperandLatency(const InstrItineraryData *ItinData, SDNode *DefNode, unsigned DefIdx, SDNode *UseNode, unsigned UseIdx) const
const int Hexagon_MEMW_OFFSET_MIN
SmallVector< MachineInstr *, 2 > getBranchingInstrs(MachineBasicBlock &MBB) const
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
int getDotCurOp(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 mayBeNewStore(const MachineInstr &MI) const
Instructions::iterator instr_iterator
bool isSolo(const MachineInstr &MI) const
const std::string to_string(const T &Value)
unsigned getReg() const
getReg - Returns the register number.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool isBranch(unsigned Opcode)
bool doesNotReturn(const MachineInstr &CallMI) const
bool producesStall(const MachineInstr &ProdMI, const MachineInstr &ConsMI) const
bool isOperandExtended(const MachineInstr &MI, unsigned OperandNum) const
#define HEXAGON_INSTR_SIZE
virtual const TargetInstrInfo * getInstrInfo() const
LLVM Value Representation.
const int Hexagon_MEMV_AUTOINC_MIN_128B
unsigned getMaxInstLength() const
bool mayBeCurLoad(const MachineInstr &MI) const
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned char TargetFlags=0) const
bool available(const MachineRegisterInfo &MRI, unsigned Reg) const
Returns true if register Reg and no aliasing register is in the set.
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.
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).
static cl::opt< bool > EnableTimingClassLatency("enable-timing-class-latency", cl::Hidden, cl::init(false), cl::desc("Enable timing class latency"))
int getMinValue(const MachineInstr &MI) const
StringRef - Represent a constant reference to a string, i.e.
Address of indexed Constant in Constant Pool.
const int Hexagon_MEMD_AUTOINC_MAX
const int Hexagon_MEMV_AUTOINC_MAX_128B
MachineBasicBlock::instr_iterator getBundleEnd(MachineBasicBlock::instr_iterator I)
Returns an iterator pointing beyond the bundle containing I.
BranchProbability getEdgeProbability(const MachineBasicBlock *Src, const MachineBasicBlock *Dst) 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.
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 isValidOffset(unsigned Opcode, int Offset, bool Extend=true) const
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
const int Hexagon_MEMB_AUTOINC_MIN
bool analyzeLoop(MachineLoop &L, MachineInstr *&IndVarInst, MachineInstr *&CmpInst) const override
Analyze the loop code, return true if it cannot be understood.
bool isConstExtended(const MachineInstr &MI) const
Instructions::const_iterator const_instr_iterator
bool areMemAccessesTriviallyDisjoint(MachineInstr &MIa, MachineInstr &MIb, AliasAnalysis *AA=nullptr) const override
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
bool modifiesRegister(unsigned Reg, const TargetRegisterInfo *TRI) const
Return true if the MachineInstr modifies (fully define or partially define) the specified register...
uint64_t getType(const MachineInstr &MI) const
MO_HI16 - On a symbol operand, this represents a relocation containing higher 16 bit of the address...
const int Hexagon_MEMB_OFFSET_MIN
unsigned getUnits(const MachineInstr &MI) const
bool isNewValueJump(const MachineInstr &MI) const
mmo_iterator memoperands_begin() const
Access to memory operands of the instruction.
int getDotNewPredJumpOp(const MachineInstr &MI, const MachineBranchProbabilityInfo *MBPI) const