Home | History | Annotate | Download | only in Utils

Lines Matching full:succ

153         BasicBlock *Succ = SI->getSuccessor(i);
154 if (Succ == TheOnlyDest)
157 Succ->removePredecessor(BB);
475 /// almost-empty BB ending in an unconditional branch to Succ, into succ.
477 /// Assumption: Succ is the single successor for BB.
479 static bool CanPropagatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) {
480 assert(*succ_begin(BB) == Succ && "Succ is not successor of BB!");
483 << Succ->getName() << "\n");
486 if (Succ->getSinglePredecessor()) return true;
492 // Use that list to make another list of common predecessors of BB and Succ
494 for (pred_iterator PI = pred_begin(Succ), PE = pred_end(Succ);
505 // Look at all the phi nodes in Succ, to see if they present a conflict when
507 for (BasicBlock::iterator I = Succ->begin(); isa<PHINode>(I); ++I) {
520 << Succ->getName() << " is conflicting with "
535 << Succ->getName() << " is conflicting with regard to common "
556 BasicBlock *Succ = cast<BranchInst>(BB->getTerminator())->getSuccessor(0);
557 if (BB == Succ) return false;
560 // phi nodes in BB or Succ. If not, we can safely merge.
561 if (!CanPropagatePredecessorsForPHIs(BB, Succ)) return false;
563 // Check for cases where Succ has multiple predecessors and a PHI node in BB
566 // BB dominates Succ, which is non-trivial to calculate in the case where
567 // Succ has multiple predecessors. Also, it requires checking whether
572 // Note that if this check finds a live use, BB dominates Succ, so BB is
575 if (!Succ->getSinglePredecessor()) {
593 if (isa<PHINode>(Succ->begin())) {
594 // If there is more than one pred of succ, and there are PHI nodes in
600 for (BasicBlock::iterator I = Succ->begin(); isa<PHINode>(I); ++I) {
610 // Note that, since we are merging phi nodes and BB and Succ might
625 if (Succ->getSinglePredecessor()) {
626 // BB is the only predecessor of Succ, so Succ will end up with exactly
631 Succ->getInstList().splice(Succ->getFirstNonPHI(), BB->getInstList());
640 // Everything that jumped to BB now goes to Succ.
641 BB->replaceAllUsesWith(Succ);
642 if (!Succ->hasName()) Succ->takeName(BB);