Lines Matching refs:Latch
211 BasicBlock *Latch = L->getLoopLatch();
212 if (!Latch || Latch->hasAddressTaken())
215 BranchInst *Jmp = dyn_cast<BranchInst>(Latch->getTerminator());
219 BasicBlock *LastExit = Latch->getSinglePredecessor();
227 if (!shouldSpeculateInstrs(Latch->begin(), Jmp))
230 DEBUG(dbgs() << "Folding loop latch " << Latch->getName() << " into "
233 // Hoist the instructions from Latch into LastExit.
234 LastExit->getInstList().splice(BI, Latch->getInstList(), Latch->begin(), Jmp);
236 unsigned FallThruPath = BI->getSuccessor(0) == Latch ? 0 : 1;
240 // Remove Latch from the CFG so that LastExit becomes the new Latch.
242 Latch->replaceSuccessorsPhiUsesWith(LastExit);
245 // Nuke the Latch block.
246 assert(Latch->empty() && "unable to evacuate Latch");
247 LI->removeBlock(Latch);
249 DT->eraseNode(Latch);
250 Latch->eraseFromParent();
391 assert(L->getHeader() == NewHeader && "Latch block is our new header");