Skip to content

Commit 540b4a5

Browse files
committed
Revert "[DebugInfo] Enable variadic debug value salvaging"
This reverts commit adace79. Still breaks things, see comment on https://reviews.llvm.org/D91722
1 parent 558d9e8 commit 540b4a5

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

llvm/lib/Transforms/Utils/Local.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,11 @@ void llvm::salvageDebugInfoForDbgValues(
17481748
} else if (isa<DbgValueInst>(DII) &&
17491749
DII->getNumVariableLocationOps() + AdditionalValues.size() <=
17501750
MaxDebugArgs) {
1751-
DII->addVariableLocationOps(AdditionalValues, SalvagedExpr);
1751+
// TODO: Uncomment the line below and delete the two beneath it to enable
1752+
// salvaging of dbg.values with multiple location operands.
1753+
// DII->addVariableLocationOps(AdditionalValues, SalvagedExpr);
1754+
Value *Undef = UndefValue::get(I.getOperand(0)->getType());
1755+
DII->replaceVariableLocationOp(I.getOperand(0), Undef);
17521756
} else {
17531757
// Do not salvage using DIArgList for dbg.addr/dbg.declare, as it is
17541758
// currently only valid for stack value expressions.

llvm/test/DebugInfo/NVPTX/debug-info.ll

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -702,12 +702,12 @@ if.end: ; preds = %if.then, %entry
702702
; CHECK-NEXT: }
703703
; CHECK-NEXT: .section .debug_info
704704
; CHECK-NEXT: {
705-
; CHECK-NEXT:.b32 10034 // Length of Unit
705+
; CHECK-NEXT:.b32 10029 // Length of Unit
706706
; CHECK-NEXT:.b8 2 // DWARF version number
707707
; CHECK-NEXT:.b8 0
708708
; CHECK-NEXT:.b32 .debug_abbrev // Offset Into Abbrev. Section
709709
; CHECK-NEXT:.b8 8 // Address Size (in bytes)
710-
; CHECK-NEXT:.b8 1 // Abbrev [1] 0xb:0x272b DW_TAG_compile_unit
710+
; CHECK-NEXT:.b8 1 // Abbrev [1] 0xb:0x2726 DW_TAG_compile_unit
711711
; CHECK-NEXT:.b8 0 // DW_AT_producer
712712
; CHECK-NEXT:.b8 4 // DW_AT_language
713713
; CHECK-NEXT:.b8 0
@@ -8306,7 +8306,7 @@ if.end: ; preds = %if.then, %entry
83068306
; CHECK-NEXT:.b8 3 // DW_AT_decl_line
83078307
; CHECK-NEXT:.b32 3345 // DW_AT_type
83088308
; CHECK-NEXT:.b8 0 // End Of Children Mark
8309-
; CHECK-NEXT:.b8 40 // Abbrev [40] 0x2671:0xc4 DW_TAG_subprogram
8309+
; CHECK-NEXT:.b8 40 // Abbrev [40] 0x2671:0xbf DW_TAG_subprogram
83108310
; CHECK-NEXT:.b64 Lfunc_begin0 // DW_AT_low_pc
83118311
; CHECK-NEXT:.b64 Lfunc_end0 // DW_AT_high_pc
83128312
; CHECK-NEXT:.b8 1 // DW_AT_frame_base
@@ -8386,7 +8386,7 @@ if.end: ; preds = %if.then, %entry
83868386
; CHECK-NEXT:.b8 12 // DW_AT_call_file
83878387
; CHECK-NEXT:.b8 6 // DW_AT_call_line
83888388
; CHECK-NEXT:.b8 37 // DW_AT_call_column
8389-
; CHECK-NEXT:.b8 43 // Abbrev [43] 0x2711:0x23 DW_TAG_inlined_subroutine
8389+
; CHECK-NEXT:.b8 43 // Abbrev [43] 0x2711:0x1e DW_TAG_inlined_subroutine
83908390
; CHECK-NEXT:.b32 9791 // DW_AT_abstract_origin
83918391
; CHECK-NEXT:.b64 Ltmp9 // DW_AT_low_pc
83928392
; CHECK-NEXT:.b64 Ltmp10 // DW_AT_high_pc
@@ -8395,8 +8395,6 @@ if.end: ; preds = %if.then, %entry
83958395
; CHECK-NEXT:.b8 5 // DW_AT_call_column
83968396
; CHECK-NEXT:.b8 44 // Abbrev [44] 0x2729:0x5 DW_TAG_formal_parameter
83978397
; CHECK-NEXT:.b32 9820 // DW_AT_abstract_origin
8398-
; CHECK-NEXT:.b8 44 // Abbrev [44] 0x272e:0x5 DW_TAG_formal_parameter
8399-
; CHECK-NEXT:.b32 9829 // DW_AT_abstract_origin
84008398
; CHECK-NEXT:.b8 0 // End Of Children Mark
84018399
; CHECK-NEXT:.b8 0 // End Of Children Mark
84028400
; CHECK-NEXT:.b8 0 // End Of Children Mark

llvm/test/DebugInfo/salvage-gep.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
; XFAIL: *
12
; RUN: opt %s -dce -S | FileCheck %s
23

34
; Tests the salvaging of GEP instructions, specifically struct indexing and

llvm/test/DebugInfo/salvage-nonconst-binop.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
; XFAIL: *
12
; RUN: opt %s -dce -S | FileCheck %s
23

34
; Tests the salvaging of binary operators that use more than one non-constant

0 commit comments

Comments
 (0)