@@ -40,13 +40,17 @@ using namespace llvm;
40
40
41
41
using namespace llvm ;
42
42
43
- static cl::opt<bool > ScheduleInlineAsm (" hexagon-sched-inline-asm" , cl::Hidden,
43
+ cl::opt<bool > ScheduleInlineAsm (" hexagon-sched-inline-asm" , cl::Hidden,
44
44
cl::init (false ), cl::desc(" Do not consider inline-asm a scheduling/"
45
45
" packetization boundary." ));
46
46
47
47
static cl::opt<bool > EnableBranchPrediction (" hexagon-enable-branch-prediction" ,
48
48
cl::Hidden, cl::init(true ), cl::desc(" Enable branch prediction" ));
49
49
50
+ static cl::opt<bool > DisableNVSchedule (" disable-hexagon-nv-schedule" ,
51
+ cl::Hidden, cl::ZeroOrMore, cl::init(false ),
52
+ cl::desc(" Disable schedule adjustment for new value stores." ));
53
+
50
54
static cl::opt<bool > EnableTimingClassLatency (
51
55
" enable-timing-class-latency" , cl::Hidden, cl::init(false ),
52
56
cl::desc(" Enable timing class latency" ));
@@ -1857,6 +1861,17 @@ bool HexagonInstrInfo::isFloat(const MachineInstr *MI) const {
1857
1861
}
1858
1862
1859
1863
1864
+ // No V60 HVX VMEM with A_INDIRECT.
1865
+ bool HexagonInstrInfo::isHVXMemWithAIndirect (const MachineInstr *I,
1866
+ const MachineInstr *J) const {
1867
+ if (!isV60VectorInstruction (I))
1868
+ return false ;
1869
+ if (!I->mayLoad () && !I->mayStore ())
1870
+ return false ;
1871
+ return J->isIndirectBranch () || isIndirectCall (J) || isIndirectL4Return (J);
1872
+ }
1873
+
1874
+
1860
1875
bool HexagonInstrInfo::isIndirectCall (const MachineInstr *MI) const {
1861
1876
switch (MI->getOpcode ()) {
1862
1877
case Hexagon::J2_callr :
@@ -2492,6 +2507,28 @@ bool HexagonInstrInfo::isVecUsableNextPacket(const MachineInstr *ProdMI,
2492
2507
}
2493
2508
2494
2509
2510
+ // / \brief Can these instructions execute at the same time in a bundle.
2511
+ bool HexagonInstrInfo::canExecuteInBundle (const MachineInstr *First,
2512
+ const MachineInstr *Second) const {
2513
+ if (DisableNVSchedule)
2514
+ return false ;
2515
+ if (mayBeNewStore (Second)) {
2516
+ // Make sure the definition of the first instruction is the value being
2517
+ // stored.
2518
+ const MachineOperand &Stored =
2519
+ Second->getOperand (Second->getNumOperands () - 1 );
2520
+ if (!Stored.isReg ())
2521
+ return false ;
2522
+ for (unsigned i = 0 , e = First->getNumOperands (); i < e; ++i) {
2523
+ const MachineOperand &Op = First->getOperand (i);
2524
+ if (Op.isReg () && Op.isDef () && Op.getReg () == Stored.getReg ())
2525
+ return true ;
2526
+ }
2527
+ }
2528
+ return false ;
2529
+ }
2530
+
2531
+
2495
2532
bool HexagonInstrInfo::hasEHLabel (const MachineBasicBlock *B) const {
2496
2533
for (auto &I : *B)
2497
2534
if (I.isEHLabel ())
0 commit comments