Home | History | Annotate | Download | only in Scalar

Lines Matching refs:Loop

1 //===- LoopDeletion.cpp - Dead Loop Deletion Pass ---------------===//
10 // This file implements the Dead Loop Deletion Pass. This pass is responsible
25 #define DEBUG_TYPE "loop-delete"
37 // Possibly eliminate loop L if it is dead.
38 bool runOnLoop(Loop *L, LPPassManager &LPM) override;
55 bool isLoopDead(Loop *L, SmallVectorImpl<BasicBlock *> &exitingBlocks,
63 INITIALIZE_PASS_BEGIN(LoopDeletion, "loop-deletion",
70 INITIALIZE_PASS_END(LoopDeletion, "loop-deletion",
77 /// isLoopDead - Determined if a loop is dead. This assumes that we've already
80 bool LoopDeletion::isLoopDead(Loop *L,
86 // Make sure that all PHI entries coming from the loop are loop invariant.
87 // Because the code is in LCSSA form, any values used outside of the loop
89 // sufficient to guarantee that no loop-variant values are used outside
90 // of the loop.
115 for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end();
129 /// we do ensure that this never remove a loop that might be infinite, as doing
133 bool LoopDeletion::runOnLoop(Loop *L, LPPassManager &LPM) {
137 // We can only remove the loop if there is a preheader that we can
158 // We require that the loop only have a single exit block. Otherwise, we'd
161 // a loop invariant manner.
165 // Finally, we have to check that the loop really is dead.
177 // Now that we know the removal is safe, remove the loop by changing the
185 // Tell ScalarEvolution that the loop is deleted. Do this before
186 // deleting the loop so that ScalarEvolution can look at the loop
211 for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end();
232 // entry from the loop's block list. We do that in the next section.
233 for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end();
238 // otherwise our loop iterators won't work.
246 // The last step is to inform the loop pass manager that we've
247 // eliminated this loop.