aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorVlad Tsyrklevich <vtsyrklevich@google.com>2019-12-10 15:50:10 -0800
committerVlad Tsyrklevich <vtsyrklevich@google.com>2019-12-10 16:03:17 -0800
commit636c93ed11a5f98b5c3ff88241460d61cb7785bb (patch)
treea7fa6839acedc18c2dfb19212ea63c59610ff47e /llvm/lib/Transforms/Utils/Local.cpp
parent70e3d0ea55e8b9385168d389fcba16a283f20214 (diff)
downloadllvm-636c93ed11a5f98b5c3ff88241460d61cb7785bb.zip
llvm-636c93ed11a5f98b5c3ff88241460d61cb7785bb.tar.gz
llvm-636c93ed11a5f98b5c3ff88241460d61cb7785bb.tar.bz2
Revert "Reapply: [DebugInfo] Recover debug intrinsics when killing duplicated/empty..."
This reverts commit f2ba93971ccc236c0eef5323704d31f48107e04f, it was causing build timeouts on sanitizer-x86_64-linux-autoconf such as http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/44917
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp27
1 files changed, 5 insertions, 22 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index c9d60ad..41f1dd9 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -485,19 +485,15 @@ void llvm::RecursivelyDeleteTriviallyDeadInstructions(
I.eraseFromParent();
}
}
-void llvm::setDbgVariableUndef(DbgVariableIntrinsic *DVI) {
- Value *DbgValue = DVI->getVariableLocation(false);
- Value *Undef = UndefValue::get(DbgValue ? DbgValue->getType()
- : Type::getInt1Ty(DVI->getContext()));
- DVI->setOperand(
- 0, MetadataAsValue::get(DVI->getContext(), ValueAsMetadata::get(Undef)));
-}
bool llvm::replaceDbgUsesWithUndef(Instruction *I) {
SmallVector<DbgVariableIntrinsic *, 1> DbgUsers;
findDbgUsers(DbgUsers, I);
- for (auto *DII : DbgUsers)
- setDbgVariableUndef(DII);
+ for (auto *DII : DbgUsers) {
+ Value *Undef = UndefValue::get(I->getType());
+ DII->setOperand(0, MetadataAsValue::get(DII->getContext(),
+ ValueAsMetadata::get(Undef)));
+ }
return !DbgUsers.empty();
}
@@ -1044,19 +1040,6 @@ bool llvm::TryToSimplifyUncondBranchFromEmptyBlock(BasicBlock *BB,
assert(PN->use_empty() && "There shouldn't be any uses here!");
PN->eraseFromParent();
}
- // If Succ has multiple predecessors, each debug intrinsic in BB may or may
- // not be valid when we reach Succ, so the debug variable should be set
- // undef since its value is unknown.
- Instruction *DbgInsertPoint = Succ->getFirstNonPHI();
- while (DbgInfoIntrinsic *DI = dyn_cast<DbgInfoIntrinsic>(&BB->front())) {
- if (auto DVI = dyn_cast<DbgVariableIntrinsic>(DI)) {
- if (!isa<DbgDeclareInst>(DVI))
- setDbgVariableUndef(DVI);
- DVI->moveBefore(DbgInsertPoint);
- } else {
- break;
- }
- }
}
// If the unconditional branch we replaced contains llvm.loop metadata, we