Skip to content

Commit

Permalink
[DebugInfo][RemoveDIs] Handle dbg.declares in SelectionDAGISel (#73496)
Browse files Browse the repository at this point in the history
This is a boring mechanical update to support DPValues that look like
dbg.declares in SelectionDAG.

The tests will become "live" once #74090 lands (see for more info).
  • Loading branch information
OCHyams committed Dec 12, 2023
1 parent b204321 commit 5ee0881
Show file tree
Hide file tree
Showing 26 changed files with 134 additions and 52 deletions.
1 change: 1 addition & 0 deletions llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ class FunctionLoweringInfo {
/// Collection of dbg.declare instructions handled after argument
/// lowering and before ISel proper.
SmallPtrSet<const DbgDeclareInst *, 8> PreprocessedDbgDeclares;
SmallPtrSet<const DPValue *, 8> PreprocessedDPVDeclares;

/// set - Initialize this FunctionLoweringInfo with the given Function
/// and its associated MachineFunction.
Expand Down
1 change: 1 addition & 0 deletions llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ void FunctionLoweringInfo::clear() {
StatepointRelocationMaps.clear();
PreferredExtendType.clear();
PreprocessedDbgDeclares.clear();
PreprocessedDPVDeclares.clear();
}

/// CreateReg - Allocate a single virtual register for the given type.
Expand Down
122 changes: 70 additions & 52 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,60 @@ SDValue SelectionDAGBuilder::getControlRoot() {
return updateRoot(PendingExports);
}

void SelectionDAGBuilder::handleDebugDeclare(Value *Address,
DILocalVariable *Variable,
DIExpression *Expression,
DebugLoc DL) {
assert(Variable && "Missing variable");

// Check if address has undef value.
if (!Address || isa<UndefValue>(Address) ||
(Address->use_empty() && !isa<Argument>(Address))) {
LLVM_DEBUG(
dbgs()
<< "dbg_declare: Dropping debug info (bad/undef/unused-arg address)\n");
return;
}

bool IsParameter = Variable->isParameter() || isa<Argument>(Address);

SDValue &N = NodeMap[Address];
if (!N.getNode() && isa<Argument>(Address))
// Check unused arguments map.
N = UnusedArgNodeMap[Address];
SDDbgValue *SDV;
if (N.getNode()) {
if (const BitCastInst *BCI = dyn_cast<BitCastInst>(Address))
Address = BCI->getOperand(0);
// Parameters are handled specially.
auto *FINode = dyn_cast<FrameIndexSDNode>(N.getNode());
if (IsParameter && FINode) {
// Byval parameter. We have a frame index at this point.
SDV = DAG.getFrameIndexDbgValue(Variable, Expression, FINode->getIndex(),
/*IsIndirect*/ true, DL, SDNodeOrder);
} else if (isa<Argument>(Address)) {
// Address is an argument, so try to emit its dbg value using
// virtual register info from the FuncInfo.ValueMap.
EmitFuncArgumentDbgValue(Address, Variable, Expression, DL,
FuncArgumentDbgValueKind::Declare, N);
return;
} else {
SDV = DAG.getDbgValue(Variable, Expression, N.getNode(), N.getResNo(),
true, DL, SDNodeOrder);
}
DAG.AddDbgValue(SDV, IsParameter);
} else {
// If Address is an argument then try to emit its dbg value using
// virtual register info from the FuncInfo.ValueMap.
if (!EmitFuncArgumentDbgValue(Address, Variable, Expression, DL,
FuncArgumentDbgValueKind::Declare, N)) {
LLVM_DEBUG(dbgs() << "dbg_declare: Dropping debug info"
<< " (could not emit func-arg dbg_value)\n");
}
}
return;
}

void SelectionDAGBuilder::visitDbgInfo(const Instruction &I) {
// Add SDDbgValue nodes for any var locs here. Do so before updating
// SDNodeOrder, as this mapping is {Inst -> Locs BEFORE Inst}.
Expand Down Expand Up @@ -1182,6 +1236,16 @@ void SelectionDAGBuilder::visitDbgInfo(const Instruction &I) {
DIExpression *Expression = DPV.getExpression();
dropDanglingDebugInfo(Variable, Expression);

if (DPV.getType() == DPValue::LocationType::Declare) {
if (FuncInfo.PreprocessedDPVDeclares.contains(&DPV))
continue;
LLVM_DEBUG(dbgs() << "SelectionDAG visiting dbg_declare: " << DPV
<< "\n");
handleDebugDeclare(DPV.getVariableLocationOp(0), Variable, Expression,
DPV.getDebugLoc());
continue;
}

// A DPValue with no locations is a kill location.
SmallVector<Value *, 4> Values(DPV.location_ops());
if (Values.empty()) {
Expand Down Expand Up @@ -6218,61 +6282,15 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
if (AssignmentTrackingEnabled ||
FuncInfo.PreprocessedDbgDeclares.count(&DI))
return;
// Assume dbg.declare can not currently use DIArgList, i.e.
// it is non-variadic.
assert(!DI.hasArgList() && "Only dbg.value should currently use DIArgList");
LLVM_DEBUG(dbgs() << "SelectionDAG visiting dbg_declare: " << DI << "\n");
DILocalVariable *Variable = DI.getVariable();
DIExpression *Expression = DI.getExpression();
dropDanglingDebugInfo(Variable, Expression);
assert(Variable && "Missing variable");
LLVM_DEBUG(dbgs() << "SelectionDAG visiting debug intrinsic: " << DI
<< "\n");
// Check if address has undef value.
const Value *Address = DI.getVariableLocationOp(0);
if (!Address || isa<UndefValue>(Address) ||
(Address->use_empty() && !isa<Argument>(Address))) {
LLVM_DEBUG(dbgs() << "Dropping debug info for " << DI
<< " (bad/undef/unused-arg address)\n");
return;
}

bool isParameter = Variable->isParameter() || isa<Argument>(Address);

SDValue &N = NodeMap[Address];
if (!N.getNode() && isa<Argument>(Address))
// Check unused arguments map.
N = UnusedArgNodeMap[Address];
SDDbgValue *SDV;
if (N.getNode()) {
if (const BitCastInst *BCI = dyn_cast<BitCastInst>(Address))
Address = BCI->getOperand(0);
// Parameters are handled specially.
auto FINode = dyn_cast<FrameIndexSDNode>(N.getNode());
if (isParameter && FINode) {
// Byval parameter. We have a frame index at this point.
SDV =
DAG.getFrameIndexDbgValue(Variable, Expression, FINode->getIndex(),
/*IsIndirect*/ true, dl, SDNodeOrder);
} else if (isa<Argument>(Address)) {
// Address is an argument, so try to emit its dbg value using
// virtual register info from the FuncInfo.ValueMap.
EmitFuncArgumentDbgValue(Address, Variable, Expression, dl,
FuncArgumentDbgValueKind::Declare, N);
return;
} else {
SDV = DAG.getDbgValue(Variable, Expression, N.getNode(), N.getResNo(),
true, dl, SDNodeOrder);
}
DAG.AddDbgValue(SDV, isParameter);
} else {
// If Address is an argument then try to emit its dbg value using
// virtual register info from the FuncInfo.ValueMap.
if (!EmitFuncArgumentDbgValue(Address, Variable, Expression, dl,
FuncArgumentDbgValueKind::Declare, N)) {
LLVM_DEBUG(dbgs() << "Dropping debug info for " << DI
<< " (could not emit func-arg dbg_value)\n");
}
}
// Assume dbg.declare can not currently use DIArgList, i.e.
// it is non-variadic.
assert(!DI.hasArgList() && "Only dbg.value should currently use DIArgList");
handleDebugDeclare(DI.getVariableLocationOp(0), Variable, Expression,
DI.getDebugLoc());
return;
}
case Intrinsic::dbg_label: {
Expand Down
3 changes: 3 additions & 0 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ class SelectionDAGBuilder {
void handleKillDebugValue(DILocalVariable *Var, DIExpression *Expr,
DebugLoc DbgLoc, unsigned Order);

void handleDebugDeclare(Value *Address, DILocalVariable *Variable,
DIExpression *Expression, DebugLoc DL);

/// Evict any dangling debug information, attempting to salvage it first.
void resolveOrClearDbgInfo();

Expand Down
8 changes: 8 additions & 0 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,14 @@ static void processDbgDeclares(FunctionLoweringInfo &FuncInfo) {
if (DI && processDbgDeclare(FuncInfo, DI->getAddress(), DI->getExpression(),
DI->getVariable(), DI->getDebugLoc()))
FuncInfo.PreprocessedDbgDeclares.insert(DI);

for (const DPValue &DPV : I.getDbgValueRange()) {
if (DPV.getType() == DPValue::LocationType::Declare &&
processDbgDeclare(FuncInfo, DPV.getVariableLocationOp(0),
DPV.getExpression(), DPV.getVariable(),
DPV.getDebugLoc()))
FuncInfo.PreprocessedDPVDeclares.insert(&DPV);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions llvm/test/CodeGen/X86/dbg-combine.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: llc -mtriple x86_64-pc-linux -O0 < %s | FileCheck %s
; RUN: llc --try-experimental-debuginfo-iterators -mtriple x86_64-pc-linux -O0 < %s | FileCheck %s

; Make sure that the sequence of debug locations for function foo is correctly
; generated. More specifically, .loc entries for lines 4,5,6,7 must appear in
Expand Down
1 change: 1 addition & 0 deletions llvm/test/CodeGen/X86/selectiondag-order.ll
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
; Check that debug intrinsics do not affect code generation.

; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck --check-prefix=X86-CHECK %s
; RUN: llc --try-experimental-debuginfo-iterators < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck --check-prefix=X86-CHECK %s

define i64 @simulate(<2 x i32> %a) {
entry:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: %llc_dwarf -O2 %s -o - | FileCheck %s
; RUN: %llc_dwarf --try-experimental-debuginfo-iterators -O2 %s -o - | FileCheck %s
; Check struct X for dead variable xyz from inlined function foo.

; CHECK: {{.section.*debug_info|.*dwinfo:}}
Expand Down
1 change: 1 addition & 0 deletions llvm/test/DebugInfo/Mips/InlinedFnLocalVar.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: llc -mtriple mips-linux-gnu -O2 %s -o - | FileCheck %s
; RUN: llc --try-experimental-debuginfo-iterators -mtriple mips-linux-gnu -O2 %s -o - | FileCheck %s
; Check struct X for dead variable xyz from inlined function foo.

; CHECK: .section .debug_info,"",@0x7000001e
Expand Down
1 change: 1 addition & 0 deletions llvm/test/DebugInfo/X86/DW_AT_const_value.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: llc %s -o - | FileCheck %s
; RUN: llc --try-experimental-debuginfo-iterators %s -o - | FileCheck %s

;; Check single location variables of various types with a constant value are
;; emitted with a DW_AT_const_value attribute.
Expand Down
1 change: 1 addition & 0 deletions llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: llc -mtriple i686-pc-cygwin -O2 %s -o - | FileCheck %s
; RUN: llc --try-experimental-debuginfo-iterators -mtriple i686-pc-cygwin -O2 %s -o - | FileCheck %s
; Check struct X for dead variable xyz from inlined function foo.

; CHECK: Lsection_info
Expand Down
3 changes: 3 additions & 0 deletions llvm/test/DebugInfo/X86/block-capture.ll
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
; RUN: llc %s -o %t -filetype=obj
; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s

; RUN: llc --try-experimental-debuginfo-iterators %s -o %t -filetype=obj
; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s

; Checks that we emit debug info for the block variable declare.
; CHECK: DW_TAG_subprogram
; CHECK: DW_TAG_variable
Expand Down
6 changes: 6 additions & 0 deletions llvm/test/DebugInfo/X86/dbg-empty-metadata-lowering.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
; RUN: | FileCheck %s --implicit-check-not=DBG --check-prefixes=AT-DISABLED,BOTH
; RUN: llc %s -stop-after=finalize-isel -o - --try-experimental-debuginfo-iterators \
; RUN: | FileCheck %s --implicit-check-not=DBG --check-prefixes=AT-DISABLED,BOTH
; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG --check-prefixes=AT-DISABLED,BOTH

;; Check that dbg.values with empty metadata are treated as kills (i.e. become
;; DBG_VALUE $noreg, ...). dbg.declares with empty metadata location operands
;; should be ignored.

; RUN: sed 's/;Uncomment-with-sed//g' < %s \
; RUN: | llc -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG --check-prefixes=AT-ENABLED,BOTH
; RUN: sed 's/;Uncomment-with-sed//g' < %s \
; RUN: | llc --try-experimental-debuginfo-iterators -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG --check-prefixes=AT-ENABLED,BOTH
;; Check the same behaviour occurs with assignment tracking enabled.

;; First ensure assignment tracking is truly unset/set.
Expand Down
3 changes: 3 additions & 0 deletions llvm/test/DebugInfo/X86/debug-info-block-captured-self.ll
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
; RUN: llc -mtriple x86_64-apple-darwin -filetype=obj -o %t.o < %s
; RUN: llvm-dwarfdump %t.o | FileCheck %s
;
; RUN: llc --try-experimental-debuginfo-iterators -mtriple x86_64-apple-darwin -filetype=obj -o %t.o < %s
; RUN: llvm-dwarfdump %t.o | FileCheck %s
;
; Test that DW_AT_location is generated for a captured "self" inside a
; block.
;
Expand Down
3 changes: 3 additions & 0 deletions llvm/test/DebugInfo/X86/debug-info-blocks.ll
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
; RUN: llc -mtriple x86_64-apple-darwin -filetype=obj -o %t.o < %s
; RUN: llvm-dwarfdump -v -debug-info %t.o | FileCheck %s

; RUN: llc --try-experimental-debuginfo-iterators -mtriple x86_64-apple-darwin -filetype=obj -o %t.o < %s
; RUN: llvm-dwarfdump -v -debug-info %t.o | FileCheck %s

; Generated from llvm/tools/clang/test/CodeGenObjC/debug-info-blocks.m
; rdar://problem/9279956
; test that the DW_AT_location of self is at ( fbreg +{{[0-9]+}}, deref, +{{[0-9]+}} )
Expand Down
1 change: 1 addition & 0 deletions llvm/test/DebugInfo/X86/empty-metadata-dbg-declare.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: llc %s -stop-after=finalize-isel -o - | FileCheck %s --implicit-check-not=DBG
; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - | FileCheck %s --implicit-check-not=DBG

;; Check that a single "empty metadata" dbg.declare doesn't accidentally cause
;; other dbg.declares in the function to go missing.
Expand Down
1 change: 1 addition & 0 deletions llvm/test/DebugInfo/X86/pieces-3.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: llc %s -filetype=obj -o - -experimental-debug-variable-locations=true | llvm-dwarfdump -v - | FileCheck %s
; RUN: llc --try-experimental-debuginfo-iterators %s -filetype=obj -o - -experimental-debug-variable-locations=true | llvm-dwarfdump -v - | FileCheck %s
;
; // Compile with -O1
; typedef struct {
Expand Down
2 changes: 2 additions & 0 deletions llvm/test/DebugInfo/X86/pieces-4.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
; RUN: llc < %s -experimental-debug-variable-locations=true | FileCheck %s
; RUN: llc -filetype=obj < %s -experimental-debug-variable-locations=true | llvm-dwarfdump -debug-loc - | FileCheck %s --check-prefix=DWARF
; RUN: llc --try-experimental-debuginfo-iterators < %s -experimental-debug-variable-locations=true | FileCheck %s
; RUN: llc --try-experimental-debuginfo-iterators -filetype=obj < %s -experimental-debug-variable-locations=true | llvm-dwarfdump -debug-loc - | FileCheck %s --check-prefix=DWARF

; Compile the following with -O1:

Expand Down
2 changes: 2 additions & 0 deletions llvm/test/DebugInfo/X86/safestack-byval.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
; SafeStack for unsafe byval arguments.
; RUN: llc -mtriple=x86_64-unknown-unknown --experimental-debug-variable-locations=false -stop-after finalize-isel %s -o - | FileCheck %s --check-prefixes=CHECK,NORMAL
; RUN: llc -mtriple=x86_64-unknown-unknown --experimental-debug-variable-locations -stop-after finalize-isel %s -o - | FileCheck %s --check-prefixes=CHECK,INSTRREF
; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-unknown-unknown --experimental-debug-variable-locations=false -stop-after finalize-isel %s -o - | FileCheck %s --check-prefixes=CHECK,NORMAL
; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-unknown-unknown --experimental-debug-variable-locations -stop-after finalize-isel %s -o - | FileCheck %s --check-prefixes=CHECK,INSTRREF

; This was built by compiling the following source with SafeStack and
; simplifying the result a little.
Expand Down
1 change: 1 addition & 0 deletions llvm/test/DebugInfo/X86/salvage-add-node-indirect.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3
; RUN: llc -mtriple=x86_64 %s -start-before=x86-isel -o - -stop-after=x86-isel | FileCheck %s
; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64 %s -start-before=x86-isel -o - -stop-after=x86-isel | FileCheck %s

; Verify that we don't crash due to attempting to turn the indirect debug value
; in @test_non_constant variadic when salvaging the ADD node with non-constant
Expand Down
7 changes: 7 additions & 0 deletions llvm/test/DebugInfo/X86/spill-indirect-nrvo.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
; RUN: llc < %s -experimental-debug-variable-locations=true | FileCheck -check-prefixes=CHECK,OPT %s
; RUN: llc -O0 < %s -experimental-debug-variable-locations=true | FileCheck -check-prefixes=CHECK,OPTNONE %s

; RUN: llc --try-experimental-debuginfo-iterators < %s -experimental-debug-variable-locations=false | FileCheck -check-prefixes=CHECK,OPT %s
;; FIXME: RemoveDIs - enable when FastISel support is added.
; run: llc --try-experimental-debuginfo-iterators -O0 < %s -experimental-debug-variable-locations=false | FileCheck -check-prefixes=CHECK,OPTNONE %s
; RUN: llc --try-experimental-debuginfo-iterators < %s -experimental-debug-variable-locations=true | FileCheck -check-prefixes=CHECK,OPT %s
;; FIXME: RemoveDIs - enable when FastISel support is added.
; run: llc --try-experimental-debuginfo-iterators -O0 < %s -experimental-debug-variable-locations=true | FileCheck -check-prefixes=CHECK,OPTNONE %s

; Make sure we insert DW_OP_deref when spilling indirect DBG_VALUE instructions.

; C++ source:
Expand Down
2 changes: 2 additions & 0 deletions llvm/test/DebugInfo/X86/spill-nontrivial-param.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
; RUN: llc < %s -experimental-debug-variable-locations=false | FileCheck %s
; RUN: llc < %s -experimental-debug-variable-locations=true | FileCheck %s
; RUN: llc --try-experimental-debuginfo-iterators < %s -experimental-debug-variable-locations=false | FileCheck %s
; RUN: llc --try-experimental-debuginfo-iterators < %s -experimental-debug-variable-locations=true | FileCheck %s

; Make sure we insert DW_OP_deref when spilling indirect DBG_VALUE instructions.
; In this example, 'nt' is passed by address because it is not trivially
Expand Down
8 changes: 8 additions & 0 deletions llvm/test/DebugInfo/X86/sret.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
; RUN: llc -split-dwarf-file=foo.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s --check-prefix=CHECK-DWO
;; FIXME: RemoveDIs - enable when FastISel support is added.
; run: llc --try-experimental-debuginfo-iterators -split-dwarf-file=foo.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
; run: llvm-dwarfdump -debug-info %t | FileCheck %s --check-prefix=CHECK-DWO

; Based on the debuginfo-tests/sret.cpp code.

Expand All @@ -8,6 +11,11 @@

; RUN: llc -O0 -fast-isel=true -mtriple=x86_64-apple-darwin -filetype=obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck -check-prefixes=CHECK,FASTISEL %s
; RUN: llc -O0 -fast-isel=false -mtriple=x86_64-apple-darwin -filetype=obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck -check-prefixes=CHECK,SDAG %s

; RUN: llc --try-experimental-debuginfo-iterators -O0 -fast-isel=false -mtriple=x86_64-apple-darwin -filetype=obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck -check-prefixes=CHECK,SDAG %s
;; FIXME: RemoveDIs - enable when FastISel support is added.
; run: llc --try-experimental-debuginfo-iterators -O0 -fast-isel=false -mtriple=x86_64-apple-darwin -filetype=obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck -check-prefixes=CHECK,SDAG %s

; CHECK: _ZN1B9AInstanceEv
; CHECK: DW_TAG_variable
; CHECK-NEXT: DW_AT_location (0x00000000
Expand Down
2 changes: 2 additions & 0 deletions llvm/test/DebugInfo/X86/union-const.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
; RUN: llc -filetype=obj < %s | llvm-dwarfdump -v -debug-info - | FileCheck %s
; RUN: llc --try-experimental-debuginfo-iterators -filetype=obj < %s | llvm-dwarfdump -v -debug-info - | FileCheck %s

; CHECK: DW_TAG_variable
; CHECK-NEXT: DW_AT_const_value [DW_FORM_udata] (0)
; CHECK-NEXT: DW_AT_name {{.*}}"a"
Expand Down
2 changes: 2 additions & 0 deletions llvm/test/DebugInfo/X86/vla-global.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
; RUN: llc -mtriple=x86_64-apple-darwin %s -o - -filetype=obj | llvm-dwarfdump - | FileCheck %s
; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-apple-darwin %s -o - -filetype=obj | llvm-dwarfdump - | FileCheck %s

; CHECK: 0x00000[[G:.*]]: DW_TAG_variable
; CHECK-NEXT: DW_AT_name ("g")
; CHECK: DW_TAG_array_type
Expand Down
2 changes: 2 additions & 0 deletions llvm/test/DebugInfo/X86/vla-multi.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
; RUN: llc -mtriple=x86_64-apple-darwin %s -o - -filetype=obj | llvm-dwarfdump - | FileCheck %s
; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-apple-darwin %s -o - -filetype=obj | llvm-dwarfdump - | FileCheck %s

; Test debug info for multidimensional arrays.
;
; void f(int i, int j, int k, int r) {
Expand Down

0 comments on commit 5ee0881

Please sign in to comment.