[llvm] [llvm][CodeGen] Fix the empty interval issue in Window Scheduler(#128714) (PR #129204)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 10 03:45:43 PDT 2025


================
@@ -344,13 +352,16 @@ void ModuloScheduleExpander::generateEpilog(
 static void replaceRegUsesAfterLoop(Register FromReg, Register ToReg,
                                     MachineBasicBlock *MBB,
                                     MachineRegisterInfo &MRI,
-                                    LiveIntervals &LIS) {
+                                    LiveIntervals &LIS,
+                                    SmallVector<Register> &NoIntervalRegs) {
   for (MachineOperand &O :
        llvm::make_early_inc_range(MRI.use_operands(FromReg)))
     if (O.getParent()->getParent() != MBB)
       O.setReg(ToReg);
+  // The interval will be calculated after the kernel expansion in
+  // calculateIntervals().
   if (!LIS.hasInterval(ToReg))
-    LIS.createEmptyInterval(ToReg);
+    NoIntervalRegs.push_back(ToReg);
----------------
arsenm wrote:

I'd expect this to be unconditionally added as well, you just created the new register 

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


More information about the llvm-commits mailing list