Lines Matching full:latch
57 cl::desc("Assume the non latch exit block to be predictable"));
99 // Latch in ConnectProlog()
101 BasicBlock *Latch = L->getLoopLatch(); in ConnectProlog() local
102 assert(Latch && "Loop must have a latch"); in ConnectProlog()
103 BasicBlock *PrologLatch = cast<BasicBlock>(VMap[Latch]); in ConnectProlog()
110 for (BasicBlock *Succ : successors(Latch)) { in ConnectProlog()
132 Value *V = PN.getIncomingValueForBlock(Latch); in ConnectProlog()
184 if (hasBranchWeightMD(*Latch->getTerminator())) { in ConnectProlog()
217 BasicBlock *Latch = L->getLoopLatch(); in ConnectEpilog() local
218 assert(Latch && "Loop must have a latch"); in ConnectEpilog()
219 BasicBlock *EpilogLatch = cast<BasicBlock>(VMap[Latch]); in ConnectEpilog()
227 // Latch in ConnectEpilog()
241 // PN = PHI [I, Latch] in ConnectEpilog()
246 // Exits from non-latch blocks point to the original exit block and the in ConnectEpilog()
259 Value *V = PN.getIncomingValueForBlock(Latch); in ConnectEpilog()
275 // PN = PHI [I, Latch], [poison, PreHeader] in ConnectEpilog()
281 // Create PHI nodes at NewExit (from the unrolling loop Latch and PreHeader). in ConnectEpilog()
283 for (BasicBlock *Succ : successors(Latch)) { in ConnectEpilog()
294 // Adding a value to the new PHI node from the unrolling loop latch. in ConnectEpilog()
295 NewPN->addIncoming(PN.getIncomingValueForBlock(Latch), Latch); in ConnectEpilog()
314 if (hasBranchWeightMD(*Latch->getTerminator())) { in ConnectEpilog()
327 SmallVector<BasicBlock*, 4> NewExitPreds{Latch}; in ConnectEpilog()
348 BasicBlock *Latch = L->getLoopLatch(); in CloneLoopBlocks() local
382 if (Latch == *BB) { in CloneLoopBlocks()
431 BasicBlock *NewLatch = cast<BasicBlock>(VMap[Latch]); in CloneLoopBlocks()
432 idx = NewPHI->getBasicBlockIndex(Latch); in CloneLoopBlocks()
487 // the unroll factor (since one of the exiting blocks is the latch block). in canProfitablyUnrollMultiExitLoop()
493 // Allow unrolling of loops with no non latch exit blocks. in canProfitablyUnrollMultiExitLoop()
599 BasicBlock *Latch = L->getLoopLatch(); in UnrollRuntimeLoopRemainder() local
602 BranchInst *LatchBR = cast<BranchInst>(Latch->getTerminator()); in UnrollRuntimeLoopRemainder()
608 << "Loop latch not terminated by a conditional branch.\n"); in UnrollRuntimeLoopRemainder()
617 // targets of the Latch be an exit block out of the loop. in UnrollRuntimeLoopRemainder()
620 << "One of the loop latch successors must be the exit block.\n"); in UnrollRuntimeLoopRemainder()
624 // These are exit blocks other than the target of the latch exiting block. in UnrollRuntimeLoopRemainder()
650 // We calculate the backedge count by using getExitCount on the Latch block, in UnrollRuntimeLoopRemainder()
654 const SCEV *BECountSC = SE->getExitCount(L, Latch); in UnrollRuntimeLoopRemainder()
696 // Latch in UnrollRuntimeLoopRemainder()
711 NewExit = SplitBlockPredecessors(LatchExit, {Latch}, ".unr-lcssa", DT, LI, in UnrollRuntimeLoopRemainder()
722 // If the latch exits from multiple level of nested loops, then in UnrollRuntimeLoopRemainder()
755 // Latch Header in UnrollRuntimeLoopRemainder()
757 // *EpilogPreHeader Latch in UnrollRuntimeLoopRemainder()
769 // If there are other exits before the latch, that may cause the latch exit in UnrollRuntimeLoopRemainder()
770 // branch to never be executed, and the latch exit count may be poison. in UnrollRuntimeLoopRemainder()
798 if (hasBranchWeightMD(*Latch->getTerminator())) { in UnrollRuntimeLoopRemainder()
851 if (PredBB == Latch) in UnrollRuntimeLoopRemainder()
852 // The latch exit is handled separately, see connectX in UnrollRuntimeLoopRemainder()
856 // extra branch which can reach the latch exit. in UnrollRuntimeLoopRemainder()
905 // Latch PrologLatch in UnrollRuntimeLoopRemainder()
910 // EpilogLatch Latch in UnrollRuntimeLoopRemainder()
937 BranchInst *LatchBR = cast<BranchInst>(Latch->getTerminator()); in UnrollRuntimeLoopRemainder()
947 NewIdx->addIncoming(IdxNext, Latch); in UnrollRuntimeLoopRemainder()
996 // Merge latch into exit block. in UnrollRuntimeLoopRemainder()