[llvm] [DebugInfo][NewGVN] Salvage debug values of trivially dead instructions (PR #149304)
Shan Huang via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 17 06:59:28 PDT 2025
================
@@ -0,0 +1,58 @@
+; RUN: opt -passes=newgvn -S %s | FileCheck %s
+
+; Check that assignDFSNumbers() in NewGVN salvages the debug values of the
+; trivially dead instructions that are marked for deletion.
+
+; CHECK: #dbg_value(i8 %tmp, [[META11:![0-9]+]], !DIExpression(DW_OP_constu, 8, DW_OP_eq, DW_OP_stack_value), [[META26:![0-9]+]])
+; CHECK: [[META11]] = !DILocalVariable(name: "2"
+; CHECK: [[META26]] = !DILocation(line: 3
+
+define void @test13() !dbg !5 {
+bb:
+ br label %bb1
+
+bb1:
+ %tmp = load i8, ptr null, align 1
+ %tmp2 = icmp eq i8 %tmp, 8, !dbg !26
+ #dbg_value(i1 %tmp2, !11, !DIExpression(), !26)
+ br label %bb3
+
+bb3:
----------------
Apochens wrote:
Thanks. I think this concise test case is enough.
https://github.com/llvm/llvm-project/pull/149304
More information about the llvm-commits
mailing list