Skip to content

Commit 44735aa

Browse files
committed
Remove nonfunctional support for DBG_VALUE_LIST Swift async entry values.
1 parent a593e9c commit 44735aa

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,10 +1408,9 @@ bool InstrRefBasedLDV::transferDebugValue(const MachineInstr &MI) {
14081408
}
14091409
}
14101410

1411-
if (convertToSwiftAsyncEntryValue && Expr) {
1412-
const_cast<MachineInstr *>(&MI)
1413-
->getOperand(MI.isDebugValueList() ? 1 : 3)
1414-
.setMetadata(DIExpression::prepend(Expr, DIExpression::EntryValue));
1411+
if (convertToSwiftAsyncEntryValue && Expr && !MI.isDebugValueList()) {
1412+
const_cast<MachineInstr *>(&MI)->getOperand(3).setMetadata(
1413+
DIExpression::prepend(Expr, DIExpression::EntryValue));
14151414
Properties.DIExpr = MI.getDebugExpression();
14161415
}
14171416
// END SWIFT

llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,10 +2199,12 @@ bool VarLocBasedLDV::ExtendRanges(MachineFunction &MF,
21992199
if (MI.isDebugValue()) {
22002200
// In Swift async functions entry values are preferred, since they
22012201
// can be evaluated in both live frames and virtual backtraces.
2202-
if (SeenDebugVars.insert(DebugVariable(MI.getDebugVariable(),
2203-
MI.getDebugExpression(),
2204-
MI.getDebugLoc()->getInlinedAt())).second &&
2205-
isSwiftAsyncContext(MI)) {
2202+
if (SeenDebugVars
2203+
.insert(DebugVariable(MI.getDebugVariable(),
2204+
MI.getDebugExpression(),
2205+
MI.getDebugLoc()->getInlinedAt()))
2206+
.second &&
2207+
isSwiftAsyncContext(MI) && !MI.isDebugValueList()) {
22062208
// If our instruction is not an entry value yet, make it an entry value.
22072209
if (!MI.getDebugExpression()->isEntryValue()) {
22082210
MI.getOperand(3).setMetadata(DIExpression::prepend(

llvm/test/DebugInfo/MIR/X86/swift-async-entryvalues.mir

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,15 @@ machineFunctionInfo: {}
211211
body: |
212212
bb.0 (%ir-block.3):
213213
liveins: $rdi, $rsi, $r14
214-
214+
215215
DBG_VALUE renamable $r14, 0, !59, !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 64, DW_OP_plus_uconst, 24, DW_OP_deref), debug-location !61
216216
frame-setup PUSH64r $r14, implicit-def $rsp, implicit $rsp
217217
CFI_INSTRUCTION def_cfa_offset 16
218218
$rsp = frame-setup SUB64ri8 $rsp, 32, implicit-def dead $eflags
219219
CFI_INSTRUCTION def_cfa_offset 48
220220
CFI_INSTRUCTION offset $r14, -16
221-
DBG_VALUE renamable $r14, 0, !54, !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 64, DW_OP_plus_uconst, 32), debug-location !58
221+
; This isn't supported, but it also shouldn't crash.
222+
DBG_VALUE_LIST !54, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_deref, DW_OP_plus_uconst, 64, DW_OP_plus_uconst, 32, DW_OP_stack_value), renamable $r14, debug-location !58
222223
$rcx = MOV64rr killed $rsi
223224
renamable $rax = MOV64rm renamable $r14, 1, $noreg, 0, $noreg, debug-location !47 :: (load 8 from %ir.4)
224225
MOV64mr $rsp, 1, $noreg, 24, $noreg, $rax :: (store 8 into %stack.0)

0 commit comments

Comments
 (0)