diff options
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. |