Skip to content

Commit 2e55fc0

Browse files
Use DIExpression:foldConstantMath() at the result of an appendOpsToArg()
1 parent adec8c2 commit 2e55fc0

File tree

10 files changed

+154
-57
lines changed

10 files changed

+154
-57
lines changed

llvm/lib/IR/DebugInfoMetadata.cpp

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,17 +1768,55 @@ DIExpression *DIExpression::appendOpsToArg(const DIExpression *Expr,
17681768
unsigned ArgNo, bool StackValue) {
17691769
assert(Expr && "Can't add ops to this expression");
17701770

1771+
unsigned OpCount = 0;
1772+
17711773
// Handle non-variadic intrinsics by prepending the opcodes.
17721774
if (!any_of(Expr->expr_ops(),
17731775
[](auto Op) { return Op.getOp() == dwarf::DW_OP_LLVM_arg; })) {
17741776
assert(ArgNo == 0 &&
17751777
"Location Index must be 0 for a non-variadic expression.");
1778+
1779+
for (auto It = Expr->expr_op_begin(); It != Expr->expr_op_end(); It++)
1780+
OpCount++;
17761781
SmallVector<uint64_t, 8> NewOps(Ops.begin(), Ops.end());
1777-
return DIExpression::prependOpcodes(Expr, NewOps, StackValue);
1782+
auto *Result = DIExpression::prependOpcodes(Expr, NewOps, StackValue);
1783+
1784+
// Instead of applying a foldConstantMath on the entire expression, apply it
1785+
// only on operations that are preppended + the succeeding operations
1786+
// totalling to the maximum foldable pattern.
1787+
uint64_t NewOpCount = 0;
1788+
for (auto It = Result->expr_op_begin(); It != Result->expr_op_end(); It++)
1789+
NewOpCount++;
1790+
1791+
// This is the number of new operations that were added to the expression,
1792+
// i.e. the number of operations in the Ops argument.
1793+
unsigned NumOfAddedOps = NewOpCount - OpCount;
1794+
// This is the number of operations that DIExpression::foldConstantMath
1795+
// should be applied upon, which is the number of new operations added + the
1796+
// succeeding operations totalling to the longest foldable pattern.
1797+
unsigned NumOfOpsToBeFolded = NumOfAddedOps + DIExpression::MaxRuleOpSize;
1798+
unsigned Count = 0;
1799+
SmallVector<uint64_t> OpsToBeFolded;
1800+
SmallVector<uint64_t> FoldedOps;
1801+
1802+
for (auto Op : Result->expr_ops()) {
1803+
if (Count < NumOfOpsToBeFolded) {
1804+
Op.appendToVector(OpsToBeFolded);
1805+
Count++;
1806+
} else {
1807+
Op.appendToVector(FoldedOps);
1808+
}
1809+
}
1810+
1811+
OpsToBeFolded = Result->foldConstantMath(OpsToBeFolded);
1812+
OpsToBeFolded.append(FoldedOps);
1813+
return DIExpression::get(Result->getContext(), OpsToBeFolded);
17781814
}
17791815

1816+
unsigned ArgPos;
17801817
SmallVector<uint64_t, 8> NewOps;
17811818
for (auto Op : Expr->expr_ops()) {
1819+
OpCount++;
17821820
// A DW_OP_stack_value comes at the end, but before a DW_OP_LLVM_fragment.
17831821
if (StackValue) {
17841822
if (Op.getOp() == dwarf::DW_OP_stack_value)
@@ -1789,13 +1827,54 @@ DIExpression *DIExpression::appendOpsToArg(const DIExpression *Expr,
17891827
}
17901828
}
17911829
Op.appendToVector(NewOps);
1792-
if (Op.getOp() == dwarf::DW_OP_LLVM_arg && Op.getArg(0) == ArgNo)
1830+
if (Op.getOp() == dwarf::DW_OP_LLVM_arg && Op.getArg(0) == ArgNo) {
17931831
NewOps.insert(NewOps.end(), Ops.begin(), Ops.end());
1832+
ArgPos = OpCount;
1833+
}
17941834
}
17951835
if (StackValue)
17961836
NewOps.push_back(dwarf::DW_OP_stack_value);
17971837

1798-
return DIExpression::get(Expr->getContext(), NewOps);
1838+
auto *Result = DIExpression::get(Expr->getContext(), NewOps);
1839+
1840+
// Instead of applying a foldConstantMath on the entire expression, apply it
1841+
// only on operations that are inserted to the ArgNo + the preceeding
1842+
// operations totalling to the maximum foldable pattern.
1843+
unsigned NewOpCount = 0;
1844+
for (auto It = Result->expr_op_begin(); It != Result->expr_op_end(); It++)
1845+
NewOpCount++;
1846+
1847+
unsigned Count = 0;
1848+
SmallVector<uint64_t> OpsToBeFolded;
1849+
SmallVector<uint64_t> FoldedOps;
1850+
SmallVector<uint64_t> RemainingOps;
1851+
1852+
// This is the number of operations we can consider already folded in the
1853+
// expression, which precede the ArgNo that the Ops are appended to.
1854+
unsigned FoldedOpCount = ArgPos > DIExpression::MaxRuleOpSize
1855+
? ArgPos - DIExpression::MaxRuleOpSize
1856+
: 0;
1857+
// This is the number of operations that DIExpression::foldConstantMath should
1858+
// be applied upon, which is the number of new operations added + the
1859+
// preceeding operations totalling to the maximum foldable pattern.
1860+
unsigned OpsToBeFoldedCount =
1861+
NewOpCount - OpCount + DIExpression::MaxRuleOpSize;
1862+
1863+
for (auto Op : Result->expr_ops()) {
1864+
if (Count < FoldedOpCount) {
1865+
Op.appendToVector(FoldedOps);
1866+
Count++;
1867+
} else if (Count >= FoldedOpCount && Count < OpsToBeFoldedCount) {
1868+
Op.appendToVector(OpsToBeFolded);
1869+
Count++;
1870+
} else
1871+
Op.appendToVector(RemainingOps);
1872+
}
1873+
1874+
OpsToBeFolded = Result->foldConstantMath(OpsToBeFolded);
1875+
FoldedOps.append(OpsToBeFolded);
1876+
FoldedOps.append(RemainingOps);
1877+
return DIExpression::get(Result->getContext(), FoldedOps);
17991878
}
18001879

18011880
DIExpression *DIExpression::replaceArg(const DIExpression *Expr,

llvm/test/DebugInfo/MIR/InstrRef/deref-spills-with-size.mir

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@
8383
# DWARF-NEXT: DW_OP_breg7 RSP-8
8484
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_stack_value
8585
## scalar / stack value with various sizes.
86-
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x8, DW_OP_lit1, DW_OP_plus, DW_OP_stack_value
87-
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref, DW_OP_lit1, DW_OP_plus, DW_OP_stack_value
88-
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_lit1, DW_OP_plus, DW_OP_stack_value)
86+
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x8, DW_OP_plus_uconst 0x1, DW_OP_stack_value
87+
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref, DW_OP_plus_uconst 0x1, DW_OP_stack_value
88+
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_plus_uconst 0x1, DW_OP_stack_value)
8989
# DWARF: DW_AT_name ("flannel")
9090

9191
# Variable with fragments.
@@ -96,9 +96,9 @@
9696
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_piece 0x4
9797
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_stack_value, DW_OP_piece 0x4
9898
## Scalar / stack value with various sizes.
99-
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x8, DW_OP_lit1, DW_OP_plus, DW_OP_stack_value, DW_OP_piece 0x4
100-
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x4, DW_OP_lit1, DW_OP_plus, DW_OP_stack_value, DW_OP_piece 0x4
101-
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_lit1, DW_OP_plus, DW_OP_stack_value, DW_OP_piece 0x4)
99+
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x8, DW_OP_plus_uconst 0x1, DW_OP_stack_value, DW_OP_piece 0x4
100+
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x4, DW_OP_plus_uconst 0x1, DW_OP_stack_value, DW_OP_piece 0x4
101+
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_plus_uconst 0x1, DW_OP_stack_value, DW_OP_piece 0x4)
102102
# DWARF: DW_AT_name ("shoes")
103103

104104
--- |
@@ -308,7 +308,7 @@ body: |
308308
$rax = MOV64ri 0, debug-location !7
309309
DBG_INSTR_REF !8, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value), dbg-instr-ref(16, 0), debug-location !7
310310
; CHECK: DBG_VALUE_LIST ![[VARNUM]],
311-
; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 8, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value), $rsp
311+
; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 8, DW_OP_plus_uconst, 1, DW_OP_stack_value), $rsp
312312
$eax = MOV32ri 0, debug-location !7
313313
DBG_VALUE $noreg, $noreg, !8, !DIExpression(), debug-location !7
314314
; CHECK: DBG_VALUE $noreg, $noreg
@@ -319,7 +319,7 @@ body: |
319319
$rax = MOV64ri 0, debug-location !7
320320
DBG_INSTR_REF !8, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value), dbg-instr-ref(17, 0), debug-location !7
321321
; CHECK: DBG_VALUE_LIST ![[VARNUM]],
322-
; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value), $rsp
322+
; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref, DW_OP_plus_uconst, 1, DW_OP_stack_value), $rsp
323323
$eax = MOV32ri 0, debug-location !7
324324
DBG_VALUE $noreg, $noreg, !8, !DIExpression(), debug-location !7
325325
; CHECK: DBG_VALUE $noreg, $noreg
@@ -330,7 +330,7 @@ body: |
330330
$rax = MOV64ri 0, debug-location !7
331331
DBG_INSTR_REF !8, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value), dbg-instr-ref(18, 0), debug-location !7
332332
; CHECK: DBG_VALUE_LIST ![[VARNUM]],
333-
; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 1, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value), $rsp
333+
; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 1, DW_OP_plus_uconst, 1, DW_OP_stack_value), $rsp
334334
$eax = MOV32ri 0, debug-location !7
335335
DBG_VALUE $noreg, $noreg, !8, !DIExpression(), debug-location !7
336336
; CHECK: DBG_VALUE $noreg, $noreg
@@ -341,7 +341,7 @@ body: |
341341
$rax = MOV64ri 0, debug-location !7
342342
DBG_INSTR_REF !10, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), dbg-instr-ref(19, 0), debug-location !7
343343
; CHECK: DBG_VALUE_LIST ![[VARNUM2]],
344-
; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 8, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), $rsp
344+
; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 8, DW_OP_plus_uconst, 1, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), $rsp
345345
$eax = MOV32ri 0, debug-location !7
346346
DBG_VALUE $noreg, $noreg, !10, !DIExpression(DW_OP_LLVM_fragment, 0, 32), debug-location !7
347347
; CHECK: DBG_VALUE $noreg, $noreg
@@ -352,7 +352,7 @@ body: |
352352
$rax = MOV64ri 0, debug-location !7
353353
DBG_INSTR_REF !10, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), dbg-instr-ref(20, 0), debug-location !7
354354
; CHECK: DBG_VALUE_LIST ![[VARNUM2]],
355-
; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 4, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), $rsp
355+
; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 4, DW_OP_plus_uconst, 1, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), $rsp
356356
$eax = MOV32ri 0, debug-location !7
357357
DBG_VALUE $noreg, $noreg, !10, !DIExpression(DW_OP_LLVM_fragment, 0, 32), debug-location !7
358358
; CHECK: DBG_VALUE $noreg, $noreg
@@ -363,7 +363,7 @@ body: |
363363
$rax = MOV64ri 0, debug-location !7
364364
DBG_INSTR_REF !10, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), dbg-instr-ref(21, 0), debug-location !7
365365
; CHECK: DBG_VALUE_LIST ![[VARNUM2]],
366-
; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 1, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), $rsp
366+
; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 1, DW_OP_plus_uconst, 1, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), $rsp
367367
$eax = MOV32ri 0, debug-location !7
368368
DBG_VALUE $noreg, $noreg, !10, !DIExpression(DW_OP_LLVM_fragment, 0, 32), debug-location !7
369369
; CHECK: DBG_VALUE $noreg, $noreg

llvm/test/DebugInfo/MIR/InstrRef/follow-spill-of-indir-value.mir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
##
2828
## Second location, variable pointed to by the register value plus eight.
2929
##
30-
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref, DW_OP_lit8, DW_OP_plus)
30+
# DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref, DW_OP_plus_uconst 0x8)
3131
##
3232
## Spilt to stack: push stack location and deref the pointer onto the dwarf
3333
## expr stack. Then add eight to it, and it points to the variable.
@@ -135,7 +135,7 @@ body: |
135135
; CHECK: DBG_VALUE $rdi,
136136
MOV64mr $rsp, 1, $noreg, -8, $noreg, $rdi :: (store (s64) into %stack.0)
137137
$rdi = MOV64ri 0
138-
; CHECK: DBG_VALUE $rsp, 0, ![[VARNUM]], !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_deref, DW_OP_constu, 8, DW_OP_plus),
138+
; CHECK: DBG_VALUE $rsp, 0, ![[VARNUM]], !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_deref, DW_OP_plus_uconst, 8),
139139
140140
renamable $rax = MOV64rm $rsp, 1, $noreg, -8, $noreg :: (load (s64) from %stack.0)
141141
renamable $eax = MOV32rm killed renamable $rax, 1, $noreg, 0, $noreg, debug-location !24 :: (load (s32) from %ir.i1, !tbaa !25)

llvm/test/DebugInfo/salvage-icmp.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
; CHECK: call void @llvm.dbg.value(metadata i32 %a,
77
; CHECK-SAME: ![[VAR_C:[0-9]+]],
8-
; CHECK-SAME: !DIExpression(DW_OP_constu, 0, DW_OP_ne, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_constu, 0, DW_OP_eq, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_constu, 1, DW_OP_gt, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_consts, 18446744073709551615, DW_OP_gt, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_constu, 2, DW_OP_ge, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_consts, 18446744073709551614, DW_OP_ge, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_constu, 3, DW_OP_lt, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_consts, 18446744073709551613, DW_OP_lt, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_constu, 4, DW_OP_le, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_consts, 18446744073709551612, DW_OP_le, DW_OP_stack_value))
8+
; CHECK-SAME: !DIExpression(DW_OP_lit0, DW_OP_ne, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_lit0, DW_OP_eq, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_constu, 1, DW_OP_gt, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_consts, 18446744073709551615, DW_OP_gt, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_constu, 2, DW_OP_ge, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_consts, 18446744073709551614, DW_OP_ge, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_constu, 3, DW_OP_lt, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_consts, 18446744073709551613, DW_OP_lt, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_constu, 4, DW_OP_le, DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_consts, 18446744073709551612, DW_OP_le, DW_OP_stack_value))
99

1010
; CHECK: call void @llvm.dbg.value(metadata !DIArgList(i32 %a, i32 %a, i32 %a, i32 %b, i32 %a, i32 %b, i32 %b, i32 %a, i32 %a, i32 %b, i32 %b),
1111
; CHECK-SAME: ![[VAR_C:[0-9]+]],

llvm/test/Transforms/Coroutines/swift-async-dbg.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ define swifttailcc void @coroutineA(ptr swiftasync %arg) !dbg !48 {
3030
; CHECK-LABEL: define {{.*}} @coroutineA(
3131
; CHECK-SAME: ptr swiftasync %[[frame_ptr:.*]])
3232
; CHECK: @llvm.dbg.declare(metadata ptr %[[frame_ptr]], {{.*}} !DIExpression(
33-
; CHECK-SAME: DW_OP_plus_uconst, 16, DW_OP_plus_uconst, 8)
33+
; CHECK-SAME: DW_OP_plus_uconst, 24)
3434
; CHECK: @llvm.dbg.value(metadata ptr %[[frame_ptr]], {{.*}} !DIExpression(
3535
; CHECK-SAME: DW_OP_plus_uconst, 16, DW_OP_deref)
3636
; CHECK: call {{.*}} @swift_task_switch
@@ -49,7 +49,7 @@ define swifttailcc void @coroutineA(ptr swiftasync %arg) !dbg !48 {
4949
; CHECK-LABEL: define {{.*}} @coroutineATY0_(
5050
; CHECK-SAME: ptr swiftasync %[[frame_ptr:.*]])
5151
; CHECK: @llvm.dbg.declare(metadata ptr %[[frame_ptr]], {{.*}} !DIExpression(
52-
; CHECK-SAME: DW_OP_LLVM_entry_value, 1, DW_OP_plus_uconst, 16, DW_OP_plus_uconst, 8)
52+
; CHECK-SAME: DW_OP_LLVM_entry_value, 1, DW_OP_plus_uconst, 24)
5353
; CHECK: @llvm.dbg.value(metadata ptr %[[frame_ptr]], {{.*}} !DIExpression(
5454
; CHECK-SAME: DW_OP_LLVM_entry_value, 1, DW_OP_plus_uconst, 16, DW_OP_deref)
5555
; CHECK: @llvm.dbg.value(metadata !DIArgList(ptr %[[frame_ptr]], i32 %{{.*}}), {{.*}} !DIExpression(
@@ -70,7 +70,7 @@ define swifttailcc void @coroutineA(ptr swiftasync %arg) !dbg !48 {
7070
; CHECK-SAME: ptr swiftasync %[[frame_ptr:.*]])
7171
; Note the extra level of indirection that shows up here!
7272
; CHECK: @llvm.dbg.declare(metadata ptr %[[frame_ptr]], {{.*}} !DIExpression(
73-
; CHECK-SAME: DW_OP_LLVM_entry_value, 1, DW_OP_deref, DW_OP_plus_uconst, 16, DW_OP_plus_uconst, 8)
73+
; CHECK-SAME: DW_OP_LLVM_entry_value, 1, DW_OP_deref, DW_OP_plus_uconst, 24)
7474
; CHECK: @llvm.dbg.value(metadata ptr %[[frame_ptr]], {{.*}} !DIExpression(
7575
; CHECK-SAME: DW_OP_LLVM_entry_value, 1, DW_OP_deref, DW_OP_plus_uconst, 16, DW_OP_deref)
7676
; CHECK: call {{.*}} @swift_task_switch
@@ -85,7 +85,7 @@ define swifttailcc void @coroutineA(ptr swiftasync %arg) !dbg !48 {
8585
; CHECK-LABEL: define {{.*}} @coroutineATY2_(
8686
; CHECK-SAME: ptr swiftasync %[[frame_ptr:.*]])
8787
; CHECK: @llvm.dbg.declare(metadata ptr %[[frame_ptr]], {{.*}} !DIExpression(
88-
; CHECK-SAME: DW_OP_LLVM_entry_value, 1, DW_OP_plus_uconst, 16, DW_OP_plus_uconst, 8)
88+
; CHECK-SAME: DW_OP_LLVM_entry_value, 1, DW_OP_plus_uconst, 24)
8989
}
9090

9191
; Everything from here on is just support code for the coroutines.

llvm/test/Transforms/InstCombine/cast-mul-select.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ define void @PR36225(i32 %a, i32 %b, i1 %c1, i3 %v1, i3 %v2) {
207207
; DBGINFO-NEXT: entry:
208208
; DBGINFO-NEXT: br label [[WHILE_BODY:%.*]], !dbg [[DBG94:![0-9]+]]
209209
; DBGINFO: while.body:
210-
; DBGINFO-NEXT: call void @llvm.dbg.value(metadata i32 [[B:%.*]], metadata [[META89:![0-9]+]], metadata !DIExpression(DW_OP_constu, 0, DW_OP_eq, DW_OP_stack_value)), !dbg [[DBG95:![0-9]+]]
210+
; DBGINFO-NEXT: call void @llvm.dbg.value(metadata i32 [[B:%.*]], metadata [[META89:![0-9]+]], metadata !DIExpression(DW_OP_lit0, DW_OP_eq, DW_OP_stack_value)), !dbg [[DBG95:![0-9]+]]
211211
; DBGINFO-NEXT: br i1 [[C1:%.*]], label [[FOR_BODY3_US:%.*]], label [[FOR_BODY3:%.*]], !dbg [[DBG96:![0-9]+]]
212212
; DBGINFO: for.body3.us:
213213
; DBGINFO-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[B]], 0, !dbg [[DBG95]]

llvm/test/Transforms/InstCombine/debuginfo-dce.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ entry:
6161
; CHECK: define void @salvage_gep0
6262
; CHECK-NEXT: entry:
6363
; CHECK-NEXT: call void @llvm.dbg.value(metadata ptr %queue,
64-
; CHECK-SAME: metadata !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_plus_uconst, 0, DW_OP_stack_value))
64+
; CHECK-SAME: metadata !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_stack_value))
6565
store ptr %1, ptr %im_not_dead, align 8
6666
ret void, !dbg !26
6767
}

0 commit comments

Comments
 (0)