[all-commits] [llvm/llvm-project] 4e1b9d: [mir-strip-debug] Fix debug location info strip fo...

Afanasyev Ivan via All-commits all-commits at lists.llvm.org
Tue Oct 29 10:26:38 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4e1b9d34f922d3b8b04a65f29681cd95dc9ce75f
      https://github.com/llvm/llvm-project/commit/4e1b9d34f922d3b8b04a65f29681cd95dc9ce75f
  Author: Afanasyev Ivan <ivafanas at gmail.com>
  Date:   2024-10-29 (Tue, 29 Oct 2024)

  Changed paths:
    M llvm/lib/CodeGen/MachineStripDebug.cpp
    A llvm/test/CodeGen/Generic/MIRStripDebug/bundles.mir

  Log Message:
  -----------
  [mir-strip-debug] Fix debug location info strip for bundled instructions (#113676)

Fix bug that `mir-strip-debug` pass does not remove debug location from
bundled instructions.

Problem arises during testing that debug info does not affect
optimization passes output (`llvm-lit` with ` -Dllc="llc
-debugify-and-strip-all-safe"`), when pass operates on MIR with bundled
instructions + memory operands.

Let mir test check looks like:

```
CHECK-NEXT: BUNDLE {
CHECK-NEXT:   $r3 = LD $r1, $r2 :: (load (s64) from %ir.a, !tbaa !2)
CHECK-NEXT: }
```

So as `mir-strip-debug` pass does not process bundled instructions,
running `llc -debugify-and-strip-all-safe` on the test will produce the
following output:

```
BUNDLE {
  $r3 = LD $r1, $r2, debug-location !DILocation(line: 3, column: 1, scope: <0x608cb2b99b10>) :: (load (s64) from %ir.a, !tbaa !2)
}
```

And test will fail, but it shouldn't.

Seems like the root cause is that `mir-strip-debug` pass should remove
debug location from bundled instructions.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list