diff --git a/llvm/include/llvm/IR/DebugInfo.h b/llvm/include/llvm/IR/DebugInfo.h index 8f9f2594541a0..006fd02a17bfd 100644 --- a/llvm/include/llvm/IR/DebugInfo.h +++ b/llvm/include/llvm/IR/DebugInfo.h @@ -236,6 +236,12 @@ inline SmallVector getDPVAssignmentMarkers(const Instruction *Inst) { return {}; } +inline SmallVector getDPVAssignmentMarkers(const Instruction *Inst) { + if (auto *ID = Inst->getMetadata(LLVMContext::MD_DIAssignID)) + return cast(ID)->getAllDPValueUsers(); + return {}; +} + /// Delete the llvm.dbg.assign intrinsics linked to \p Inst. void deleteAssignmentMarkers(const Instruction *Inst); diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp index adf87ebb69f54..551a37b132445 100644 --- a/llvm/lib/Transforms/Scalar/SROA.cpp +++ b/llvm/lib/Transforms/Scalar/SROA.cpp @@ -319,6 +319,29 @@ static DebugVariable getAggregateVariable(DbgVariableIntrinsic *DVI) { return DebugVariable(DVI->getVariable(), std::nullopt, DVI->getDebugLoc().getInlinedAt()); } +static DebugVariable getAggregateVariable(DPValue *DPV) { + return DebugVariable(DPV->getVariable(), std::nullopt, + DPV->getDebugLoc().getInlinedAt()); +} + +static DPValue *createLinkedAssign(DPValue *, DIBuilder &DIB, + Instruction *LinkedInstr, Value *NewValue, + DILocalVariable *Variable, + DIExpression *Expression, Value *Address, + DIExpression *AddressExpression, + const DILocation *DI) { + (void)DIB; + return DPValue::createLinkedDPVAssign(LinkedInstr, NewValue, Variable, + Expression, Address, AddressExpression, + DI); +} +static DbgAssignIntrinsic *createLinkedAssign( + DbgAssignIntrinsic *, DIBuilder &DIB, Instruction *LinkedInstr, + Value *NewValue, DILocalVariable *Variable, DIExpression *Expression, + Value *Address, DIExpression *AddressExpression, const DILocation *DI) { + return DIB.insertDbgAssign(LinkedInstr, NewValue, Variable, Expression, + Address, AddressExpression, DI); +} /// Find linked dbg.assign and generate a new one with the correct /// FragmentInfo. Link Inst to the new dbg.assign. If Value is nullptr the @@ -340,8 +363,9 @@ static void migrateDebugInfo(AllocaInst *OldAlloca, bool IsSplit, Instruction *Inst, Value *Dest, Value *Value, const DataLayout &DL) { auto MarkerRange = at::getAssignmentMarkers(OldInst); + auto DPVAssignMarkerRange = at::getDPVAssignmentMarkers(OldInst); // Nothing to do if OldInst has no linked dbg.assign intrinsics. - if (MarkerRange.empty()) + if (MarkerRange.empty() && DPVAssignMarkerRange.empty()) return; LLVM_DEBUG(dbgs() << " migrateDebugInfo\n"); @@ -362,6 +386,9 @@ static void migrateDebugInfo(AllocaInst *OldAlloca, bool IsSplit, for (auto *DAI : at::getAssignmentMarkers(OldAlloca)) BaseFragments[getAggregateVariable(DAI)] = DAI->getExpression()->getFragmentInfo(); + for (auto *DPV : at::getDPVAssignmentMarkers(OldAlloca)) + BaseFragments[getAggregateVariable(DPV)] = + DPV->getExpression()->getFragmentInfo(); // The new inst needs a DIAssignID unique metadata tag (if OldInst has // one). It shouldn't already have one: assert this assumption. @@ -371,7 +398,7 @@ static void migrateDebugInfo(AllocaInst *OldAlloca, bool IsSplit, DIBuilder DIB(*OldInst->getModule(), /*AllowUnresolved*/ false); assert(OldAlloca->isStaticAlloca()); - for (DbgAssignIntrinsic *DbgAssign : MarkerRange) { + auto MigrateDbgAssign = [&](auto DbgAssign) { LLVM_DEBUG(dbgs() << " existing dbg.assign is: " << *DbgAssign << "\n"); auto *Expr = DbgAssign->getExpression(); @@ -382,7 +409,7 @@ static void migrateDebugInfo(AllocaInst *OldAlloca, bool IsSplit, { auto R = BaseFragments.find(getAggregateVariable(DbgAssign)); if (R == BaseFragments.end()) - continue; + return; BaseFragment = R->second; } std::optional CurrentFragment = @@ -393,7 +420,7 @@ static void migrateDebugInfo(AllocaInst *OldAlloca, bool IsSplit, BaseFragment, CurrentFragment, NewFragment); if (Result == Skip) - continue; + return; if (Result == UseFrag && !(NewFragment == CurrentFragment)) { if (CurrentFragment) { // Rewrite NewFragment to be relative to the existing one (this is @@ -425,9 +452,10 @@ static void migrateDebugInfo(AllocaInst *OldAlloca, bool IsSplit, } ::Value *NewValue = Value ? Value : DbgAssign->getValue(); - auto *NewAssign = DIB.insertDbgAssign( - Inst, NewValue, DbgAssign->getVariable(), Expr, Dest, - DIExpression::get(Ctx, std::nullopt), DbgAssign->getDebugLoc()); + auto *NewAssign = createLinkedAssign( + DbgAssign, DIB, Inst, NewValue, DbgAssign->getVariable(), Expr, Dest, + DIExpression::get(Expr->getContext(), std::nullopt), + DbgAssign->getDebugLoc()); // If we've updated the value but the original dbg.assign has an arglist // then kill it now - we can't use the requested new value. @@ -461,9 +489,11 @@ static void migrateDebugInfo(AllocaInst *OldAlloca, bool IsSplit, NewAssign->moveBefore(DbgAssign); NewAssign->setDebugLoc(DbgAssign->getDebugLoc()); - LLVM_DEBUG(dbgs() << "Created new assign intrinsic: " << *NewAssign - << "\n"); - } + LLVM_DEBUG(dbgs() << "Created new assign: " << *NewAssign << "\n"); + }; + + for_each(MarkerRange, MigrateDbgAssign); + for_each(DPVAssignMarkerRange, MigrateDbgAssign); } namespace { @@ -3108,6 +3138,7 @@ class AllocaSliceRewriter : public InstVisitor { // emit dbg.assign intrinsics for mem intrinsics storing through non- // constant geps, or storing a variable number of bytes. assert(at::getAssignmentMarkers(&II).empty() && + at::getDPVAssignmentMarkers(&II).empty() && "AT: Unexpected link to non-const GEP"); deleteIfTriviallyDead(OldPtr); return false; @@ -3254,11 +3285,13 @@ class AllocaSliceRewriter : public InstVisitor { Value *AdjustedPtr = getNewAllocaSlicePtr(IRB, OldPtr->getType()); if (IsDest) { // Update the address component of linked dbg.assigns. - for (auto *DAI : at::getAssignmentMarkers(&II)) { - if (llvm::is_contained(DAI->location_ops(), II.getDest()) || - DAI->getAddress() == II.getDest()) - DAI->replaceVariableLocationOp(II.getDest(), AdjustedPtr); - } + auto UpdateAssignAddress = [&](auto *DbgAssign) { + if (llvm::is_contained(DbgAssign->location_ops(), II.getDest()) || + DbgAssign->getAddress() == II.getDest()) + DbgAssign->replaceVariableLocationOp(II.getDest(), AdjustedPtr); + }; + for_each(at::getAssignmentMarkers(&II), UpdateAssignAddress); + for_each(at::getDPVAssignmentMarkers(&II), UpdateAssignAddress); II.setDest(AdjustedPtr); II.setDestAlignment(SliceAlign); } else { @@ -3842,6 +3875,7 @@ class AggLoadStoreRewriter : public InstVisitor { DL); } else { assert(at::getAssignmentMarkers(Store).empty() && + at::getDPVAssignmentMarkers(Store).empty() && "AT: unexpected debug.assign linked to store through " "unbounded GEP"); } @@ -4861,10 +4895,22 @@ static void insertNewDbgInst(DIBuilder &DIB, DPValue *Orig, AllocaInst *NewAddr, DIExpression *NewFragmentExpr, Instruction *BeforeInst) { (void)DIB; - DPValue *New = new DPValue(ValueAsMetadata::get(NewAddr), Orig->getVariable(), - NewFragmentExpr, Orig->getDebugLoc(), - DPValue::LocationType::Declare); - BeforeInst->getParent()->insertDPValueBefore(New, BeforeInst->getIterator()); + if (Orig->isDbgDeclare()) { + DPValue *DPV = DPValue::createDPVDeclare( + NewAddr, Orig->getVariable(), NewFragmentExpr, Orig->getDebugLoc()); + BeforeInst->getParent()->insertDPValueBefore(DPV, + BeforeInst->getIterator()); + return; + } + if (!NewAddr->hasMetadata(LLVMContext::MD_DIAssignID)) { + NewAddr->setMetadata(LLVMContext::MD_DIAssignID, + DIAssignID::getDistinct(NewAddr->getContext())); + } + auto *NewAssign = DPValue::createLinkedDPVAssign( + NewAddr, Orig->getValue(), Orig->getVariable(), NewFragmentExpr, NewAddr, + Orig->getAddressExpression(), Orig->getDebugLoc()); + LLVM_DEBUG(dbgs() << "Created new DPVAssign: " << *NewAssign << "\n"); + (void)NewAssign; } /// Walks the slices of an alloca and form partitions based on them, @@ -5042,6 +5088,7 @@ bool SROA::splitAlloca(AllocaInst &AI, AllocaSlices &AS) { for_each(findDbgDeclares(&AI), MigrateOne); for_each(findDPVDeclares(&AI), MigrateOne); for_each(at::getAssignmentMarkers(&AI), MigrateOne); + for_each(at::getDPVAssignmentMarkers(&AI), MigrateOne); return Changed; } @@ -5262,8 +5309,9 @@ std::pair SROA::runSROA(Function &F) { "Should not have modified the CFG when told to preserve it."); if (Changed && isAssignmentTrackingEnabled(*F.getParent())) { - for (auto &BB : F) + for (auto &BB : F) { RemoveRedundantDbgInstrs(&BB); + } } return {Changed, CFGChanged}; diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/instcombine/remove-redundant-dbg.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/instcombine/remove-redundant-dbg.ll index 11895098179eb..cffac06f8e545 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/instcombine/remove-redundant-dbg.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/instcombine/remove-redundant-dbg.ll @@ -1,5 +1,7 @@ ; RUN: opt -passes=sroa -S %s -o - \ ; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" +; RUN: opt --try-experimental-debuginfo-iterators -passes=sroa -S %s -o - \ +; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" ;; Check that sroa removes redundant debug intrinsics after it makes a ;; change. This has a significant positive impact on peak memory and compiler diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/after-inlining.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/after-inlining.ll index 16acdb4453126..e386871699281 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/after-inlining.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/after-inlining.ll @@ -1,4 +1,5 @@ ; RUN: opt %s -S -passes=sroa -o - | FileCheck %s +; RUN: opt --try-experimental-debuginfo-iterators %s -S -passes=sroa -o - | FileCheck %s ;; Check that SROA preserves the InlinedAt status of new dbg.assign intriniscs ;; it inserts. diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/alloca-single-slice.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/alloca-single-slice.ll index af2c565986f50..d99bde32aa8ce 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/alloca-single-slice.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/alloca-single-slice.ll @@ -1,5 +1,7 @@ ; RUN: opt -passes=sroa,verify -S %s -o - \ ; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" +; RUN: opt --try-experimental-debuginfo-iterators -passes=sroa,verify -S %s -o - \ +; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" ; Check that single sliced allocas retain their assignment tracking debug info. diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/arglist.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/arglist.ll index 8a76081094086..83f257e77b0be 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/arglist.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/arglist.ll @@ -1,4 +1,5 @@ ; RUN: opt -passes=sroa -S %s -o - | FileCheck %s +; RUN: opt --try-experimental-debuginfo-iterators -passes=sroa -S %s -o - | FileCheck %s ;; Check that a dbg.assign for a promoted variable becomes a kill location if ;; it used an arglist. diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/complex.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/complex.ll index cc733a0dbbc1e..ed4c6fa947ce0 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/complex.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/complex.ll @@ -1,5 +1,7 @@ ; RUN: opt -passes=sroa -S -o - %s \ ; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" +; RUN: opt --try-experimental-debuginfo-iterators -passes=sroa -S -o - %s \ +; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" ; ;; Based on llvm/test/DebugInfo/ARM/sroa-complex.ll ;; generated from: diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/fail-fragment.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/fail-fragment.ll index d9ded4839a982..234504d14442e 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/fail-fragment.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/fail-fragment.ll @@ -1,5 +1,7 @@ ; RUN: opt -passes=sroa -S %s -o - \ ; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" +; RUN: opt --try-experimental-debuginfo-iterators -passes=sroa -S %s -o - \ +; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" ;; Check that a dbg.assign for a promoted variable becomes a kill location if ;; it used a fragment that can't be split (the first check directive below). diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/frag-2.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/frag-2.ll index a6dba664822c7..5016bd4dd1f03 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/frag-2.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/frag-2.ll @@ -1,4 +1,5 @@ ; RUN: opt -passes=sroa -S %s -o - | FileCheck %s +; RUN: opt --try-experimental-debuginfo-iterators -passes=sroa -S %s -o - | FileCheck %s ;; $ cat test.cpp ;; class a { diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/frag.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/frag.ll index 38ebed1cf0b91..c8fb65b76de58 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/frag.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/frag.ll @@ -1,4 +1,5 @@ ; RUN: opt %s -S -passes=sroa -o - | FileCheck %s +; RUN: opt --try-experimental-debuginfo-iterators %s -S -passes=sroa -o - | FileCheck %s ;; $ cat test.cpp ;; class c { diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/id.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/id.ll index 13c05081ffc52..ae185ebaf9591 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/id.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/id.ll @@ -1,4 +1,5 @@ ; RUN: opt -passes=sroa -S %s -o - | FileCheck %s +; RUN: opt --try-experimental-debuginfo-iterators -passes=sroa -S %s -o - | FileCheck %s ;; Check that multiple dbg.assign intrinsics linked to a store that is getting ;; split (or at least that is touched by SROA, causing a replacement store to diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/memcpy.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/memcpy.ll index 22fd7eb86273d..709f33125c87b 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/memcpy.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/memcpy.ll @@ -1,5 +1,7 @@ ; RUN: opt -passes=sroa,verify -S %s -o - \ ; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" +; RUN: opt --try-experimental-debuginfo-iterators -passes=sroa,verify -S %s -o - \ +; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" ;; Check that the new slices of an alloca and memcpy intructions get dbg.assign ;; intrinsics with the correct fragment info. diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/memmove-to-from-same-alloca.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/memmove-to-from-same-alloca.ll index 3e744eaf985cf..07b29ab795b72 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/memmove-to-from-same-alloca.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/memmove-to-from-same-alloca.ll @@ -1,5 +1,7 @@ ; RUN: opt %s -passes=sroa -o - -S \ ; RUN: | FileCheck %s +; RUN: opt --try-experimental-debuginfo-iterators %s -passes=sroa -o - -S \ +; RUN: | FileCheck %s ;; Generated from this C++ source: ;; __attribute__((nodebug)) struct Blob {int P[6];} Glob; diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/remove-redundant-dbg.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/remove-redundant-dbg.ll index 11895098179eb..cffac06f8e545 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/remove-redundant-dbg.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/remove-redundant-dbg.ll @@ -1,5 +1,7 @@ ; RUN: opt -passes=sroa -S %s -o - \ ; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" +; RUN: opt --try-experimental-debuginfo-iterators -passes=sroa -S %s -o - \ +; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" ;; Check that sroa removes redundant debug intrinsics after it makes a ;; change. This has a significant positive impact on peak memory and compiler diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/rewrite.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/rewrite.ll index f7ba8026df463..15fbfa04f7b0c 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/rewrite.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/rewrite.ll @@ -1,5 +1,7 @@ ; RUN: opt -passes=sroa,verify -S %s -o - \ ; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" +; RUN: opt --try-experimental-debuginfo-iterators -passes=sroa,verify -S %s -o - \ +; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" ; Check that the new slices of an alloca and memset intructions get dbg.assign ; intrinsics with the correct fragment info. Ensure that only the diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/split-pre-fragmented-store-2.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/split-pre-fragmented-store-2.ll index a7ec437989e16..1f126f6aa6b4f 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/split-pre-fragmented-store-2.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/split-pre-fragmented-store-2.ll @@ -1,5 +1,7 @@ ; RUN: opt -S -passes=sroa -sroa-skip-mem2reg %s \ ; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" +; RUN: opt --try-experimental-debuginfo-iterators -S -passes=sroa -sroa-skip-mem2reg %s \ +; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" ;; NOTE: This is the same as split-pre-fragmented-store.ll except the base ;; alloca's dbg.assign has been altered to contain a fragment of the full diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/split-pre-fragmented-store.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/split-pre-fragmented-store.ll index 4bf78aa441a36..458c3298b813d 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/split-pre-fragmented-store.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/split-pre-fragmented-store.ll @@ -1,5 +1,7 @@ ; RUN: opt -S -passes=sroa -sroa-skip-mem2reg %s \ ; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" +; RUN: opt --try-experimental-debuginfo-iterators -S -passes=sroa -sroa-skip-mem2reg %s \ +; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" ;; IR hand-modified, originally generated from: ;; struct Pair { int a; int b; }; diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/store.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/store.ll index 72d6ab234dcbe..7601bdd21ce85 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/store.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/store.ll @@ -1,5 +1,7 @@ ; RUN: opt -passes=sroa,verify -S %s -o - \ ; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" +; RUN: opt --try-experimental-debuginfo-iterators -passes=sroa,verify -S %s -o - \ +; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" ; Check that the new slices of an alloca and memset intructions get dbg.assign ; intrinsics with the correct fragment info. Ensure that only the diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/unspecified-var-size.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/unspecified-var-size.ll index c04e5a7a2146a..2a94622bbe553 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/unspecified-var-size.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/unspecified-var-size.ll @@ -1,4 +1,5 @@ ; RUN: opt -S %s -passes=sroa -o - | FileCheck %s +; RUN: opt --try-experimental-debuginfo-iterators -S %s -passes=sroa -o - | FileCheck %s ;; $ cat test.cpp ;; #include diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/user-memcpy.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/user-memcpy.ll index abc110273ab3b..23d0ff3461046 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/user-memcpy.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/user-memcpy.ll @@ -1,5 +1,7 @@ ; RUN: opt -passes=sroa -S %s -o - \ ; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" +; RUN: opt --try-experimental-debuginfo-iterators -passes=sroa -S %s -o - \ +; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg" ;; Check that the fragments generated in SROA for a split alloca that has a ;; dbg.assign with non-zero-offset fragment are correct. diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/var-sized-fragment.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/var-sized-fragment.ll index 59406b30d735a..97bab2febcae9 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/var-sized-fragment.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/var-sized-fragment.ll @@ -1,4 +1,5 @@ ; RUN: opt -S %s -o - -passes=sroa | FileCheck %s +; RUN: opt --try-experimental-debuginfo-iterators -S %s -o - -passes=sroa | FileCheck %s ;; SROA splits the alloca into two. Each slice already has a 32-bit variable ;; associated with it (the structured binding variables). Check SROA doesn't diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/vec-1.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/vec-1.ll index f09e88144e835..69b884431a357 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/vec-1.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/vec-1.ll @@ -1,4 +1,5 @@ ; RUN: opt %s -S -passes=sroa -o - | FileCheck %s +; RUN: opt --try-experimental-debuginfo-iterators %s -S -passes=sroa -o - | FileCheck %s ;; Ensure that only the value-expression gets fragment info; that the ;; address-expression remains untouched. diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/vec-2.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/vec-2.ll index 107a1e0a91bc6..3281c107317de 100644 --- a/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/vec-2.ll +++ b/llvm/test/DebugInfo/Generic/assignment-tracking/sroa/vec-2.ll @@ -1,4 +1,5 @@ ; RUN: opt %s -S -passes=sroa -o - | FileCheck %s +; RUN: opt --try-experimental-debuginfo-iterators %s -S -passes=sroa -o - | FileCheck %s ;; $ cat test.cpp ;; class a {