Lines Matching refs:Loop
1 //===- LoopDeletion.cpp - Dead Loop Deletion Pass ---------------===//
10 // This file implements the Dead Loop Deletion Pass. This pass is responsible
26 #define DEBUG_TYPE "loop-delete"
38 // Possibly eliminate loop L if it is dead.
39 bool runOnLoop(Loop *L, LPPassManager &) override;
57 bool isLoopDead(Loop *L, SmallVectorImpl<BasicBlock *> &exitingBlocks,
65 INITIALIZE_PASS_BEGIN(LoopDeletion, "loop-deletion",
72 INITIALIZE_PASS_END(LoopDeletion, "loop-deletion",
79 /// isLoopDead - Determined if a loop is dead. This assumes that we've already
82 bool LoopDeletion::isLoopDead(Loop *L,
88 // Make sure that all PHI entries coming from the loop are loop invariant.
89 // Because the code is in LCSSA form, any values used outside of the loop
91 // sufficient to guarantee that no loop-variant values are used outside
92 // of the loop.
117 for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end();
131 /// we do ensure that this never remove a loop that might be infinite, as doing
135 bool LoopDeletion::runOnLoop(Loop *L, LPPassManager &) {
139 // We can only remove the loop if there is a preheader that we can
160 // We require that the loop only have a single exit block. Otherwise, we'd
163 // a loop invariant manner.
167 // Finally, we have to check that the loop really is dead.
179 // Now that we know the removal is safe, remove the loop by changing the
187 // Tell ScalarEvolution that the loop is deleted. Do this before
188 // deleting the loop so that ScalarEvolution can look at the loop
213 for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end();
234 // entry from the loop's block list. We do that in the next section.
235 for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end();
240 // otherwise our loop iterators won't work.
247 // The last step is to update LoopInfo now that we've eliminated this loop.