[llvm] [DebugInfo][LoopStrengthReduce] Salvage the debug value of the dead cmp instruction (PR #147241)
Stephen Tozer via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 8 04:58:58 PDT 2025
================
@@ -1,7 +1,16 @@
; RUN: opt < %s -loop-reduce -S 2>&1 | FileCheck %s
+
;; This test case checks that whether the new icmp instruction preserves
;; the debug location of the original instruction for %exitcond
+
+;; This test case also checks that the debug value of the dead icmp
+;; instruction is salvaged.
+
+; CHECK: #dbg_value(i32 %n, ![[META1:[0-9]+]], !DIExpression(DW_OP_lit0, DW_OP_eq, DW_OP_stack_value), ![[META2:[0-9]+]])
----------------
SLTozer wrote:
Maybe for legibility's sake, add some `CHECK-LABEL`s for the basic blocks here? Just to make the structure of the output slightly clearer.
```suggestion
; CHECK-LABEL: bb.nph:
; CHECK: #dbg_value(i32 %n, ![[META1:[0-9]+]], !DIExpression(DW_OP_lit0, DW_OP_eq, DW_OP_stack_value), ![[META2:[0-9]+]])
; CHECK-LABEL: bb:
```
https://github.com/llvm/llvm-project/pull/147241
More information about the llvm-commits
mailing list