diff options
author | Jay Foad <jay.foad@amd.com> | 2020-06-11 14:22:16 +0100 |
---|---|---|
committer | Jay Foad <jay.foad@amd.com> | 2020-06-11 14:22:16 +0100 |
commit | f45c65aa415a1b55f9397a8c3e139675843c3002 (patch) | |
tree | f5a503fcf5ccb3f7ccc88b4ac8bb994cec1cead8 /llvm/lib/IR/BasicBlock.cpp | |
parent | bb8c7e756c51bb3dc05b30671fa4c64f48e41c39 (diff) | |
download | llvm-f45c65aa415a1b55f9397a8c3e139675843c3002.zip llvm-f45c65aa415a1b55f9397a8c3e139675843c3002.tar.gz llvm-f45c65aa415a1b55f9397a8c3e139675843c3002.tar.bz2 |
Revert "[IR] Clean up dead instructions after simplifying a conditional branch"
This reverts commit 4494e45316a0bfaabb6bb1450fb0f49a0e6832af.
It caused problems for sanitizer buildbots.
Diffstat (limited to 'llvm/lib/IR/BasicBlock.cpp')
-rw-r--r-- | llvm/lib/IR/BasicBlock.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp index c71a79f..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); - 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. |