Home | History | Annotate | Download | only in Utils

Lines Matching refs:OrigBB

378 /// UpdatePHINodes - Update the PHI nodes in OrigBB to include the values coming
380 static void UpdatePHINodes(BasicBlock *OrigBB, BasicBlock *NewBB,
383 // Otherwise, create a new PHI node in NewBB for each PHI node in OrigBB.
385 for (BasicBlock::iterator I = OrigBB->begin(); isa<PHINode>(I); ) {
480 /// OrigBB, by introducing two new basic blocks into the function. One of those
482 /// block gets the remaining predecessors of OrigBB. The landingpad instruction
483 /// OrigBB is clone into both of the new basic blocks. The new blocks are given
492 void llvm::SplitLandingPadPredecessors(BasicBlock *OrigBB,
497 assert(OrigBB->isLandingPad() && "Trying to split a non-landing pad!");
499 // Create a new basic block for OrigBB's predecessors listed in Preds. Insert
501 BasicBlock *NewBB1 = BasicBlock::Create(OrigBB->getContext(),
502 OrigBB->getName() + Suffix1,
503 OrigBB->getParent(), OrigBB);
507 BranchInst *BI1 = BranchInst::Create(OrigBB, NewBB1);
509 // Move the edges from Preds to point to NewBB1 instead of OrigBB.
516 Preds[i]->getTerminator()->replaceUsesOfWith(OrigBB, NewBB1);
521 UpdateAnalysisInformation(OrigBB, NewBB1, Preds, P, HasLoopExit);
523 // Update the PHI nodes in OrigBB with the values coming from NewBB1.
524 UpdatePHINodes(OrigBB, NewBB1, Preds, BI1, P, HasLoopExit);
526 // Move the remaining edges from OrigBB to point to NewBB2.
528 for (pred_iterator i = pred_begin(OrigBB), e = pred_end(OrigBB);
535 e = pred_end(OrigBB);
540 // Create another basic block for the rest of OrigBB's predecessors.
541 NewBB2 = BasicBlock::Create(OrigBB->getContext(),
542 OrigBB->getName() + Suffix2,
543 OrigBB->getParent(), OrigBB);
547 BranchInst *BI2 = BranchInst::Create(OrigBB, NewBB2);
549 // Move the remaining edges from OrigBB to point to NewBB2.
552 (*i)->getTerminator()->replaceUsesOfWith(OrigBB, NewBB2);
556 UpdateAnalysisInformation(OrigBB, NewBB2, NewBB2Preds, P, HasLoopExit);
558 // Update the PHI nodes in OrigBB with the values coming from NewBB2.
559 UpdatePHINodes(OrigBB, NewBB2, NewBB2Preds, BI2, P, HasLoopExit);
562 LandingPadInst *LPad = OrigBB->getLandingPadInst();