[llvm] [RemoveDIs][DebugInfo] Handle DPVAssigns in Assignment Tracking excluding lowering (PR #78982)
Stephen Tozer via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 22 10:18:17 PST 2024
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/78982
>From 00aad95b0faef6726245c4bdf0b8c59596ef7793 Mon Sep 17 00:00:00 2001
From: Stephen Tozer <Stephen.Tozer at Sony.com>
Date: Wed, 3 Jan 2024 16:45:02 +0000
Subject: [PATCH 1/3] Handle remaining AT analysis changes, and emit them
correctly in SelDag
---
.../CodeGen/AssignmentTrackingAnalysis.cpp | 280 ++++++++++--------
.../SelectionDAG/SelectionDAGBuilder.cpp | 1 +
2 files changed, 154 insertions(+), 127 deletions(-)
diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
index 52b464cc76af4c..657d47afd1f716 100644
--- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
+++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
@@ -829,6 +829,13 @@ class MemLocFragmentFill {
void process(BasicBlock &BB, VarFragMap &LiveSet) {
BBInsertBeforeMap[&BB].clear();
for (auto &I : BB) {
+ for (auto &DPV : I.getDbgValueRange()) {
+ if (const auto *Locs = FnVarLocs->getWedge(&DPV)) {
+ for (const VarLocInfo &Loc : *Locs) {
+ addDef(Loc, &DPV, *I.getParent(), LiveSet);
+ }
+ }
+ }
if (const auto *Locs = FnVarLocs->getWedge(&I)) {
for (const VarLocInfo &Loc : *Locs) {
addDef(Loc, &I, *I.getParent(), LiveSet);
@@ -2335,73 +2342,78 @@ removeRedundantDbgLocsUsingBackwardScan(const BasicBlock *BB,
VariableDefinedBytes.clear();
}
- // Get the location defs that start just before this instruction.
- const auto *Locs = FnVarLocs.getWedge(&I);
- if (!Locs)
- continue;
+ auto HandleLocsForWedge = [&](auto *WedgePosition) {
+ // Get the location defs that start just before this instruction.
+ const auto *Locs = FnVarLocs.getWedge(WedgePosition);
+ if (!Locs)
+ return;
+
+ NumWedgesScanned++;
+ bool ChangedThisWedge = false;
+ // The new pruned set of defs, reversed because we're scanning backwards.
+ SmallVector<VarLocInfo> NewDefsReversed;
+
+ // Iterate over the existing defs in reverse.
+ for (auto RIt = Locs->rbegin(), REnd = Locs->rend(); RIt != REnd; ++RIt) {
+ NumDefsScanned++;
+ DebugAggregate Aggr =
+ getAggregate(FnVarLocs.getVariable(RIt->VariableID));
+ uint64_t SizeInBits = Aggr.first->getSizeInBits().value_or(0);
+ uint64_t SizeInBytes = divideCeil(SizeInBits, 8);
+
+ // Cutoff for large variables to prevent expensive bitvector operations.
+ const uint64_t MaxSizeBytes = 2048;
+
+ if (SizeInBytes == 0 || SizeInBytes > MaxSizeBytes) {
+ // If the size is unknown (0) then keep this location def to be safe.
+ // Do the same for defs of large variables, which would be expensive
+ // to represent with a BitVector.
+ NewDefsReversed.push_back(*RIt);
+ continue;
+ }
- NumWedgesScanned++;
- bool ChangedThisWedge = false;
- // The new pruned set of defs, reversed because we're scanning backwards.
- SmallVector<VarLocInfo> NewDefsReversed;
-
- // Iterate over the existing defs in reverse.
- for (auto RIt = Locs->rbegin(), REnd = Locs->rend(); RIt != REnd; ++RIt) {
- NumDefsScanned++;
- DebugAggregate Aggr =
- getAggregate(FnVarLocs.getVariable(RIt->VariableID));
- uint64_t SizeInBits = Aggr.first->getSizeInBits().value_or(0);
- uint64_t SizeInBytes = divideCeil(SizeInBits, 8);
-
- // Cutoff for large variables to prevent expensive bitvector operations.
- const uint64_t MaxSizeBytes = 2048;
-
- if (SizeInBytes == 0 || SizeInBytes > MaxSizeBytes) {
- // If the size is unknown (0) then keep this location def to be safe.
- // Do the same for defs of large variables, which would be expensive
- // to represent with a BitVector.
- NewDefsReversed.push_back(*RIt);
- continue;
- }
+ // Only keep this location definition if it is not fully eclipsed by
+ // other definitions in this wedge that come after it
+
+ // Inert the bytes the location definition defines.
+ auto InsertResult =
+ VariableDefinedBytes.try_emplace(Aggr, BitVector(SizeInBytes));
+ bool FirstDefinition = InsertResult.second;
+ BitVector &DefinedBytes = InsertResult.first->second;
+
+ DIExpression::FragmentInfo Fragment =
+ RIt->Expr->getFragmentInfo().value_or(
+ DIExpression::FragmentInfo(SizeInBits, 0));
+ bool InvalidFragment = Fragment.endInBits() > SizeInBits;
+ uint64_t StartInBytes = Fragment.startInBits() / 8;
+ uint64_t EndInBytes = divideCeil(Fragment.endInBits(), 8);
+
+ // If this defines any previously undefined bytes, keep it.
+ if (FirstDefinition || InvalidFragment ||
+ DefinedBytes.find_first_unset_in(StartInBytes, EndInBytes) != -1) {
+ if (!InvalidFragment)
+ DefinedBytes.set(StartInBytes, EndInBytes);
+ NewDefsReversed.push_back(*RIt);
+ continue;
+ }
- // Only keep this location definition if it is not fully eclipsed by
- // other definitions in this wedge that come after it
-
- // Inert the bytes the location definition defines.
- auto InsertResult =
- VariableDefinedBytes.try_emplace(Aggr, BitVector(SizeInBytes));
- bool FirstDefinition = InsertResult.second;
- BitVector &DefinedBytes = InsertResult.first->second;
-
- DIExpression::FragmentInfo Fragment =
- RIt->Expr->getFragmentInfo().value_or(
- DIExpression::FragmentInfo(SizeInBits, 0));
- bool InvalidFragment = Fragment.endInBits() > SizeInBits;
- uint64_t StartInBytes = Fragment.startInBits() / 8;
- uint64_t EndInBytes = divideCeil(Fragment.endInBits(), 8);
-
- // If this defines any previously undefined bytes, keep it.
- if (FirstDefinition || InvalidFragment ||
- DefinedBytes.find_first_unset_in(StartInBytes, EndInBytes) != -1) {
- if (!InvalidFragment)
- DefinedBytes.set(StartInBytes, EndInBytes);
- NewDefsReversed.push_back(*RIt);
- continue;
+ // Redundant def found: throw it away. Since the wedge of defs is being
+ // rebuilt, doing nothing is the same as deleting an entry.
+ ChangedThisWedge = true;
+ NumDefsRemoved++;
}
- // Redundant def found: throw it away. Since the wedge of defs is being
- // rebuilt, doing nothing is the same as deleting an entry.
- ChangedThisWedge = true;
- NumDefsRemoved++;
- }
-
- // Un-reverse the defs and replace the wedge with the pruned version.
- if (ChangedThisWedge) {
- std::reverse(NewDefsReversed.begin(), NewDefsReversed.end());
- FnVarLocs.setWedge(&I, std::move(NewDefsReversed));
- NumWedgesChanged++;
- Changed = true;
- }
+ // Un-reverse the defs and replace the wedge with the pruned version.
+ if (ChangedThisWedge) {
+ std::reverse(NewDefsReversed.begin(), NewDefsReversed.end());
+ FnVarLocs.setWedge(WedgePosition, std::move(NewDefsReversed));
+ NumWedgesChanged++;
+ Changed = true;
+ }
+ };
+ HandleLocsForWedge(&I);
+ for (DPValue &DPV : reverse(I.getDbgValueRange()))
+ HandleLocsForWedge(&DPV);
}
return Changed;
@@ -2426,42 +2438,48 @@ removeRedundantDbgLocsUsingForwardScan(const BasicBlock *BB,
// instructions.
for (const Instruction &I : *BB) {
// Get the defs that come just before this instruction.
- const auto *Locs = FnVarLocs.getWedge(&I);
- if (!Locs)
- continue;
-
- NumWedgesScanned++;
- bool ChangedThisWedge = false;
- // The new pruned set of defs.
- SmallVector<VarLocInfo> NewDefs;
+ auto HandleLocsForWedge = [&](auto *WedgePosition) {
+ const auto *Locs = FnVarLocs.getWedge(WedgePosition);
+ if (!Locs)
+ return;
+
+ NumWedgesScanned++;
+ bool ChangedThisWedge = false;
+ // The new pruned set of defs.
+ SmallVector<VarLocInfo> NewDefs;
+
+ // Iterate over the existing defs.
+ for (const VarLocInfo &Loc : *Locs) {
+ NumDefsScanned++;
+ DebugVariable Key(FnVarLocs.getVariable(Loc.VariableID).getVariable(),
+ std::nullopt, Loc.DL.getInlinedAt());
+ auto VMI = VariableMap.find(Key);
+
+ // Update the map if we found a new value/expression describing the
+ // variable, or if the variable wasn't mapped already.
+ if (VMI == VariableMap.end() || VMI->second.first != Loc.Values ||
+ VMI->second.second != Loc.Expr) {
+ VariableMap[Key] = {Loc.Values, Loc.Expr};
+ NewDefs.push_back(Loc);
+ continue;
+ }
- // Iterate over the existing defs.
- for (const VarLocInfo &Loc : *Locs) {
- NumDefsScanned++;
- DebugVariable Key(FnVarLocs.getVariable(Loc.VariableID).getVariable(),
- std::nullopt, Loc.DL.getInlinedAt());
- auto VMI = VariableMap.find(Key);
-
- // Update the map if we found a new value/expression describing the
- // variable, or if the variable wasn't mapped already.
- if (VMI == VariableMap.end() || VMI->second.first != Loc.Values ||
- VMI->second.second != Loc.Expr) {
- VariableMap[Key] = {Loc.Values, Loc.Expr};
- NewDefs.push_back(Loc);
- continue;
+ // Did not insert this Loc, which is the same as removing it.
+ ChangedThisWedge = true;
+ NumDefsRemoved++;
}
- // Did not insert this Loc, which is the same as removing it.
- ChangedThisWedge = true;
- NumDefsRemoved++;
- }
+ // Replace the existing wedge with the pruned version.
+ if (ChangedThisWedge) {
+ FnVarLocs.setWedge(WedgePosition, std::move(NewDefs));
+ NumWedgesChanged++;
+ Changed = true;
+ }
+ };
- // Replace the existing wedge with the pruned version.
- if (ChangedThisWedge) {
- FnVarLocs.setWedge(&I, std::move(NewDefs));
- NumWedgesChanged++;
- Changed = true;
- }
+ for (DPValue &DPV : I.getDbgValueRange())
+ HandleLocsForWedge(&DPV);
+ HandleLocsForWedge(&I);
}
return Changed;
@@ -2508,41 +2526,46 @@ removeUndefDbgLocsFromEntryBlock(const BasicBlock *BB,
// instructions.
for (const Instruction &I : *BB) {
// Get the defs that come just before this instruction.
- const auto *Locs = FnVarLocs.getWedge(&I);
- if (!Locs)
- continue;
-
- NumWedgesScanned++;
- bool ChangedThisWedge = false;
- // The new pruned set of defs.
- SmallVector<VarLocInfo> NewDefs;
-
- // Iterate over the existing defs.
- for (const VarLocInfo &Loc : *Locs) {
- NumDefsScanned++;
- DebugAggregate Aggr{FnVarLocs.getVariable(Loc.VariableID).getVariable(),
- Loc.DL.getInlinedAt()};
- DebugVariable Var = FnVarLocs.getVariable(Loc.VariableID);
+ auto HandleLocsForWedge = [&](auto *WedgePosition) {
+ const auto *Locs = FnVarLocs.getWedge(WedgePosition);
+ if (!Locs)
+ return;
+
+ NumWedgesScanned++;
+ bool ChangedThisWedge = false;
+ // The new pruned set of defs.
+ SmallVector<VarLocInfo> NewDefs;
+
+ // Iterate over the existing defs.
+ for (const VarLocInfo &Loc : *Locs) {
+ NumDefsScanned++;
+ DebugAggregate Aggr{FnVarLocs.getVariable(Loc.VariableID).getVariable(),
+ Loc.DL.getInlinedAt()};
+ DebugVariable Var = FnVarLocs.getVariable(Loc.VariableID);
+
+ // Remove undef entries that are encountered before any non-undef
+ // intrinsics from the entry block.
+ if (Loc.Values.isKillLocation(Loc.Expr) && !HasDefinedBits(Aggr, Var)) {
+ // Did not insert this Loc, which is the same as removing it.
+ NumDefsRemoved++;
+ ChangedThisWedge = true;
+ continue;
+ }
- // Remove undef entries that are encountered before any non-undef
- // intrinsics from the entry block.
- if (Loc.Values.isKillLocation(Loc.Expr) && !HasDefinedBits(Aggr, Var)) {
- // Did not insert this Loc, which is the same as removing it.
- NumDefsRemoved++;
- ChangedThisWedge = true;
- continue;
+ DefineBits(Aggr, Var);
+ NewDefs.push_back(Loc);
}
- DefineBits(Aggr, Var);
- NewDefs.push_back(Loc);
- }
-
- // Replace the existing wedge with the pruned version.
- if (ChangedThisWedge) {
- FnVarLocs.setWedge(&I, std::move(NewDefs));
- NumWedgesChanged++;
- Changed = true;
- }
+ // Replace the existing wedge with the pruned version.
+ if (ChangedThisWedge) {
+ FnVarLocs.setWedge(WedgePosition, std::move(NewDefs));
+ NumWedgesChanged++;
+ Changed = true;
+ }
+ };
+ for (DPValue &DPV : I.getDbgValueRange())
+ HandleLocsForWedge(&DPV);
+ HandleLocsForWedge(&I);
}
return Changed;
@@ -2574,6 +2597,9 @@ static DenseSet<DebugAggregate> findVarsWithStackSlot(Function &Fn) {
for (DbgAssignIntrinsic *DAI : at::getAssignmentMarkers(&I)) {
Result.insert({DAI->getVariable(), DAI->getDebugLoc().getInlinedAt()});
}
+ for (DPValue *DPV : at::getDPVAssignmentMarkers(&I)) {
+ Result.insert({DPV->getVariable(), DPV->getDebugLoc().getInlinedAt()});
+ }
}
}
return Result;
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 44c78a006656e0..f4e098d4a87695 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -1241,6 +1241,7 @@ void SelectionDAGBuilder::visitDbgInfo(const Instruction &I) {
It->Expr, Vals.size() > 1, It->DL, SDNodeOrder);
}
}
+ return;
}
// Is there is any debug-info attached to this instruction, in the form of
>From b66e13105ebf670471b93fee4704b848dde2fe77 Mon Sep 17 00:00:00 2001
From: Stephen Tozer <Stephen.Tozer at Sony.com>
Date: Mon, 22 Jan 2024 18:17:55 +0000
Subject: [PATCH 2/3] Add a helpful comment
---
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index f4e098d4a87695..67b55a0b6e0156 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -1241,6 +1241,10 @@ void SelectionDAGBuilder::visitDbgInfo(const Instruction &I) {
It->Expr, Vals.size() > 1, It->DL, SDNodeOrder);
}
}
+ // We must early-exit here to prevent any DPValues from being emitted below,
+ // as we have just emitted the debug values resulting from assignment
+ // tracking analysis, making any existing DPValues redundant (and probably
+ // less correct).
return;
}
>From 0a20ff1758340fcbafc5f17ad1f39328d9ca1d37 Mon Sep 17 00:00:00 2001
From: Stephen Tozer <Stephen.Tozer at Sony.com>
Date: Mon, 22 Jan 2024 17:43:16 +0000
Subject: [PATCH 3/3] Add tests for ATAnalysis
---
.../AArch64/scalable-vectors.ll | 3 +++
.../DebugInfo/assignment-tracking/X86/DSE.ll | 4 ++++
.../X86/assignment-tracking-not-enabled.ll | 4 ++++
.../assignment-tracking/X86/coalesce-cfg.ll | 4 ++++
.../X86/coalesce-options.ll | 18 ++++++++++++++++++
.../assignment-tracking/X86/coalesce-simple.ll | 4 ++++
.../X86/dbg-phi-produces-undef.ll | 4 ++++
.../assignment-tracking/X86/diamond-1.ll | 4 ++++
.../assignment-tracking/X86/diamond-2.ll | 4 ++++
.../assignment-tracking/X86/diamond-3.ll | 4 ++++
.../assignment-tracking/X86/frag-size-zero.ll | 3 +++
.../assignment-tracking/X86/global-storage.ll | 3 +++
.../assignment-tracking/X86/large-type.ll | 4 ++++
.../assignment-tracking/X86/loop-hoist.ll | 4 ++++
.../assignment-tracking/X86/loop-sink.ll | 4 ++++
.../assignment-tracking/X86/loop-unroll.ll | 3 +++
.../X86/lower-offset-expression.ll | 4 ++++
.../assignment-tracking/X86/lower-to-value.ll | 11 +++++++++++
.../X86/mem-loc-frag-fill-cfg.ll | 10 ++++++++++
.../X86/mem-loc-frag-fill.ll | 10 ++++++++++
.../assignment-tracking/X86/negative-offset.ll | 3 +++
.../X86/nested-loop-frags.ll | 4 ++++
.../X86/nested-loop-sroa.ll | 4 ++++
.../assignment-tracking/X86/nested-loop.ll | 4 ++++
.../X86/no-redundant-def-after-alloca.ll | 4 ++++
.../assignment-tracking/X86/order-of-defs.ll | 4 ++++
.../X86/remove-redundant-defs-bwd-scan.ll | 4 ++++
...ove-redundant-defs-to-prevent-reordering.ll | 9 +++++++++
.../X86/remove-undef-fragment.ll | 4 ++++
.../X86/sdag-dangling-dbgassign.ll | 9 +++++++++
.../X86/sdag-ir-salvage-assign.ll | 11 +++++++++++
.../X86/sdag-transfer-dbgassign.ll | 9 +++++++++
.../X86/single-memory-location-2.ll | 4 ++++
.../X86/single-memory-location.ll | 4 ++++
.../assignment-tracking/X86/split-alloca.ll | 4 ++++
.../untagged-store-assignment-extra-checks.ll | 4 ++++
...tagged-store-assignment-outside-variable.ll | 4 ++++
.../X86/untagged-store-frag.ll | 4 ++++
.../X86/use-known-value-at-early-mem-def-2.ll | 4 ++++
.../X86/use-known-value-at-early-mem-def.ll | 4 ++++
40 files changed, 210 insertions(+)
diff --git a/llvm/test/DebugInfo/assignment-tracking/AArch64/scalable-vectors.ll b/llvm/test/DebugInfo/assignment-tracking/AArch64/scalable-vectors.ll
index 4f3db535f6eb87..81a15422216509 100644
--- a/llvm/test/DebugInfo/assignment-tracking/AArch64/scalable-vectors.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/AArch64/scalable-vectors.ll
@@ -1,5 +1,8 @@
; RUN: llc %s -stop-after=finalize-isel -o - | FileCheck %s
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - | FileCheck %s
+
;; Hand written. Check AssignmentTrackingAnalysis doesn't try to get the size
;; of scalable vectors (which causes an assertion failure).
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/DSE.ll b/llvm/test/DebugInfo/assignment-tracking/X86/DSE.ll
index 057c82b0872a6f..57bb53d8269c3f 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/DSE.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/DSE.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-before=finalize-isel -o - \
; RUN: | FileCheck %s
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-before=finalize-isel -o - \
+; RUN: | FileCheck %s
+
; Check basic lowering behaviour of dbg.assign intrinsics. The first
; assignment to `local`, which has been DSE'd, should be represented with a
; constant value DBG_VALUE. The second assignment should have a DBG_VALUE
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/assignment-tracking-not-enabled.ll b/llvm/test/DebugInfo/assignment-tracking/X86/assignment-tracking-not-enabled.ll
index 73b4fd0b75dab5..2f0b4fd284b9a4 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/assignment-tracking-not-enabled.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/assignment-tracking-not-enabled.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
+
;; Check that SelectionDAG downgrades dbg.assigns to dbg.values if assignment
;; tracking isn't enabled (e.g. if the module flag
;; "debug-info-assignment-tracking" is missing / false).
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/coalesce-cfg.ll b/llvm/test/DebugInfo/assignment-tracking/X86/coalesce-cfg.ll
index 49fbcb95818ae7..5c0d24e1155c5a 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/coalesce-cfg.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/coalesce-cfg.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -o - -stop-after=finalize-isel \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -o - -stop-after=finalize-isel \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
+
;; Test coalescing of contiguous fragments in adjacent location definitions.
;; Further details and check directives inline.
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/coalesce-options.ll b/llvm/test/DebugInfo/assignment-tracking/X86/coalesce-options.ll
index 39bfcdaa417166..81ccc7b6258e92 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/coalesce-options.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/coalesce-options.ll
@@ -15,20 +15,38 @@
; RUN: llc %s -o - -stop-after=finalize-isel -experimental-debug-variable-locations=true \
; RUN: | FileCheck %s --check-prefixes=CHECK,ENABLE
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -o - -stop-after=finalize-isel -experimental-debug-variable-locations=true \
+; RUN: | FileCheck %s --check-prefixes=CHECK,ENABLE
+
;; Coalescing default + instructino-referencing disabled = disable.
; RUN: llc %s -o - -stop-after=finalize-isel -experimental-debug-variable-locations=false \
; RUN: | FileCheck %s --check-prefixes=CHECK,DISABLE
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -o - -stop-after=finalize-isel -experimental-debug-variable-locations=false \
+; RUN: | FileCheck %s --check-prefixes=CHECK,DISABLE
+
;; Coalescing enabled + instructino-referencing disabled = enable.
; RUN: llc %s -o - -stop-after=finalize-isel -experimental-debug-variable-locations=false \
; RUN: -debug-ata-coalesce-frags=true \
; RUN: | FileCheck %s --check-prefixes=CHECK,ENABLE
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -o - -stop-after=finalize-isel -experimental-debug-variable-locations=false \
+; RUN: -debug-ata-coalesce-frags=true \
+; RUN: | FileCheck %s --check-prefixes=CHECK,ENABLE
+
;; Coalescing disabled + instructino-referencing enabled = disable.
; RUN: llc %s -o - -stop-after=finalize-isel -experimental-debug-variable-locations=true \
; RUN: -debug-ata-coalesce-frags=false \
; RUN: | FileCheck %s --check-prefixes=CHECK,DISABLE
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -o - -stop-after=finalize-isel -experimental-debug-variable-locations=true \
+; RUN: -debug-ata-coalesce-frags=false \
+; RUN: | FileCheck %s --check-prefixes=CHECK,DISABLE
+
; CHECK: MOV32mi %stack.0.a, 1, $noreg, 0, $noreg, 5
; ENABLE-NEXT: DBG_VALUE %stack.0.a, $noreg, ![[#]], !DIExpression(DW_OP_deref)
; DISABLE-NEXT: DBG_VALUE %stack.0.a, $noreg, ![[#]], !DIExpression(DW_OP_deref, DW_OP_LLVM_fragment, 0, 32)
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/coalesce-simple.ll b/llvm/test/DebugInfo/assignment-tracking/X86/coalesce-simple.ll
index ccbaca0e61dab4..f68301ccc75895 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/coalesce-simple.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/coalesce-simple.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -o - -stop-after=finalize-isel \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -o - -stop-after=finalize-isel \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
+
;; Test coalescing of contiguous fragments in adjacent location definitions.
;; Further details and check directives inline.
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/dbg-phi-produces-undef.ll b/llvm/test/DebugInfo/assignment-tracking/X86/dbg-phi-produces-undef.ll
index 37a2dbd4521613..2ab4e57f470af7 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/dbg-phi-produces-undef.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/dbg-phi-produces-undef.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s
+
;; Hand written test because the scenario is unlikely. Check that the "value"
;; of a debug def PHIs is "undef" (because we don't actually track PHIs).
;;
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/diamond-1.ll b/llvm/test/DebugInfo/assignment-tracking/X86/diamond-1.ll
index b4e84a99783011..07d0540107f47b 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/diamond-1.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/diamond-1.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s
+
;; cat test.cpp
;; void d();
;; void e();
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/diamond-2.ll b/llvm/test/DebugInfo/assignment-tracking/X86/diamond-2.ll
index 1526b3471b2e0a..2dd82ff9e595a1 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/diamond-2.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/diamond-2.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s
+
;; Same as diamond-1.ll except that the DIAssignID attached to the store has
;; been deleted. In this case, we expect the same output as for diamond-1.ll
;; because we choose to interpret stores to stack slots that don't link to
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/diamond-3.ll b/llvm/test/DebugInfo/assignment-tracking/X86/diamond-3.ll
index b20b166cb9cd49..69ae720276a70c 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/diamond-3.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/diamond-3.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
+
;; Hand written to test scenario we can definitely run into in the wild. This
;; file name includes "diamond" because the idea is that we lose (while
;; optimizing) one of the diamond branches which was empty except for a debug
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/frag-size-zero.ll b/llvm/test/DebugInfo/assignment-tracking/X86/frag-size-zero.ll
index 3a3865d0511b94..c6124df1b26e95 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/frag-size-zero.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/frag-size-zero.ll
@@ -1,5 +1,8 @@
; RUN: llc %s -stop-after=finalize-isel -o - | FileCheck %s
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - | FileCheck %s
+
;; Check that a zero-sized fragment (the final dbg.assign) is ignored by
;; AssignmentTrackingAnalysis.
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/global-storage.ll b/llvm/test/DebugInfo/assignment-tracking/X86/global-storage.ll
index 7d265acdb5bb40..d7b8d76fdecaa8 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/global-storage.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/global-storage.ll
@@ -1,5 +1,8 @@
; RUN: llc %s -stop-after=finalize-isel -o - | FileCheck %s
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - | FileCheck %s
+
;; Local variable has global storage. Check AssignmentTrackingAnalysis doesn't
;; crash/assert.
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/large-type.ll b/llvm/test/DebugInfo/assignment-tracking/X86/large-type.ll
index cebbc162fcb3a8..9ab0f365978875 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/large-type.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/large-type.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
+
;; Based on optimized IR from C source:
;; int main () {
;; char a1[__INT_MAX__];
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/loop-hoist.ll b/llvm/test/DebugInfo/assignment-tracking/X86/loop-hoist.ll
index 559cdc59dffd9b..c83d530c285269 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/loop-hoist.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/loop-hoist.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
+
;; $ cat test.cpp
;; int d();
;; void e();
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/loop-sink.ll b/llvm/test/DebugInfo/assignment-tracking/X86/loop-sink.ll
index fcd51960b67cc6..77d730ff1d3599 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/loop-sink.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/loop-sink.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s --implicit-check-not=DBG
+
;; Tiny loop with a store sunk out of it:
;; void e();
;; void es(int*);
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/loop-unroll.ll b/llvm/test/DebugInfo/assignment-tracking/X86/loop-unroll.ll
index 5ef5cb4dde9e1a..51661d4b030c8e 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/loop-unroll.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/loop-unroll.ll
@@ -1,5 +1,8 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s
;;
;; Backend counterpart to ../Generic/dbg-assign-loop-unroll. This IR was
;; generated by running `opt -loop-unroll -S` on the IR in that test.
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/lower-offset-expression.ll b/llvm/test/DebugInfo/assignment-tracking/X86/lower-offset-expression.ll
index b4d85959af15bf..2d0bf287079f05 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/lower-offset-expression.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/lower-offset-expression.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s
+
;; Handwritten test.
;; Here we have dbg.assign intrinsics with fragments (in the value-expression)
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/lower-to-value.ll b/llvm/test/DebugInfo/assignment-tracking/X86/lower-to-value.ll
index 859056aff6337a..28195bc22a62dd 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/lower-to-value.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/lower-to-value.ll
@@ -2,11 +2,22 @@
; RUN: -experimental-debug-variable-locations=false \
; RUN: -debug-ata-coalesce-frags=true \
; RUN: | FileCheck %s --check-prefixes=CHECK,DBGVALUE --implicit-check-not=DBG_VALUE
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-before finalize-isel -o - \
+; RUN: -experimental-debug-variable-locations=false \
+; RUN: -debug-ata-coalesce-frags=true \
+; RUN: | FileCheck %s --check-prefixes=CHECK,DBGVALUE --implicit-check-not=DBG_VALUE
; RUN: llc %s -stop-before finalize-isel -o - \
; RUN: -experimental-debug-variable-locations=true \
; RUN: | FileCheck %s --check-prefixes=CHECK,INSTRREF --implicit-check-not=DBG_VALUE \
; RUN: --implicit-check-not=DBG_INSTR_REF
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-before finalize-isel -o - \
+; RUN: -experimental-debug-variable-locations=true \
+; RUN: | FileCheck %s --check-prefixes=CHECK,INSTRREF --implicit-check-not=DBG_VALUE \
+; RUN: --implicit-check-not=DBG_INSTR_REF
+
;; Check that dbg.assigns for an aggregate variable which lives on the stack
;; for some of its lifetime are lowered into an appropriate set of DBG_VALUEs.
;;
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/mem-loc-frag-fill-cfg.ll b/llvm/test/DebugInfo/assignment-tracking/X86/mem-loc-frag-fill-cfg.ll
index 0ea8373cef5128..0211fb7e74bd0f 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/mem-loc-frag-fill-cfg.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/mem-loc-frag-fill-cfg.ll
@@ -2,10 +2,20 @@
; RUN: -experimental-debug-variable-locations=false \
; RUN: -debug-ata-coalesce-frags=true \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-before finalize-isel -o - \
+; RUN: -experimental-debug-variable-locations=false \
+; RUN: -debug-ata-coalesce-frags=true \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
; RUN: llc %s -stop-before finalize-isel -o - \
; RUN: -experimental-debug-variable-locations=true \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-before finalize-isel -o - \
+; RUN: -experimental-debug-variable-locations=true \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
+
;; Check that the mem-loc-frag-fill pseudo-pass works on a simple CFG. When
;; LLVM sees a dbg.value with an overlapping fragment it essentially considers
;; the previous location as valid for all bits in that fragment. The pass
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/mem-loc-frag-fill.ll b/llvm/test/DebugInfo/assignment-tracking/X86/mem-loc-frag-fill.ll
index 630678153de005..597531aaf1d3f5 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/mem-loc-frag-fill.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/mem-loc-frag-fill.ll
@@ -2,10 +2,20 @@
; RUN: -experimental-debug-variable-locations=false \
; RUN: -debug-ata-coalesce-frags=true \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-before finalize-isel -o - \
+; RUN: -experimental-debug-variable-locations=false \
+; RUN: -debug-ata-coalesce-frags=true \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
; RUN: llc %s -stop-before finalize-isel -o - \
; RUN: -experimental-debug-variable-locations=true \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-before finalize-isel -o - \
+; RUN: -experimental-debug-variable-locations=true \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
+
;; Check that the mem-loc-frag-fill analysis works on a simple case; ensure
;; that location definitions are added to preserve memory locations of
;; fragments of variables at subsequent location definitions for other
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/negative-offset.ll b/llvm/test/DebugInfo/assignment-tracking/X86/negative-offset.ll
index 74486c4822397a..20ea85bd273751 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/negative-offset.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/negative-offset.ll
@@ -1,5 +1,8 @@
; RUN: llc %s -stop-after=finalize-isel -o - | FileCheck %s --implicit-check-not=DBG_VALUE
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - | FileCheck %s --implicit-check-not=DBG_VALUE
+
;; Check stores to an address computed as a negative offset from an alloca are
;; ignored by the assignment tracking analysis. For this example that should
;; result in no DBG_VALUEs in the while.body.lr.ph branch.
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/nested-loop-frags.ll b/llvm/test/DebugInfo/assignment-tracking/X86/nested-loop-frags.ll
index 6e066fa90f4cb5..39132dd5471b10 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/nested-loop-frags.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/nested-loop-frags.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s --implicit-check-not=DBG
+
;; Test a variety of block inputs and lattice configurations for the assignment
;; tracking analysis (debug-ata). This is similar to nested-loop.ll and
;; nested-loop-sroa.ll except that the allocas are 64 bits and the stores are a
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/nested-loop-sroa.ll b/llvm/test/DebugInfo/assignment-tracking/X86/nested-loop-sroa.ll
index 1f4351e6d3516a..39c91724946f42 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/nested-loop-sroa.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/nested-loop-sroa.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s --implicit-check-not=DBG
+
;; Test a variety of block inputs and lattice configurations for the assignment
;; tracking analysis (debug-ata). This is the same as nested-loop.ll except each
;; alloca holds a fragment of a variable instead of a whole variable.
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/nested-loop.ll b/llvm/test/DebugInfo/assignment-tracking/X86/nested-loop.ll
index 3f4350fd15af75..b88a58566e4f6f 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/nested-loop.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/nested-loop.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s --implicit-check-not=DBG
+
;; Test a variety of block inputs and lattice configurations for the assignment
;; tracking analysis (debug-ata).
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/no-redundant-def-after-alloca.ll b/llvm/test/DebugInfo/assignment-tracking/X86/no-redundant-def-after-alloca.ll
index 626757e964dcd4..9ef3ea59247e7d 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/no-redundant-def-after-alloca.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/no-redundant-def-after-alloca.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -o - -stop-after=finalize-isel \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -o - -stop-after=finalize-isel \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
+
;; Hand written. Check that no unnecessary undef is inserted after an alloca
;; that has a linked dbg.assign that doesn't immediately follow it.
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/order-of-defs.ll b/llvm/test/DebugInfo/assignment-tracking/X86/order-of-defs.ll
index 191d61360feb4e..9b8f3b9b67a3f9 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/order-of-defs.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/order-of-defs.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
+
;; Ensure that the order of several debug intrinsics between non-debug
;; instructions is maintained.
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/remove-redundant-defs-bwd-scan.ll b/llvm/test/DebugInfo/assignment-tracking/X86/remove-redundant-defs-bwd-scan.ll
index dc2638c69969d5..211098b4a8d555 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/remove-redundant-defs-bwd-scan.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/remove-redundant-defs-bwd-scan.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
+
;; Hand-written to test assignment tracking analysis' removal of redundant
;; debug loc definitions. Checks written inline.
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/remove-redundant-defs-to-prevent-reordering.ll b/llvm/test/DebugInfo/assignment-tracking/X86/remove-redundant-defs-to-prevent-reordering.ll
index b0628aecdc8497..5d52cc342cf289 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/remove-redundant-defs-to-prevent-reordering.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/remove-redundant-defs-to-prevent-reordering.ll
@@ -1,10 +1,19 @@
; RUN: llc %s -stop-before finalize-isel -o - \
; RUN: -experimental-debug-variable-locations=false \
; RUN: | FileCheck %s --check-prefixes=CHECK,DBGVALUE --implicit-check-not="DBG_VALUE \$noreg"
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-before finalize-isel -o - \
+; RUN: -experimental-debug-variable-locations=false \
+; RUN: | FileCheck %s --check-prefixes=CHECK,DBGVALUE --implicit-check-not="DBG_VALUE \$noreg"
; RUN: llc %s -stop-before finalize-isel -o - \
; RUN: -experimental-debug-variable-locations=true \
; RUN: | FileCheck %s --check-prefixes=CHECK,INSTRREF --implicit-check-not="DBG_VALUE \$noreg"
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-before finalize-isel -o - \
+; RUN: -experimental-debug-variable-locations=true \
+; RUN: | FileCheck %s --check-prefixes=CHECK,INSTRREF --implicit-check-not="DBG_VALUE \$noreg"
+
;; Found in the wild, but this test involves modifications from:
;; int b;
;; void ext();
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/remove-undef-fragment.ll b/llvm/test/DebugInfo/assignment-tracking/X86/remove-undef-fragment.ll
index b006fb05146260..980b6ffa09ef5e 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/remove-undef-fragment.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/remove-undef-fragment.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -o - -stop-after=finalize-isel \
; RUN: | FileCheck %s --implicit-check-not=DBG
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -o - -stop-after=finalize-isel \
+; RUN: | FileCheck %s --implicit-check-not=DBG
+
;; In the IR below, for variable n, we get dbg intrinsics that describe this:
;;
;; entry-block:
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/sdag-dangling-dbgassign.ll b/llvm/test/DebugInfo/assignment-tracking/X86/sdag-dangling-dbgassign.ll
index fc05d398e6fdb7..ba7d3f6a67e272 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/sdag-dangling-dbgassign.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/sdag-dangling-dbgassign.ll
@@ -1,10 +1,19 @@
; RUN: llc %s -stop-before finalize-isel -o - \
; RUN: -experimental-debug-variable-locations=false \
; RUN: | FileCheck %s --check-prefixes=CHECK,DBGVALUE
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-before finalize-isel -o - \
+; RUN: -experimental-debug-variable-locations=false \
+; RUN: | FileCheck %s --check-prefixes=CHECK,DBGVALUE
; RUN: llc %s -stop-before finalize-isel -o - \
; RUN: -experimental-debug-variable-locations=true \
; RUN: | FileCheck %s --check-prefixes=CHECK,INSTRREF
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-before finalize-isel -o - \
+; RUN: -experimental-debug-variable-locations=true \
+; RUN: | FileCheck %s --check-prefixes=CHECK,INSTRREF
+
;--------------------------------------------------------------------
; Adapted from sdag-dangling-dbgvalue.ll to test dbg.assign intrinsics. This
; ensures that dbg.assigns with no linked store are treated as dbg.values. For
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/sdag-ir-salvage-assign.ll b/llvm/test/DebugInfo/assignment-tracking/X86/sdag-ir-salvage-assign.ll
index 57a88bcdd3bcbe..38a0a8675bef24 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/sdag-ir-salvage-assign.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/sdag-ir-salvage-assign.ll
@@ -2,11 +2,22 @@
; RUN: -stop-before finalize-isel %s -o - \
; RUN: -experimental-debug-variable-locations=false \
; RUN: | FileCheck %s --check-prefixes=CHECK,DBGVALUE
+
+; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-unknown-unknown -start-after=codegenprepare \
+; RUN: -stop-before finalize-isel %s -o - \
+; RUN: -experimental-debug-variable-locations=false \
+; RUN: | FileCheck %s --check-prefixes=CHECK,DBGVALUE
; RUN: llc -mtriple=x86_64-unknown-unknown -start-after=codegenprepare \
; RUN: -stop-before finalize-isel %s -o - \
; RUN: -experimental-debug-variable-locations=true \
; RUN: | FileCheck %s --check-prefixes=CHECK,INSTRREF
+
+; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-unknown-unknown -start-after=codegenprepare \
+; RUN: -stop-before finalize-isel %s -o - \
+; RUN: -experimental-debug-variable-locations=true \
+; RUN: | FileCheck %s --check-prefixes=CHECK,INSTRREF
+
; Adapted from sdag-ir-salvage.ll to test dbg.assign intrinsics. This ensures
; that dbg.assigns with no linked store are treated as dbg.values.
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/sdag-transfer-dbgassign.ll b/llvm/test/DebugInfo/assignment-tracking/X86/sdag-transfer-dbgassign.ll
index 1aea122f3cc2c9..fba127b5f5266e 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/sdag-transfer-dbgassign.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/sdag-transfer-dbgassign.ll
@@ -1,10 +1,19 @@
; RUN: llc %s -start-after=codegenprepare -stop-before finalize-isel -o - \
; RUN: -experimental-debug-variable-locations=false \
; RUN: | FileCheck %s --check-prefixes=CHECK,DBGVALUE
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -start-after=codegenprepare -stop-before finalize-isel -o - \
+; RUN: -experimental-debug-variable-locations=false \
+; RUN: | FileCheck %s --check-prefixes=CHECK,DBGVALUE
; RUN: llc %s -start-after=codegenprepare -stop-before finalize-isel -o - \
; RUN: -experimental-debug-variable-locations=true \
; RUN: | FileCheck %s --check-prefixes=CHECK,INSTRREF
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -start-after=codegenprepare -stop-before finalize-isel -o - \
+; RUN: -experimental-debug-variable-locations=true \
+; RUN: | FileCheck %s --check-prefixes=CHECK,INSTRREF
+
; Adapted from sdag-transfer-dbgvalue.ll to test dbg.assign intrinsics. This
; ensures that dbg.assigns with no linked store are treated as dbg.values.
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/single-memory-location-2.ll b/llvm/test/DebugInfo/assignment-tracking/X86/single-memory-location-2.ll
index 485ee833ae2db2..1b2d047815755a 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/single-memory-location-2.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/single-memory-location-2.ll
@@ -1,6 +1,10 @@
; RUN: llc -stop-after=finalize-isel %s -o - \
; RUN: | FileCheck %s
+
+; RUN: llc --try-experimental-debuginfo-iterators -stop-after=finalize-isel %s -o - \
+; RUN: | FileCheck %s
+
;; Check that a dbg.assign for a fully stack-homed variable causes the variable
;; location to appear in the Machine Function side table. Similar to
;; single-memory-location.ll except this has slightly more complicated input
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/single-memory-location.ll b/llvm/test/DebugInfo/assignment-tracking/X86/single-memory-location.ll
index 1f806e5255fc51..a9cc55dbe84747 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/single-memory-location.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/single-memory-location.ll
@@ -1,6 +1,10 @@
; RUN: llc -stop-after=finalize-isel %s -o - \
; RUN: | FileCheck %s
+
+; RUN: llc --try-experimental-debuginfo-iterators -stop-after=finalize-isel %s -o - \
+; RUN: | FileCheck %s
+
;; Check that a dbg.assign for a fully stack-homed variable causes the variable
;; location to appear in the Machine Function side table (variable 'local').
;;
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/split-alloca.ll b/llvm/test/DebugInfo/assignment-tracking/X86/split-alloca.ll
index 15f5374568bc36..045c9fd31af4c1 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/split-alloca.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/split-alloca.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -o - -stop-after=finalize-isel \
; RUN: | FileCheck %s --implicit-check-not=DBG
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -o - -stop-after=finalize-isel \
+; RUN: | FileCheck %s --implicit-check-not=DBG
+
;; Hand written. Check that we fall back to emitting a list of defs for
;; variables with split allocas (i.e. we want to see DBG_VALUEs and no
;; debug-info-variable entry in the stack slot table).
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/untagged-store-assignment-extra-checks.ll b/llvm/test/DebugInfo/assignment-tracking/X86/untagged-store-assignment-extra-checks.ll
index c407a7da7fa2c2..3dd9098df83821 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/untagged-store-assignment-extra-checks.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/untagged-store-assignment-extra-checks.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
+
;; Similarly to untagged-store-assignment-outside-variable.ll this test checks
;; that out of bounds stores that have no DIAssignID are interpreted correctly
;; (see inline comments and checks). Hand-written IR.
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/untagged-store-assignment-outside-variable.ll b/llvm/test/DebugInfo/assignment-tracking/X86/untagged-store-assignment-outside-variable.ll
index 3a7c528d320a73..fe1af199d5e7ea 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/untagged-store-assignment-outside-variable.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/untagged-store-assignment-outside-variable.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
+
;; Generated from following C source that contains UB (read and write to
;; out of bounds static array element.
;; int a;
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/untagged-store-frag.ll b/llvm/test/DebugInfo/assignment-tracking/X86/untagged-store-frag.ll
index b7e713c7224f4b..ccafaf03ed2d93 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/untagged-store-frag.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/untagged-store-frag.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG_
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s --implicit-check-not=DBG_
+
;; Hand-written to test untagged store handling on a simple case. Here's what
;; we're looking at in the IR:
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/use-known-value-at-early-mem-def-2.ll b/llvm/test/DebugInfo/assignment-tracking/X86/use-known-value-at-early-mem-def-2.ll
index ebab33f73c86bb..cbe9af2f7d8182 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/use-known-value-at-early-mem-def-2.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/use-known-value-at-early-mem-def-2.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG_VALUE
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s --implicit-check-not=DBG_VALUE
+
;; Check that sandwiching instructions between a linked store and dbg.assign
;; results in a dbg.value(prev_value) being inserted at the store, and a
;; dbg.value(deref) at the dbg.assign.
diff --git a/llvm/test/DebugInfo/assignment-tracking/X86/use-known-value-at-early-mem-def.ll b/llvm/test/DebugInfo/assignment-tracking/X86/use-known-value-at-early-mem-def.ll
index d85784f1b56c95..135123ef860664 100644
--- a/llvm/test/DebugInfo/assignment-tracking/X86/use-known-value-at-early-mem-def.ll
+++ b/llvm/test/DebugInfo/assignment-tracking/X86/use-known-value-at-early-mem-def.ll
@@ -1,6 +1,10 @@
; RUN: llc %s -stop-after=finalize-isel -o - \
; RUN: | FileCheck %s --implicit-check-not=DBG_VALUE
+
+; RUN: llc --try-experimental-debuginfo-iterators %s -stop-after=finalize-isel -o - \
+; RUN: | FileCheck %s --implicit-check-not=DBG_VALUE
+
;; Check that sandwiching instructions between a linked store and dbg.assign
;; results in a dbg.value(prev_value) being inserted at the store, and a
;; dbg.value(deref) at the dbg.assign.
More information about the llvm-commits
mailing list