diff --git a/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h b/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h index 4c17e8dcc41a6..cde7247aeb151 100644 --- a/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h +++ b/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h @@ -191,6 +191,7 @@ class FunctionLoweringInfo { /// Collection of dbg.declare instructions handled after argument /// lowering and before ISel proper. SmallPtrSet PreprocessedDbgDeclares; + SmallPtrSet PreprocessedDPVDeclares; /// set - Initialize this FunctionLoweringInfo with the given Function /// and its associated MachineFunction. diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index 1128ecfd860db..03cba892a167b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -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. diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 4fd76d012a167..12ed4a82ee91a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -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(Address) || + (Address->use_empty() && !isa(Address))) { + LLVM_DEBUG( + dbgs() + << "dbg_declare: Dropping debug info (bad/undef/unused-arg address)\n"); + return; + } + + bool IsParameter = Variable->isParameter() || isa(Address); + + SDValue &N = NodeMap[Address]; + if (!N.getNode() && isa(Address)) + // Check unused arguments map. + N = UnusedArgNodeMap[Address]; + SDDbgValue *SDV; + if (N.getNode()) { + if (const BitCastInst *BCI = dyn_cast(Address)) + Address = BCI->getOperand(0); + // Parameters are handled specially. + auto *FINode = dyn_cast(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(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}. @@ -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 Values(DPV.location_ops()); if (Values.empty()) { @@ -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(Address) || - (Address->use_empty() && !isa(Address))) { - LLVM_DEBUG(dbgs() << "Dropping debug info for " << DI - << " (bad/undef/unused-arg address)\n"); - return; - } - - bool isParameter = Variable->isParameter() || isa(Address); - - SDValue &N = NodeMap[Address]; - if (!N.getNode() && isa(Address)) - // Check unused arguments map. - N = UnusedArgNodeMap[Address]; - SDDbgValue *SDV; - if (N.getNode()) { - if (const BitCastInst *BCI = dyn_cast(Address)) - Address = BCI->getOperand(0); - // Parameters are handled specially. - auto FINode = dyn_cast(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(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: { diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h index 5b55c3461b0b6..2e102c002c093 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h @@ -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(); diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index dd28ec09d0e2b..a1cf4cbbee1b8 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -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); + } } } diff --git a/llvm/test/CodeGen/X86/dbg-combine.ll b/llvm/test/CodeGen/X86/dbg-combine.ll index b3d2213b90c0a..d6065f1318ae0 100644 --- a/llvm/test/CodeGen/X86/dbg-combine.ll +++ b/llvm/test/CodeGen/X86/dbg-combine.ll @@ -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 diff --git a/llvm/test/CodeGen/X86/selectiondag-order.ll b/llvm/test/CodeGen/X86/selectiondag-order.ll index 163e2cb90b2fe..417b12bbd73f1 100644 --- a/llvm/test/CodeGen/X86/selectiondag-order.ll +++ b/llvm/test/CodeGen/X86/selectiondag-order.ll @@ -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: diff --git a/llvm/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll b/llvm/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll index 87d75c16dd8e3..2a5d5e776b934 100644 --- a/llvm/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll +++ b/llvm/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll @@ -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:}} diff --git a/llvm/test/DebugInfo/Mips/InlinedFnLocalVar.ll b/llvm/test/DebugInfo/Mips/InlinedFnLocalVar.ll index 9e5bc3ed0db58..d4d0ec2d813ca 100644 --- a/llvm/test/DebugInfo/Mips/InlinedFnLocalVar.ll +++ b/llvm/test/DebugInfo/Mips/InlinedFnLocalVar.ll @@ -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 diff --git a/llvm/test/DebugInfo/X86/DW_AT_const_value.ll b/llvm/test/DebugInfo/X86/DW_AT_const_value.ll index 39d718a457d35..ecb423a0a1139 100644 --- a/llvm/test/DebugInfo/X86/DW_AT_const_value.ll +++ b/llvm/test/DebugInfo/X86/DW_AT_const_value.ll @@ -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. diff --git a/llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll b/llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll index 7f659bf9042a9..0b27ec8194a1c 100644 --- a/llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll +++ b/llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll @@ -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 diff --git a/llvm/test/DebugInfo/X86/block-capture.ll b/llvm/test/DebugInfo/X86/block-capture.ll index f78ce32fb34ae..585526fea148c 100644 --- a/llvm/test/DebugInfo/X86/block-capture.ll +++ b/llvm/test/DebugInfo/X86/block-capture.ll @@ -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 diff --git a/llvm/test/DebugInfo/X86/dbg-empty-metadata-lowering.ll b/llvm/test/DebugInfo/X86/dbg-empty-metadata-lowering.ll index b98e99c53dfe6..a5edac3ead504 100644 --- a/llvm/test/DebugInfo/X86/dbg-empty-metadata-lowering.ll +++ b/llvm/test/DebugInfo/X86/dbg-empty-metadata-lowering.ll @@ -2,6 +2,9 @@ ; 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. @@ -9,6 +12,9 @@ ; 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. diff --git a/llvm/test/DebugInfo/X86/debug-info-block-captured-self.ll b/llvm/test/DebugInfo/X86/debug-info-block-captured-self.ll index d96ea5190b864..c70b51f7f8d10 100644 --- a/llvm/test/DebugInfo/X86/debug-info-block-captured-self.ll +++ b/llvm/test/DebugInfo/X86/debug-info-block-captured-self.ll @@ -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. ; diff --git a/llvm/test/DebugInfo/X86/debug-info-blocks.ll b/llvm/test/DebugInfo/X86/debug-info-blocks.ll index 0914fa68620c9..5dacd711ad604 100644 --- a/llvm/test/DebugInfo/X86/debug-info-blocks.ll +++ b/llvm/test/DebugInfo/X86/debug-info-blocks.ll @@ -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]+}} ) diff --git a/llvm/test/DebugInfo/X86/empty-metadata-dbg-declare.ll b/llvm/test/DebugInfo/X86/empty-metadata-dbg-declare.ll index 8ae4e7b183e9a..241a39f3d899a 100644 --- a/llvm/test/DebugInfo/X86/empty-metadata-dbg-declare.ll +++ b/llvm/test/DebugInfo/X86/empty-metadata-dbg-declare.ll @@ -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. diff --git a/llvm/test/DebugInfo/X86/pieces-3.ll b/llvm/test/DebugInfo/X86/pieces-3.ll index dfd7b3c48ef93..60bf758b49856 100644 --- a/llvm/test/DebugInfo/X86/pieces-3.ll +++ b/llvm/test/DebugInfo/X86/pieces-3.ll @@ -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 { diff --git a/llvm/test/DebugInfo/X86/pieces-4.ll b/llvm/test/DebugInfo/X86/pieces-4.ll index adc93fc93a2cd..aa93bd6a7f5f0 100644 --- a/llvm/test/DebugInfo/X86/pieces-4.ll +++ b/llvm/test/DebugInfo/X86/pieces-4.ll @@ -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: diff --git a/llvm/test/DebugInfo/X86/safestack-byval.ll b/llvm/test/DebugInfo/X86/safestack-byval.ll index acaa8031537ca..168cddd80633d 100644 --- a/llvm/test/DebugInfo/X86/safestack-byval.ll +++ b/llvm/test/DebugInfo/X86/safestack-byval.ll @@ -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. diff --git a/llvm/test/DebugInfo/X86/salvage-add-node-indirect.ll b/llvm/test/DebugInfo/X86/salvage-add-node-indirect.ll index cae8a479a5ad9..967721bde8a34 100644 --- a/llvm/test/DebugInfo/X86/salvage-add-node-indirect.ll +++ b/llvm/test/DebugInfo/X86/salvage-add-node-indirect.ll @@ -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 diff --git a/llvm/test/DebugInfo/X86/spill-indirect-nrvo.ll b/llvm/test/DebugInfo/X86/spill-indirect-nrvo.ll index 0b18318c53a85..b9a504b9b7b60 100644 --- a/llvm/test/DebugInfo/X86/spill-indirect-nrvo.ll +++ b/llvm/test/DebugInfo/X86/spill-indirect-nrvo.ll @@ -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: diff --git a/llvm/test/DebugInfo/X86/spill-nontrivial-param.ll b/llvm/test/DebugInfo/X86/spill-nontrivial-param.ll index 1e01f2cd97032..9c05b050e7338 100644 --- a/llvm/test/DebugInfo/X86/spill-nontrivial-param.ll +++ b/llvm/test/DebugInfo/X86/spill-nontrivial-param.ll @@ -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 diff --git a/llvm/test/DebugInfo/X86/sret.ll b/llvm/test/DebugInfo/X86/sret.ll index 017fc968d4276..087f136541d93 100644 --- a/llvm/test/DebugInfo/X86/sret.ll +++ b/llvm/test/DebugInfo/X86/sret.ll @@ -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. @@ -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 diff --git a/llvm/test/DebugInfo/X86/union-const.ll b/llvm/test/DebugInfo/X86/union-const.ll index e9aafc9c228e4..1bb5cc26b1fe2 100644 --- a/llvm/test/DebugInfo/X86/union-const.ll +++ b/llvm/test/DebugInfo/X86/union-const.ll @@ -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" diff --git a/llvm/test/DebugInfo/X86/vla-global.ll b/llvm/test/DebugInfo/X86/vla-global.ll index d1a85bb7407b0..ee43ea166b705 100644 --- a/llvm/test/DebugInfo/X86/vla-global.ll +++ b/llvm/test/DebugInfo/X86/vla-global.ll @@ -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 diff --git a/llvm/test/DebugInfo/X86/vla-multi.ll b/llvm/test/DebugInfo/X86/vla-multi.ll index 210250ee9d662..911918338c21d 100644 --- a/llvm/test/DebugInfo/X86/vla-multi.ll +++ b/llvm/test/DebugInfo/X86/vla-multi.ll @@ -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) {