Home | History | Annotate | Download | only in Utils

Lines Matching refs:DestBB

548 /// MergeBasicBlockIntoOnlyPred - DestBB is a block with one predecessor and its
549 /// predecessor is known to have one successor (DestBB!). Eliminate the edge
550 /// between them, moving the instructions in the predecessor into DestBB and
553 void llvm::MergeBasicBlockIntoOnlyPred(BasicBlock *DestBB, DominatorTree *DT) {
555 while (PHINode *PN = dyn_cast<PHINode>(DestBB->begin())) {
563 BasicBlock *PredBB = DestBB->getSinglePredecessor();
566 // Zap anything that took the address of DestBB. Not doing this will give the
568 if (DestBB->hasAddressTaken()) {
569 BlockAddress *BA = BlockAddress::get(DestBB);
577 // Anything that branched to PredBB now branches to DestBB.
578 PredBB->replaceAllUsesWith(DestBB);
580 // Splice all the instructions from PredBB to DestBB.
582 DestBB->getInstList().splice(DestBB->begin(), PredBB->getInstList());
584 // If the PredBB is the entry block of the function, move DestBB up to
586 if (PredBB == &DestBB->getParent()->getEntryBlock())
587 DestBB->moveAfter(PredBB);
591 DT->changeImmediateDominator(DestBB, PredBBIDom);