[llvm] [llvm][CodeGen] Fix the issue caused by live interval checking in window scheduler (PR #123184)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 16 03:45:01 PST 2025


================
@@ -645,14 +645,17 @@ void WindowScheduler::expand() {
 
 void WindowScheduler::updateLiveIntervals() {
   SmallVector<Register, 128> UsedRegs;
-  for (MachineInstr &MI : *MBB)
+  for (MachineInstr &MI : *MBB) {
     for (const MachineOperand &MO : MI.operands()) {
       if (!MO.isReg() || MO.getReg() == 0)
         continue;
       Register Reg = MO.getReg();
       if (!is_contained(UsedRegs, Reg))
         UsedRegs.push_back(Reg);
     }
+    // Remove the residual slot index of newly cloned MI.
+    Context->LIS->getSlotIndexes()->removeMachineInstrFromMaps(MI, true);
----------------
arsenm wrote:

Should use the LIS wrapper instead of manually querying SlotIndexes 

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


More information about the llvm-commits mailing list