aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/BasicBlock.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2020-06-16 10:17:21 +0100
committerJay Foad <jay.foad@amd.com>2020-06-16 10:32:15 +0100
commit6fdd5a28b7840185d1f75d5702e7e2f3c4723b1c (patch)
tree2b01d6aed4e92977f575283ce93f11b3987782cc /llvm/lib/IR/BasicBlock.cpp
parent73bfb4fd52dc748022172021129956ce0071e679 (diff)
downloadllvm-6fdd5a28b7840185d1f75d5702e7e2f3c4723b1c.zip
llvm-6fdd5a28b7840185d1f75d5702e7e2f3c4723b1c.tar.gz
llvm-6fdd5a28b7840185d1f75d5702e7e2f3c4723b1c.tar.bz2
Revert "[IR] Clean up dead instructions after simplifying a conditional branch"
This reverts commit 69bdfb075b293c4b3363f2dc0ac732ca03c3c9ca. Reverting to investigate https://bugs.llvm.org/show_bug.cgi?id=46343
Diffstat (limited to 'llvm/lib/IR/BasicBlock.cpp')
-rw-r--r--llvm/lib/IR/BasicBlock.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp
index 1fb1042..64f1d3f 100644
--- a/llvm/lib/IR/BasicBlock.cpp
+++ b/llvm/lib/IR/BasicBlock.cpp
@@ -323,13 +323,8 @@ iterator_range<BasicBlock::phi_iterator> BasicBlock::phis() {
/// If \p KeepOneInputPHIs is true then don't remove PHIs that are left with
/// zero or one incoming values, and don't simplify PHIs with all incoming
/// values the same.
-///
-/// If \p MaybeDeadInstrs is not nullptr then whenever we drop a reference to
-/// an instruction, append it to the vector. The caller should check whether
-/// these instructions are now trivially dead, and if so delete them.
-void BasicBlock::removePredecessor(
- BasicBlock *Pred, bool KeepOneInputPHIs,
- SmallVectorImpl<WeakTrackingVH> *MaybeDeadInstrs) {
+void BasicBlock::removePredecessor(BasicBlock *Pred,
+ bool KeepOneInputPHIs) {
// Use hasNUsesOrMore to bound the cost of this assertion for complex CFGs.
assert((hasNUsesOrMore(16) ||
find(pred_begin(this), pred_end(this), Pred) != pred_end(this)) &&
@@ -343,11 +338,7 @@ void BasicBlock::removePredecessor(
// Update all PHI nodes.
for (iterator II = begin(); isa<PHINode>(II);) {
PHINode *PN = cast<PHINode>(II++);
- Value *V = PN->removeIncomingValue(Pred, !KeepOneInputPHIs);
- if (MaybeDeadInstrs) {
- if (auto *I = dyn_cast<Instruction>(V))
- MaybeDeadInstrs->push_back(I);
- }
+ PN->removeIncomingValue(Pred, !KeepOneInputPHIs);
if (!KeepOneInputPHIs) {
// If we have a single predecessor, removeIncomingValue erased the PHI
// node itself.