Lines Matching defs:NewBB
853 // the only edge into Succ from outside of BBLoop is that of NewBB after
855 // NewBB is the new exit block and it has no non-loop predecessors. If the
881 auto *NewBB =
883 setUnwindEdgeTo(BB->getTerminator(), NewBB);
884 updatePhiNodes(Succ, BB, NewBB, LandingPadReplacement);
888 auto *Terminator = BranchInst::Create(Succ, NewBB);
890 LandingPadReplacement->addIncoming(NewLP, NewBB);
904 auto *NewCleanupPad = CleanupPadInst::Create(ParentPad, {}, BBName, NewBB);
905 CleanupReturnInst::Create(NewCleanupPad, Succ, NewBB);
911 return NewBB;
917 Updates.push_back({DominatorTree::Insert, BB, NewBB});
918 Updates.push_back({DominatorTree::Insert, NewBB, Succ});
937 // Both in the same loop, the NewBB joins loop.
938 SuccLoop->addBasicBlockToLoop(NewBB, *LI);
941 BBLoop->addBasicBlockToLoop(NewBB, *LI);
944 SuccLoop->addBasicBlockToLoop(NewBB, *LI);
953 P->addBasicBlockToLoop(NewBB, *LI);
960 assert(!BBLoop->contains(NewBB) &&
965 createPHIsForSplitLoopExit(BB, NewBB, Succ);
978 return NewBB;
1146 static void UpdateAnalysisInformation(BasicBlock *OldBB, BasicBlock *NewBB,
1155 if (NewBB->isEntryBlock() && DTU->hasDomTree()) {
1159 DTU->recalculate(*NewBB->getParent());
1161 // Split block expects NewBB to have a non-empty set of predecessors.
1164 Updates.push_back({DominatorTree::Insert, NewBB, OldBB});
1168 Updates.push_back({DominatorTree::Insert, Pred, NewBB});
1175 assert(NewBB->isEntryBlock());
1176 DT->setNewRoot(NewBB);
1178 // Split block expects NewBB to have a non-empty set of predecessors.
1179 DT->splitBlock(NewBB);
1185 MSSAU->wireOldPredecessorsToNewImmediatePredecessor(OldBB, NewBB, Preds);
1204 // as true and make the NewBB the header of some loop. This breaks LI.
1250 InnermostPredLoop->addBasicBlockToLoop(NewBB, *LI);
1252 L->addBasicBlockToLoop(NewBB, *LI);
1254 L->moveToHeader(NewBB);
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.
1297 PN->addIncoming(InVal, NewBB);
1303 // Create the new PHI node, insert it into NewBB at the end of the block
1319 PN->addIncoming(NewPHI, NewBB);
1350 BasicBlock *NewBB = BasicBlock::Create(
1354 BranchInst *BI = BranchInst::Create(BB, NewBB);
1373 // Move the edges from Preds to point to NewBB instead of BB.
1380 Pred->getTerminator()->replaceSuccessorWith(BB, NewBB);
1383 // Insert a new PHI node into NewBB for every PHI node in BB and that new PHI
1390 cast<PHINode>(I)->addIncoming(PoisonValue::get(I->getType()), NewBB);
1395 UpdateAnalysisInformation(BB, NewBB, Preds, DTU, DT, LI, MSSAU, PreserveLCSSA,
1399 // Update the PHI nodes in BB with the values coming from NewBB.
1400 UpdatePHINodes(BB, NewBB, Preds, BI, HasLoopExit);
1416 return NewBB;