Lines Matching defs:OrigBB
1257 /// Update the PHI nodes in OrigBB to include the values coming from NewBB.
1259 static void UpdatePHINodes(BasicBlock *OrigBB, BasicBlock *NewBB,
1262 // Otherwise, create a new PHI node in NewBB for each PHI node in OrigBB.
1264 for (BasicBlock::iterator I = OrigBB->begin(); isa<PHINode>(I); ) {
1323 BasicBlock *OrigBB, ArrayRef<BasicBlock *> Preds, const char *Suffix1,
1437 BasicBlock *OrigBB, ArrayRef<BasicBlock *> Preds, const char *Suffix1,
1441 assert(OrigBB->isLandingPad() && "Trying to split a non-landing pad!");
1443 // Create a new basic block for OrigBB's predecessors listed in Preds. Insert
1445 BasicBlock *NewBB1 = BasicBlock::Create(OrigBB->getContext(),
1446 OrigBB->getName() + Suffix1,
1447 OrigBB->getParent(), OrigBB);
1451 BranchInst *BI1 = BranchInst::Create(OrigBB, NewBB1);
1452 BI1->setDebugLoc(OrigBB->getFirstNonPHI()->getDebugLoc());
1454 // Move the edges from Preds to point to NewBB1 instead of OrigBB.
1461 Pred->getTerminator()->replaceUsesOfWith(OrigBB, NewBB1);
1465 UpdateAnalysisInformation(OrigBB, NewBB1, Preds, DTU, DT, LI, MSSAU,
1468 // Update the PHI nodes in OrigBB with the values coming from NewBB1.
1469 UpdatePHINodes(OrigBB, NewBB1, Preds, BI1, HasLoopExit);
1471 // Move the remaining edges from OrigBB to point to NewBB2.
1473 for (pred_iterator i = pred_begin(OrigBB), e = pred_end(OrigBB);
1480 e = pred_end(OrigBB);
1485 // Create another basic block for the rest of OrigBB's predecessors.
1486 NewBB2 = BasicBlock::Create(OrigBB->getContext(),
1487 OrigBB->getName() + Suffix2,
1488 OrigBB->getParent(), OrigBB);
1492 BranchInst *BI2 = BranchInst::Create(OrigBB, NewBB2);
1493 BI2->setDebugLoc(OrigBB->getFirstNonPHI()->getDebugLoc());
1495 // Move the remaining edges from OrigBB to point to NewBB2.
1497 NewBB2Pred->getTerminator()->replaceUsesOfWith(OrigBB, NewBB2);
1501 UpdateAnalysisInformation(OrigBB, NewBB2, NewBB2Preds, DTU, DT, LI, MSSAU,
1504 // Update the PHI nodes in OrigBB with the values coming from NewBB2.
1505 UpdatePHINodes(OrigBB, NewBB2, NewBB2Preds, BI2, HasLoopExit);
1508 LandingPadInst *LPad = OrigBB->getLandingPadInst();
1538 void llvm::SplitLandingPadPredecessors(BasicBlock *OrigBB,
1545 return SplitLandingPadPredecessorsImpl(OrigBB, Preds, Suffix1, Suffix2,