64 #define DEBUG_TYPE "hexagon-instrinfo" 66 #define GET_INSTRINFO_CTOR_DTOR 67 #define GET_INSTRMAP_INFO 69 #include "HexagonGenDFAPacketizer.inc" 70 #include "HexagonGenInstrInfo.inc" 74 "packetization boundary."));
81 cl::desc(
"Disable schedule adjustment for new value stores."));
85 cl::desc(
"Enable timing class latency"));
89 cl::desc(
"Enable vec alu forwarding"));
93 cl::desc(
"Enable vec acc forwarding"));
100 cl::desc(
"Use the DFA based hazard recognizer."));
115 void HexagonInstrInfo::anchor() {}
122 return (Reg >= Hexagon::R0 && Reg <= Hexagon::R7) ||
123 (Reg >= Hexagon::R16 && Reg <= Hexagon::R23);
135 for (; MIB != MIE; ++MIB) {
136 if (!MIB->isDebugInstr())
151 if (EndLoopOp == Hexagon::ENDLOOP0) {
152 LOOPi = Hexagon::J2_loop0i;
153 LOOPr = Hexagon::J2_loop0r;
155 LOOPi = Hexagon::J2_loop1i;
156 LOOPr = Hexagon::J2_loop1r;
162 if (!Visited.
insert(PB).second)
166 for (
auto I = PB->instr_rbegin(),
E = PB->instr_rend();
I !=
E; ++
I) {
167 unsigned Opc =
I->getOpcode();
168 if (Opc == LOOPi || Opc == LOOPr)
172 if (Opc == EndLoopOp &&
I->getOperand(0).getMBB() != TargetBB)
244 case Hexagon::L2_loadri_io:
245 case Hexagon::L2_loadrd_io:
246 case Hexagon::V6_vL32b_ai:
247 case Hexagon::V6_vL32b_nt_ai:
248 case Hexagon::V6_vL32Ub_ai:
249 case Hexagon::LDriw_pred:
250 case Hexagon::LDriw_ctr:
251 case Hexagon::PS_vloadrq_ai:
252 case Hexagon::PS_vloadrw_ai:
253 case Hexagon::PS_vloadrw_nt_ai: {
264 case Hexagon::L2_ploadrit_io:
265 case Hexagon::L2_ploadrif_io:
266 case Hexagon::L2_ploadrdt_io:
267 case Hexagon::L2_ploadrdf_io: {
292 case Hexagon::S2_storerb_io:
293 case Hexagon::S2_storerh_io:
294 case Hexagon::S2_storeri_io:
295 case Hexagon::S2_storerd_io:
296 case Hexagon::V6_vS32b_ai:
297 case Hexagon::V6_vS32Ub_ai:
298 case Hexagon::STriw_pred:
299 case Hexagon::STriw_ctr:
300 case Hexagon::PS_vstorerq_ai:
301 case Hexagon::PS_vstorerw_ai: {
312 case Hexagon::S2_pstorerbt_io:
313 case Hexagon::S2_pstorerbf_io:
314 case Hexagon::S2_pstorerht_io:
315 case Hexagon::S2_pstorerhf_io:
316 case Hexagon::S2_pstorerit_io:
317 case Hexagon::S2_pstorerif_io:
318 case Hexagon::S2_pstorerdt_io:
319 case Hexagon::S2_pstorerdf_io: {
343 for (++MII; MII != MBB->
instr_end() && MII->isInsideBundle(); ++MII)
361 for (++MII; MII != MBB->
instr_end() && MII->isInsideBundle(); ++MII)
389 bool AllowModify)
const {
421 while (I->isDebugInstr()) {
427 bool JumpToBlock = I->getOpcode() == Hexagon::J2_jump &&
428 I->getOperand(0).isMBB();
430 if (AllowModify && JumpToBlock &&
433 I->eraseFromParent();
439 if (!isUnpredicatedTerminator(*I))
447 if (&*I != LastInst && !I->
isBundle() && isUnpredicatedTerminator(*I)) {
449 SecondLastInst = &*
I;
460 int SecLastOpcode = SecondLastInst ? SecondLastInst->
getOpcode() : 0;
463 if (LastOpcode == Hexagon::J2_jump && !LastInst->
getOperand(0).
isMBB())
465 if (SecLastOpcode == Hexagon::J2_jump &&
476 if (LastInst && !SecondLastInst) {
477 if (LastOpcode == Hexagon::J2_jump) {
487 if (LastOpcodeHasJMP_c) {
502 <<
" with one jump\n";);
509 if (SecLastOpcodeHasJMP_c && (LastOpcode == Hexagon::J2_jump)) {
520 if (SecLastOpcodeHasNVJump &&
522 (LastOpcode == Hexagon::J2_jump)) {
533 if (SecLastOpcode == Hexagon::J2_jump && LastOpcode == Hexagon::J2_jump) {
537 I->eraseFromParent();
542 if (
isEndLoopN(SecLastOpcode) && LastOpcode == Hexagon::J2_jump) {
550 <<
" with two jumps";);
556 int *BytesRemoved)
const {
557 assert(!BytesRemoved &&
"code size not handled");
562 while (I != MBB.
begin()) {
564 if (I->isDebugInstr())
569 if (Count && (I->getOpcode() == Hexagon::J2_jump))
583 int *BytesAdded)
const {
584 unsigned BOpc = Hexagon::J2_jump;
585 unsigned BccOpc = Hexagon::J2_jumpt;
587 assert(TBB &&
"insertBranch must not be told to insert a fallthrough");
588 assert(!BytesAdded &&
"code size not handled");
593 if (!Cond.
empty() && Cond[0].isImm())
594 BccOpc = Cond[0].getImm();
614 int EndLoopOp = Cond[0].getImm();
621 assert(Loop !=
nullptr &&
"Inserting an ENDLOOP without a LOOP");
626 assert((Cond.
size() == 3) &&
"Only supporting rr/ri version of nvjump");
633 if (Cond[2].
isReg()) {
637 }
else if(Cond[2].isImm()) {
639 addImm(Cond[2].getImm()).
addMBB(TBB);
643 assert((Cond.
size() == 2) &&
"Malformed cond vector");
651 "Cond. cannot be empty when multiple branchings are required");
653 "NV-jump cannot be inserted with another branch");
656 int EndLoopOp = Cond[0].getImm();
663 assert(Loop !=
nullptr &&
"Inserting an ENDLOOP without a LOOP");
693 TripCount = Loop->
getOpcode() == Hexagon::J2_loop0r
700 bool shouldIgnoreForPipelining(
const MachineInstr *
MI)
const override {
702 return MI == EndLoop;
708 if (TripCount == -1) {
712 TII->get(Hexagon::C2_cmpgtui), Done)
720 return TripCount > TC;
728 void adjustTripCount(
int TripCountAdjust)
override {
731 if (Loop->
getOpcode() == Hexagon::J2_loop0i ||
732 Loop->
getOpcode() == Hexagon::J2_loop1i) {
734 assert(TripCount > 0 &&
"Can't create an empty or negative loop!");
744 TII->get(Hexagon::A2_addi), NewLoopCount)
754 std::unique_ptr<TargetInstrInfo::PipelinerLoopInfo>
762 LoopBB, I->getOpcode(), I->getOperand(0).getMBB(), VisitedBBs);
764 return std::make_unique<HexagonPipelinerLoopInfo>(LoopInst, &*
I);
770 unsigned NumCycles,
unsigned ExtraPredCycles,
784 return NumInstrs <= 4;
794 if (Hexagon::IntRegsRegClass.
contains(SrcReg, DestReg)) {
795 BuildMI(MBB, I, DL,
get(Hexagon::A2_tfr), DestReg)
796 .
addReg(SrcReg, KillFlag);
799 if (Hexagon::DoubleRegsRegClass.
contains(SrcReg, DestReg)) {
800 BuildMI(MBB, I, DL,
get(Hexagon::A2_tfrp), DestReg)
801 .
addReg(SrcReg, KillFlag);
804 if (Hexagon::PredRegsRegClass.
contains(SrcReg, DestReg)) {
806 BuildMI(MBB, I, DL,
get(Hexagon::C2_or), DestReg)
810 if (Hexagon::CtrRegsRegClass.
contains(DestReg) &&
811 Hexagon::IntRegsRegClass.
contains(SrcReg)) {
812 BuildMI(MBB, I, DL,
get(Hexagon::A2_tfrrcr), DestReg)
813 .
addReg(SrcReg, KillFlag);
816 if (Hexagon::IntRegsRegClass.
contains(DestReg) &&
817 Hexagon::CtrRegsRegClass.
contains(SrcReg)) {
818 BuildMI(MBB, I, DL,
get(Hexagon::A2_tfrcrr), DestReg)
819 .
addReg(SrcReg, KillFlag);
822 if (Hexagon::ModRegsRegClass.
contains(DestReg) &&
823 Hexagon::IntRegsRegClass.
contains(SrcReg)) {
824 BuildMI(MBB, I, DL,
get(Hexagon::A2_tfrrcr), DestReg)
825 .
addReg(SrcReg, KillFlag);
828 if (Hexagon::PredRegsRegClass.
contains(SrcReg) &&
829 Hexagon::IntRegsRegClass.
contains(DestReg)) {
830 BuildMI(MBB, I, DL,
get(Hexagon::C2_tfrpr), DestReg)
831 .
addReg(SrcReg, KillFlag);
834 if (Hexagon::IntRegsRegClass.
contains(SrcReg) &&
835 Hexagon::PredRegsRegClass.
contains(DestReg)) {
836 BuildMI(MBB, I, DL,
get(Hexagon::C2_tfrrp), DestReg)
837 .
addReg(SrcReg, KillFlag);
840 if (Hexagon::PredRegsRegClass.
contains(SrcReg) &&
841 Hexagon::IntRegsRegClass.
contains(DestReg)) {
842 BuildMI(MBB, I, DL,
get(Hexagon::C2_tfrpr), DestReg)
843 .
addReg(SrcReg, KillFlag);
846 if (Hexagon::HvxVRRegClass.
contains(SrcReg, DestReg)) {
847 BuildMI(MBB, I, DL,
get(Hexagon::V6_vassign), DestReg).
848 addReg(SrcReg, KillFlag);
851 if (Hexagon::HvxWRRegClass.
contains(SrcReg, DestReg)) {
852 Register LoSrc = HRI.getSubReg(SrcReg, Hexagon::vsub_lo);
853 Register HiSrc = HRI.getSubReg(SrcReg, Hexagon::vsub_hi);
854 BuildMI(MBB, I, DL,
get(Hexagon::V6_vcombine), DestReg)
859 if (Hexagon::HvxQRRegClass.
contains(SrcReg, DestReg)) {
860 BuildMI(MBB, I, DL,
get(Hexagon::V6_pred_and), DestReg)
862 .
addReg(SrcReg, KillFlag);
865 if (Hexagon::HvxQRRegClass.
contains(SrcReg) &&
866 Hexagon::HvxVRRegClass.
contains(DestReg)) {
870 if (Hexagon::HvxQRRegClass.
contains(DestReg) &&
871 Hexagon::HvxVRRegClass.
contains(SrcReg)) {
897 if (Hexagon::IntRegsRegClass.hasSubClassEq(RC)) {
898 BuildMI(MBB, I, DL,
get(Hexagon::S2_storeri_io))
901 }
else if (Hexagon::DoubleRegsRegClass.hasSubClassEq(RC)) {
902 BuildMI(MBB, I, DL,
get(Hexagon::S2_storerd_io))
905 }
else if (Hexagon::PredRegsRegClass.hasSubClassEq(RC)) {
906 BuildMI(MBB, I, DL,
get(Hexagon::STriw_pred))
909 }
else if (Hexagon::ModRegsRegClass.hasSubClassEq(RC)) {
910 BuildMI(MBB, I, DL,
get(Hexagon::STriw_ctr))
913 }
else if (Hexagon::HvxQRRegClass.hasSubClassEq(RC)) {
914 BuildMI(MBB, I, DL,
get(Hexagon::PS_vstorerq_ai))
917 }
else if (Hexagon::HvxVRRegClass.hasSubClassEq(RC)) {
918 BuildMI(MBB, I, DL,
get(Hexagon::PS_vstorerv_ai))
921 }
else if (Hexagon::HvxWRRegClass.hasSubClassEq(RC)) {
922 BuildMI(MBB, I, DL,
get(Hexagon::PS_vstorerw_ai))
943 if (Hexagon::IntRegsRegClass.hasSubClassEq(RC)) {
944 BuildMI(MBB, I, DL,
get(Hexagon::L2_loadri_io), DestReg)
946 }
else if (Hexagon::DoubleRegsRegClass.hasSubClassEq(RC)) {
947 BuildMI(MBB, I, DL,
get(Hexagon::L2_loadrd_io), DestReg)
949 }
else if (Hexagon::PredRegsRegClass.hasSubClassEq(RC)) {
950 BuildMI(MBB, I, DL,
get(Hexagon::LDriw_pred), DestReg)
952 }
else if (Hexagon::ModRegsRegClass.hasSubClassEq(RC)) {
953 BuildMI(MBB, I, DL,
get(Hexagon::LDriw_ctr), DestReg)
955 }
else if (Hexagon::HvxQRRegClass.hasSubClassEq(RC)) {
956 BuildMI(MBB, I, DL,
get(Hexagon::PS_vloadrq_ai), DestReg)
958 }
else if (Hexagon::HvxVRRegClass.hasSubClassEq(RC)) {
959 BuildMI(MBB, I, DL,
get(Hexagon::PS_vloadrv_ai), DestReg)
961 }
else if (Hexagon::HvxWRRegClass.hasSubClassEq(RC)) {
962 BuildMI(MBB, I, DL,
get(Hexagon::PS_vloadrw_ai), DestReg)
991 auto RealCirc = [&](
unsigned Opc,
bool HasImm,
unsigned MxOp) {
993 unsigned CSx = (Mx == Hexagon::M0 ? Hexagon::CS0 : Hexagon::CS1);
994 BuildMI(MBB, MI, DL,
get(Hexagon::A2_tfrrcr), CSx)
1005 auto UseAligned = [&] (
const MachineInstr &
MI,
unsigned NeedAlign) {
1010 return NeedAlign <= MMO->getAlignment();
1015 case TargetOpcode::COPY: {
1021 std::prev(MBBI)->copyImplicitOps(*MBB.
getParent(),
MI);
1026 case Hexagon::PS_aligna:
1032 case Hexagon::V6_vassignp: {
1036 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vcombine), DstReg)
1037 .
addReg(HRI.getSubReg(SrcReg, Hexagon::vsub_hi),
Kill)
1038 .addReg(HRI.getSubReg(SrcReg, Hexagon::vsub_lo),
Kill);
1042 case Hexagon::V6_lo: {
1045 Register SrcSubLo = HRI.getSubReg(SrcReg, Hexagon::vsub_lo);
1051 case Hexagon::V6_hi: {
1054 Register SrcSubHi = HRI.getSubReg(SrcReg, Hexagon::vsub_hi);
1060 case Hexagon::PS_vloadrv_ai: {
1065 unsigned NeedAlign = HRI.getSpillAlignment(Hexagon::HvxVRRegClass);
1066 unsigned NewOpc = UseAligned(MI, NeedAlign) ? Hexagon::V6_vL32b_ai
1067 : Hexagon::V6_vL32Ub_ai;
1068 BuildMI(MBB, MI, DL,
get(NewOpc), DstReg)
1075 case Hexagon::PS_vloadrw_ai: {
1080 unsigned VecOffset = HRI.getSpillSize(Hexagon::HvxVRRegClass);
1081 unsigned NeedAlign = HRI.getSpillAlignment(Hexagon::HvxVRRegClass);
1082 unsigned NewOpc = UseAligned(MI, NeedAlign) ? Hexagon::V6_vL32b_ai
1083 : Hexagon::V6_vL32Ub_ai;
1084 BuildMI(MBB, MI, DL,
get(NewOpc),
1085 HRI.getSubReg(DstReg, Hexagon::vsub_lo))
1089 BuildMI(MBB, MI, DL,
get(NewOpc),
1090 HRI.getSubReg(DstReg, Hexagon::vsub_hi))
1092 .addImm(Offset + VecOffset)
1097 case Hexagon::PS_vstorerv_ai: {
1101 assert(BaseOp.getSubReg() == 0);
1103 unsigned NeedAlign = HRI.getSpillAlignment(Hexagon::HvxVRRegClass);
1104 unsigned NewOpc = UseAligned(MI, NeedAlign) ? Hexagon::V6_vS32b_ai
1105 : Hexagon::V6_vS32Ub_ai;
1106 BuildMI(MBB, MI, DL,
get(NewOpc))
1114 case Hexagon::PS_vstorerw_ai: {
1119 unsigned VecOffset = HRI.getSpillSize(Hexagon::HvxVRRegClass);
1120 unsigned NeedAlign = HRI.getSpillAlignment(Hexagon::HvxVRRegClass);
1121 unsigned NewOpc = UseAligned(MI, NeedAlign) ? Hexagon::V6_vS32b_ai
1122 : Hexagon::V6_vS32Ub_ai;
1123 BuildMI(MBB, MI, DL,
get(NewOpc))
1126 .
addReg(HRI.getSubReg(SrcReg, Hexagon::vsub_lo))
1128 BuildMI(MBB, MI, DL,
get(NewOpc))
1130 .addImm(Offset + VecOffset)
1131 .
addReg(HRI.getSubReg(SrcReg, Hexagon::vsub_hi))
1136 case Hexagon::PS_true: {
1138 BuildMI(MBB, MI, DL,
get(Hexagon::C2_orn), Reg)
1144 case Hexagon::PS_false: {
1146 BuildMI(MBB, MI, DL,
get(Hexagon::C2_andn), Reg)
1152 case Hexagon::PS_qtrue: {
1159 case Hexagon::PS_qfalse: {
1166 case Hexagon::PS_vdd0: {
1168 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vsubw_dv), Vd)
1174 case Hexagon::PS_vmulw: {
1179 Register Src1SubHi = HRI.getSubReg(Src1Reg, Hexagon::isub_hi);
1180 Register Src1SubLo = HRI.getSubReg(Src1Reg, Hexagon::isub_lo);
1181 Register Src2SubHi = HRI.getSubReg(Src2Reg, Hexagon::isub_hi);
1182 Register Src2SubLo = HRI.getSubReg(Src2Reg, Hexagon::isub_lo);
1184 HRI.getSubReg(DstReg, Hexagon::isub_hi))
1188 HRI.getSubReg(DstReg, Hexagon::isub_lo))
1198 case Hexagon::PS_vmulw_acc: {
1204 Register Src1SubHi = HRI.getSubReg(Src1Reg, Hexagon::isub_hi);
1205 Register Src1SubLo = HRI.getSubReg(Src1Reg, Hexagon::isub_lo);
1206 Register Src2SubHi = HRI.getSubReg(Src2Reg, Hexagon::isub_hi);
1207 Register Src2SubLo = HRI.getSubReg(Src2Reg, Hexagon::isub_lo);
1208 Register Src3SubHi = HRI.getSubReg(Src3Reg, Hexagon::isub_hi);
1209 Register Src3SubLo = HRI.getSubReg(Src3Reg, Hexagon::isub_lo);
1211 HRI.getSubReg(DstReg, Hexagon::isub_hi))
1216 HRI.getSubReg(DstReg, Hexagon::isub_lo))
1229 case Hexagon::PS_pselect: {
1243 BuildMI(MBB, MI, DL,
get(Hexagon::A2_tfrpt), Rd)
1244 .
addReg(Pu, (Rd == Rt) ? K1 : 0)
1247 BuildMI(MBB, MI, DL,
get(Hexagon::A2_tfrpf), Rd)
1253 case Hexagon::PS_vselect: {
1268 auto T =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vcmov))
1277 auto T =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vncmov))
1287 case Hexagon::PS_wselect: {
1304 auto T =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vccombine))
1316 auto T =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vnccombine))
1328 case Hexagon::PS_crash: {
1344 void printCustom(
raw_ostream &OS)
const override {
1345 OS <<
"MisalignedCrash";
1349 static const CrashPseudoSourceValue CrashPSV(*
this);
1353 BuildMI(MBB, MI, DL,
get(Hexagon::PS_loadrdabs), Hexagon::D13)
1360 case Hexagon::PS_tailcall_i:
1361 MI.
setDesc(
get(Hexagon::J2_jump));
1363 case Hexagon::PS_tailcall_r:
1364 case Hexagon::PS_jmpret:
1365 MI.
setDesc(
get(Hexagon::J2_jumpr));
1367 case Hexagon::PS_jmprett:
1368 MI.
setDesc(
get(Hexagon::J2_jumprt));
1370 case Hexagon::PS_jmpretf:
1371 MI.
setDesc(
get(Hexagon::J2_jumprf));
1373 case Hexagon::PS_jmprettnewpt:
1374 MI.
setDesc(
get(Hexagon::J2_jumprtnewpt));
1376 case Hexagon::PS_jmpretfnewpt:
1377 MI.
setDesc(
get(Hexagon::J2_jumprfnewpt));
1379 case Hexagon::PS_jmprettnew:
1380 MI.
setDesc(
get(Hexagon::J2_jumprtnew));
1382 case Hexagon::PS_jmpretfnew:
1383 MI.
setDesc(
get(Hexagon::J2_jumprfnew));
1386 case Hexagon::PS_loadrub_pci:
1387 return RealCirc(Hexagon::L2_loadrub_pci,
true, 4);
1388 case Hexagon::PS_loadrb_pci:
1389 return RealCirc(Hexagon::L2_loadrb_pci,
true, 4);
1390 case Hexagon::PS_loadruh_pci:
1391 return RealCirc(Hexagon::L2_loadruh_pci,
true, 4);
1392 case Hexagon::PS_loadrh_pci:
1393 return RealCirc(Hexagon::L2_loadrh_pci,
true, 4);
1394 case Hexagon::PS_loadri_pci:
1395 return RealCirc(Hexagon::L2_loadri_pci,
true, 4);
1396 case Hexagon::PS_loadrd_pci:
1397 return RealCirc(Hexagon::L2_loadrd_pci,
true, 4);
1398 case Hexagon::PS_loadrub_pcr:
1399 return RealCirc(Hexagon::L2_loadrub_pcr,
false, 3);
1400 case Hexagon::PS_loadrb_pcr:
1401 return RealCirc(Hexagon::L2_loadrb_pcr,
false, 3);
1402 case Hexagon::PS_loadruh_pcr:
1403 return RealCirc(Hexagon::L2_loadruh_pcr,
false, 3);
1404 case Hexagon::PS_loadrh_pcr:
1405 return RealCirc(Hexagon::L2_loadrh_pcr,
false, 3);
1406 case Hexagon::PS_loadri_pcr:
1407 return RealCirc(Hexagon::L2_loadri_pcr,
false, 3);
1408 case Hexagon::PS_loadrd_pcr:
1409 return RealCirc(Hexagon::L2_loadrd_pcr,
false, 3);
1410 case Hexagon::PS_storerb_pci:
1411 return RealCirc(Hexagon::S2_storerb_pci,
true, 3);
1412 case Hexagon::PS_storerh_pci:
1413 return RealCirc(Hexagon::S2_storerh_pci,
true, 3);
1414 case Hexagon::PS_storerf_pci:
1415 return RealCirc(Hexagon::S2_storerf_pci,
true, 3);
1416 case Hexagon::PS_storeri_pci:
1417 return RealCirc(Hexagon::S2_storeri_pci,
true, 3);
1418 case Hexagon::PS_storerd_pci:
1419 return RealCirc(Hexagon::S2_storerd_pci,
true, 3);
1420 case Hexagon::PS_storerb_pcr:
1421 return RealCirc(Hexagon::S2_storerb_pcr,
false, 2);
1422 case Hexagon::PS_storerh_pcr:
1423 return RealCirc(Hexagon::S2_storerh_pcr,
false, 2);
1424 case Hexagon::PS_storerf_pcr:
1425 return RealCirc(Hexagon::S2_storerf_pcr,
false, 2);
1426 case Hexagon::PS_storeri_pcr:
1427 return RealCirc(Hexagon::S2_storeri_pcr,
false, 2);
1428 case Hexagon::PS_storerd_pcr:
1429 return RealCirc(Hexagon::S2_storerd_pcr,
false, 2);
1443 case Hexagon::V6_vgathermh_pseudo:
1444 First =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vgathermh))
1448 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vS32b_new_ai))
1455 case Hexagon::V6_vgathermw_pseudo:
1456 First =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vgathermw))
1460 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vS32b_new_ai))
1467 case Hexagon::V6_vgathermhw_pseudo:
1468 First =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vgathermhw))
1472 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vS32b_new_ai))
1479 case Hexagon::V6_vgathermhq_pseudo:
1480 First =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vgathermhq))
1485 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vS32b_new_ai))
1492 case Hexagon::V6_vgathermwq_pseudo:
1493 First =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vgathermwq))
1498 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vS32b_new_ai))
1505 case Hexagon::V6_vgathermhwq_pseudo:
1506 First =
BuildMI(MBB, MI, DL,
get(Hexagon::V6_vgathermhwq))
1511 BuildMI(MBB, MI, DL,
get(Hexagon::V6_vS32b_new_ai))
1528 assert(Cond[0].isImm() &&
"First entry in the cond vector not imm-val");
1529 unsigned opcode = Cond[0].getImm();
1531 assert(
get(opcode).
isBranch() &&
"Should be a branching condition.");
1535 Cond[0].setImm(NewOpcode);
1542 BuildMI(MBB, MI, DL,
get(Hexagon::A2_nop));
1583 while (NOp < NumOps) {
1591 unsigned PredReg, PredRegPos, PredRegFlags;
1592 bool GotPredReg =
getPredReg(Cond, PredReg, PredRegPos, PredRegFlags);
1595 T.
addReg(PredReg, PredRegFlags);
1596 while (NOp < NumOps)
1620 std::vector<MachineOperand> &Pred)
const {
1629 if (RC == &Hexagon::PredRegsRegClass) {
1635 for (
unsigned PR : Hexagon::PredRegsRegClass) {
1651 if (!Subtarget.usePredicatedCalls())
1656 if (!Subtarget.hasV62Ops()) {
1658 case Hexagon::V6_vL32b_ai:
1659 case Hexagon::V6_vL32b_pi:
1660 case Hexagon::V6_vL32b_ppu:
1661 case Hexagon::V6_vL32b_cur_ai:
1662 case Hexagon::V6_vL32b_cur_pi:
1663 case Hexagon::V6_vL32b_cur_ppu:
1664 case Hexagon::V6_vL32b_nt_ai:
1665 case Hexagon::V6_vL32b_nt_pi:
1666 case Hexagon::V6_vL32b_nt_ppu:
1667 case Hexagon::V6_vL32b_tmp_ai:
1668 case Hexagon::V6_vL32b_tmp_pi:
1669 case Hexagon::V6_vL32b_tmp_ppu:
1670 case Hexagon::V6_vL32b_nt_cur_ai:
1671 case Hexagon::V6_vL32b_nt_cur_pi:
1672 case Hexagon::V6_vL32b_nt_cur_ppu:
1673 case Hexagon::V6_vL32b_nt_tmp_ai:
1674 case Hexagon::V6_vL32b_nt_tmp_pi:
1675 case Hexagon::V6_vL32b_nt_tmp_ppu:
1731 bool atInsnStart =
true;
1732 unsigned Length = 0;
1734 for (; *Str; ++Str) {
1738 if (atInsnStart && !std::isspace(static_cast<unsigned char>(*Str))) {
1739 Length += MaxInstLength;
1740 atInsnStart =
false;
1744 atInsnStart =
false;
1749 Length += AStr.
count(Occ)*4;
1766 unsigned &SrcReg2,
int &
Mask,
1772 case Hexagon::C2_cmpeq:
1773 case Hexagon::C2_cmpeqp:
1774 case Hexagon::C2_cmpgt:
1775 case Hexagon::C2_cmpgtp:
1776 case Hexagon::C2_cmpgtu:
1777 case Hexagon::C2_cmpgtup:
1778 case Hexagon::C4_cmpneq:
1779 case Hexagon::C4_cmplte:
1780 case Hexagon::C4_cmplteu:
1781 case Hexagon::C2_cmpeqi:
1782 case Hexagon::C2_cmpgti:
1783 case Hexagon::C2_cmpgtui:
1784 case Hexagon::C4_cmpneqi:
1785 case Hexagon::C4_cmplteui:
1786 case Hexagon::C4_cmpltei:
1790 case Hexagon::A4_cmpbeq:
1791 case Hexagon::A4_cmpbgt:
1792 case Hexagon::A4_cmpbgtu:
1793 case Hexagon::A4_cmpbeqi:
1794 case Hexagon::A4_cmpbgti:
1795 case Hexagon::A4_cmpbgtui:
1799 case Hexagon::A4_cmpheq:
1800 case Hexagon::A4_cmphgt:
1801 case Hexagon::A4_cmphgtu:
1802 case Hexagon::A4_cmpheqi:
1803 case Hexagon::A4_cmphgti:
1804 case Hexagon::A4_cmphgtui:
1812 case Hexagon::C2_cmpeq:
1813 case Hexagon::C2_cmpeqp:
1814 case Hexagon::C2_cmpgt:
1815 case Hexagon::C2_cmpgtp:
1816 case Hexagon::C2_cmpgtu:
1817 case Hexagon::C2_cmpgtup:
1818 case Hexagon::A4_cmpbeq:
1819 case Hexagon::A4_cmpbgt:
1820 case Hexagon::A4_cmpbgtu:
1821 case Hexagon::A4_cmpheq:
1822 case Hexagon::A4_cmphgt:
1823 case Hexagon::A4_cmphgtu:
1824 case Hexagon::C4_cmpneq:
1825 case Hexagon::C4_cmplte:
1826 case Hexagon::C4_cmplteu:
1830 case Hexagon::C2_cmpeqi:
1831 case Hexagon::C2_cmpgtui:
1832 case Hexagon::C2_cmpgti:
1833 case Hexagon::C4_cmpneqi:
1834 case Hexagon::C4_cmplteui:
1835 case Hexagon::C4_cmpltei:
1836 case Hexagon::A4_cmpbeqi:
1837 case Hexagon::A4_cmpbgti:
1838 case Hexagon::A4_cmpbgtui:
1839 case Hexagon::A4_cmpheqi:
1840 case Hexagon::A4_cmphgti:
1841 case Hexagon::A4_cmphgtui: {
1856 unsigned *PredCost)
const {
1882 unsigned BasePosA, OffsetPosA;
1890 unsigned BasePosB, OffsetPosB;
1897 if (BaseRegA != BaseRegB || BaseSubA != BaseSubB)
1915 if (OffsetA > OffsetB) {
1916 uint64_t OffDiff = (uint64_t)((int64_t)OffsetA - (int64_t)OffsetB);
1917 return SizeB <= OffDiff;
1919 if (OffsetA < OffsetB) {
1920 uint64_t OffDiff = (uint64_t)((int64_t)OffsetB - (int64_t)OffsetA);
1921 return SizeA <= OffDiff;
1931 unsigned BasePos = 0, OffsetPos = 0;
1935 if (OffsetOp.
isImm()) {
1936 Value = OffsetOp.
getImm();
1939 }
else if (MI.
getOpcode() == Hexagon::A2_addi) {
1941 if (AddOp.
isImm()) {
1950 std::pair<unsigned, unsigned>
1958 using namespace HexagonII;
1960 static const std::pair<unsigned, const char*> Flags[] = {
1968 {
MO_IE,
"hexagon-ie"},
1977 using namespace HexagonII;
1979 static const std::pair<unsigned, const char*> Flags[] = {
1989 TRC = &Hexagon::PredRegsRegClass;
1991 TRC = &Hexagon::IntRegsRegClass;
1993 TRC = &Hexagon::DoubleRegsRegClass;
2064 assert(MO.
isImm() &&
"Extendable operand must be Immediate type");
2068 int ImmValue = MO.
getImm();
2070 return (ImmValue < MinValue || ImmValue > MaxValue);
2075 case Hexagon::L4_return:
2076 case Hexagon::L4_return_t:
2077 case Hexagon::L4_return_f:
2078 case Hexagon::L4_return_tnew_pnt:
2079 case Hexagon::L4_return_fnew_pnt:
2080 case Hexagon::L4_return_tnew_pt:
2081 case Hexagon::L4_return_fnew_pt:
2102 for (
auto &RegA : DefsA)
2103 for (
auto &RegB : UsesB) {
2110 if (RegB == *SubRegs)
2115 if (RegA == *SubRegs)
2125 case Hexagon::V6_vL32b_cur_pi:
2126 case Hexagon::V6_vL32b_cur_ai:
2159 return (Opcode == Hexagon::ENDLOOP0 ||
2160 Opcode == Hexagon::ENDLOOP1);
2187 case Hexagon::PS_fi:
2188 case Hexagon::PS_fia:
2214 const uint64_t
F =
get(Opcode).TSFlags;
2230 case Hexagon::J2_callr:
2231 case Hexagon::J2_callrf:
2232 case Hexagon::J2_callrt:
2233 case Hexagon::PS_call_nr:
2241 case Hexagon::L4_return:
2242 case Hexagon::L4_return_t:
2243 case Hexagon::L4_return_f:
2244 case Hexagon::L4_return_fnew_pnt:
2245 case Hexagon::L4_return_fnew_pt:
2246 case Hexagon::L4_return_tnew_pnt:
2247 case Hexagon::L4_return_tnew_pt:
2255 case Hexagon::J2_jumpr:
2256 case Hexagon::J2_jumprt:
2257 case Hexagon::J2_jumprf:
2258 case Hexagon::J2_jumprtnewpt:
2259 case Hexagon::J2_jumprfnewpt:
2260 case Hexagon::J2_jumprtnew:
2261 case Hexagon::J2_jumprfnew:
2272 unsigned offset)
const {
2276 return isInt<11>(offset);
2282 case Hexagon::J2_jump:
2283 case Hexagon::J2_call:
2284 case Hexagon::PS_call_nr:
2285 return isInt<24>(offset);
2286 case Hexagon::J2_jumpt:
2287 case Hexagon::J2_jumpf:
2288 case Hexagon::J2_jumptnew:
2289 case Hexagon::J2_jumptnewpt:
2290 case Hexagon::J2_jumpfnew:
2291 case Hexagon::J2_jumpfnewpt:
2292 case Hexagon::J2_callt:
2293 case Hexagon::J2_callf:
2294 return isInt<17>(offset);
2295 case Hexagon::J2_loop0i:
2296 case Hexagon::J2_loop0iext:
2297 case Hexagon::J2_loop0r:
2298 case Hexagon::J2_loop0rext:
2299 case Hexagon::J2_loop1i:
2300 case Hexagon::J2_loop1iext:
2301 case Hexagon::J2_loop1r:
2302 case Hexagon::J2_loop1rext:
2303 return isInt<9>(offset);
2305 case Hexagon::J4_cmpeqi_tp0_jump_nt:
2306 case Hexagon::J4_cmpeqi_tp1_jump_nt:
2307 case Hexagon::J4_cmpeqn1_tp0_jump_nt:
2308 case Hexagon::J4_cmpeqn1_tp1_jump_nt:
2309 return isInt<11>(offset);
2323 if (isLate && isEarly) {
2333 case TargetOpcode::EXTRACT_SUBREG:
2334 case TargetOpcode::INSERT_SUBREG:
2335 case TargetOpcode::SUBREG_TO_REG:
2336 case TargetOpcode::REG_SEQUENCE:
2337 case TargetOpcode::IMPLICIT_DEF:
2338 case TargetOpcode::COPY:
2340 case TargetOpcode::PHI:
2347 return !
is_TC1(SchedClass);
2358 return Opcode == Hexagon::J2_loop0i ||
2359 Opcode == Hexagon::J2_loop0r ||
2360 Opcode == Hexagon::J2_loop0iext ||
2361 Opcode == Hexagon::J2_loop0rext ||
2362 Opcode == Hexagon::J2_loop1i ||
2363 Opcode == Hexagon::J2_loop1r ||
2364 Opcode == Hexagon::J2_loop1iext ||
2365 Opcode == Hexagon::J2_loop1rext;
2370 default:
return false;
2371 case Hexagon::L4_iadd_memopw_io:
2372 case Hexagon::L4_isub_memopw_io:
2373 case Hexagon::L4_add_memopw_io:
2374 case Hexagon::L4_sub_memopw_io:
2375 case Hexagon::L4_and_memopw_io:
2376 case Hexagon::L4_or_memopw_io:
2377 case Hexagon::L4_iadd_memoph_io:
2378 case Hexagon::L4_isub_memoph_io:
2379 case Hexagon::L4_add_memoph_io:
2380 case Hexagon::L4_sub_memoph_io:
2381 case Hexagon::L4_and_memoph_io:
2382 case Hexagon::L4_or_memoph_io:
2383 case Hexagon::L4_iadd_memopb_io:
2384 case Hexagon::L4_isub_memopb_io:
2385 case Hexagon::L4_add_memopb_io:
2386 case Hexagon::L4_sub_memopb_io:
2387 case Hexagon::L4_and_memopb_io:
2388 case Hexagon::L4_or_memopb_io:
2389 case Hexagon::L4_ior_memopb_io:
2390 case Hexagon::L4_ior_memoph_io:
2391 case Hexagon::L4_ior_memopw_io:
2392 case Hexagon::L4_iand_memopb_io:
2393 case Hexagon::L4_iand_memoph_io:
2394 case Hexagon::L4_iand_memopw_io:
2406 const uint64_t
F =
get(Opcode).TSFlags;
2428 const uint64_t
F =
get(Opcode).TSFlags;
2434 unsigned OperandNum)
const {
2447 const uint64_t
F =
get(Opcode).TSFlags;
2459 const uint64_t
F =
get(Opcode).TSFlags;
2467 const uint64_t
F =
get(Opcode).TSFlags;
2472 const uint64_t
F =
get(Opcode).TSFlags;
2477 const uint64_t
F =
get(Opcode).TSFlags;
2484 return MI.
getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4 ||
2485 MI.
getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4_EXT ||
2486 MI.
getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4_PIC ||
2487 MI.
getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4_EXT_PIC;
2493 case Hexagon::L2_loadrb_io:
2494 case Hexagon::L4_loadrb_ur:
2495 case Hexagon::L4_loadrb_ap:
2496 case Hexagon::L2_loadrb_pr:
2497 case Hexagon::L2_loadrb_pbr:
2498 case Hexagon::L2_loadrb_pi:
2499 case Hexagon::L2_loadrb_pci:
2500 case Hexagon::L2_loadrb_pcr:
2501 case Hexagon::L2_loadbsw2_io:
2502 case Hexagon::L4_loadbsw2_ur:
2503 case Hexagon::L4_loadbsw2_ap:
2504 case Hexagon::L2_loadbsw2_pr:
2505 case Hexagon::L2_loadbsw2_pbr:
2506 case Hexagon::L2_loadbsw2_pi:
2507 case Hexagon::L2_loadbsw2_pci:
2508 case Hexagon::L2_loadbsw2_pcr:
2509 case Hexagon::L2_loadbsw4_io:
2510 case Hexagon::L4_loadbsw4_ur:
2511 case Hexagon::L4_loadbsw4_ap:
2512 case Hexagon::L2_loadbsw4_pr:
2513 case Hexagon::L2_loadbsw4_pbr:
2514 case Hexagon::L2_loadbsw4_pi:
2515 case Hexagon::L2_loadbsw4_pci:
2516 case Hexagon::L2_loadbsw4_pcr:
2517 case Hexagon::L4_loadrb_rr:
2518 case Hexagon::L2_ploadrbt_io:
2519 case Hexagon::L2_ploadrbt_pi:
2520 case Hexagon::L2_ploadrbf_io:
2521 case Hexagon::L2_ploadrbf_pi:
2522 case Hexagon::L2_ploadrbtnew_io:
2523 case Hexagon::L2_ploadrbfnew_io:
2524 case Hexagon::L4_ploadrbt_rr:
2525 case Hexagon::L4_ploadrbf_rr:
2526 case Hexagon::L4_ploadrbtnew_rr:
2527 case Hexagon::L4_ploadrbfnew_rr:
2528 case Hexagon::L2_ploadrbtnew_pi:
2529 case Hexagon::L2_ploadrbfnew_pi:
2530 case Hexagon::L4_ploadrbt_abs:
2531 case Hexagon::L4_ploadrbf_abs:
2532 case Hexagon::L4_ploadrbtnew_abs:
2533 case Hexagon::L4_ploadrbfnew_abs:
2534 case Hexagon::L2_loadrbgp:
2536 case Hexagon::L2_loadrh_io:
2537 case Hexagon::L4_loadrh_ur:
2538 case Hexagon::L4_loadrh_ap:
2539 case Hexagon::L2_loadrh_pr:
2540 case Hexagon::L2_loadrh_pbr:
2541 case Hexagon::L2_loadrh_pi:
2542 case Hexagon::L2_loadrh_pci:
2543 case Hexagon::L2_loadrh_pcr:
2544 case Hexagon::L4_loadrh_rr:
2545 case Hexagon::L2_ploadrht_io:
2546 case Hexagon::L2_ploadrht_pi:
2547 case Hexagon::L2_ploadrhf_io:
2548 case Hexagon::L2_ploadrhf_pi:
2549 case Hexagon::L2_ploadrhtnew_io:
2550 case Hexagon::L2_ploadrhfnew_io:
2551 case Hexagon::L4_ploadrht_rr:
2552 case Hexagon::L4_ploadrhf_rr:
2553 case Hexagon::L4_ploadrhtnew_rr:
2554 case Hexagon::L4_ploadrhfnew_rr:
2555 case Hexagon::L2_ploadrhtnew_pi:
2556 case Hexagon::L2_ploadrhfnew_pi:
2557 case Hexagon::L4_ploadrht_abs:
2558 case Hexagon::L4_ploadrhf_abs:
2559 case Hexagon::L4_ploadrhtnew_abs:
2560 case Hexagon::L4_ploadrhfnew_abs:
2561 case Hexagon::L2_loadrhgp:
2575 case Hexagon::STriw_pred:
2576 case Hexagon::LDriw_pred:
2588 if (
Op.isGlobal() ||
Op.isSymbol())
2596 return is_TC1(SchedClass);
2601 return is_TC2(SchedClass);
2621 for (
int I = 0;
I <
N;
I++)
2626 if (MI2.
getOpcode() == Hexagon::V6_vS32b_pi)
2634 const uint64_t V =
getType(MI);
2641 if (Offset % Size != 0)
2643 int Count = Offset /
Size;
2658 return isInt<4>(Count);
2668 return isInt<3>(Count);
2687 case Hexagon::PS_vstorerq_ai:
2688 case Hexagon::PS_vstorerv_ai:
2689 case Hexagon::PS_vstorerw_ai:
2690 case Hexagon::PS_vstorerw_nt_ai:
2691 case Hexagon::PS_vloadrq_ai:
2692 case Hexagon::PS_vloadrv_ai:
2693 case Hexagon::PS_vloadrw_ai:
2694 case Hexagon::PS_vloadrw_nt_ai:
2695 case Hexagon::V6_vL32b_ai:
2696 case Hexagon::V6_vS32b_ai:
2697 case Hexagon::V6_vL32b_nt_ai:
2698 case Hexagon::V6_vS32b_nt_ai:
2699 case Hexagon::V6_vL32Ub_ai:
2700 case Hexagon::V6_vS32Ub_ai: {
2701 unsigned VectorSize = TRI->
getSpillSize(Hexagon::HvxVRRegClass);
2703 if (Offset & (VectorSize-1))
2705 return isInt<4>(Offset >>
Log2_32(VectorSize));
2708 case Hexagon::J2_loop0i:
2709 case Hexagon::J2_loop1i:
2710 return isUInt<10>(
Offset);
2712 case Hexagon::S4_storeirb_io:
2713 case Hexagon::S4_storeirbt_io:
2714 case Hexagon::S4_storeirbf_io:
2715 return isUInt<6>(
Offset);
2717 case Hexagon::S4_storeirh_io:
2718 case Hexagon::S4_storeirht_io:
2719 case Hexagon::S4_storeirhf_io:
2720 return isShiftedUInt<6,1>(
Offset);
2722 case Hexagon::S4_storeiri_io:
2723 case Hexagon::S4_storeirit_io:
2724 case Hexagon::S4_storeirif_io:
2725 return isShiftedUInt<6,2>(
Offset);
2732 case Hexagon::L2_loadri_io:
2733 case Hexagon::S2_storeri_io:
2734 return (Offset >= Hexagon_MEMW_OFFSET_MIN) &&
2737 case Hexagon::L2_loadrd_io:
2738 case Hexagon::S2_storerd_io:
2739 return (Offset >= Hexagon_MEMD_OFFSET_MIN) &&
2742 case Hexagon::L2_loadrh_io:
2743 case Hexagon::L2_loadruh_io:
2744 case Hexagon::S2_storerh_io:
2745 case Hexagon::S2_storerf_io:
2746 return (Offset >= Hexagon_MEMH_OFFSET_MIN) &&
2749 case Hexagon::L2_loadrb_io:
2750 case Hexagon::L2_loadrub_io:
2751 case Hexagon::S2_storerb_io:
2752 return (Offset >= Hexagon_MEMB_OFFSET_MIN) &&
2755 case Hexagon::A2_addi:
2756 return (Offset >= Hexagon_ADDI_OFFSET_MIN) &&
2759 case Hexagon::L4_iadd_memopw_io:
2760 case Hexagon::L4_isub_memopw_io:
2761 case Hexagon::L4_add_memopw_io:
2762 case Hexagon::L4_sub_memopw_io:
2763 case Hexagon::L4_and_memopw_io:
2764 case Hexagon::L4_or_memopw_io:
2765 return (0 <= Offset && Offset <= 255);
2767 case Hexagon::L4_iadd_memoph_io:
2768 case Hexagon::L4_isub_memoph_io:
2769 case Hexagon::L4_add_memoph_io:
2770 case Hexagon::L4_sub_memoph_io:
2771 case Hexagon::L4_and_memoph_io:
2772 case Hexagon::L4_or_memoph_io:
2773 return (0 <= Offset && Offset <= 127);
2775 case Hexagon::L4_iadd_memopb_io:
2776 case Hexagon::L4_isub_memopb_io:
2777 case Hexagon::L4_add_memopb_io:
2778 case Hexagon::L4_sub_memopb_io:
2779 case Hexagon::L4_and_memopb_io:
2780 case Hexagon::L4_or_memopb_io:
2781 return (0 <= Offset && Offset <= 63);
2785 case Hexagon::STriw_pred:
2786 case Hexagon::LDriw_pred:
2787 case Hexagon::STriw_ctr:
2788 case Hexagon::LDriw_ctr:
2791 case Hexagon::PS_fi:
2792 case Hexagon::PS_fia:
2796 case Hexagon::L2_ploadrbt_io:
2797 case Hexagon::L2_ploadrbf_io:
2798 case Hexagon::L2_ploadrubt_io:
2799 case Hexagon::L2_ploadrubf_io:
2800 case Hexagon::S2_pstorerbt_io:
2801 case Hexagon::S2_pstorerbf_io:
2802 return isUInt<6>(
Offset);
2804 case Hexagon::L2_ploadrht_io:
2805 case Hexagon::L2_ploadrhf_io:
2806 case Hexagon::L2_ploadruht_io:
2807 case Hexagon::L2_ploadruhf_io:
2808 case Hexagon::S2_pstorerht_io:
2809 case Hexagon::S2_pstorerhf_io:
2810 return isShiftedUInt<6,1>(
Offset);
2812 case Hexagon::L2_ploadrit_io:
2813 case Hexagon::L2_ploadrif_io:
2814 case Hexagon::S2_pstorerit_io:
2815 case Hexagon::S2_pstorerif_io:
2816 return isShiftedUInt<6,2>(
Offset);
2818 case Hexagon::L2_ploadrdt_io:
2819 case Hexagon::L2_ploadrdf_io:
2820 case Hexagon::S2_pstorerdt_io:
2821 case Hexagon::S2_pstorerdf_io:
2822 return isShiftedUInt<6,3>(
Offset);
2826 "Please define it in the above switch statement!");
2834 const uint64_t
F =
get(MI.
getOpcode()).TSFlags;
2858 case Hexagon::L2_loadrub_io:
2859 case Hexagon::L4_loadrub_ur:
2860 case Hexagon::L4_loadrub_ap:
2861 case Hexagon::L2_loadrub_pr:
2862 case Hexagon::L2_loadrub_pbr:
2863 case Hexagon::L2_loadrub_pi:
2864 case Hexagon::L2_loadrub_pci:
2865 case Hexagon::L2_loadrub_pcr:
2866 case Hexagon::L2_loadbzw2_io:
2867 case Hexagon::L4_loadbzw2_ur:
2868 case Hexagon::L4_loadbzw2_ap:
2869 case Hexagon::L2_loadbzw2_pr:
2870 case Hexagon::L2_loadbzw2_pbr:
2871 case Hexagon::L2_loadbzw2_pi:
2872 case Hexagon::L2_loadbzw2_pci:
2873 case Hexagon::L2_loadbzw2_pcr:
2874 case Hexagon::L2_loadbzw4_io:
2875 case Hexagon::L4_loadbzw4_ur:
2876 case Hexagon::L4_loadbzw4_ap:
2877 case Hexagon::L2_loadbzw4_pr:
2878 case Hexagon::L2_loadbzw4_pbr:
2879 case Hexagon::L2_loadbzw4_pi:
2880 case Hexagon::L2_loadbzw4_pci:
2881 case Hexagon::L2_loadbzw4_pcr:
2882 case Hexagon::L4_loadrub_rr:
2883 case Hexagon::L2_ploadrubt_io:
2884 case Hexagon::L2_ploadrubt_pi:
2885 case Hexagon::L2_ploadrubf_io:
2886 case Hexagon::L2_ploadrubf_pi:
2887 case Hexagon::L2_ploadrubtnew_io:
2888 case Hexagon::L2_ploadrubfnew_io:
2889 case Hexagon::L4_ploadrubt_rr:
2890 case Hexagon::L4_ploadrubf_rr:
2891 case Hexagon::L4_ploadrubtnew_rr:
2892 case Hexagon::L4_ploadrubfnew_rr:
2893 case Hexagon::L2_ploadrubtnew_pi:
2894 case Hexagon::L2_ploadrubfnew_pi:
2895 case Hexagon::L4_ploadrubt_abs:
2896 case Hexagon::L4_ploadrubf_abs:
2897 case Hexagon::L4_ploadrubtnew_abs:
2898 case Hexagon::L4_ploadrubfnew_abs:
2899 case Hexagon::L2_loadrubgp:
2901 case Hexagon::L2_loadruh_io:
2902 case Hexagon::L4_loadruh_ur:
2903 case Hexagon::L4_loadruh_ap:
2904 case Hexagon::L2_loadruh_pr:
2905 case Hexagon::L2_loadruh_pbr:
2906 case Hexagon::L2_loadruh_pi:
2907 case Hexagon::L2_loadruh_pci:
2908 case Hexagon::L2_loadruh_pcr:
2909 case Hexagon::L4_loadruh_rr:
2910 case Hexagon::L2_ploadruht_io:
2911 case Hexagon::L2_ploadruht_pi:
2912 case Hexagon::L2_ploadruhf_io:
2913 case Hexagon::L2_ploadruhf_pi:
2914 case Hexagon::L2_ploadruhtnew_io:
2915 case Hexagon::L2_ploadruhfnew_io:
2916 case Hexagon::L4_ploadruht_rr:
2917 case Hexagon::L4_ploadruhf_rr:
2918 case Hexagon::L4_ploadruhtnew_rr:
2919 case Hexagon::L4_ploadruhfnew_rr:
2920 case Hexagon::L2_ploadruhtnew_pi:
2921 case Hexagon::L2_ploadruhfnew_pi:
2922 case Hexagon::L4_ploadruht_abs:
2923 case Hexagon::L4_ploadruhf_abs:
2924 case Hexagon::L4_ploadruhtnew_abs:
2925 case Hexagon::L4_ploadruhfnew_abs:
2926 case Hexagon::L2_loadruhgp:
2946 unsigned AccessSize = 0;
2948 return BaseOp !=
nullptr && BaseOp->
isReg();
2966 if (!Stored.
isReg())
2979 return Opc == Hexagon::PS_call_nr || Opc == Hexagon::PS_callr_nr;
2995 if (Hexagon::getRegForm(MI.
getOpcode()) >= 0)
3005 NonExtOpcode = Hexagon::changeAddrMode_abs_io(MI.
getOpcode());
3011 NonExtOpcode = Hexagon::changeAddrMode_io_rr(MI.
getOpcode());
3014 NonExtOpcode = Hexagon::changeAddrMode_ur_rr(MI.
getOpcode());
3019 if (NonExtOpcode < 0)
3027 return Hexagon::getRealHWInstr(MI.
getOpcode(),
3028 Hexagon::InstrType_Pseudo) >= 0;
3046 Subtarget.hasV60Ops();
3051 if (MI.
mayStore() && !Subtarget.useNewValueStores())
3085 if (!MII->isBundle())
3088 for (++MII; MII != MIE && MII->isInsideBundle(); ++MII) {
3097 unsigned PredReg)
const {
3100 if (MO.isRegMask() && MO.clobbersPhysReg(PredReg))
3102 if (MO.isReg() && MO.isDef() && MO.isImplicit() && (MO.getReg() == PredReg))
3109 case Hexagon::A4_addp_c:
3110 case Hexagon::A4_subp_c:
3111 case Hexagon::A4_tlbmatch:
3112 case Hexagon::A5_ACS:
3113 case Hexagon::F2_sfinvsqrta:
3114 case Hexagon::F2_sfrecipa:
3115 case Hexagon::J2_endloop0:
3116 case Hexagon::J2_endloop01:
3117 case Hexagon::J2_ploop1si:
3118 case Hexagon::J2_ploop1sr:
3119 case Hexagon::J2_ploop2si:
3120 case Hexagon::J2_ploop2sr:
3121 case Hexagon::J2_ploop3si:
3122 case Hexagon::J2_ploop3sr:
3123 case Hexagon::S2_cabacdecbin:
3124 case Hexagon::S2_storew_locked:
3125 case Hexagon::S4_stored_locked:
3132 return Opcode == Hexagon::J2_jumpt ||
3133 Opcode == Hexagon::J2_jumptpt ||
3134 Opcode == Hexagon::J2_jumpf ||
3135 Opcode == Hexagon::J2_jumpfpt ||
3136 Opcode == Hexagon::J2_jumptnew ||
3137 Opcode == Hexagon::J2_jumpfnew ||
3138 Opcode == Hexagon::J2_jumptnewpt ||
3139 Opcode == Hexagon::J2_jumpfnewpt;
3159 unsigned &AccessSize)
const {
3168 unsigned BasePos = 0, OffsetPos = 0;
3178 if (!OffsetOp.
isImm())
3180 Offset = OffsetOp.
getImm();
3191 unsigned &BasePos,
unsigned &OffsetPos)
const {
3256 while (I->isDebugInstr()) {
3261 if (!isUnpredicatedTerminator(*I))
3270 if (&*I != LastInst && !I->
isBundle() && isUnpredicatedTerminator(*I)) {
3271 if (!SecondLastInst) {
3272 SecondLastInst = &*
I;
3294 unsigned DstReg, SrcReg, Src1Reg, Src2Reg;
3305 case Hexagon::C2_cmpeq:
3306 case Hexagon::C2_cmpgt:
3307 case Hexagon::C2_cmpgtu:
3311 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3312 (Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
3316 case Hexagon::C2_cmpeqi:
3317 case Hexagon::C2_cmpgti:
3318 case Hexagon::C2_cmpgtui:
3322 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3323 (Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
3329 case Hexagon::A2_tfr:
3336 case Hexagon::A2_tfrsi:
3344 case Hexagon::S2_tstbit_i:
3347 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
3348 (Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
3357 case Hexagon::J2_jumptnew:
3358 case Hexagon::J2_jumpfnew:
3359 case Hexagon::J2_jumptnewpt:
3360 case Hexagon::J2_jumpfnewpt:
3362 if (Hexagon::PredRegsRegClass.
contains(Src1Reg) &&
3363 (Hexagon::P0 == Src1Reg || Hexagon::P1 == Src1Reg))
3370 case Hexagon::J2_jump:
3371 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4:
3372 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4_PIC:
3384 if ((GA.
getOpcode() != Hexagon::C2_cmpeqi) ||
3385 (GB.
getOpcode() != Hexagon::J2_jumptnew))
3390 if (DestReg != Hexagon::P0 && DestReg != Hexagon::P1)
3398 return DestReg == Hexagon::P0 ? Hexagon::J4_cmpeqn1_tp0_jump_nt
3399 : Hexagon::J4_cmpeqn1_tp1_jump_nt;
3402 return DestReg == Hexagon::P0 ? Hexagon::J4_cmpeqi_tp0_jump_nt
3403 : Hexagon::J4_cmpeqi_tp1_jump_nt;
3407 enum Hexagon::PredSense inPredSense;
3408 inPredSense = invertPredicate ? Hexagon::PredSense_false :
3409 Hexagon::PredSense_true;
3410 int CondOpcode = Hexagon::getPredOpcode(Opc, inPredSense);
3411 if (CondOpcode >= 0)
3421 case Hexagon::V6_vL32b_pi:
3422 return Hexagon::V6_vL32b_cur_pi;
3423 case Hexagon::V6_vL32b_ai:
3424 return Hexagon::V6_vL32b_cur_ai;
3425 case Hexagon::V6_vL32b_nt_pi:
3426 return Hexagon::V6_vL32b_nt_cur_pi;
3427 case Hexagon::V6_vL32b_nt_ai:
3428 return Hexagon::V6_vL32b_nt_cur_ai;
3437 case Hexagon::V6_vL32b_cur_pi:
3438 return Hexagon::V6_vL32b_pi;
3439 case Hexagon::V6_vL32b_cur_ai:
3440 return Hexagon::V6_vL32b_ai;
3441 case Hexagon::V6_vL32b_nt_cur_pi:
3442 return Hexagon::V6_vL32b_nt_pi;
3443 case Hexagon::V6_vL32b_nt_cur_ai:
3444 return Hexagon::V6_vL32b_nt_ai;
3532 int NVOpcode = Hexagon::getNewValueOpcode(MI.
getOpcode());
3540 case Hexagon::S4_storerb_ur:
3541 return Hexagon::S4_storerbnew_ur;
3543 case Hexagon::S2_storerb_pci:
3544 return Hexagon::S2_storerb_pci;
3546 case Hexagon::S2_storeri_pci:
3547 return Hexagon::S2_storeri_pci;
3549 case Hexagon::S2_storerh_pci:
3550 return Hexagon::S2_storerh_pci;
3552 case Hexagon::S2_storerd_pci:
3553 return Hexagon::S2_storerd_pci;
3555 case Hexagon::S2_storerf_pci:
3556 return Hexagon::S2_storerf_pci;
3558 case Hexagon::V6_vS32b_ai:
3559 return Hexagon::V6_vS32b_new_ai;
3561 case Hexagon::V6_vS32b_pi:
3562 return Hexagon::V6_vS32b_new_pi;
3587 if (BrTarget.
isMBB()) {
3589 Taken = getEdgeProbability(Src, Dst) >= OneHalf;
3602 bool SawCond =
false, Bad =
false;
3606 if (
I.isConditionalBranch()) {
3613 if (
I.isUnconditionalBranch() && !SawCond) {
3621 if (NextIt == B.instr_end()) {
3624 if (!B.isLayoutSuccessor(SB))
3626 Taken = getEdgeProbability(Src, SB) < OneHalf;
3630 assert(NextIt->isUnconditionalBranch());
3639 Taken = BT && getEdgeProbability(Src, BT) < OneHalf;
3647 case Hexagon::J2_jumpt:
3648 return Taken ? Hexagon::J2_jumptnewpt : Hexagon::J2_jumptnew;
3649 case Hexagon::J2_jumpf:
3650 return Taken ? Hexagon::J2_jumpfnewpt : Hexagon::J2_jumpfnew;
3662 case Hexagon::J2_jumpt:
3663 case Hexagon::J2_jumpf:
3667 int NewOpcode = Hexagon::getPredNewOpcode(MI.
getOpcode());
3676 NewOp = Hexagon::getPredOldOpcode(NewOp);
3680 if (!Subtarget.getFeatureBits()[Hexagon::ArchV60]) {
3682 case Hexagon::J2_jumptpt:
3683 NewOp = Hexagon::J2_jumpt;
3685 case Hexagon::J2_jumpfpt:
3686 NewOp = Hexagon::J2_jumpf;
3688 case Hexagon::J2_jumprtpt:
3689 NewOp = Hexagon::J2_jumprt;
3691 case Hexagon::J2_jumprfpt:
3692 NewOp = Hexagon::J2_jumprf;
3697 "Couldn't change predicate new instruction to its old form.");
3701 NewOp = Hexagon::getNonNVStore(NewOp);
3702 assert(NewOp >= 0 &&
"Couldn't change new-value store to its old form.");
3705 if (Subtarget.hasV60Ops())
3710 case Hexagon::J2_jumpfpt:
3711 return Hexagon::J2_jumpf;
3712 case Hexagon::J2_jumptpt:
3713 return Hexagon::J2_jumpt;
3714 case Hexagon::J2_jumprfpt:
3715 return Hexagon::J2_jumprf;
3716 case Hexagon::J2_jumprtpt:
3717 return Hexagon::J2_jumprt;
3726 unsigned DstReg, SrcReg, Src1Reg, Src2Reg;
3737 case Hexagon::L2_loadri_io:
3743 if (Hexagon::IntRegsRegClass.
contains(SrcReg) &&
3755 case Hexagon::L2_loadrub_io:
3773 case Hexagon::L2_loadrh_io:
3774 case Hexagon::L2_loadruh_io:
3783 case Hexagon::L2_loadrb_io:
3792 case Hexagon::L2_loadrd_io:
3797 Hexagon::IntRegsRegClass.
contains(SrcReg) &&
3805 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4:
3806 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4_PIC:
3807 case Hexagon::L4_return:
3808 case Hexagon::L2_deallocframe:
3810 case Hexagon::EH_RETURN_JMPR:
3811 case Hexagon::PS_jmpret:
3812 case Hexagon::SL2_jumpr31:
3816 if (Hexagon::IntRegsRegClass.
contains(DstReg) && (Hexagon::R31 == DstReg))
3819 case Hexagon::PS_jmprett:
3820 case Hexagon::PS_jmpretf:
3821 case Hexagon::PS_jmprettnewpt:
3822 case Hexagon::PS_jmpretfnewpt:
3823 case Hexagon::PS_jmprettnew:
3824 case Hexagon::PS_jmpretfnew:
3825 case Hexagon::SL2_jumpr31_t:
3826 case Hexagon::SL2_jumpr31_f:
3827 case Hexagon::SL2_jumpr31_tnew:
3831 if ((Hexagon::PredRegsRegClass.
contains(SrcReg) &&
3832 (Hexagon::P0 == SrcReg)) &&
3833 (Hexagon::IntRegsRegClass.
contains(DstReg) && (Hexagon::R31 == DstReg)))
3836 case Hexagon::L4_return_t:
3837 case Hexagon::L4_return_f:
3838 case Hexagon::L4_return_tnew_pnt:
3839 case Hexagon::L4_return_fnew_pnt:
3840 case Hexagon::L4_return_tnew_pt:
3841 case Hexagon::L4_return_fnew_pt:
3844 if (Hexagon::PredRegsRegClass.
contains(SrcReg) && (Hexagon::P0 == SrcReg))
3852 case Hexagon::S2_storeri_io:
3857 if (Hexagon::IntRegsRegClass.
contains(Src1Reg) &&
3868 case Hexagon::S2_storerb_io:
3885 case Hexagon::S2_storerh_io:
3894 case Hexagon::S2_storerd_io:
3899 Hexagon::IntRegsRegClass.
contains(Src1Reg) &&
3904 case Hexagon::S4_storeiri_io:
3912 case Hexagon::S4_storeirb_io:
3920 case Hexagon::S2_allocframe:
3943 case Hexagon::A2_addi:
3948 if (Hexagon::IntRegsRegClass.
contains(SrcReg) &&
3964 case Hexagon::A2_add:
3973 case Hexagon::A2_andir:
3985 case Hexagon::A2_tfr:
3992 case Hexagon::A2_tfrsi:
4001 case Hexagon::C2_cmoveit:
4002 case Hexagon::C2_cmovenewit:
4003 case Hexagon::C2_cmoveif:
4004 case Hexagon::C2_cmovenewif:
4011 Hexagon::PredRegsRegClass.
contains(SrcReg) && Hexagon::P0 == SrcReg &&
4015 case Hexagon::C2_cmpeqi:
4019 if (Hexagon::PredRegsRegClass.
contains(DstReg) &&
4024 case Hexagon::A2_combineii:
4025 case Hexagon::A4_combineii:
4037 case Hexagon::A4_combineri:
4046 case Hexagon::A4_combineir:
4055 case Hexagon::A2_sxtb:
4056 case Hexagon::A2_sxth:
4057 case Hexagon::A2_zxtb:
4058 case Hexagon::A2_zxth:
4071 return Hexagon::getRealHWInstr(MI.
getOpcode(), Hexagon::InstrType_Real);
4098 unsigned UseIdx)
const {
4145 Cond[0].setImm(Opc);
4152 : Hexagon::getTruePredOpcode(Opc);
4153 if (InvPredOpcode >= 0)
4154 return InvPredOpcode;
4168 return ~(-1U << (bits - 1));
4170 return ~(-1U <<
bits);
4176 case Hexagon::L2_loadrbgp:
4177 case Hexagon::L2_loadrdgp:
4178 case Hexagon::L2_loadrhgp:
4179 case Hexagon::L2_loadrigp:
4180 case Hexagon::L2_loadrubgp:
4181 case Hexagon::L2_loadruhgp:
4182 case Hexagon::S2_storerbgp:
4183 case Hexagon::S2_storerbnewgp:
4184 case Hexagon::S2_storerhgp:
4185 case Hexagon::S2_storerhnewgp:
4186 case Hexagon::S2_storerigp:
4187 case Hexagon::S2_storerinewgp:
4188 case Hexagon::S2_storerdgp:
4189 case Hexagon::S2_storerfgp:
4203 using namespace HexagonII;
4215 return HRI.getSpillSize(Hexagon::HvxVRRegClass);
4230 return -1U << (bits - 1);
4239 short NonExtOpcode = Hexagon::getRegForm(MI.
getOpcode());
4240 if (NonExtOpcode >= 0)
4241 return NonExtOpcode;
4247 return Hexagon::changeAddrMode_abs_io(MI.
getOpcode());
4249 return Hexagon::changeAddrMode_io_rr(MI.
getOpcode());
4251 return Hexagon::changeAddrMode_ur_rr(MI.
getOpcode());
4261 unsigned &PredReg,
unsigned &PredRegPos,
unsigned &PredRegFlags)
const {
4269 PredReg = Cond[1].getReg();
4273 if (Cond[1].isImplicit())
4281 return Hexagon::getRealHWInstr(MI.
getOpcode(), Hexagon::InstrType_Pseudo);
4285 return Hexagon::getRegForm(MI.
getOpcode());
4312 unsigned NumDefs = 0;
4345 assert(BundleHead->isBundle() &&
"Not a bundle header");
4355 "Instruction must be extendable");
4361 "Branch with unknown extendable field type");
4395 for (
unsigned insn = TargetOpcode::GENERIC_OP_END+1;
4396 insn < Hexagon::INSTRUCTION_LIST_END; ++insn) {
4397 NewMI =
BuildMI(B, I, DL,
get(insn));
4417 int PredRevOpcode = -1;
4419 PredRevOpcode = Hexagon::notTakenBranchPrediction(Opcode);
4421 PredRevOpcode = Hexagon::takenBranchPrediction(Opcode);
4422 assert(PredRevOpcode > 0);
4423 return PredRevOpcode;
4429 return Cond.
empty() || (Cond[0].isImm() && (Cond.
size() != 1));
4436 if (Operand.isImm())
4437 Operand.
setImm(Operand.getImm() | memShufDisabledMask);
4445 return (Operand.isImm() && (Operand.getImm() & memShufDisabledMask) != 0);
4450 return Opc >= 0 ? Hexagon::changeAddrMode_abs_io(Opc) : Opc;
4454 return Opc >= 0 ? Hexagon::changeAddrMode_io_abs(Opc) : Opc;
4458 return Opc >= 0 ? Hexagon::changeAddrMode_io_pi(Opc) : Opc;
4462 return Opc >= 0 ? Hexagon::changeAddrMode_io_rr(Opc) : Opc;
4466 return Opc >= 0 ? Hexagon::changeAddrMode_pi_io(Opc) : Opc;
4470 return Opc >= 0 ? Hexagon::changeAddrMode_rr_io(Opc) : Opc;
4474 return Opc >= 0 ? Hexagon::changeAddrMode_rr_ur(Opc) : Opc;
4478 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
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...
short changeAddrMode_rr_io(short Opc) const
static bool isConstant(const MachineInstr &MI)
instr_iterator instr_begin()
const int Hexagon_MEMH_OFFSET_MAX
bool is_TC2early(unsigned SchedClass)
bool isCall(QueryType Type=AnyInBundle) const
Wrapper class representing physical registers. Should be passed by value.
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
Object returned by analyzeLoopForPipelining.
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.
This class represents lattice values for constants.
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 bool mayAlias(MachineInstr &MIa, MachineInstr &MIb, AliasAnalysis *AA)
static cl::opt< bool > UseDFAHazardRec("dfa-hazard-rec", cl::init(true), cl::Hidden, cl::ZeroOrMore, cl::desc("Use the DFA based hazard recognizer."))
Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
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.
void push_back(const T &Elt)
bool isAbsoluteSet(const MachineInstr &MI) const
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
bool isJumpR(const MachineInstr &MI) const
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
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
bool getInvertedPredSense(SmallVectorImpl< MachineOperand > &Cond) const
Address of indexed Jump Table for switch.
int findRegisterDefOperandIdx(Register 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...
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 mayLoadOrStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly read or modify memory.
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...
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly...
MachineBasicBlock reference.
#define HEXAGON_INSTR_SIZE
bool isExpr(unsigned OpType) const
bool isTailCall(const MachineInstr &MI) const override
unsigned const TargetRegisterInfo * TRI
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
unsigned getMemAccessSize(const MachineInstr &MI) const
Printable printReg(Register Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubIdx=0, const MachineRegisterInfo *MRI=nullptr)
Prints virtual and physical registers with or without a TRI instance.
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
bool hasLoadFromStackSlot(const MachineInstr &MI, SmallVectorImpl< const MachineMemOperand *> &Accesses) const override
Check if the instruction or the bundle of instructions has load from stack slots. ...
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0) 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 ...
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
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."))
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg, bool KillSrc) const override
Emit instructions to copy a pair of physical registers.
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...
const HexagonInstrInfo * TII
Register getFrameRegister(const MachineFunction &MF) const override
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
Retuns the total number of operands.
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
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
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
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
bool isDeallocRet(const MachineInstr &MI) const
bool isExtended(const MachineInstr &MI) const
bool hasStoreToStackSlot(const MachineInstr &MI, SmallVectorImpl< const MachineMemOperand *> &Accesses) const override
Check if the instruction or the bundle of instructions has store to stack slots.
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
MachineBasicBlock::instr_iterator expandVGatherPseudo(MachineInstr &MI) 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
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
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)...
LLVM_NODISCARD size_t size() const
size - Get the string size.
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
void setReg(Register Reg)
Change the register this operand corresponds to.
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
MachineOperand * getBaseAndOffset(const MachineInstr &MI, int64_t &Offset, unsigned &AccessSize) const
TargetInstrInfo - Interface to description of machine instruction set.
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...
The memory access is volatile.
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.
ArrayRef< MachineMemOperand * > memoperands() const
Access to memory operands of the instruction.
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.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
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.
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
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
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
This class contains a discriminated union of information about pointers in memory operands...
bool isExtendable(const MachineInstr &MI) const
#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.
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...
bool readsRegister(Register Reg, const TargetRegisterInfo *TRI=nullptr) const
Return true if the MachineInstr reads the specified register.
virtual bool hasLoadFromStackSlot(const MachineInstr &MI, SmallVectorImpl< const MachineMemOperand *> &Accesses) const
If the specified machine instruction has a load from a stack slot, return true along with the FrameIn...
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.
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...
bool isNewValueInst(const MachineInstr &MI) const
bool available(const MachineRegisterInfo &MRI, MCPhysReg Reg) const
Returns true if register Reg and no aliasing register is in the set.
static uint64_t add(uint64_t LeftOp, uint64_t RightOp)
MachineOperand class - Representation of each machine instruction operand.
bool isVecAcc(const MachineInstr &MI) const
MachineInstrBuilder MachineInstrBuilder & DefMI
bool modifiesRegister(Register Reg, const TargetRegisterInfo *TRI) const
Return true if the MachineInstr modifies (fully define or partially define) the specified register...
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...
bool areMemAccessesTriviallyDisjoint(const MachineInstr &MIa, const MachineInstr &MIb) const override
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
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
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
Special value supplied for machine level alias analysis.
bool isValid() const
isValid - returns true if this iterator is not yet at the end.
bool isNewValue(const MachineInstr &MI) const
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
bool isSaveCalleeSavedRegsCall(const MachineInstr &MI) const
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
int findRegisterUseOperandIdx(Register 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...
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
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
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
bool isDependent(const MachineInstr &ProdMI, const MachineInstr &ConsMI) const
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.
unsigned getInlineAsmLength(const char *Str, const MCAsmInfo &MAI, const TargetSubtargetInfo *STI=nullptr) const override
Measure the specified inline asm to determine an approximation of its length.
virtual bool hasStoreToStackSlot(const MachineInstr &MI, SmallVectorImpl< const MachineMemOperand *> &Accesses) const
If the specified machine instruction has a store to a stack slot, return true along with the FrameInd...
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const int Hexagon_MEMB_OFFSET_MAX
void splice(iterator Where, MachineBasicBlock *Other, iterator From)
Take an instruction from MBB 'Other' at the position From, and insert it into this MBB right before '...
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
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
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
const MachineInstrBuilder & cloneMemRefs(const MachineInstr &OtherMI) 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
bool hasNonExtEquivalent(const MachineInstr &MI) const
unsigned getInstrTimingClassLatency(const InstrItineraryData *ItinData, const MachineInstr &MI) const
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
std::unique_ptr< PipelinerLoopInfo > analyzeLoopForPipelining(MachineBasicBlock *LoopBB) const override
Analyze loop L, which must be a single-basic-block loop, and if the conditions can be understood enou...
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.
Instructions::iterator instr_iterator
const std::string to_string(const T &Value)
bool isTC2(const MachineInstr &MI) const
LLVM_NODISCARD const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
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)
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.
const HexagonInstrInfo * getInstrInfo() const override
bool PredOpcodeHasJMP_c(unsigned Opcode) const
bool getMemOperandWithOffset(const MachineInstr &LdSt, const MachineOperand *&BaseOp, int64_t &Offset, const TargetRegisterInfo *TRI) const override
Get the base register and byte offset of a load/store instr.
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
virtual unsigned getMaxInstLength(const MCSubtargetInfo *STI=nullptr) const
Returns the maximum possible encoded instruction size in bytes.
bool isAddrModeWithOffset(const MachineInstr &MI) const
unsigned getOpcode() const
Return the opcode number for this descriptor.
This class implements an extremely fast bulk output stream that can only output to a stream...
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
Register getReg() const
getReg - Returns the register number.
MachineBasicBlock::instr_iterator getBundleEnd(MachineBasicBlock::instr_iterator I)
Returns an iterator pointing beyond the bundle containing I.
const MachineOperand & getOperand(unsigned i) const
bool isBaseImmOffset(const MachineInstr &MI) const
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...
Instructions::const_iterator const_instr_iterator
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
virtual int getOperandLatency(const InstrItineraryData *ItinData, SDNode *DefNode, unsigned DefIdx, SDNode *UseNode, unsigned UseIdx) const
bool isIndirectL4Return(const MachineInstr &MI) const
MO_HI16 - On a symbol operand, this represents a relocation containing higher 16 bit of the address...
Wrapper class representing virtual and physical registers.
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...
HexagonII::CompoundGroup getCompoundCandidateGroup(const MachineInstr &MI) const