[llvm] [DebugInfo][LICM] Salvage dbg_values for the dead instructions to erase (PR #138796)
Orlando Cazalet-Hyams via llvm-commits
llvm-commits at lists.llvm.org
Fri May 9 00:59:24 PDT 2025
================
@@ -0,0 +1,45 @@
+; RUN: opt -S -passes=licm %s | FileCheck %s
+
+; Check that hoistBOAssociation() in LICM salvages the dbg_value for the
+; hoisted binary operation.
+
+define void @hoist_binop(i64 %c1, i64 %c2) !dbg !5 {
+; CHECK-LABEL: define void @hoist_binop(
+; CHECK-LABEL: loop:
+; CHECK: #dbg_value(!DIArgList(i64 [[INDEX:%.*]], i64 [[C1:%.*]]), [[META9:![0-9]+]], !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_stack_value), [[META13:![0-9]+]])
+;
+entry:
+ br label %loop, !dbg !13
+
+loop: ; preds = %loop, %entry
+ %index = phi i64 [ 0, %entry ], [ %index.next, %loop ], !dbg !14
+ %step.add = add i64 %index, %c1, !dbg !15
+ #dbg_value(i64 %step.add, !11, !DIExpression(), !15)
----------------
OCHyams wrote:
nit: please can you indent the `#dbg_value`, same in the other tests below (sorry to be annoying).
https://github.com/llvm/llvm-project/pull/138796
More information about the llvm-commits
mailing list