diff --git a/llvm/include/llvm/CodeGen/FastISel.h b/llvm/include/llvm/CodeGen/FastISel.h index dc2931b40d352..0f17e51f0b7a7 100644 --- a/llvm/include/llvm/CodeGen/FastISel.h +++ b/llvm/include/llvm/CodeGen/FastISel.h @@ -319,6 +319,10 @@ class FastISel { /// Reset InsertPt to the given old insert position. void leaveLocalValueArea(SavePoint Old); + /// Target-independent lowering of non-instruction debug info associated with + /// this instruction. + void handleDbgInfo(const Instruction *II); + protected: explicit FastISel(FunctionLoweringInfo &FuncInfo, const TargetLibraryInfo *LibInfo, @@ -518,6 +522,16 @@ class FastISel { return MF->getFunction().hasOptSize(); } + /// Target-independent lowering of debug information. Returns false if the + /// debug information couldn't be lowered and was instead discarded. + virtual bool lowerDbgValue(const Value *V, DIExpression *Expr, + DILocalVariable *Var, const DebugLoc &DL); + + /// Target-independent lowering of debug information. Returns false if the + /// debug information couldn't be lowered and was instead discarded. + virtual bool lowerDbgDeclare(const Value *V, DIExpression *Expr, + DILocalVariable *Var, const DebugLoc &DL); + private: /// Handle PHI nodes in successor blocks. /// diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 09e260394262b..6d80b282a1ed2 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -1180,6 +1180,184 @@ bool FastISel::selectCall(const User *I) { return lowerCall(Call); } +void FastISel::handleDbgInfo(const Instruction *II) { + if (!II->hasDbgValues()) + return; + + // Clear any metadata. + MIMD = MIMetadata(); + + // Reverse order of debug records, because fast-isel walks through backwards. + for (DPValue &DPV : llvm::reverse(II->getDbgValueRange())) { + flushLocalValueMap(); + recomputeInsertPt(); + + Value *V = nullptr; + if (!DPV.hasArgList()) + V = DPV.getVariableLocationOp(0); + + bool Res = false; + if (DPV.getType() == DPValue::LocationType::Value) { + Res = lowerDbgValue(V, DPV.getExpression(), DPV.getVariable(), + DPV.getDebugLoc()); + } else { + assert(DPV.getType() == DPValue::LocationType::Declare); + if (FuncInfo.PreprocessedDPVDeclares.contains(&DPV)) + continue; + Res = lowerDbgDeclare(V, DPV.getExpression(), DPV.getVariable(), + DPV.getDebugLoc()); + } + + if (!Res) + LLVM_DEBUG(dbgs() << "Dropping debug-info for " << DPV << "\n";); + } +} + +bool FastISel::lowerDbgValue(const Value *V, DIExpression *Expr, + DILocalVariable *Var, const DebugLoc &DL) { + // This form of DBG_VALUE is target-independent. + const MCInstrDesc &II = TII.get(TargetOpcode::DBG_VALUE); + if (!V || isa(V)) { + // DI is either undef or cannot produce a valid DBG_VALUE, so produce an + // undef DBG_VALUE to terminate any prior location. + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, false, 0U, Var, Expr); + return true; + } + if (const auto *CI = dyn_cast(V)) { + // See if there's an expression to constant-fold. + if (Expr) + std::tie(Expr, CI) = Expr->constantFold(CI); + if (CI->getBitWidth() > 64) + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + .addCImm(CI) + .addImm(0U) + .addMetadata(Var) + .addMetadata(Expr); + else + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + .addImm(CI->getZExtValue()) + .addImm(0U) + .addMetadata(Var) + .addMetadata(Expr); + return true; + } + if (const auto *CF = dyn_cast(V)) { + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + .addFPImm(CF) + .addImm(0U) + .addMetadata(Var) + .addMetadata(Expr); + return true; + } + if (const auto *Arg = dyn_cast(V); + Arg && Expr && Expr->isEntryValue()) { + // As per the Verifier, this case is only valid for swift async Args. + assert(Arg->hasAttribute(Attribute::AttrKind::SwiftAsync)); + + Register Reg = getRegForValue(Arg); + for (auto [PhysReg, VirtReg] : FuncInfo.RegInfo->liveins()) + if (Reg == VirtReg || Reg == PhysReg) { + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, false /*IsIndirect*/, + PhysReg, Var, Expr); + return true; + } + + LLVM_DEBUG(dbgs() << "Dropping dbg.value: expression is entry_value but " + "couldn't find a physical register\n"); + return false; + } + if (auto SI = FuncInfo.StaticAllocaMap.find(dyn_cast(V)); + SI != FuncInfo.StaticAllocaMap.end()) { + MachineOperand FrameIndexOp = MachineOperand::CreateFI(SI->second); + bool IsIndirect = false; + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, IsIndirect, FrameIndexOp, + Var, Expr); + return true; + } + if (Register Reg = lookUpRegForValue(V)) { + // FIXME: This does not handle register-indirect values at offset 0. + if (!FuncInfo.MF->useDebugInstrRef()) { + bool IsIndirect = false; + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, IsIndirect, Reg, Var, + Expr); + return true; + } + // If using instruction referencing, produce this as a DBG_INSTR_REF, + // to be later patched up by finalizeDebugInstrRefs. + SmallVector MOs({MachineOperand::CreateReg( + /* Reg */ Reg, /* isDef */ false, /* isImp */ false, + /* isKill */ false, /* isDead */ false, + /* isUndef */ false, /* isEarlyClobber */ false, + /* SubReg */ 0, /* isDebug */ true)}); + SmallVector Ops({dwarf::DW_OP_LLVM_arg, 0}); + auto *NewExpr = DIExpression::prependOpcodes(Expr, Ops); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(TargetOpcode::DBG_INSTR_REF), /*IsIndirect*/ false, MOs, + Var, NewExpr); + return true; + } + return false; +} + +bool FastISel::lowerDbgDeclare(const Value *Address, DIExpression *Expr, + DILocalVariable *Var, const DebugLoc &DL) { + if (!Address || isa(Address)) { + LLVM_DEBUG(dbgs() << "Dropping debug info (bad/undef address)\n"); + return false; + } + + std::optional Op; + if (Register Reg = lookUpRegForValue(Address)) + Op = MachineOperand::CreateReg(Reg, false); + + // If we have a VLA that has a "use" in a metadata node that's then used + // here but it has no other uses, then we have a problem. E.g., + // + // int foo (const int *x) { + // char a[*x]; + // return 0; + // } + // + // If we assign 'a' a vreg and fast isel later on has to use the selection + // DAG isel, it will want to copy the value to the vreg. However, there are + // no uses, which goes counter to what selection DAG isel expects. + if (!Op && !Address->use_empty() && isa(Address) && + (!isa(Address) || + !FuncInfo.StaticAllocaMap.count(cast(Address)))) + Op = MachineOperand::CreateReg(FuncInfo.InitializeRegForValue(Address), + false); + + if (Op) { + assert(Var->isValidLocationForIntrinsic(DL) && + "Expected inlined-at fields to agree"); + if (FuncInfo.MF->useDebugInstrRef() && Op->isReg()) { + // If using instruction referencing, produce this as a DBG_INSTR_REF, + // to be later patched up by finalizeDebugInstrRefs. Tack a deref onto + // the expression, we don't have an "indirect" flag in DBG_INSTR_REF. + SmallVector Ops( + {dwarf::DW_OP_LLVM_arg, 0, dwarf::DW_OP_deref}); + auto *NewExpr = DIExpression::prependOpcodes(Expr, Ops); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(TargetOpcode::DBG_INSTR_REF), /*IsIndirect*/ false, *Op, + Var, NewExpr); + return true; + } + + // A dbg.declare describes the address of a source variable, so lower it + // into an indirect DBG_VALUE. + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(TargetOpcode::DBG_VALUE), /*IsIndirect*/ true, *Op, Var, + Expr); + return true; + } + + // We can't yet handle anything else here because it would require + // generating code, thus altering codegen because of debug info. + LLVM_DEBUG( + dbgs() << "Dropping debug info (no materialized reg for address)\n"); + return false; +} + bool FastISel::selectIntrinsicCall(const IntrinsicInst *II) { switch (II->getIntrinsicID()) { default: @@ -1209,153 +1387,28 @@ bool FastISel::selectIntrinsicCall(const IntrinsicInst *II) { return true; const Value *Address = DI->getAddress(); - if (!Address || isa(Address)) { - LLVM_DEBUG(dbgs() << "Dropping debug info for " << *DI - << " (bad/undef address)\n"); - return true; - } + if (!lowerDbgDeclare(Address, DI->getExpression(), DI->getVariable(), + MIMD.getDL())) + LLVM_DEBUG(dbgs() << "Dropping debug info for " << *DI); - std::optional Op; - if (Register Reg = lookUpRegForValue(Address)) - Op = MachineOperand::CreateReg(Reg, false); - - // If we have a VLA that has a "use" in a metadata node that's then used - // here but it has no other uses, then we have a problem. E.g., - // - // int foo (const int *x) { - // char a[*x]; - // return 0; - // } - // - // If we assign 'a' a vreg and fast isel later on has to use the selection - // DAG isel, it will want to copy the value to the vreg. However, there are - // no uses, which goes counter to what selection DAG isel expects. - if (!Op && !Address->use_empty() && isa(Address) && - (!isa(Address) || - !FuncInfo.StaticAllocaMap.count(cast(Address)))) - Op = MachineOperand::CreateReg(FuncInfo.InitializeRegForValue(Address), - false); - - if (Op) { - assert(DI->getVariable()->isValidLocationForIntrinsic(MIMD.getDL()) && - "Expected inlined-at fields to agree"); - if (FuncInfo.MF->useDebugInstrRef() && Op->isReg()) { - // If using instruction referencing, produce this as a DBG_INSTR_REF, - // to be later patched up by finalizeDebugInstrRefs. Tack a deref onto - // the expression, we don't have an "indirect" flag in DBG_INSTR_REF. - SmallVector Ops( - {dwarf::DW_OP_LLVM_arg, 0, dwarf::DW_OP_deref}); - auto *NewExpr = DIExpression::prependOpcodes(DI->getExpression(), Ops); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD.getDL(), - TII.get(TargetOpcode::DBG_INSTR_REF), /*IsIndirect*/ false, *Op, - DI->getVariable(), NewExpr); - } else { - // A dbg.declare describes the address of a source variable, so lower it - // into an indirect DBG_VALUE. - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD.getDL(), - TII.get(TargetOpcode::DBG_VALUE), /*IsIndirect*/ true, *Op, - DI->getVariable(), DI->getExpression()); - } - } else { - // We can't yet handle anything else here because it would require - // generating code, thus altering codegen because of debug info. - LLVM_DEBUG(dbgs() << "Dropping debug info for " << *DI - << " (no materialized reg for address)\n"); - } return true; } case Intrinsic::dbg_value: { // This form of DBG_VALUE is target-independent. const DbgValueInst *DI = cast(II); - const MCInstrDesc &II = TII.get(TargetOpcode::DBG_VALUE); const Value *V = DI->getValue(); DIExpression *Expr = DI->getExpression(); DILocalVariable *Var = DI->getVariable(); + if (DI->hasArgList()) + // Signal that we don't have a location for this. + V = nullptr; + assert(Var->isValidLocationForIntrinsic(MIMD.getDL()) && "Expected inlined-at fields to agree"); - if (!V || isa(V) || DI->hasArgList()) { - // DI is either undef or cannot produce a valid DBG_VALUE, so produce an - // undef DBG_VALUE to terminate any prior location. - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD.getDL(), II, false, 0U, - Var, Expr); - return true; - } - if (const auto *CI = dyn_cast(V)) { - // See if there's an expression to constant-fold. - if (Expr) - std::tie(Expr, CI) = Expr->constantFold(CI); - if (CI->getBitWidth() > 64) - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, II) - .addCImm(CI) - .addImm(0U) - .addMetadata(Var) - .addMetadata(Expr); - else - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, II) - .addImm(CI->getZExtValue()) - .addImm(0U) - .addMetadata(Var) - .addMetadata(Expr); - return true; - } - if (const auto *CF = dyn_cast(V)) { - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, II) - .addFPImm(CF) - .addImm(0U) - .addMetadata(Var) - .addMetadata(Expr); - return true; - } - if (const auto *Arg = dyn_cast(V); - Arg && Expr && Expr->isEntryValue()) { - // As per the Verifier, this case is only valid for swift async Args. - assert(Arg->hasAttribute(Attribute::AttrKind::SwiftAsync)); - - Register Reg = getRegForValue(Arg); - for (auto [PhysReg, VirtReg] : FuncInfo.RegInfo->liveins()) - if (Reg == VirtReg || Reg == PhysReg) { - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD.getDL(), II, - false /*IsIndirect*/, PhysReg, Var, Expr); - return true; - } - LLVM_DEBUG(dbgs() << "Dropping dbg.value: expression is entry_value but " - "couldn't find a physical register\n" - << *DI << "\n"); - return true; - } - if (auto SI = FuncInfo.StaticAllocaMap.find(dyn_cast(V)); - SI != FuncInfo.StaticAllocaMap.end()) { - MachineOperand FrameIndexOp = MachineOperand::CreateFI(SI->second); - bool IsIndirect = false; - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD.getDL(), II, IsIndirect, - FrameIndexOp, Var, Expr); - return true; - } - if (Register Reg = lookUpRegForValue(V)) { - // FIXME: This does not handle register-indirect values at offset 0. - if (!FuncInfo.MF->useDebugInstrRef()) { - bool IsIndirect = false; - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD.getDL(), II, IsIndirect, - Reg, Var, Expr); - return true; - } - // If using instruction referencing, produce this as a DBG_INSTR_REF, - // to be later patched up by finalizeDebugInstrRefs. - SmallVector MOs({MachineOperand::CreateReg( - /* Reg */ Reg, /* isDef */ false, /* isImp */ false, - /* isKill */ false, /* isDead */ false, - /* isUndef */ false, /* isEarlyClobber */ false, - /* SubReg */ 0, /* isDebug */ true)}); - SmallVector Ops({dwarf::DW_OP_LLVM_arg, 0}); - auto *NewExpr = DIExpression::prependOpcodes(Expr, Ops); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD.getDL(), - TII.get(TargetOpcode::DBG_INSTR_REF), /*IsIndirect*/ false, MOs, - Var, NewExpr); - return true; - } - // We don't know how to handle other cases, so we drop. - LLVM_DEBUG(dbgs() << "Dropping debug info for " << *DI << "\n"); + if (!lowerDbgValue(V, Expr, Var, MIMD.getDL())) + LLVM_DEBUG(dbgs() << "Dropping debug info for " << *DI << "\n"); + return true; } case Intrinsic::dbg_label: { diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index f28211ac113ca..99bb3d875d4fa 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1614,6 +1614,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) { if (isFoldedOrDeadInstruction(Inst, *FuncInfo) || ElidedArgCopyInstrs.count(Inst)) { --NumFastIselRemaining; + FastIS->handleDbgInfo(Inst); continue; } @@ -1625,6 +1626,8 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) { if (FastIS->selectInstruction(Inst)) { --NumFastIselRemaining; ++NumFastIselSuccess; + + FastIS->handleDbgInfo(Inst); // If fast isel succeeded, skip over all the folded instructions, and // then see if there is a load right before the selected instructions. // Try to fold the load if so. @@ -1640,6 +1643,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) { // If we succeeded, don't re-select the load. LLVM_DEBUG(dbgs() << "FastISel folded load: " << *BeforeInst << "\n"); + FastIS->handleDbgInfo(BeforeInst); BI = std::next(BasicBlock::const_iterator(BeforeInst)); --NumFastIselRemaining; ++NumFastIselSuccess; diff --git a/llvm/test/CodeGen/AArch64/fast-isel-branch-uncond-debug.ll b/llvm/test/CodeGen/AArch64/fast-isel-branch-uncond-debug.ll index 1d213945966a6..e1614d322b93d 100644 --- a/llvm/test/CodeGen/AArch64/fast-isel-branch-uncond-debug.ll +++ b/llvm/test/CodeGen/AArch64/fast-isel-branch-uncond-debug.ll @@ -1,4 +1,5 @@ ; RUN: llc -mtriple=aarch64 -O1 -opt-bisect-limit=2 -o - %s 2> /dev/null | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -mtriple=aarch64 -O1 -opt-bisect-limit=2 -o - %s 2> /dev/null | FileCheck %s define dso_local i32 @a() #0 !dbg !7 { entry: @@ -41,4 +42,4 @@ declare void @llvm.dbg.value(metadata, metadata, metadata) #2 !18 = distinct !{!18, !19, !20} !19 = !DILocation(line: 3, column: 3, scope: !17) !20 = !DILocation(line: 4, column: 5, scope: !17) - \ No newline at end of file + diff --git a/llvm/test/CodeGen/AArch64/fast-isel-dbg.ll b/llvm/test/CodeGen/AArch64/fast-isel-dbg.ll index 602d454044d43..0c1a693089cb0 100644 --- a/llvm/test/CodeGen/AArch64/fast-isel-dbg.ll +++ b/llvm/test/CodeGen/AArch64/fast-isel-dbg.ll @@ -1,4 +1,6 @@ ; RUN: llc -o - %s -fast-isel -stop-before=finalize-isel | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -o - %s -fast-isel -stop-before=finalize-isel | FileCheck %s + ; Make sure fast-isel produces DBG_VALUE instructions even if no debug printer ; is scheduled because of -stop-before. target triple="aarch64--" diff --git a/llvm/test/CodeGen/AArch64/fastisel-debugvalue-undef.ll b/llvm/test/CodeGen/AArch64/fastisel-debugvalue-undef.ll index cccede6a50459..c30a01baedaf3 100644 --- a/llvm/test/CodeGen/AArch64/fastisel-debugvalue-undef.ll +++ b/llvm/test/CodeGen/AArch64/fastisel-debugvalue-undef.ll @@ -1,4 +1,5 @@ ; RUN: llc -O0 -fast-isel=1 -o - -print-after="finalize-isel" %s 2>&1 | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -O0 -fast-isel=1 -o - -print-after="finalize-isel" %s 2>&1 | FileCheck %s ; Check that we emit a DBG_VALUE for the `@llvm.dbg.value` which has `undef` has first arg. diff --git a/llvm/test/CodeGen/ARM/debug-info-blocks.ll b/llvm/test/CodeGen/ARM/debug-info-blocks.ll index 1c9ffb1775aa4..8ef341faed6b7 100644 --- a/llvm/test/CodeGen/ARM/debug-info-blocks.ll +++ b/llvm/test/CodeGen/ARM/debug-info-blocks.ll @@ -1,4 +1,5 @@ ; RUN: llc -filetype=obj -O0 < %s | llvm-dwarfdump -v - | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -filetype=obj -O0 < %s | llvm-dwarfdump -v - | FileCheck %s ; debug_info content ; CHECK: DW_AT_name {{.*}} "foobar_func_block_invoke_0" diff --git a/llvm/test/CodeGen/Generic/csw-debug-assert.ll b/llvm/test/CodeGen/Generic/csw-debug-assert.ll index 084cbfa79679a..85a8d8bb1d98e 100644 --- a/llvm/test/CodeGen/Generic/csw-debug-assert.ll +++ b/llvm/test/CodeGen/Generic/csw-debug-assert.ll @@ -2,6 +2,7 @@ ; REQUIRES: asserts ; REQUIRES: x86_64-linux ; RUN: llc -O1 -regalloc=pbqp < %s | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -O1 -regalloc=pbqp < %s | FileCheck %s target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" diff --git a/llvm/test/CodeGen/X86/2010-08-04-StackVariable.ll b/llvm/test/CodeGen/X86/2010-08-04-StackVariable.ll index 198c0d4806c52..e95b3b4884b41 100644 --- a/llvm/test/CodeGen/X86/2010-08-04-StackVariable.ll +++ b/llvm/test/CodeGen/X86/2010-08-04-StackVariable.ll @@ -1,4 +1,5 @@ ; RUN: llc -O0 -mtriple=x86_64-apple-darwin < %s | grep DW_OP_breg7 +; RUN: llc --try-experimental-debuginfo-iterators -O0 -mtriple=x86_64-apple-darwin < %s | grep DW_OP_breg7 ; Use DW_OP_breg7 in variable's location expression if the variable is in a stack slot. %struct.SVal = type { ptr, i32 } diff --git a/llvm/test/CodeGen/X86/DbgValueOtherTargets.test b/llvm/test/CodeGen/X86/DbgValueOtherTargets.test index 02f56823fd1d6..29497d33f075f 100644 --- a/llvm/test/CodeGen/X86/DbgValueOtherTargets.test +++ b/llvm/test/CodeGen/X86/DbgValueOtherTargets.test @@ -1,2 +1,5 @@ RUN: llc -O0 -mtriple=i686-- -asm-verbose < %S/../Inputs/DbgValueOtherTargets.ll | FileCheck %S/../Inputs/DbgValueOtherTargets.ll RUN: llc -O0 -mtriple=x86_64-- -asm-verbose < %S/../Inputs/DbgValueOtherTargets.ll | FileCheck %S/../Inputs/DbgValueOtherTargets.ll + +RUN: llc --try-experimental-debuginfo-iterators -O0 -mtriple=i686-- -asm-verbose < %S/../Inputs/DbgValueOtherTargets.ll | FileCheck %S/../Inputs/DbgValueOtherTargets.ll +RUN: llc --try-experimental-debuginfo-iterators -O0 -mtriple=x86_64-- -asm-verbose < %S/../Inputs/DbgValueOtherTargets.ll | FileCheck %S/../Inputs/DbgValueOtherTargets.ll \ No newline at end of file diff --git a/llvm/test/CodeGen/X86/fast-isel-dbg-value-alloca.ll b/llvm/test/CodeGen/X86/fast-isel-dbg-value-alloca.ll index 77f883ee9bd3a..bdb5239d289ea 100644 --- a/llvm/test/CodeGen/X86/fast-isel-dbg-value-alloca.ll +++ b/llvm/test/CodeGen/X86/fast-isel-dbg-value-alloca.ll @@ -1,6 +1,8 @@ ; RUN: llc -fast-isel -fast-isel-abort=1 -mtriple=x86_64-unknown-unknown -stop-after=finalize-isel %s -o - | \ ; RUN: FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -fast-isel -fast-isel-abort=1 -mtriple=x86_64-unknown-unknown -stop-after=finalize-isel %s -o - | FileCheck %s + define void @foo(ptr noalias nocapture %arg) !dbg !38 { %k.debug = alloca ptr, align 8 store ptr %arg, ptr %k.debug, align 8, !dbg !70 diff --git a/llvm/test/CodeGen/X86/fold-sext-trunc.ll b/llvm/test/CodeGen/X86/fold-sext-trunc.ll index c29ca2204a6ad..9963bb7b030dc 100644 --- a/llvm/test/CodeGen/X86/fold-sext-trunc.ll +++ b/llvm/test/CodeGen/X86/fold-sext-trunc.ll @@ -1,5 +1,9 @@ ; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s ; RUN: llc < %s -O0 -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -stop-after livedebugvalues -o - | FileCheck %s -check-prefix=MIR + +; RUN: llc --try-experimental-debuginfo-iterators < %s -mtriple=x86_64-- | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s -O0 -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -stop-after livedebugvalues -o - | FileCheck %s -check-prefix=MIR + ; PR4050 %0 = type { i64 } diff --git a/llvm/test/CodeGen/X86/fold-zext-trunc.ll b/llvm/test/CodeGen/X86/fold-zext-trunc.ll index 88713d0b553ad..7a70b75a028aa 100644 --- a/llvm/test/CodeGen/X86/fold-zext-trunc.ll +++ b/llvm/test/CodeGen/X86/fold-zext-trunc.ll @@ -1,5 +1,9 @@ ; RUN: llc < %s | FileCheck %s -check-prefix=ASM ; RUN: llc < %s -O0 -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -stop-after livedebugvalues -o - | FileCheck %s -check-prefix=MIR + +; RUN: llc --try-experimental-debuginfo-iterators < %s | FileCheck %s -check-prefix=ASM +; RUN: llc --try-experimental-debuginfo-iterators < %s -O0 -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -stop-after livedebugvalues -o - | FileCheck %s -check-prefix=MIR + ; PR9055 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" target triple = "i686-pc-linux-gnu" diff --git a/llvm/test/CodeGen/X86/label-heapallocsite.ll b/llvm/test/CodeGen/X86/label-heapallocsite.ll index 87225354d7333..78bebc1fd174d 100644 --- a/llvm/test/CodeGen/X86/label-heapallocsite.ll +++ b/llvm/test/CodeGen/X86/label-heapallocsite.ll @@ -1,6 +1,9 @@ ; RUN: llc < %s | FileCheck --check-prefixes=CHECK %s ; RUN: llc -O0 < %s | FileCheck --check-prefixes=CHECK %s +; RUN: llc --try-experimental-debuginfo-iterators < %s | FileCheck --check-prefixes=CHECK %s +; RUN: llc --try-experimental-debuginfo-iterators -O0 < %s | FileCheck --check-prefixes=CHECK %s + ; Source to regenerate: ; $ clang -cc1 -triple x86_64-windows-msvc t.cpp -debug-info-kind=limited \ ; -gcodeview -O2 -fms-extensions -emit-llvm -o t.ll diff --git a/llvm/test/CodeGen/X86/machine-outliner-disubprogram.ll b/llvm/test/CodeGen/X86/machine-outliner-disubprogram.ll index c5b3c74653db3..dc582b9c8746e 100644 --- a/llvm/test/CodeGen/X86/machine-outliner-disubprogram.ll +++ b/llvm/test/CodeGen/X86/machine-outliner-disubprogram.ll @@ -3,6 +3,7 @@ ; Also make sure that the DISubprograms reference the generated unit. ; make sure that if there are two outlined functions in the program, ; RUN: llc %s -verify-machineinstrs -enable-machine-outliner -mtriple=x86_64-apple-darwin -o /dev/null -print-after=machine-outliner +; RUN: llc --try-experimental-debuginfo-iterators %s -verify-machineinstrs -enable-machine-outliner -mtriple=x86_64-apple-darwin -o /dev/null -print-after=machine-outliner define void @f6() #0 !dbg !8 { entry: %dog = alloca i32, align 4 diff --git a/llvm/test/CodeGen/X86/pr53243-tail-call-fastisel.ll b/llvm/test/CodeGen/X86/pr53243-tail-call-fastisel.ll index 333eff8fb0081..f21e8df95a4f0 100644 --- a/llvm/test/CodeGen/X86/pr53243-tail-call-fastisel.ll +++ b/llvm/test/CodeGen/X86/pr53243-tail-call-fastisel.ll @@ -1,5 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc -O0 -fast-isel -mtriple=x86_64-- < %s | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -O0 -fast-isel -mtriple=x86_64-- < %s | FileCheck %s define void @test() { ; CHECK-LABEL: test: diff --git a/llvm/test/CodeGen/X86/sink-local-value.ll b/llvm/test/CodeGen/X86/sink-local-value.ll index 4732fb48a922d..0e956b00b984f 100644 --- a/llvm/test/CodeGen/X86/sink-local-value.ll +++ b/llvm/test/CodeGen/X86/sink-local-value.ll @@ -1,4 +1,5 @@ ; RUN: llc -O0 < %s | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -O0 < %s | FileCheck %s target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" target triple = "i386-linux-gnu" diff --git a/llvm/test/DebugInfo/AArch64/cfi-eof-prologue.ll b/llvm/test/DebugInfo/AArch64/cfi-eof-prologue.ll index 0ee313d88866e..a7c2294561694 100644 --- a/llvm/test/DebugInfo/AArch64/cfi-eof-prologue.ll +++ b/llvm/test/DebugInfo/AArch64/cfi-eof-prologue.ll @@ -15,6 +15,7 @@ ; of CFI instructions. ; RUN: llc -fast-isel -O0 -filetype=asm < %s | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -fast-isel -O0 -filetype=asm < %s | FileCheck %s ; ModuleID = 'test1.cpp' target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" diff --git a/llvm/test/DebugInfo/AArch64/frameindices.ll b/llvm/test/DebugInfo/AArch64/frameindices.ll index 8f736a07034cf..d0080afa9085a 100644 --- a/llvm/test/DebugInfo/AArch64/frameindices.ll +++ b/llvm/test/DebugInfo/AArch64/frameindices.ll @@ -1,4 +1,5 @@ ; RUN: llc -frame-pointer=all -O0 -fast-isel -filetype=obj < %s | llvm-dwarfdump -v - | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -frame-pointer=all -O0 -fast-isel -filetype=obj < %s | llvm-dwarfdump -v - | FileCheck %s ; Test that a variable with multiple entries in the MMI table makes it into the ; debug info. ; diff --git a/llvm/test/DebugInfo/ARM/split-complex.ll b/llvm/test/DebugInfo/ARM/split-complex.ll index 8ac5d4f0aaba6..64de07ea61d64 100644 --- a/llvm/test/DebugInfo/ARM/split-complex.ll +++ b/llvm/test/DebugInfo/ARM/split-complex.ll @@ -1,5 +1,8 @@ -; RUN: llc -mtriple=thumbv7-apple-unknown-macho -O0 -filetype=obj -o %t.o %s -; RUN: llvm-dwarfdump -v -debug-info %t.o | FileCheck %s +; RUN: llc -mtriple=thumbv7-apple-unknown-macho -O0 -filetype=obj -o - %s \ +; RUN: | llvm-dwarfdump -v -debug-info - | FileCheck %s + +; RUN: llc --try-experimental-debuginfo-iterators -mtriple=thumbv7-apple-unknown-macho -O0 -filetype=obj -o - %s \ +; RUN: | llvm-dwarfdump -v -debug-info - | FileCheck %s ; generated from (-triple thumbv7-apple-unknown-macho -Os): ; void f(_Complex double c) { c = 0; } diff --git a/llvm/test/DebugInfo/COFF/class-options-common.ll b/llvm/test/DebugInfo/COFF/class-options-common.ll index 903824722b0cc..0c6e3a844b0fa 100644 --- a/llvm/test/DebugInfo/COFF/class-options-common.ll +++ b/llvm/test/DebugInfo/COFF/class-options-common.ll @@ -2,6 +2,11 @@ ; RUN: llc < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s ; RUN: llc < %s | FileCheck %s --check-prefix=ASM-INLINE-COMMENTS ; +; Same as above, with experimental debuginfo iterators. +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s | FileCheck %s --check-prefix=ASM-INLINE-COMMENTS +; ; Command to generate function-options.ll ; $ clang++ class-options-common.cpp -S -emit-llvm -g -gcodeview -o class-options-common.ll diff --git a/llvm/test/DebugInfo/COFF/cpp-mangling.ll b/llvm/test/DebugInfo/COFF/cpp-mangling.ll index 09a0d92b610c2..beb2180957d78 100644 --- a/llvm/test/DebugInfo/COFF/cpp-mangling.ll +++ b/llvm/test/DebugInfo/COFF/cpp-mangling.ll @@ -1,6 +1,9 @@ ; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -o - -O0 -filetype=obj < %s \ ; RUN: | llvm-readobj --codeview - | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -mcpu=core2 -mtriple=i686-pc-win32 -o - -O0 -filetype=obj < %s \ +; RUN: | llvm-readobj --codeview - | FileCheck %s + ; C++ source to regenerate: ; namespace foo { ; int bar(int x) { return x * 2; } @@ -111,4 +114,4 @@ attributes #1 = { nounwind readnone } !29 = !{null, !30, !10} !30 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !25, size: 32, flags: DIFlagArtificial | DIFlagObjectPointer) !31 = distinct !DISubprogram(name: "operator<<", linkageName: "??6S@@QAEXH@Z", scope: !25, file: !1, line: 8, type: !28, scopeLine: 8, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, declaration: !27, retainedNodes: !2) -!32 = !DILocation(line: 8, column: 27, scope: !31) \ No newline at end of file +!32 = !DILocation(line: 8, column: 27, scope: !31) diff --git a/llvm/test/DebugInfo/COFF/enum-co.ll b/llvm/test/DebugInfo/COFF/enum-co.ll index 4ccfaae511fc2..6ac7445595e87 100644 --- a/llvm/test/DebugInfo/COFF/enum-co.ll +++ b/llvm/test/DebugInfo/COFF/enum-co.ll @@ -1,6 +1,9 @@ ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s ; RUN: llc < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s + ; Command to generate enum-co.ll ; $ clang++ enum-co.cpp -S -emit-llvm -g -gcodeview -o enum-co.ll ; diff --git a/llvm/test/DebugInfo/COFF/function-options.ll b/llvm/test/DebugInfo/COFF/function-options.ll index 863994be1d5ef..79658509398f4 100644 --- a/llvm/test/DebugInfo/COFF/function-options.ll +++ b/llvm/test/DebugInfo/COFF/function-options.ll @@ -1,5 +1,8 @@ ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s ; RUN: llc < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s + +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s ; ; Command to generate function-options.ll ; $ clang++ function-options.cpp -S -emit-llvm -g -gcodeview -o function-options.ll diff --git a/llvm/test/DebugInfo/COFF/global_visibility.ll b/llvm/test/DebugInfo/COFF/global_visibility.ll index 8da374d3a0752..191c2d935cfd4 100644 --- a/llvm/test/DebugInfo/COFF/global_visibility.ll +++ b/llvm/test/DebugInfo/COFF/global_visibility.ll @@ -1,4 +1,5 @@ ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s ; ; This test verifies global variables are emitted within the correct scope. ; diff --git a/llvm/test/DebugInfo/COFF/globals.ll b/llvm/test/DebugInfo/COFF/globals.ll index 2724b99dc14be..9113f5fe87f8a 100644 --- a/llvm/test/DebugInfo/COFF/globals.ll +++ b/llvm/test/DebugInfo/COFF/globals.ll @@ -5,6 +5,14 @@ ; RUN: llc < %s -filetype=obj -o %t ; RUN: obj2yaml < %t | FileCheck %s --check-prefixes=YAML,YAML-FILE +; Repeat with experimental debuginfo iterators: +; RUN: llc --try-experimental-debuginfo-iterators < %s | FileCheck %s --check-prefix=ASM +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s --check-prefix=OBJ +; RUN: llc --try-experimental-debuginfo-iterators < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s --check-prefix=OBJ +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | obj2yaml | FileCheck %s --check-prefixes=YAML,YAML-STDOUT +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj -o %t +; RUN: obj2yaml < %t | FileCheck %s --check-prefixes=YAML,YAML-FILE + ; C++ source to regenerate: ; $ cat a.cpp ; int first; diff --git a/llvm/test/DebugInfo/COFF/lambda.ll b/llvm/test/DebugInfo/COFF/lambda.ll index 7b575a7b07aad..a171c85ba3c20 100644 --- a/llvm/test/DebugInfo/COFF/lambda.ll +++ b/llvm/test/DebugInfo/COFF/lambda.ll @@ -1,6 +1,9 @@ ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s ; RUN: llc < %s | llvm-mc -filetype=obj --triple=i686-windows | llvm-readobj - --codeview | FileCheck %s ; +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s | llvm-mc -filetype=obj --triple=i686-windows | llvm-readobj - --codeview | FileCheck %s +; ; Verify lambda routines are emitted properly in CodeView. ; ; The original source code: diff --git a/llvm/test/DebugInfo/COFF/lines-bb-start.ll b/llvm/test/DebugInfo/COFF/lines-bb-start.ll index 70c96b368c9ad..c8693b6f2d578 100644 --- a/llvm/test/DebugInfo/COFF/lines-bb-start.ll +++ b/llvm/test/DebugInfo/COFF/lines-bb-start.ll @@ -1,4 +1,5 @@ ; RUN: llc -O0 < %s | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -O0 < %s | FileCheck %s source_filename = "t.c" target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" diff --git a/llvm/test/DebugInfo/COFF/nrvo.ll b/llvm/test/DebugInfo/COFF/nrvo.ll index 7bd9d35b7a00e..52b93ddf6bc37 100644 --- a/llvm/test/DebugInfo/COFF/nrvo.ll +++ b/llvm/test/DebugInfo/COFF/nrvo.ll @@ -1,6 +1,9 @@ ; RUN: llc < %s | FileCheck %s --check-prefix=ASM ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s --check-prefix=OBJ +; RUN: llc --try-experimental-debuginfo-iterators < %s | FileCheck %s --check-prefix=ASM +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s --check-prefix=OBJ + ; C++ source to regenerate: ; struct Foo { ; Foo() = default; diff --git a/llvm/test/DebugInfo/COFF/numeric-leaves.ll b/llvm/test/DebugInfo/COFF/numeric-leaves.ll index 2b3f7ed495c6c..68f6edc76e27c 100644 --- a/llvm/test/DebugInfo/COFF/numeric-leaves.ll +++ b/llvm/test/DebugInfo/COFF/numeric-leaves.ll @@ -2,6 +2,11 @@ ; RUN: llc < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s ; RUN: llc < %s | FileCheck %s --check-prefix=ASM +; Repeat with experimental debuginfo iterators. +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s | FileCheck %s --check-prefix=ASM + ; C++ source to regenerate: ; $ cat numeric-leaves.cpp ; const long long Minus1 = -1; diff --git a/llvm/test/DebugInfo/COFF/parent-type-scopes.ll b/llvm/test/DebugInfo/COFF/parent-type-scopes.ll index 95c7a55895222..7d91e6538e313 100644 --- a/llvm/test/DebugInfo/COFF/parent-type-scopes.ll +++ b/llvm/test/DebugInfo/COFF/parent-type-scopes.ll @@ -1,6 +1,9 @@ ; RUN: llc < %s -filetype=obj -o %t.o ; RUN: llvm-pdbutil dump -types %t.o | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj -o %t.o +; RUN: llvm-pdbutil dump -types %t.o | FileCheck %s + ; C++ source: ; // Note that MSVC doesn't emit anything about WrapTypedef or WrapTypedef::Inner! ; struct WrapTypedef { diff --git a/llvm/test/DebugInfo/COFF/purge-typedef-udts.ll b/llvm/test/DebugInfo/COFF/purge-typedef-udts.ll index 8118e0ca2ae8b..64f97c106a4a5 100644 --- a/llvm/test/DebugInfo/COFF/purge-typedef-udts.ll +++ b/llvm/test/DebugInfo/COFF/purge-typedef-udts.ll @@ -1,4 +1,5 @@ ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s source_filename = "test/DebugInfo/COFF/purge-typedef-udts.ll" target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" target triple = "i686-pc-windows-msvc19.11.25506" diff --git a/llvm/test/DebugInfo/COFF/thunk.ll b/llvm/test/DebugInfo/COFF/thunk.ll index 39abed5807807..d6c15f5953587 100644 --- a/llvm/test/DebugInfo/COFF/thunk.ll +++ b/llvm/test/DebugInfo/COFF/thunk.ll @@ -1,7 +1,12 @@ ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s ; RUN: llc < %s | FileCheck %s --check-prefix=ASM ; RUN: opt -S -debugger-tune=lldb %s | FileCheck -check-prefix=OPT %s -; + +; Do the same for experimental debuginfo iterators. +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s | FileCheck %s --check-prefix=ASM +; RUN: opt --try-experimental-debuginfo-iterators -S -debugger-tune=lldb %s | FileCheck -check-prefix=OPT %s + ; -- "thunk.cpp" begin -------------------------------------------------------- ; class A { public: virtual bool MyMethod() { return true; } }; ; class B { public: virtual bool MyMethod() { return true; } }; diff --git a/llvm/test/DebugInfo/COFF/type-quals.ll b/llvm/test/DebugInfo/COFF/type-quals.ll index c5953d384d31d..461266f72bdc8 100644 --- a/llvm/test/DebugInfo/COFF/type-quals.ll +++ b/llvm/test/DebugInfo/COFF/type-quals.ll @@ -1,6 +1,9 @@ ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s ; RUN: llc < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s + ; C++ source to regenerate: ; $ cat m.cpp ; union Union { diff --git a/llvm/test/DebugInfo/COFF/types-cvarargs.ll b/llvm/test/DebugInfo/COFF/types-cvarargs.ll index 68c7a7740b711..bd41d68669f60 100644 --- a/llvm/test/DebugInfo/COFF/types-cvarargs.ll +++ b/llvm/test/DebugInfo/COFF/types-cvarargs.ll @@ -1,6 +1,9 @@ ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s ; RUN: llc < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s + ; C++ source to regenerate: ; $ cat t.cpp ; typedef void (*FuncTypedef)(int, float, ...); diff --git a/llvm/test/DebugInfo/COFF/types-integer-old.ll b/llvm/test/DebugInfo/COFF/types-integer-old.ll index 2ed36662a804b..c1c18bca8ed48 100644 --- a/llvm/test/DebugInfo/COFF/types-integer-old.ll +++ b/llvm/test/DebugInfo/COFF/types-integer-old.ll @@ -1,4 +1,5 @@ ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s ; Tests that CodeView integer types are generated even when using Clang's old integer type names. diff --git a/llvm/test/DebugInfo/COFF/types-method-ref-qualifiers.ll b/llvm/test/DebugInfo/COFF/types-method-ref-qualifiers.ll index b7114b87ae5e0..6f9987c33ab9e 100644 --- a/llvm/test/DebugInfo/COFF/types-method-ref-qualifiers.ll +++ b/llvm/test/DebugInfo/COFF/types-method-ref-qualifiers.ll @@ -1,6 +1,9 @@ ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s ; RUN: llc < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s + ; C++ source to regenerate: ; struct A { ; int NoRefQual(); diff --git a/llvm/test/DebugInfo/Generic/2010-10-01-crash.ll b/llvm/test/DebugInfo/Generic/2010-10-01-crash.ll index 8f8d67173c1cd..54c4c07f8c238 100644 --- a/llvm/test/DebugInfo/Generic/2010-10-01-crash.ll +++ b/llvm/test/DebugInfo/Generic/2010-10-01-crash.ll @@ -1,4 +1,5 @@ ; RUN: llc -O0 %s -o /dev/null +; RUN: llc --try-experimental-debuginfo-iterators -O0 %s -o /dev/null define void @CGRectStandardize(ptr sret(i32) %agg.result, ptr byval(i32) %rect) nounwind ssp !dbg !0 { entry: diff --git a/llvm/test/DebugInfo/Generic/PR20038.ll b/llvm/test/DebugInfo/Generic/PR20038.ll index 024a6abf0591a..d7fa11efab5da 100644 --- a/llvm/test/DebugInfo/Generic/PR20038.ll +++ b/llvm/test/DebugInfo/Generic/PR20038.ll @@ -2,6 +2,7 @@ ; XFAIL: target=sparc{{.*}} ; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=All < %s | llvm-dwarfdump -debug-info - | FileCheck %s --implicit-check-not=DW_TAG +; RUN: %llc_dwarf --try-experimental-debuginfo-iterators -O0 -filetype=obj -dwarf-linkage-names=All < %s | llvm-dwarfdump -debug-info - | FileCheck %s --implicit-check-not=DW_TAG ; IR generated from clang -O0 with: ; struct C { diff --git a/llvm/test/DebugInfo/Generic/dead-argument-order.ll b/llvm/test/DebugInfo/Generic/dead-argument-order.ll index f6cd8092a48d8..b2037b0590f20 100644 --- a/llvm/test/DebugInfo/Generic/dead-argument-order.ll +++ b/llvm/test/DebugInfo/Generic/dead-argument-order.ll @@ -1,4 +1,5 @@ ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s +; RUN: %llc_dwarf --try-experimental-debuginfo-iterators -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s ; Built from the following source with clang -O1 ; struct S { int i; }; diff --git a/llvm/test/DebugInfo/Generic/discriminated-union.ll b/llvm/test/DebugInfo/Generic/discriminated-union.ll index 0acf478f653ae..d267d9b029e95 100644 --- a/llvm/test/DebugInfo/Generic/discriminated-union.ll +++ b/llvm/test/DebugInfo/Generic/discriminated-union.ll @@ -1,6 +1,9 @@ ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t ; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s +; RUN: %llc_dwarf --try-experimental-debuginfo-iterators -O0 -filetype=obj < %s > %t +; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s + ; Check for a variant part that has two members, one of which has a ; discriminant value. diff --git a/llvm/test/DebugInfo/Generic/disubrange_vla.ll b/llvm/test/DebugInfo/Generic/disubrange_vla.ll index 18dd128ee01f9..6554cf46b0be3 100644 --- a/llvm/test/DebugInfo/Generic/disubrange_vla.ll +++ b/llvm/test/DebugInfo/Generic/disubrange_vla.ll @@ -4,6 +4,13 @@ ; RUN: llvm-dwarfdump -verbose %t >> %t2 ; RUN: cat %t2 | FileCheck %s +; Repeat the test with experimental debuginfo iterators. +; RUN: rm -rf %t %t2 +; RUN: %llc_dwarf --try-experimental-debuginfo-iterators -O0 -filetype=obj < %s > %t +; RUN: llvm-dwarfdump -name=vla_expr %t > %t2 +; RUN: llvm-dwarfdump -verbose %t >> %t2 +; RUN: cat %t2 | FileCheck %s + ; This test runs llvm-dwarfdump twice: ; - First to get the debug entry for 'vla_expr'. ; - Second to check that this is the entry referenced in DW_AT_count. diff --git a/llvm/test/DebugInfo/Generic/enum-types.ll b/llvm/test/DebugInfo/Generic/enum-types.ll index 8af9b21bdaa42..288513468b06f 100644 --- a/llvm/test/DebugInfo/Generic/enum-types.ll +++ b/llvm/test/DebugInfo/Generic/enum-types.ll @@ -1,5 +1,6 @@ ; ; RUN: %llc_dwarf -filetype=obj -O0 -dwarf-linkage-names=All < %s | llvm-dwarfdump -v -debug-info - | FileCheck %s +; RUN: %llc_dwarf --try-experimental-debuginfo-iterators -filetype=obj -O0 -dwarf-linkage-names=All < %s | llvm-dwarfdump -v -debug-info - | FileCheck %s ; Make sure we can handle enums with the same identifier but in enum types of ; different compile units. diff --git a/llvm/test/DebugInfo/Generic/enum.ll b/llvm/test/DebugInfo/Generic/enum.ll index 63665e355edff..11d30d35f7cf7 100644 --- a/llvm/test/DebugInfo/Generic/enum.ll +++ b/llvm/test/DebugInfo/Generic/enum.ll @@ -1,6 +1,9 @@ ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t ; RUN: llvm-dwarfdump -v %t | FileCheck %s +; RUN: %llc_dwarf --try-experimental-debuginfo-iterators -O0 -filetype=obj < %s > %t +; RUN: llvm-dwarfdump -v %t | FileCheck %s + ; IR generated from the following code compiled with clang -g: ; enum e1 { I, J = 0xffffffffU, K = 0xf000000000000000ULL } a; ; enum e2 { X }; diff --git a/llvm/test/DebugInfo/Generic/import-inlined-declaration.ll b/llvm/test/DebugInfo/Generic/import-inlined-declaration.ll index dc57127dae18f..6870cfa81100f 100644 --- a/llvm/test/DebugInfo/Generic/import-inlined-declaration.ll +++ b/llvm/test/DebugInfo/Generic/import-inlined-declaration.ll @@ -1,5 +1,7 @@ ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump - | FileCheck --implicit-check-not "{{DW_TAG|NULL}}" %s +; RUN: %llc_dwarf --try-experimental-debuginfo-iterators -O0 -filetype=obj < %s | llvm-dwarfdump - | FileCheck --implicit-check-not "{{DW_TAG|NULL}}" %s + ; namespace ns { ; inline __attribute__((always_inline)) ; void foo() { int a = 4; } diff --git a/llvm/test/DebugInfo/Generic/inlined-vars.ll b/llvm/test/DebugInfo/Generic/inlined-vars.ll index 8a71f09ca01b8..f2ef69b474014 100644 --- a/llvm/test/DebugInfo/Generic/inlined-vars.ll +++ b/llvm/test/DebugInfo/Generic/inlined-vars.ll @@ -1,5 +1,7 @@ ; RUN: %llc_dwarf -O0 < %s | FileCheck %s -check-prefix ARGUMENT ; RUN: %llc_dwarf -O0 < %s | FileCheck %s -check-prefix VARIABLE +; RUN: %llc_dwarf --try-experimental-debuginfo-iterators -O0 < %s | FileCheck %s -check-prefix ARGUMENT +; RUN: %llc_dwarf --try-experimental-debuginfo-iterators -O0 < %s | FileCheck %s -check-prefix VARIABLE ; PR 13202 define i32 @main() uwtable !dbg !5 { diff --git a/llvm/test/DebugInfo/Generic/recursive_inlining.ll b/llvm/test/DebugInfo/Generic/recursive_inlining.ll index 908e408401f8f..4636a4d2b722a 100644 --- a/llvm/test/DebugInfo/Generic/recursive_inlining.ll +++ b/llvm/test/DebugInfo/Generic/recursive_inlining.ll @@ -1,4 +1,5 @@ ; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump -debug-info - | FileCheck %s +; RUN: %llc_dwarf --try-experimental-debuginfo-iterators -filetype=obj -O0 < %s | llvm-dwarfdump -debug-info - | FileCheck %s ; This isn't a very pretty test case - I imagine there might be other ways to ; tickle the optimizers into producing the desired code, but I haven't found diff --git a/llvm/test/DebugInfo/Generic/univariant-discriminated-union.ll b/llvm/test/DebugInfo/Generic/univariant-discriminated-union.ll index 628c2f8b1dec9..9514e6fa4db4d 100644 --- a/llvm/test/DebugInfo/Generic/univariant-discriminated-union.ll +++ b/llvm/test/DebugInfo/Generic/univariant-discriminated-union.ll @@ -1,6 +1,9 @@ ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t ; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s +; RUN: %llc_dwarf --try-experimental-debuginfo-iterators -O0 -filetype=obj < %s > %t +; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s + ; Check for a univariant discriminated union -- that is, a variant ; part without a discriminant and with just a single variant. diff --git a/llvm/test/DebugInfo/Mips/delay-slot.ll b/llvm/test/DebugInfo/Mips/delay-slot.ll index ed2769f33f4b3..f966ac7c1ec53 100644 --- a/llvm/test/DebugInfo/Mips/delay-slot.ll +++ b/llvm/test/DebugInfo/Mips/delay-slot.ll @@ -1,4 +1,5 @@ ; RUN: llc -filetype=obj -O0 -relocation-model=pic < %s -mtriple mips-unknown-linux-gnu | llvm-dwarfdump -a - | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -filetype=obj -O0 -relocation-model=pic < %s -mtriple mips-unknown-linux-gnu | llvm-dwarfdump -a - | FileCheck %s ; PR19815 ; Generated using clang -target mips-linux-gnu -g test.c -S -o - -flto|opt -passes=sroa -S diff --git a/llvm/test/DebugInfo/X86/aligned_stack_var.ll b/llvm/test/DebugInfo/X86/aligned_stack_var.ll index 089b3ffab5693..f8b5d4c1bdf56 100644 --- a/llvm/test/DebugInfo/X86/aligned_stack_var.ll +++ b/llvm/test/DebugInfo/X86/aligned_stack_var.ll @@ -1,6 +1,9 @@ ; RUN: llc %s -mtriple=x86_64-pc-linux-gnu -O0 -filetype=obj -o %t ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators %s -mtriple=x86_64-pc-linux-gnu -O0 -filetype=obj -o %t +; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s + ; If stack is realigned, we shouldn't describe locations of local ; variables by giving offset from the frame pointer (%rbp): ; push %rpb diff --git a/llvm/test/DebugInfo/X86/arguments.ll b/llvm/test/DebugInfo/X86/arguments.ll index 767c1385e77f4..229a69696ce85 100644 --- a/llvm/test/DebugInfo/X86/arguments.ll +++ b/llvm/test/DebugInfo/X86/arguments.ll @@ -2,6 +2,9 @@ ; RUN: llc -mtriple=x86_64-unknown-unknown -O0 -filetype=obj < %s > %t ; RUN: llvm-dwarfdump %t | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-unknown-unknown -O0 -filetype=obj < %s > %t +; RUN: llvm-dwarfdump %t | FileCheck %s + ; IR generated from clang -g with the following source: ; struct foo { ; foo(const foo&); diff --git a/llvm/test/DebugInfo/X86/asan_debug_info.ll b/llvm/test/DebugInfo/X86/asan_debug_info.ll index 4a4743ee0df57..342e3c86f6890 100644 --- a/llvm/test/DebugInfo/X86/asan_debug_info.ll +++ b/llvm/test/DebugInfo/X86/asan_debug_info.ll @@ -3,7 +3,7 @@ ; RUN: llvm-dwarfdump - | FileCheck %s ; RUN: opt --try-experimental-debuginfo-iterators < %s -passes=asan -asan-use-after-return=never -S | \ -; RUN: llc -O0 -filetype=obj - -o - | \ +; RUN: llc --try-experimental-debuginfo-iterators -O0 -filetype=obj - -o - | \ ; RUN: llvm-dwarfdump - | FileCheck %s ; For this test case, ASan used to produce IR which resulted in the following diff --git a/llvm/test/DebugInfo/X86/byvalstruct.ll b/llvm/test/DebugInfo/X86/byvalstruct.ll index d84e4753516b9..a23a49d3145d3 100644 --- a/llvm/test/DebugInfo/X86/byvalstruct.ll +++ b/llvm/test/DebugInfo/X86/byvalstruct.ll @@ -1,5 +1,7 @@ ; RUN: llc -mtriple=x86_64-apple-macosx10.8.0 -O0 -filetype=obj -o %t %s ; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-apple-macosx10.8.0 -O0 -filetype=obj -o %t %s +; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s ; Test that we generate debug info for by-value struct args that are not used. ; ; CHECK: DW_TAG_formal_parameter diff --git a/llvm/test/DebugInfo/X86/convert-linked.ll b/llvm/test/DebugInfo/X86/convert-linked.ll index 6a74a6310bc34..9a0d65b4ccd13 100644 --- a/llvm/test/DebugInfo/X86/convert-linked.ll +++ b/llvm/test/DebugInfo/X86/convert-linked.ll @@ -1,4 +1,5 @@ ; RUN: llc -mtriple=x86_64 -filetype=obj -O0 < %s | llvm-dwarfdump - | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64 -filetype=obj -O0 < %s | llvm-dwarfdump - | FileCheck %s ; CHECK: DW_TAG_compile_unit ; CHECK: [[CU0BT0:0x[0-9a-f]+]]: DW_TAG_base_type diff --git a/llvm/test/DebugInfo/X86/dbg-declare-arg.ll b/llvm/test/DebugInfo/X86/dbg-declare-arg.ll index 8e5c117d16be4..c206ab660d229 100644 --- a/llvm/test/DebugInfo/X86/dbg-declare-arg.ll +++ b/llvm/test/DebugInfo/X86/dbg-declare-arg.ll @@ -1,4 +1,5 @@ ; RUN: llc -O0 -fast-isel=true -filetype=obj -o - %s | llvm-dwarfdump -v - | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -O0 -fast-isel=true -filetype=obj -o - %s | llvm-dwarfdump -v - | FileCheck %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple = "x86_64-apple-macosx10.6.7" diff --git a/llvm/test/DebugInfo/X86/dbg-declare-inalloca.ll b/llvm/test/DebugInfo/X86/dbg-declare-inalloca.ll index 1de1d0b17b392..2afbf3d8255b5 100644 --- a/llvm/test/DebugInfo/X86/dbg-declare-inalloca.ll +++ b/llvm/test/DebugInfo/X86/dbg-declare-inalloca.ll @@ -2,6 +2,11 @@ ; RUN: llc < %s | FileCheck %s ; RUN: llc -filetype=obj -O0 < %s | llvm-readobj --codeview - | FileCheck %s --check-prefix=OBJ +; Same checks, this time with experimental debuginfo iterators. +; RUN: llc --try-experimental-debuginfo-iterators -O0 < %s | FileCheck %s --check-prefix=CHECK --check-prefix=DEBUG +; RUN: llc --try-experimental-debuginfo-iterators < %s | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -filetype=obj -O0 < %s | llvm-readobj --codeview - | FileCheck %s --check-prefix=OBJ + ; IR generated by the following source: ; struct NonTrivial { ; NonTrivial();// : x(42) {} diff --git a/llvm/test/DebugInfo/X86/dbg-declare.ll b/llvm/test/DebugInfo/X86/dbg-declare.ll index f07ddbb639ec8..4cf93c6be0ce1 100644 --- a/llvm/test/DebugInfo/X86/dbg-declare.ll +++ b/llvm/test/DebugInfo/X86/dbg-declare.ll @@ -1,6 +1,11 @@ ; RUN: llc < %s -O0 -mtriple x86_64-apple-darwin | FileCheck %s ; RUN: llc < %s -O0 -mtriple x86_64-apple-darwin -filetype=obj \ ; RUN: | llvm-dwarfdump -v - --debug-info | FileCheck %s --check-prefix=DWARF + +; RUN: llc --try-experimental-debuginfo-iterators < %s -O0 -mtriple x86_64-apple-darwin | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators < %s -O0 -mtriple x86_64-apple-darwin -filetype=obj \ +; RUN: | llvm-dwarfdump -v - --debug-info | FileCheck %s --check-prefix=DWARF + ; ; CHECK-LABEL: _foo: diff --git a/llvm/test/DebugInfo/X86/dbg_value_direct.ll b/llvm/test/DebugInfo/X86/dbg_value_direct.ll index 4ac25414f2a72..a1bdd8eab0906 100644 --- a/llvm/test/DebugInfo/X86/dbg_value_direct.ll +++ b/llvm/test/DebugInfo/X86/dbg_value_direct.ll @@ -1,4 +1,5 @@ ; RUN: llc -filetype=obj -O0 < %s +; RUN: llc --try-experimental-debuginfo-iterators -filetype=obj -O0 < %s ; Test that we handle DBG_VALUEs in a register without crashing. ; ; Generated from clang with -fsanitize=address: diff --git a/llvm/test/DebugInfo/X86/debug-info-template-parameter.ll b/llvm/test/DebugInfo/X86/debug-info-template-parameter.ll index 10f453e1f21f4..e552bb02b03cb 100644 --- a/llvm/test/DebugInfo/X86/debug-info-template-parameter.ll +++ b/llvm/test/DebugInfo/X86/debug-info-template-parameter.ll @@ -1,4 +1,5 @@ ; RUN: llc %s -filetype=obj -o - | llvm-dwarfdump -v - | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators %s -filetype=obj -o - | llvm-dwarfdump -v - | FileCheck %s ; C++ source to regenerate: diff --git a/llvm/test/DebugInfo/X86/debug_value_list_selectiondag.ll b/llvm/test/DebugInfo/X86/debug_value_list_selectiondag.ll index c4b7b497fb7fb..cd21b78487a77 100644 --- a/llvm/test/DebugInfo/X86/debug_value_list_selectiondag.ll +++ b/llvm/test/DebugInfo/X86/debug_value_list_selectiondag.ll @@ -2,6 +2,12 @@ ; RUN: llc %s -fast-isel=true -start-after=codegenprepare -stop-before=finalize-isel -experimental-debug-variable-locations=false -o - | FileCheck --check-prefixes=CHECK,FAST %s ; RUN: llc %s -global-isel=true -start-after=codegenprepare -stop-before=finalize-isel -experimental-debug-variable-locations=false -o - | FileCheck --check-prefixes=CHECK,GLOBAL %s +;; Run with experimental debuginfo iterators. +; RUN: llc --try-experimental-debuginfo-iterators %s -start-after=codegenprepare -stop-before=finalize-isel -experimental-debug-variable-locations=false -o - | FileCheck --check-prefixes=CHECK,DAG %s +; RUN: llc --try-experimental-debuginfo-iterators %s -fast-isel=true -start-after=codegenprepare -stop-before=finalize-isel -experimental-debug-variable-locations=false -o - | FileCheck --check-prefixes=CHECK,FAST %s +;; FIXME: Disabled until global isel support is added. +; run: llc --try-experimental-debuginfo-iterators %s -global-isel=true -start-after=codegenprepare -stop-before=finalize-isel -experimental-debug-variable-locations=false -o - | FileCheck --check-prefixes=CHECK,GLOBAL %s + ;; Run with assignment tracking enabled (use sed to add the module flag). ; RUN: sed 's/;Uncomment-with-sed//g' < %s \ ; RUN: | llc -global-isel=false -start-after=codegenprepare -stop-before=finalize-isel -experimental-debug-variable-locations=false -o - \ diff --git a/llvm/test/DebugInfo/X86/double-declare.ll b/llvm/test/DebugInfo/X86/double-declare.ll index 6f273b142f998..5e422e171ae35 100644 --- a/llvm/test/DebugInfo/X86/double-declare.ll +++ b/llvm/test/DebugInfo/X86/double-declare.ll @@ -1,4 +1,5 @@ ; RUN: llc -mtriple=x86_64-apple-darwin -O0 -filetype=obj -o - < %s | llvm-dwarfdump -v -debug-info - | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-apple-darwin -O0 -filetype=obj -o - < %s | llvm-dwarfdump -v -debug-info - | FileCheck %s ; PR33157. Don't crash on duplicate dbg.declare. ; CHECK: DW_TAG_formal_parameter ; CHECK: DW_AT_location [DW_FORM_exprloc] diff --git a/llvm/test/DebugInfo/X86/fi-piece.ll b/llvm/test/DebugInfo/X86/fi-piece.ll index 30144d7875550..e7b8afea90593 100644 --- a/llvm/test/DebugInfo/X86/fi-piece.ll +++ b/llvm/test/DebugInfo/X86/fi-piece.ll @@ -1,4 +1,5 @@ ; RUN: llc %s -filetype=obj -o - | llvm-dwarfdump -v - | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators %s -filetype=obj -o - | llvm-dwarfdump -v - | FileCheck %s ; Test that multi-DW_OP_piece expressions are emitted for FI variables. ; ; CHECK: .debug_info contents: diff --git a/llvm/test/DebugInfo/X86/implicit_value-double.ll b/llvm/test/DebugInfo/X86/implicit_value-double.ll index 03f7a018ebc4a..e0d8e791839c0 100644 --- a/llvm/test/DebugInfo/X86/implicit_value-double.ll +++ b/llvm/test/DebugInfo/X86/implicit_value-double.ll @@ -2,7 +2,10 @@ ;; for double type. ; RUN: llc -O0 -debugger-tune=gdb -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s --check-prefixes=CHECK,BOTH +; RUN: llc --try-experimental-debuginfo-iterators -O0 -debugger-tune=gdb -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s --check-prefixes=CHECK,BOTH + ; RUN: llc -O0 -debugger-tune=lldb -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s --check-prefixes=CHECK,BOTH +; RUN: llc --try-experimental-debuginfo-iterators -O0 -debugger-tune=lldb -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s --check-prefixes=CHECK,BOTH ; CHECK: .debug_info contents: ; CHECK: DW_TAG_variable @@ -11,6 +14,7 @@ ; CHECK-NEXT: DW_AT_name ("d") ; RUN: llc -O0 -debugger-tune=sce -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s -check-prefixes=SCE-CHECK,BOTH +; RUN: llc --try-experimental-debuginfo-iterators -O0 -debugger-tune=sce -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s -check-prefixes=SCE-CHECK,BOTH ; SCE-CHECK: .debug_info contents: ; SCE-CHECK: DW_TAG_variable diff --git a/llvm/test/DebugInfo/X86/instr-ref-opt-levels.ll b/llvm/test/DebugInfo/X86/instr-ref-opt-levels.ll index 23eaacac6a743..9313751a5c135 100644 --- a/llvm/test/DebugInfo/X86/instr-ref-opt-levels.ll +++ b/llvm/test/DebugInfo/X86/instr-ref-opt-levels.ll @@ -8,6 +8,17 @@ ; RUN: -fast-isel -experimental-debug-variable-locations \ ; RUN: | FileCheck %s --check-prefix=FASTISEL --implicit-check-not=DBG_VALUE +;; Repeat the tests using experimental debuginfo iterators. +; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-- %s -o - -O0 -stop-before=finalize-isel \ +; RUN: -experimental-debug-variable-locations \ +; RUN: | FileCheck %s --check-prefix=O0 --implicit-check-not=DBG_INSTR_REF +; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-- %s -o - -O2 -stop-before=finalize-isel \ +; RUN: -experimental-debug-variable-locations \ +; RUN: | FileCheck %s --check-prefix=O2 --implicit-check-not=DBG_VALUE +; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-- %s -o - -stop-before=finalize-isel \ +; RUN: -fast-isel -experimental-debug-variable-locations \ +; RUN: | FileCheck %s --check-prefix=FASTISEL --implicit-check-not=DBG_VALUE + ; Test that instruction-referencing variable locations are issued at -O2, but ; normal DBG_VALUEs are issued at -O0. This behaviour is desired as the former ; is slow when applied to unoptimized code. diff --git a/llvm/test/DebugInfo/X86/instr-ref-selectiondag.ll b/llvm/test/DebugInfo/X86/instr-ref-selectiondag.ll index dbbef2b39587d..29f7d9353e0a3 100644 --- a/llvm/test/DebugInfo/X86/instr-ref-selectiondag.ll +++ b/llvm/test/DebugInfo/X86/instr-ref-selectiondag.ll @@ -12,6 +12,21 @@ ; RUN: | FileCheck %s --check-prefix=FASTISEL-INSTRREF \ ; RUN: --implicit-check-not=DBG_VALUE +;; Repeat tests using experimental debuginfo iterators. +; RUN: llc --try-experimental-debuginfo-iterators %s -mtriple=x86_64-unknown-unknown -o - -stop-before=finalize-isel -experimental-debug-variable-locations=false \ +; RUN: | FileCheck %s --check-prefix=NORMAL \ +; RUN: --implicit-check-not=debug-instr-number \ +; RUN: --implicit-check-not=DBG_INSTR_REF +; RUN: llc --try-experimental-debuginfo-iterators %s -mtriple=x86_64-unknown-unknown -o - -stop-before=finalize-isel \ +; RUN: -experimental-debug-variable-locations -verify-machineinstrs \ +; RUN: | FileCheck %s --check-prefix=INSTRREF \ +; RUN: --implicit-check-not=DBG_VALUE +; RUN: llc --try-experimental-debuginfo-iterators %s -mtriple=x86_64-unknown-unknown -o - -stop-before=finalize-isel \ +; RUN: -experimental-debug-variable-locations -verify-machineinstrs \ +; RUN: -fast-isel \ +; RUN: | FileCheck %s --check-prefix=FASTISEL-INSTRREF \ +; RUN: --implicit-check-not=DBG_VALUE + ; NORMAL: ![[SOCKS:[0-9]+]] = !DILocalVariable(name: "socks", ; NORMAL: ![[KNEES:[0-9]+]] = !DILocalVariable(name: "knees", ; INSTRREF: ![[SOCKS:[0-9]+]] = !DILocalVariable(name: "socks", diff --git a/llvm/test/DebugInfo/X86/missing-abstract-variable.ll b/llvm/test/DebugInfo/X86/missing-abstract-variable.ll index 175a306bdaf6b..8d493e593b8b5 100644 --- a/llvm/test/DebugInfo/X86/missing-abstract-variable.ll +++ b/llvm/test/DebugInfo/X86/missing-abstract-variable.ll @@ -1,5 +1,5 @@ ; RUN: %llc_dwarf -mtriple x86_64-gnu-linux -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s - +; RUN: %llc_dwarf --try-experimental-debuginfo-iterators -mtriple x86_64-gnu-linux -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s ; Build from the following source with clang -O2. ; The important details are that 'x's abstract definition is first built during diff --git a/llvm/test/DebugInfo/X86/parameters.ll b/llvm/test/DebugInfo/X86/parameters.ll index 5254fadecbd7e..cacdd571c91df 100644 --- a/llvm/test/DebugInfo/X86/parameters.ll +++ b/llvm/test/DebugInfo/X86/parameters.ll @@ -1,5 +1,6 @@ ; ; RUN: llc -mtriple=x86_64-unknown-linux-gnu -O0 -filetype=obj %s -o - | llvm-dwarfdump -v -debug-info - | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-unknown-linux-gnu -O0 -filetype=obj %s -o - | llvm-dwarfdump -v -debug-info - | FileCheck %s ; Test case derived from compiling the following source with clang -g: ; diff --git a/llvm/test/DebugInfo/X86/pieces-1.ll b/llvm/test/DebugInfo/X86/pieces-1.ll index f614f78c65814..e0fcd083c7e89 100644 --- a/llvm/test/DebugInfo/X86/pieces-1.ll +++ b/llvm/test/DebugInfo/X86/pieces-1.ll @@ -1,4 +1,5 @@ ; RUN: llc -O0 %s -filetype=obj -o - | llvm-dwarfdump -debug-loc - | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -O0 %s -filetype=obj -o - | llvm-dwarfdump -debug-loc - | FileCheck %s ; ; rdar://problem/15928306 ; diff --git a/llvm/test/DebugInfo/X86/reference-argument.ll b/llvm/test/DebugInfo/X86/reference-argument.ll index 8747da5071a8b..803947ffeef6b 100644 --- a/llvm/test/DebugInfo/X86/reference-argument.ll +++ b/llvm/test/DebugInfo/X86/reference-argument.ll @@ -1,5 +1,7 @@ ; RUN: llc -mtriple=x86_64-apple-macosx10.9.0 -filetype=obj -O0 < %s \ ; RUN: | llvm-dwarfdump -v -debug-info - | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-apple-macosx10.9.0 -filetype=obj -O0 < %s \ +; RUN: | llvm-dwarfdump -v -debug-info - | FileCheck %s ; ModuleID = 'aggregate-indirect-arg.cpp' ; extracted from debuginfo-tests/aggregate-indirect-arg.cpp diff --git a/llvm/test/DebugInfo/X86/spill-indirect-nrvo.ll b/llvm/test/DebugInfo/X86/spill-indirect-nrvo.ll index b9a504b9b7b60..4bcb08d675a47 100644 --- a/llvm/test/DebugInfo/X86/spill-indirect-nrvo.ll +++ b/llvm/test/DebugInfo/X86/spill-indirect-nrvo.ll @@ -4,11 +4,9 @@ ; 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 -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 +; 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. diff --git a/llvm/test/DebugInfo/X86/sret.ll b/llvm/test/DebugInfo/X86/sret.ll index f06b097d07b98..222fb05b6df8b 100644 --- a/llvm/test/DebugInfo/X86/sret.ll +++ b/llvm/test/DebugInfo/X86/sret.ll @@ -1,8 +1,7 @@ ; 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 +; 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. @@ -12,8 +11,7 @@ ; 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 -;; FIXME: RemoveDIs - enable when FastISel support is added. -; run: llc --try-experimental-debuginfo-iterators -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 --try-experimental-debuginfo-iterators -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 --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 diff --git a/llvm/test/DebugInfo/X86/subreg.ll b/llvm/test/DebugInfo/X86/subreg.ll index 671af9e05fe24..f826cc5a9c93b 100644 --- a/llvm/test/DebugInfo/X86/subreg.ll +++ b/llvm/test/DebugInfo/X86/subreg.ll @@ -1,4 +1,5 @@ ; RUN: llc %s -mtriple=x86_64-pc-linux-gnu -O0 -o - | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators %s -mtriple=x86_64-pc-linux-gnu -O0 -o - | FileCheck %s ; We are testing that a value in a 16 bit register gets reported as ; being in its superregister. diff --git a/llvm/test/DebugInfo/X86/subregisters.ll b/llvm/test/DebugInfo/X86/subregisters.ll index 4e279aba3d8b3..5dc5a8033f1e7 100644 --- a/llvm/test/DebugInfo/X86/subregisters.ll +++ b/llvm/test/DebugInfo/X86/subregisters.ll @@ -1,5 +1,8 @@ ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t.o -filetype=obj -O0 ; RUN: llvm-dwarfdump -v %t.o | FileCheck %s + +; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-apple-darwin %s -o %t.o -filetype=obj -O0 +; RUN: llvm-dwarfdump -v %t.o | FileCheck %s ; ; Test that on x86_64, the 32-bit subregister esi is emitted as ; subregister of the 64-bit rsi. diff --git a/llvm/test/DebugInfo/X86/vla.ll b/llvm/test/DebugInfo/X86/vla.ll index 26322ec0fdd7b..f90cf2aadc71c 100644 --- a/llvm/test/DebugInfo/X86/vla.ll +++ b/llvm/test/DebugInfo/X86/vla.ll @@ -1,4 +1,5 @@ ; RUN: llc -O0 -mtriple=x86_64-apple-darwin -filetype=asm %s -o - | FileCheck %s +; RUN: llc --try-experimental-debuginfo-iterators -O0 -mtriple=x86_64-apple-darwin -filetype=asm %s -o - | FileCheck %s ; Ensure that we generate an indirect location for the variable length array a. ; CHECK: ##DEBUG_VALUE: vla:a <- [DW_OP_deref] [{{\$r[a-z]+}}+0] ; CHECK: DW_OP_breg{{[0-9]}}