Changeset View
Changeset View
Standalone View
Standalone View
llvm/include/llvm/Passes/PassBuilder.h
Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | public: | ||||
/// name is the name of a pass, the InnerPipeline is empty, since passes | /// name is the name of a pass, the InnerPipeline is empty, since passes | ||||
/// cannot contain inner pipelines. See parsePassPipeline() for a more | /// cannot contain inner pipelines. See parsePassPipeline() for a more | ||||
/// detailed description of the textual pipeline format. | /// detailed description of the textual pipeline format. | ||||
struct PipelineElement { | struct PipelineElement { | ||||
StringRef Name; | StringRef Name; | ||||
std::vector<PipelineElement> InnerPipeline; | std::vector<PipelineElement> InnerPipeline; | ||||
}; | }; | ||||
/// ThinLTO phase. | /// LTO phase. | ||||
/// | /// | ||||
/// This enumerates the LLVM ThinLTO optimization phases. | /// This enumerates the LLVM (Thin)LTO optimization phases. | ||||
enum class ThinLTOPhase { | enum class LTOPhase { | ||||
/// No ThinLTO behavior needed. | /// No LTO behavior needed. | ||||
None, | None, | ||||
/// ThinLTO prelink (summary) phase. | /// LTO prelink phase. | ||||
PreLink, | PreLink, | ||||
/// ThinLTO postlink (backend compile) phase. | /// LTO postlink (backend compile) phase. | ||||
PostLink | PostLink | ||||
}; | }; | ||||
/// LLVM-provided high-level optimization levels. | /// LLVM-provided high-level optimization levels. | ||||
/// | /// | ||||
/// This enumerates the LLVM-provided high-level optimization levels. Each | /// This enumerates the LLVM-provided high-level optimization levels. Each | ||||
/// level has a specific goal and rationale. | /// level has a specific goal and rationale. | ||||
enum OptimizationLevel { | enum OptimizationLevel { | ||||
▲ Show 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | public: | ||||
/// repeatedly over the IR and is not expected to destroy important | /// repeatedly over the IR and is not expected to destroy important | ||||
/// information about the semantics of the IR. | /// information about the semantics of the IR. | ||||
/// | /// | ||||
/// Note that \p Level cannot be `O0` here. The pipelines produced are | /// Note that \p Level cannot be `O0` here. The pipelines produced are | ||||
/// only intended for use when attempting to optimize code. If frontends | /// only intended for use when attempting to optimize code. If frontends | ||||
/// require some transformations for semantic reasons, they should explicitly | /// require some transformations for semantic reasons, they should explicitly | ||||
/// build them. | /// build them. | ||||
/// | /// | ||||
/// \p Phase indicates the current ThinLTO phase. | /// \p Phase indicates the current LTO phase. | ||||
FunctionPassManager | FunctionPassManager | ||||
buildFunctionSimplificationPipeline(OptimizationLevel Level, | buildFunctionSimplificationPipeline(OptimizationLevel Level, LTOPhase Phase, | ||||
ThinLTOPhase Phase, | |||||
bool DebugLogging = false); | bool DebugLogging = false); | ||||
/// Construct the core LLVM module canonicalization and simplification | /// Construct the core LLVM module canonicalization and simplification | ||||
/// pipeline. | /// pipeline. | ||||
/// | /// | ||||
/// This pipeline focuses on canonicalizing and simplifying the entire module | /// This pipeline focuses on canonicalizing and simplifying the entire module | ||||
/// of IR. Much like the function simplification pipeline above, it is | /// of IR. Much like the function simplification pipeline above, it is | ||||
/// suitable to run repeatedly over the IR and is not expected to destroy | /// suitable to run repeatedly over the IR and is not expected to destroy | ||||
/// important information. It does, however, perform inlining and other | /// important information. It does, however, perform inlining and other | ||||
/// heuristic based simplifications that are not strictly reversible. | /// heuristic based simplifications that are not strictly reversible. | ||||
/// | /// | ||||
/// Note that \p Level cannot be `O0` here. The pipelines produced are | /// Note that \p Level cannot be `O0` here. The pipelines produced are | ||||
/// only intended for use when attempting to optimize code. If frontends | /// only intended for use when attempting to optimize code. If frontends | ||||
/// require some transformations for semantic reasons, they should explicitly | /// require some transformations for semantic reasons, they should explicitly | ||||
/// build them. | /// build them. | ||||
/// | /// | ||||
/// \p Phase indicates the current ThinLTO phase. | /// \p Phase indicates the current LTO phase. | ||||
ModulePassManager | ModulePassManager | ||||
buildModuleSimplificationPipeline(OptimizationLevel Level, | buildModuleSimplificationPipeline(OptimizationLevel Level, LTOPhase Phase, | ||||
ThinLTOPhase Phase, | |||||
bool DebugLogging = false); | bool DebugLogging = false); | ||||
/// Construct the core LLVM module optimization pipeline. | /// Construct the core LLVM module optimization pipeline. | ||||
/// | /// | ||||
/// This pipeline focuses on optimizing the execution speed of the IR. It | /// This pipeline focuses on optimizing the execution speed of the IR. It | ||||
/// uses cost modeling and thresholds to balance code growth against runtime | /// uses cost modeling and thresholds to balance code growth against runtime | ||||
/// improvements. It includes vectorization and other information destroying | /// improvements. It includes vectorization and other information destroying | ||||
/// transformations. It also cannot generally be run repeatedly on a module | /// transformations. It also cannot generally be run repeatedly on a module | ||||
Show All 14 Lines | public: | ||||
/// optimization and code generation without any link-time optimization. It | /// optimization and code generation without any link-time optimization. It | ||||
/// typically correspond to frontend "-O[123]" options for optimization | /// typically correspond to frontend "-O[123]" options for optimization | ||||
/// levels \c O1, \c O2 and \c O3 resp. | /// levels \c O1, \c O2 and \c O3 resp. | ||||
/// | /// | ||||
/// Note that \p Level cannot be `O0` here. The pipelines produced are | /// Note that \p Level cannot be `O0` here. The pipelines produced are | ||||
/// only intended for use when attempting to optimize code. If frontends | /// only intended for use when attempting to optimize code. If frontends | ||||
/// require some transformations for semantic reasons, they should explicitly | /// require some transformations for semantic reasons, they should explicitly | ||||
/// build them. | /// build them. | ||||
ModulePassManager buildPerModuleDefaultPipeline(OptimizationLevel Level, | ModulePassManager | ||||
buildPerModuleDefaultPipeline(OptimizationLevel Level, | |||||
bool DebugLogging = false, | bool DebugLogging = false, | ||||
bool LTOPreLink = false); | LTOPhase Phase = LTOPhase::None); | ||||
/// Build a pre-link, ThinLTO-targeting default optimization pipeline to | /// Build a pre-link, ThinLTO-targeting default optimization pipeline to | ||||
/// a pass manager. | /// a pass manager. | ||||
/// | /// | ||||
/// This adds the pre-link optimizations tuned to prepare a module for | /// This adds the pre-link optimizations tuned to prepare a module for | ||||
/// a ThinLTO run. It works to minimize the IR which needs to be analyzed | /// a ThinLTO run. It works to minimize the IR which needs to be analyzed | ||||
/// without making irreversible decisions which could be made better during | /// without making irreversible decisions which could be made better during | ||||
/// the LTO run. | /// the LTO run. | ||||
▲ Show 20 Lines • Show All 418 Lines • Show Last 20 Lines |