[llvm] [AMDGPU][Scheduler] Scoring system for rematerialization candidates (PR #153092)

Jeffrey Byrnes via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 8 10:44:57 PDT 2025


================
@@ -2040,6 +2257,13 @@ void GCNScheduleDAGMILive::updateRegionBoundaries(
     RegionBounds.first = NewMI; // Insertion
 }
 
+void GCNScheduleDAGMILive::deleteMI(unsigned RegionIdx, MachineInstr *MI) {
+  updateRegionBoundaries(Regions[RegionIdx], MI, nullptr);
----------------
jrbyrnes wrote:

> `test_rollback_remats_emptydefregion` in `machine-scheduler-sink-trivial-remats.mir` tests that we can completely empty a region (bb.1) and then rollback instructions to it again and it seems to work without issue.

Can you add a test where we do this in the case of multiple scheduling regions in a block? We have multiple sched regions in a block, but, through remat, we empty the first one? You can use sched.barrier(i32 0) to create sched regions. My concern is that we may run into issues if `Region.second != MBB.end()`

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


More information about the llvm-commits mailing list