[llvm] [InstCombine][DebugInfo] Update debug value uses in `freelyInvertAllUsersOf` (PR #137013)
Orlando Cazalet-Hyams via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 25 04:28:51 PDT 2025
================
@@ -0,0 +1,55 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -passes=instcombine -S %s -o - | FileCheck %s
+
+; Make sure that the DIExpression is updated correctly after InstCombinerImpl::freelyInvertAllUsersOf.
+
+define i32 @test(i32 noundef %x, i32 noundef %y) !dbg !10 {
+; CHECK-LABEL: define i32 @test(
+; CHECK-SAME: i32 noundef [[X:%.*]], i32 noundef [[Y:%.*]]) !dbg [[DBG10:![0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[CMP_NOT:%.*]] = icmp eq i32 [[X]], 0
+; CHECK-NEXT: #dbg_value(i1 [[CMP_NOT]], [[META15:![0-9]+]], !DIExpression(DW_OP_not, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_stack_value), [[META16:![0-9]+]])
+; CHECK-NEXT: [[TMP0:%.*]] = and i32 [[Y]], 1
+; CHECK-NEXT: [[AND:%.*]] = select i1 [[CMP_NOT]], i32 0, i32 [[TMP0]]
+; CHECK-NEXT: ret i32 [[AND]]
+;
+entry:
+ %cmp = icmp ne i32 %x, 0
+ %conv = zext i1 %cmp to i32
+ #dbg_value(i32 %conv, !15, !DIExpression(), !16)
----------------
OCHyams wrote:
nit: Please can you indent the dbg_value two spaces? My previous comment seems to have disappeared
https://github.com/llvm/llvm-project/pull/137013
More information about the llvm-commits
mailing list