Lines Matching defs:NewBB
852 // the only edge into Succ from outside of BBLoop is that of NewBB after
854 // NewBB is the new exit block and it has no non-loop predecessors. If the
880 auto *NewBB =
882 setUnwindEdgeTo(BB->getTerminator(), NewBB);
883 updatePhiNodes(Succ, BB, NewBB, LandingPadReplacement);
887 auto *Terminator = BranchInst::Create(Succ, NewBB);
889 LandingPadReplacement->addIncoming(NewLP, NewBB);
903 auto *NewCleanupPad = CleanupPadInst::Create(ParentPad, {}, BBName, NewBB);
904 CleanupReturnInst::Create(NewCleanupPad, Succ, NewBB);
910 return NewBB;
916 Updates.push_back({DominatorTree::Insert, BB, NewBB});
917 Updates.push_back({DominatorTree::Insert, NewBB, Succ});
936 // Both in the same loop, the NewBB joins loop.
937 SuccLoop->addBasicBlockToLoop(NewBB, *LI);
940 BBLoop->addBasicBlockToLoop(NewBB, *LI);
943 SuccLoop->addBasicBlockToLoop(NewBB, *LI);
952 P->addBasicBlockToLoop(NewBB, *LI);
959 assert(!BBLoop->contains(NewBB) &&
964 createPHIsForSplitLoopExit(BB, NewBB, Succ);
977 return NewBB;
1145 static void UpdateAnalysisInformation(BasicBlock *OldBB, BasicBlock *NewBB,
1154 if (NewBB->isEntryBlock() && DTU->hasDomTree()) {
1158 DTU->recalculate(*NewBB->getParent());
1160 // Split block expects NewBB to have a non-empty set of predecessors.
1163 Updates.push_back({DominatorTree::Insert, NewBB, OldBB});
1167 Updates.push_back({DominatorTree::Insert, Pred, NewBB});
1174 assert(NewBB->isEntryBlock());
1175 DT->setNewRoot(NewBB);
1177 // Split block expects NewBB to have a non-empty set of predecessors.
1178 DT->splitBlock(NewBB);
1184 MSSAU->wireOldPredecessorsToNewImmediatePredecessor(OldBB, NewBB, Preds);
1203 // as true and make the NewBB the header of some loop. This breaks LI.
1249 InnermostPredLoop->addBasicBlockToLoop(NewBB, *LI);
1251 L->addBasicBlockToLoop(NewBB, *LI);
1253 L->moveToHeader(NewBB);
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.
1296 PN->addIncoming(InVal, NewBB);
1302 // Create the new PHI node, insert it into NewBB at the end of the block
1318 PN->addIncoming(NewPHI, NewBB);
1349 BasicBlock *NewBB = BasicBlock::Create(
1353 BranchInst *BI = BranchInst::Create(BB, NewBB);
1372 // Move the edges from Preds to point to NewBB instead of BB.
1379 Pred->getTerminator()->replaceSuccessorWith(BB, NewBB);
1382 // Insert a new PHI node into NewBB for every PHI node in BB and that new PHI
1389 cast<PHINode>(I)->addIncoming(PoisonValue::get(I->getType()), NewBB);
1394 UpdateAnalysisInformation(BB, NewBB, Preds, DTU, DT, LI, MSSAU, PreserveLCSSA,
1398 // Update the PHI nodes in BB with the values coming from NewBB.
1399 UpdatePHINodes(BB, NewBB, Preds, BI, HasLoopExit);
1415 return NewBB;