Home | History | Annotate | Download | only in Scalar

Lines Matching full:latch

84   // Simplify the loop latch before attempting to rotate the header
217 BasicBlock *Latch = L->getLoopLatch();
218 if (!Latch || Latch->hasAddressTaken())
221 BranchInst *Jmp = dyn_cast<BranchInst>(Latch->getTerminator());
225 BasicBlock *LastExit = Latch->getSinglePredecessor();
233 if (!shouldSpeculateInstrs(Latch->begin(), Jmp))
236 DEBUG(dbgs() << "Folding loop latch " << Latch->getName() << " into "
239 // Hoist the instructions from Latch into LastExit.
240 LastExit->getInstList().splice(BI, Latch->getInstList(), Latch->begin(), Jmp);
242 unsigned FallThruPath = BI->getSuccessor(0) == Latch ? 0 : 1;
246 // Remove Latch from the CFG so that LastExit becomes the new Latch.
248 Latch->replaceSuccessorsPhiUsesWith(LastExit);
251 // Nuke the Latch block.
252 assert(Latch->empty() && "unable to evacuate Latch");
253 LI->removeBlock(Latch);
255 DT->eraseNode(Latch);
256 Latch->eraseFromParent();
262 /// \param SimplifiedLatch is true if the latch was just folded into the final
263 /// loop exit. In this case we may want to rotate even though the new latch is
264 /// now an exiting branch. This rotation would have happened had the latch not
266 /// rotating loops in which the latch exits to avoid excessive or endless
268 /// form. This property is satisfied because simplifying the loop latch can only
288 // If the loop latch already contains a branch that leaves the loop then the
293 // Rotate if either the loop latch does *not* exit the loop, or if the loop
294 // latch was just simplified.
418 assert(L->getHeader() == NewHeader && "Latch block is our new header");
440 // loop latch.
511 assert(L->getLoopLatch() && "Invalid loop latch after loop rotation");