Lines Matching full:loop
1 //===- LoopPassManager.cpp - Loop pass management -------------------------===//
23 /// Explicitly specialize the pass manager's run method to handle loop nest
26 PassManager<Loop, LoopAnalysisManager, LoopStandardAnalysisResults &,
27 LPMUpdater &>::run(Loop &L, LoopAnalysisManager &AM, in run()
29 // Runs loop-nest passes only when the current loop is a top-level one. in run()
34 // Invalidation for the current loop should be handled above, and other loop in run()
35 // analysis results shouldn't be impacted by runs over this loop. Therefore, in run()
39 // FIXME: This isn't correct! This loop and all nested loops' analyses should in run()
40 // be preserved, but unrolling should invalidate the parent loop's analyses. in run()
41 PA.preserveSet<AllAnalysesOn<Loop>>(); in run()
46 void PassManager<Loop, LoopAnalysisManager, LoopStandardAnalysisResults &,
66 // Run both loop passes and loop-nest passes on top-level loop \p L.
68 LoopPassManager::runWithLoopNestPasses(Loop &L, LoopAnalysisManager &AM, in runWithLoopNestPasses()
72 "Loop-nest passes should only run on top-level loops."); in runWithLoopNestPasses()
82 // loop and `IsLoopNestPtrValid` indicates whether the pointer is still valid. in runWithLoopNestPasses()
84 // invalid when encountering a loop-nest pass. in runWithLoopNestPasses()
87 Loop *OuterMostLoop = &L; in runWithLoopNestPasses()
92 // The `I`-th pass is a loop pass. in runWithLoopNestPasses()
96 // The `I`-th pass is a loop-nest pass. in runWithLoopNestPasses()
99 // If the loop-nest object calculated before is no longer valid, in runWithLoopNestPasses()
100 // re-calculate it here before running the loop-nest pass. in runWithLoopNestPasses()
122 // If the loop was deleted, abort the run and return to the outer walk. in runWithLoopNestPasses()
136 // Check if the current pass preserved the loop-nest object or not. in runWithLoopNestPasses()
139 // After running the loop pass, the parent loop might change and we need to in runWithLoopNestPasses()
147 // Run all loop passes on loop \p L. Loop-nest passes don't run either because
148 // \p L is not a top-level one or simply because there are no loop-nest passes
151 LoopPassManager::runWithoutLoopNestPasses(Loop &L, LoopAnalysisManager &AM, in runWithoutLoopNestPasses()
169 // If the loop was deleted, abort the run and return to the outer walk. in runWithoutLoopNestPasses()
183 // After running the loop pass, the parent loop might change and we need to in runWithoutLoopNestPasses()
194 OS << (UseMemorySSA ? "loop-mssa(" : "loop("); in printPipeline()
200 // Before we even compute any loop analyses, first run a miniature function in run()
214 // Get the loop structure for this function in run()
221 // Get the analysis results needed by loop passes. in run()
242 // Setup the loop analysis manager from its proxy. It is important that in run()
244 // LoopStandardAnalysisResults object. The loop analyses cached in this in run()
253 SmallPriorityWorklist<Loop *, 4> Worklist; in run()
255 // Register the worklist and loop analysis manager so that loop passes can in run()
256 // update them when they mutate the loop nest structure. in run()
259 // Add the loop nests in the reverse order of LoopInfo. See method in run()
264 for (Loop *L : LI) in run()
272 assert(llvm::any_cast<const Loop *>(&IR) || in run()
274 const Loop **LPtr = llvm::any_cast<const Loop *>(&IR); in run()
275 const Loop *L = LPtr ? *LPtr : nullptr; in run()
278 assert(L && "Loop should be valid for printing"); in run()
280 // Verify the loop structure and LCSSA form before visiting the loop. in run()
288 Loop *L = Worklist.pop_back_val(); in run()
290 "L should be a top-level loop in loop-nest mode."); in run()
292 // Reset the update structure for this loop. in run()
297 // Save a parent loop pointer for asserts. in run()
303 if (!PI.runBeforePass<Loop>(*Pass, *L)) in run()
308 // Do not pass deleted Loop into the instrumentation. in run()
310 PI.runAfterPassInvalidated<Loop>(*Pass, PassPA); in run()
312 PI.runAfterPass<Loop>(*Pass, *L, PassPA); in run()
315 report_fatal_error("Loop pass manager using MemorySSA contains a pass " in run()
331 // If the loop hasn't been deleted, we need to handle invalidation here. in run()
333 // We know that the loop pass couldn't have invalidated any other in run()
334 // loop's analyses (that's the contract of a loop pass), so directly in run()
335 // handle the loop analysis manager's invalidation here. in run()
348 // Loops. This precludes *any* invalidation of loop analyses by the proxy, in run()
350 // loop analysis manager incrementally above. in run()
351 PA.preserveSet<AllAnalysesOn<Loop>>(); in run()
370 PreservedAnalyses PrintLoopPass::run(Loop &L, LoopAnalysisManager &, in run()