LLVM 22.0.0git
LoopPassManager.h File Reference

This header provides classes for managing a pipeline of passes over loops in LLVM IR. More...

Go to the source code of this file.

Classes

class  llvm::PassManager< Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & >
struct  llvm::RequireAnalysisPass< AnalysisT, Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & >
 A partial specialization of the require analysis template pass to forward the extra parameters from a transformation's run method to the AnalysisManager's getResult.
class  llvm::LPMUpdater
 This class provides an interface for updating the loop pass manager based on mutations to the loop nest. More...
class  llvm::FunctionToLoopPassAdaptor
class  llvm::PrintLoopPass
 Pass for printing a loop's contents as textual IR. More...

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.

Typedefs

typedef PassManager< Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & > llvm::LoopPassManager
 The Loop pass manager.
template<typename AnalysisT>
using llvm::RequireAnalysisLoopPass
 An alias template to easily name a require analysis loop pass.

Functions

template<typename LoopPassT>
FunctionToLoopPassAdaptor llvm::createFunctionToLoopPassAdaptor (LoopPassT &&Pass, bool UseMemorySSA=false, bool UseBlockFrequencyInfo=false)
 A function to deduce a loop pass type and wrap it in the templated adaptor.
template<>
FunctionToLoopPassAdaptor llvm::createFunctionToLoopPassAdaptor< LoopPassManager > (LoopPassManager &&LPM, bool UseMemorySSA, bool UseBlockFrequencyInfo)
 If Pass is an instance of LoopPassManager, the returned adaptor will be in loop-nest mode if the pass manager contains only loop-nest passes.

Detailed Description

This header provides classes for managing a pipeline of passes over loops in LLVM IR.

The primary loop pass pipeline is managed in a very particular way to provide a set of core guarantees: 1) Loops are, where possible, in simplified form. 2) Loops are always in LCSSA form. 3) A collection of Loop-specific analysis results are available:

  • LoopInfo
  • DominatorTree
  • ScalarEvolution
  • AAManager 4) All loop passes preserve #1 (where possible), #2, and #3. 5) Loop passes run over each loop in the loop nest from the innermost to the outermost. Specifically, all inner loops are processed before passes run over outer loops. When running the pipeline across an inner loop creates new inner loops, those are added and processed in this order as well.

This process is designed to facilitate transformations which simplify, reduce, and remove loops. For passes which are more oriented towards optimizing loops, especially optimizing loop nests instead of single loops in isolation, this framework is less interesting.

Definition in file LoopPassManager.h.