[llvm] [DebugInfo][InstrRef] Copy instr-ref to replacement instrs in X86FixupSetCCPass (PR #159777)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 29 04:40:17 PDT 2025


================
@@ -136,6 +136,12 @@ bool X86FixupSetCCPass::runOnMachineFunction(MachineFunction &MF) {
           .addReg(ZeroReg)
           .addReg(Reg0)
           .addImm(X86::sub_8bit);
+
+      // Transfer the debug-instr-number to the setcc.
+      if (unsigned InstrNum = ZExt->peekDebugInstrNum())
+        ZExt->getParent()->getParent()->makeDebugValueSubstitution(
----------------
jmorse wrote:

I think we can just use the `MF` argument to the function rather than using get-parent twice.

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


More information about the llvm-commits mailing list