Lines Matching full:succ
193 for (BasicBlock *Succ : SI->successors()) {
195 if (Succ == TheOnlyDest)
198 Succ->removePredecessor(BB);
621 /// almost-empty BB ending in an unconditional branch to Succ, into Succ.
623 /// Assumption: Succ is the single successor for BB.
625 static bool CanPropagatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) {
626 assert(*succ_begin(BB) == Succ && "Succ is not successor of BB!");
629 << Succ->getName() << "\n");
632 if (Succ->getSinglePredecessor()) return true;
637 // Look at all the phi nodes in Succ, to see if they present a conflict when
639 for (BasicBlock::iterator I = Succ->begin(); isa<PHINode>(I); ++I) {
653 << Succ->getName() << " is conflicting with "
669 << Succ->getName() << " is conflicting with regard to common "
782 // Note that, since we are merging phi nodes and BB and Succ might
823 BasicBlock *Succ = cast<BranchInst>(BB->getTerminator())->getSuccessor(0);
824 if (BB == Succ) return false;
827 // phi nodes in BB or Succ. If not, we can safely merge.
828 if (!CanPropagatePredecessorsForPHIs(BB, Succ)) return false;
830 // Check for cases where Succ has multiple predecessors and a PHI node in BB
833 // BB dominates Succ, which is non-trivial to calculate in the case where
834 // Succ has multiple predecessors. Also, it requires checking whether
839 // Note that if this check finds a live use, BB dominates Succ, so BB is
842 if (!Succ
859 if (isa<PHINode>(Succ->begin())) {
860 // If there is more than one pred of succ, and there are PHI nodes in
866 for (BasicBlock::iterator I = Succ->begin(); isa<PHINode>(I); ++I) {
873 if (Succ->getSinglePredecessor()) {
874 // BB is the only predecessor of Succ, so Succ will end up with exactly
879 Succ->getInstList().splice(Succ->getFirstNonPHI()->getIterator(),
889 // Everything that jumped to BB now goes to Succ.
890 BB->replaceAllUsesWith(Succ);
891 if (!Succ->hasName()) Succ->takeName(BB);