[llvm] [CodeGen] Debug insns must not affect liveness analysis (PR #193104)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 8 02:13:25 PDT 2026
================
@@ -101,6 +101,9 @@ bool DeadMachineInstructionElimImpl::eliminateDeadMI(MachineFunction &MF) {
// Now scan the instructions and delete dead ones, tracking physreg
// liveness as we go.
for (MachineInstr &MI : make_early_inc_range(reverse(*MBB))) {
+ // Do not let debug instructions affect liveness calculations.
+ if (MI.isDebugInstr())
----------------
jayfoad wrote:
Really? This seems like the wrong tradeoff to me. It should be trivial for callers to call stepBackwards in a loop until they get to the instruction of interest. Why should every caller need to know that debug instructions have no effect on live regs, instead of the live regs analysis itself knowing that?
https://github.com/llvm/llvm-project/pull/193104
More information about the llvm-commits
mailing list