[llvm] [LiveRegUnits] Exclude runtime defined liveins when computing liveouts (PR #154325)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 20 03:22:04 PDT 2025


================
@@ -553,8 +553,8 @@ class MachineBasicBlock
         LiveRegI = (*BlockI)->livein_begin();
         if (!advanceToValidPosition())
           return;
-        if (LiveRegI->PhysReg == ExceptionPointer ||
-            LiveRegI->PhysReg == ExceptionSelector)
+        if ((*BlockI)->isEHPad() && (LiveRegI->PhysReg == ExceptionPointer ||
+                                     LiveRegI->PhysReg == ExceptionSelector))
----------------
MacDue wrote:

This was a latent bug, these registers should not be skipped outside of landing-pads (this matches the logic in `operator++`).

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


More information about the llvm-commits mailing list