[llvm] [AMDGPU][Scheduler] Fix non-monotonic SlotIndex after schedule revert (PR #192039)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 14 09:13:51 PDT 2026
================
@@ -2210,6 +2213,18 @@ void GCNSchedStage::modifyRegionSchedule(unsigned RegionIdx,
if (NonDebugReordered)
DAG.LIS->handleMove(*MI, true);
} else {
+ // MI is already at the expected position. However, earlier splices in
+ // this loop may have changed neighboring slot indices, so this MI's
+ // slot index can become non-monotonic w.r.t. the physical MBB order.
+ // Only re-seat when monotonicity is actually violated to avoid
+ // unnecessary LiveInterval changes that could perturb scheduling.
+ if (!MI->isDebugInstr() && !MI->isBundled() &&
+ DAG.LIS->getSlotIndexes()->hasIndex(*MI)) {
+ SlotIndex MI_Idx = DAG.LIS->getInstructionIndex(*MI);
+ SlotIndex PrevIdx = DAG.LIS->getSlotIndexes()->getIndexBefore(*MI);
+ if (PrevIdx >= MI_Idx)
+ DAG.LIS->handleMove(*MI, true);
----------------
michaelselehov wrote:
Done
https://github.com/llvm/llvm-project/pull/192039
More information about the llvm-commits
mailing list