Lines Matching defs:OrigBB
1258 /// Update the PHI nodes in OrigBB to include the values coming from NewBB.
1260 static void UpdatePHINodes(BasicBlock *OrigBB, BasicBlock *NewBB,
1263 // Otherwise, create a new PHI node in NewBB for each PHI node in OrigBB.
1265 for (BasicBlock::iterator I = OrigBB->begin(); isa<PHINode>(I); ) {
1324 BasicBlock *OrigBB, ArrayRef<BasicBlock *> Preds, const char *Suffix1,
1438 BasicBlock *OrigBB, ArrayRef<BasicBlock *> Preds, const char *Suffix1,
1442 assert(OrigBB->isLandingPad() && "Trying to split a non-landing pad!");
1444 // Create a new basic block for OrigBB's predecessors listed in Preds. Insert
1446 BasicBlock *NewBB1 = BasicBlock::Create(OrigBB->getContext(),
1447 OrigBB->getName() + Suffix1,
1448 OrigBB->getParent(), OrigBB);
1452 BranchInst *BI1 = BranchInst::Create(OrigBB, NewBB1);
1453 BI1->setDebugLoc(OrigBB->getFirstNonPHIIt()->getDebugLoc());
1455 // Move the edges from Preds to point to NewBB1 instead of OrigBB.
1462 Pred->getTerminator()->replaceUsesOfWith(OrigBB, NewBB1);
1466 UpdateAnalysisInformation(OrigBB, NewBB1, Preds, DTU, DT, LI, MSSAU,
1469 // Update the PHI nodes in OrigBB with the values coming from NewBB1.
1470 UpdatePHINodes(OrigBB, NewBB1, Preds, BI1, HasLoopExit);
1472 // Move the remaining edges from OrigBB to point to NewBB2.
1474 for (pred_iterator i = pred_begin(OrigBB), e = pred_end(OrigBB);
1481 e = pred_end(OrigBB);
1486 // Create another basic block for the rest of OrigBB's predecessors.
1487 NewBB2 = BasicBlock::Create(OrigBB->getContext(),
1488 OrigBB->getName() + Suffix2,
1489 OrigBB->getParent(), OrigBB);
1493 BranchInst *BI2 = BranchInst::Create(OrigBB, NewBB2);
1494 BI2->setDebugLoc(OrigBB->getFirstNonPHIIt()->getDebugLoc());
1496 // Move the remaining edges from OrigBB to point to NewBB2.
1498 NewBB2Pred->getTerminator()->replaceUsesOfWith(OrigBB, NewBB2);
1502 UpdateAnalysisInformation(OrigBB, NewBB2, NewBB2Preds, DTU, DT, LI, MSSAU,
1505 // Update the PHI nodes in OrigBB with the values coming from NewBB2.
1506 UpdatePHINodes(OrigBB, NewBB2, NewBB2Preds, BI2, HasLoopExit);
1509 LandingPadInst *LPad = OrigBB->getLandingPadInst();
1539 void llvm::SplitLandingPadPredecessors(BasicBlock *OrigBB,
1546 return SplitLandingPadPredecessorsImpl(OrigBB, Preds, Suffix1, Suffix2,