[llvm] [InstrRef] Preserve debug instr num in aarch64-ldst-opt. (PR #136009)

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 17 17:38:54 PDT 2025


================
@@ -1227,6 +1261,30 @@ AArch64LoadStoreOpt::mergePairedInsns(MachineBasicBlock::iterator I,
             .addImm(0)
             .addImm(31);
     (void)MIBSXTW;
+
+    if (I->peekDebugInstrNum()) {
+      auto InstrNum = I->peekDebugInstrNum();
+      // If I is the instruction which got sign extended, restore the debug
+      // instruction number from I to the SBFMXri instruction
----------------
adrian-prantl wrote:

I think this comment might benefit from an example (like in the PR description) to illustrate each case. This would make it obvious why two instructions get updated in the else branch, and only one in the then branch.

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


More information about the llvm-commits mailing list