[llvm] [AMDGPU] Optionally Use GCNRPTrackers during scheduling (PR #93090)

Valery Pykhtin via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 3 03:52:23 PDT 2024


================
@@ -430,28 +593,44 @@ bool GCNDownwardRPTracker::reset(const MachineInstr &MI,
   return true;
 }
 
-bool GCNDownwardRPTracker::advanceBeforeNext() {
+bool GCNDownwardRPTracker::advanceBeforeNext(MachineInstr *MI,
+                                             bool UseInternalIterator,
+                                             LiveIntervals *TheLIS) {
   assert(MRI && "call reset first");
-  if (!LastTrackedMI)
-    return NextMI == MBBEnd;
-
-  assert(NextMI == MBBEnd || !NextMI->isDebugInstr());
+  SlotIndex SI;
+  const LiveIntervals *CurrLIS;
+  const MachineInstr *CurrMI;
+  if (UseInternalIterator) {
+    if (!LastTrackedMI)
+      return NextMI == MBBEnd;
+
+    assert(NextMI == MBBEnd || !NextMI->isDebugInstr());
+    CurrLIS = &LIS;
+    CurrMI = LastTrackedMI;
+
+    SI = NextMI == MBBEnd
+             ? CurrLIS->getInstructionIndex(*LastTrackedMI).getDeadSlot()
+             : CurrLIS->getInstructionIndex(*NextMI).getBaseIndex();
+  } else { //! UseInternalIterator
+    CurrLIS = TheLIS;
----------------
vpykhtin wrote:

I'm not sure what is the CurrLIS? Are there more than one LISes anywhere?

https://github.com/llvm/llvm-project/pull/93090


More information about the llvm-commits mailing list