Skip to content

Commit eb7da59

Browse files
committed
[debuginfo] replace usage of undef with poison as placeholder [NFC]
1 parent 199c400 commit eb7da59

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

llvm/lib/Transforms/Utils/Local.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,7 +1726,7 @@ void llvm::ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII,
17261726
// For now, when there is a store to parts of the variable (but we do not
17271727
// know which part) we insert an dbg.value intrinsic to indicate that we
17281728
// know nothing about the variable's content.
1729-
DV = UndefValue::get(DV->getType());
1729+
DV = PoisonValue::get(DV->getType());
17301730
insertDbgValueOrDbgVariableRecord(Builder, DV, DIVar, DIExpr, NewLoc,
17311731
SI->getIterator());
17321732
}
@@ -1798,7 +1798,7 @@ void llvm::ConvertDebugDeclareToDebugValue(DbgVariableRecord *DVR,
17981798
// For now, when there is a store to parts of the variable (but we do not
17991799
// know which part) we insert an dbg.value intrinsic to indicate that we
18001800
// know nothing about the variable's content.
1801-
DV = UndefValue::get(DV->getType());
1801+
DV = PoisonValue::get(DV->getType());
18021802
ValueAsMetadata *DVAM = ValueAsMetadata::get(DV);
18031803
DbgVariableRecord *NewDVR =
18041804
new DbgVariableRecord(DVAM, DIVar, DIExpr, NewLoc.get());

llvm/test/DebugInfo/Generic/sroa-extract-bits.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ define i8 @test6(i32 %arg1, i8 %arg2) {
127127
; CHECK-SAME: i32 [[ARG1:%.*]], i8 [[ARG2:%.*]]) {
128128
; CHECK-NEXT: entry:
129129
; CHECK-NEXT: [[PTR_SROA_0_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[ARG1]] to i8
130-
; CHECK-NEXT: #dbg_value(i8 undef, [[META2]], !DIExpression(DW_OP_LLVM_extract_bits_sext, 0, 8), [[META7]])
130+
; CHECK-NEXT: #dbg_value(i8 poison, [[META2]], !DIExpression(DW_OP_LLVM_extract_bits_sext, 0, 8), [[META7]])
131131
; CHECK-NEXT: [[PTR_SROA_2_0_EXTRACT_SHIFT:%.*]] = lshr i32 [[ARG1]], 8
132132
; CHECK-NEXT: [[PTR_SROA_2_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[PTR_SROA_2_0_EXTRACT_SHIFT]] to i16
133-
; CHECK-NEXT: #dbg_value(i16 undef, [[META9]], !DIExpression(DW_OP_LLVM_extract_bits_zext, 0, 16), [[META7]])
133+
; CHECK-NEXT: #dbg_value(i16 poison, [[META9]], !DIExpression(DW_OP_LLVM_extract_bits_zext, 0, 16), [[META7]])
134134
; CHECK-NEXT: [[PTR_SROA_21_0_EXTRACT_SHIFT:%.*]] = lshr i32 [[ARG1]], 24
135135
; CHECK-NEXT: [[PTR_SROA_21_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[PTR_SROA_21_0_EXTRACT_SHIFT]] to i8
136-
; CHECK-NEXT: #dbg_value(i8 undef, [[META8]], !DIExpression(DW_OP_LLVM_extract_bits_sext, 0, 8), [[META7]])
137-
; CHECK-NEXT: #dbg_value(i8 undef, [[META8]], !DIExpression(DW_OP_LLVM_extract_bits_sext, 0, 8), [[META7]])
136+
; CHECK-NEXT: #dbg_value(i8 poison, [[META8]], !DIExpression(DW_OP_LLVM_extract_bits_sext, 0, 8), [[META7]])
137+
; CHECK-NEXT: #dbg_value(i8 poison, [[META8]], !DIExpression(DW_OP_LLVM_extract_bits_sext, 0, 8), [[META7]])
138138
; CHECK-NEXT: ret i8 [[PTR_SROA_0_0_EXTRACT_TRUNC]]
139139
;
140140
entry:

llvm/test/Transforms/InstCombine/dbg-scalable-store-fixed-frag.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ define i32 @foo(<vscale x 2 x i32> %x) {
77
; CHECK-LABEL: @foo(
88
; CHECK-NEXT: entry:
99
; CHECK-NEXT: [[ARR:%.*]] = alloca i32, align 4
10-
; CHECK-NEXT: #dbg_value(<vscale x 2 x i32> undef, [[META8:![0-9]+]], !DIExpression(), [[META14:![0-9]+]])
10+
; CHECK-NEXT: #dbg_value(<vscale x 2 x i32> poison, [[META8:![0-9]+]], !DIExpression(), [[META14:![0-9]+]])
1111
; CHECK-NEXT: store <vscale x 2 x i32> [[X:%.*]], ptr [[ARR]], align 4
1212
; CHECK-NEXT: [[RES:%.*]] = load i32, ptr [[ARR]], align 4
1313
; CHECK-NEXT: ret i32 [[RES]]

llvm/test/Transforms/InstCombine/debuginfo.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ entry:
7474
; NOLOWER-NOT: store
7575
; NOLOWER-NOT: #dbg_declare
7676
; Here we want to find: call void @llvm.dbg.value(metadata i64 %o.coerce0, metadata [[VARIABLE_O]], metadata !DIExpression(DW_OP_LLVM_fragment, 0, 64))
77-
; NOLOWER: #dbg_value(i64 undef, {{.*}})
77+
; NOLOWER: #dbg_value(i64 poison, {{.*}})
7878
; NOLOWER-NOT: store
7979
; Here we want to find: call void @llvm.dbg.value(metadata i64 %o.coerce1, metadata [[VARIABLE_O]], metadata !DIExpression(DW_OP_LLVM_fragment, 64, 64))
80-
; NOLOWER: #dbg_value(i64 undef, {{.*}})
80+
; NOLOWER: #dbg_value(i64 poison, {{.*}})
8181
; NOLOWER-NOT: store
8282
; NOLOWER: call void @tworegs_callee(i64 %o.coerce0, i64 %o.coerce1)
8383

llvm/test/Transforms/Mem2Reg/dbg_declare_to_value_conversions.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ define i32 @foo2(ptr %arg) {
3333
store ptr %arg, ptr %arg.indirect_addr
3434
call void @llvm.dbg.declare(metadata ptr %arg.indirect_addr, metadata !25, metadata !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 2)), !dbg !40
3535
; CHECK-LABEL: @foo2
36-
; CHECK-NEXT: #dbg_value(ptr undef, {{.*}}, !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 2),
36+
; CHECK-NEXT: #dbg_value(ptr poison, {{.*}}, !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 2),
3737
%val = load i32, ptr %arg
3838
ret i32 %val
3939
}

llvm/test/Transforms/Mem2Reg/debug-alloca-vla-2.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ define void @scan(i32 %n) #0 !dbg !4 {
2525
; CHECK: for.cond:
2626
; CHECK-NEXT: [[VLA1_0:%.*]] = phi i32 [ undef, [[ENTRY:%.*]] ], [ [[T0:%.*]], [[FOR_COND]] ]
2727
; CHECK-NEXT: [[T0]] = add i32 [[VLA1_0]], 1
28-
; CHECK-NEXT: #dbg_value(i32 undef, [[META11:![0-9]+]], !DIExpression(), [[META19:![0-9]+]])
28+
; CHECK-NEXT: #dbg_value(i32 poison, [[META11:![0-9]+]], !DIExpression(), [[META19:![0-9]+]])
2929
; CHECK-NEXT: br label [[FOR_COND]], !dbg [[DBG10]]
3030
;
3131
entry:

0 commit comments

Comments
 (0)