aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUtils.cpp36
1 files changed, 11 insertions, 25 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index 0681ebc..ff69fa9 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -606,7 +606,6 @@ void llvm::deleteDeadLoop(Loop *L, DominatorTree *DT, ScalarEvolution *SE,
// Use a map to unique and a vector to guarantee deterministic ordering.
llvm::SmallDenseSet<DebugVariable, 4> DeadDebugSet;
- llvm::SmallVector<DbgVariableIntrinsic *, 4> DeadDebugInst;
llvm::SmallVector<DbgVariableRecord *, 4> DeadDbgVariableRecords;
if (ExitBlock) {
@@ -633,29 +632,19 @@ void llvm::deleteDeadLoop(Loop *L, DominatorTree *DT, ScalarEvolution *SE,
U.set(Poison);
}
- // RemoveDIs: do the same as below for DbgVariableRecords.
- if (Block->IsNewDbgInfoFormat) {
- for (DbgVariableRecord &DVR : llvm::make_early_inc_range(
- filterDbgVars(I.getDbgRecordRange()))) {
- DebugVariable Key(DVR.getVariable(), DVR.getExpression(),
- DVR.getDebugLoc().get());
- if (!DeadDebugSet.insert(Key).second)
- continue;
- // Unlinks the DVR from it's container, for later insertion.
- DVR.removeFromParent();
- DeadDbgVariableRecords.push_back(&DVR);
- }
- }
-
- // For one of each variable encountered, preserve a debug intrinsic (set
+ // For one of each variable encountered, preserve a debug record (set
// to Poison) and transfer it to the loop exit. This terminates any
// variable locations that were set during the loop.
- auto *DVI = dyn_cast<DbgVariableIntrinsic>(&I);
- if (!DVI)
- continue;
- if (!DeadDebugSet.insert(DebugVariable(DVI)).second)
- continue;
- DeadDebugInst.push_back(DVI);
+ for (DbgVariableRecord &DVR :
+ llvm::make_early_inc_range(filterDbgVars(I.getDbgRecordRange()))) {
+ DebugVariable Key(DVR.getVariable(), DVR.getExpression(),
+ DVR.getDebugLoc().get());
+ if (!DeadDebugSet.insert(Key).second)
+ continue;
+ // Unlinks the DVR from it's container, for later insertion.
+ DVR.removeFromParent();
+ DeadDbgVariableRecords.push_back(&DVR);
+ }
}
// After the loop has been deleted all the values defined and modified
@@ -671,9 +660,6 @@ void llvm::deleteDeadLoop(Loop *L, DominatorTree *DT, ScalarEvolution *SE,
"There should be a non-PHI instruction in exit block, else these "
"instructions will have no parent.");
- for (auto *DVI : DeadDebugInst)
- DVI->moveBefore(*ExitBlock, InsertDbgValueBefore);
-
// Due to the "head" bit in BasicBlock::iterator, we're going to insert
// each DbgVariableRecord right at the start of the block, wheras dbg.values
// would be repeatedly inserted before the first instruction. To replicate