diff options
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r-- | lib/Transforms/Utils/Local.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index 78217c8efa..82b8da3a10 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -503,19 +503,7 @@ void llvm::MergeBasicBlockIntoOnlyPred(BasicBlock *DestBB, Pass *P) { // Splice all the instructions from PredBB to DestBB. PredBB->getTerminator()->eraseFromParent(); - - // First splice over the PHI nodes. - BasicBlock::iterator PI = PredBB->begin(); - while (isa<PHINode>(PI)) - ++PI; - - if (PI != PredBB->begin()) - DestBB->getInstList().splice(DestBB->begin(), PredBB->getInstList(), - PredBB->begin(), PI); - - // Now splice over the rest of the instructions. - DestBB->getInstList().splice(DestBB->getFirstInsertionPt(), - PredBB->getInstList(), PI, PredBB->end()); + DestBB->getInstList().splice(DestBB->begin(), PredBB->getInstList()); if (P) { DominatorTree *DT = P->getAnalysisIfAvailable<DominatorTree>(); @@ -525,7 +513,6 @@ void llvm::MergeBasicBlockIntoOnlyPred(BasicBlock *DestBB, Pass *P) { DT->eraseNode(PredBB); } } - // Nuke BB. PredBB->eraseFromParent(); } |