diff options
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBlockPlacement.cpp | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp index a469f893ce1..639b588766a 100644 --- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp +++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp @@ -2730,31 +2730,6 @@ void MachineBlockPlacement::optimizeBranches() { TII->removeBranch(*ChainBB); TII->insertBranch(*ChainBB, FBB, TBB, Cond, dl); ChainBB->updateTerminator(); - } else if (Cond.empty() && TBB && ChainBB != TBB && - !TBB->canFallThrough()) { - // When ChainBB is unconditional branch to the TBB, and TBB has no - // fallthrough predecessor and fallthrough successor, try to merge - // ChainBB and TBB. This is legal under the one of following conditions: - // 1. ChainBB is empty except for an unconditional branch. - // 2. TBB has only one predecessor. - MachineFunction::iterator I(TBB); - if (((TBB == &*F->begin()) || !std::prev(I)->canFallThrough()) && - (TailDup.isSimpleBB(ChainBB) || (TBB->pred_size() == 1))) { - TII->removeBranch(*ChainBB); - ChainBB->removeSuccessor(TBB); - - // Update the CFG. - for (MachineBasicBlock::pred_iterator PI = TBB->pred_begin(), - PE = TBB->pred_end(); PI != PE; PI++) - (*PI)->ReplaceUsesOfBlockWith(TBB, ChainBB); - - for (MachineBasicBlock *Succ : TBB->successors()) - ChainBB->addSuccessor(Succ, MBPI->getEdgeProbability(TBB, Succ)); - - // Move all the instructions of TBB to ChainBB. - ChainBB->splice(ChainBB->end(), TBB, TBB->begin(), TBB->end()); - F->remove(TBB); - } } } } |