[all-commits] [llvm/llvm-project] d1fd44: [AMDGPU][Scheduler] Fix non-monotonic SlotIndex af...

michaelselehov via All-commits all-commits at lists.llvm.org
Wed Apr 15 09:42:12 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d1fd44fac1bb2fb344fa48cbdc372b86e3516d58
      https://github.com/llvm/llvm-project/commit/d1fd44fac1bb2fb344fa48cbdc372b86e3516d58
  Author: michaelselehov <michael.selehov at amd.com>
  Date:   2026-04-15 (Wed, 15 Apr 2026)

  Changed paths:
    M llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
    A llvm/test/CodeGen/AMDGPU/machine-scheduler-revert-slot-monotonicity.mir

  Log Message:
  -----------
  [AMDGPU][Scheduler] Fix non-monotonic SlotIndex after schedule revert (#192039)

modifyRegionSchedule restores the original instruction order by splicing
MIs before RegionEnd. When an MI is already at the expected position
(MII == RegionEnd) its SlotIndex was left unchanged, even though earlier
splices may have shifted neighboring indices. This could leave a stale,
lower-numbered slot on a non-moved MI, breaking SlotIndex monotonicity
and corrupting LiveIntervals.

The corruption surfaced as a "register isn't live" assertion in
GCNDownwardRPTracker when PreRARematStage's finalizeGCNSchedStage
globally reverted regions that were already locally reverted by
checkScheduling.

Fix by calling LIS->handleMove for non-moved MIs whose SlotIndex has
become non-monotonic (PrevIdx >= MI_Idx). Additionally, track whether
checkScheduling already reverted a region and skip the redundant global
revert in finalizeGCNSchedStage.

Assisted-by: Claude Opus



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list