LLVM  12.0.0git
Classes | Public Types | Public Member Functions | List of all members
llvm::PassBuilder Class Reference

This class provides access to building LLVM's passes. More...

#include "llvm/Passes/PassBuilder.h"

Classes

class  OptimizationLevel
 LLVM-provided high-level optimization levels. More...
 
struct  PipelineElement
 A struct to capture parsed pass pipeline names. More...
 

Public Types

enum  ThinLTOPhase { ThinLTOPhase::None, ThinLTOPhase::PreLink, ThinLTOPhase::PostLink }
 ThinLTO phase. More...
 

Public Member Functions

 PassBuilder (TargetMachine *TM=nullptr, PipelineTuningOptions PTO=PipelineTuningOptions(), Optional< PGOOptions > PGOOpt=None, PassInstrumentationCallbacks *PIC=nullptr)
 
void crossRegisterProxies (LoopAnalysisManager &LAM, FunctionAnalysisManager &FAM, CGSCCAnalysisManager &CGAM, ModuleAnalysisManager &MAM)
 Cross register the analysis managers through their proxies. More...
 
void registerModuleAnalyses (ModuleAnalysisManager &MAM)
 Registers all available module analysis passes. More...
 
void registerCGSCCAnalyses (CGSCCAnalysisManager &CGAM)
 Registers all available CGSCC analysis passes. More...
 
void registerFunctionAnalyses (FunctionAnalysisManager &FAM)
 Registers all available function analysis passes. More...
 
void registerLoopAnalyses (LoopAnalysisManager &LAM)
 Registers all available loop analysis passes. More...
 
FunctionPassManager buildFunctionSimplificationPipeline (OptimizationLevel Level, ThinLTOPhase Phase, bool DebugLogging=false)
 Construct the core LLVM function canonicalization and simplification pipeline. More...
 
ModulePassManager buildModuleSimplificationPipeline (OptimizationLevel Level, ThinLTOPhase Phase, bool DebugLogging=false)
 Construct the core LLVM module canonicalization and simplification pipeline. More...
 
ModuleInlinerWrapperPass buildInlinerPipeline (OptimizationLevel Level, ThinLTOPhase Phase, bool DebugLogging=false)
 Construct the module pipeline that performs inlining as well as the inlining-driven cleanups. More...
 
ModulePassManager buildModuleOptimizationPipeline (OptimizationLevel Level, bool DebugLogging=false, bool LTOPreLink=false)
 Construct the core LLVM module optimization pipeline. More...
 
ModulePassManager buildPerModuleDefaultPipeline (OptimizationLevel Level, bool DebugLogging=false, bool LTOPreLink=false)
 Build a per-module default optimization pipeline. More...
 
ModulePassManager buildThinLTOPreLinkDefaultPipeline (OptimizationLevel Level, bool DebugLogging=false)
 Build a pre-link, ThinLTO-targeting default optimization pipeline to a pass manager. More...
 
ModulePassManager buildThinLTODefaultPipeline (OptimizationLevel Level, bool DebugLogging, const ModuleSummaryIndex *ImportSummary)
 Build an ThinLTO default optimization pipeline to a pass manager. More...
 
ModulePassManager buildLTOPreLinkDefaultPipeline (OptimizationLevel Level, bool DebugLogging=false)
 Build a pre-link, LTO-targeting default optimization pipeline to a pass manager. More...
 
ModulePassManager buildLTODefaultPipeline (OptimizationLevel Level, bool DebugLogging, ModuleSummaryIndex *ExportSummary)
 Build an LTO default optimization pipeline to a pass manager. More...
 
AAManager buildDefaultAAPipeline ()
 Build the default AAManager with the default alias analysis pipeline registered. More...
 
Error parsePassPipeline (ModulePassManager &MPM, StringRef PipelineText, bool VerifyEachPass=true, bool DebugLogging=false)
 Parse a textual pass pipeline description into a ModulePassManager. More...
 
Error parsePassPipeline (CGSCCPassManager &CGPM, StringRef PipelineText, bool VerifyEachPass=true, bool DebugLogging=false)
 {{@ Parse a textual pass pipeline description into a specific PassManager More...
 
Error parsePassPipeline (FunctionPassManager &FPM, StringRef PipelineText, bool VerifyEachPass=true, bool DebugLogging=false)
 
Error parsePassPipeline (LoopPassManager &LPM, StringRef PipelineText, bool VerifyEachPass=true, bool DebugLogging=false)
 
Error parseAAPipeline (AAManager &AA, StringRef PipelineText)
 Parse a textual alias analysis pipeline into the provided AA manager. More...
 
bool isAAPassName (StringRef PassName)
 Returns true if the pass name is the name of an alias analysis pass. More...
 
bool isAnalysisPassName (StringRef PassName)
 Returns true if the pass name is the name of a (non-alias) analysis pass. More...
 
void registerPeepholeEPCallback (const std::function< void(FunctionPassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point. More...
 
void registerLateLoopOptimizationsEPCallback (const std::function< void(LoopPassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point. More...
 
void registerLoopOptimizerEndEPCallback (const std::function< void(LoopPassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point. More...
 
void registerScalarOptimizerLateEPCallback (const std::function< void(FunctionPassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point. More...
 
void registerCGSCCOptimizerLateEPCallback (const std::function< void(CGSCCPassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point. More...
 
void registerVectorizerStartEPCallback (const std::function< void(FunctionPassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point. More...
 
void registerPipelineStartEPCallback (const std::function< void(ModulePassManager &)> &C)
 Register a callback for a default optimizer pipeline extension point. More...
 
void registerOptimizerLastEPCallback (const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point. More...
 
void registerParseAACallback (const std::function< bool(StringRef Name, AAManager &AA)> &C)
 Register a callback for parsing an AliasAnalysis Name to populate the given AAManager AA. More...
 
void registerAnalysisRegistrationCallback (const std::function< void(CGSCCAnalysisManager &)> &C)
 {{@ Register callbacks for analysis registration with this PassBuilder instance. More...
 
void registerAnalysisRegistrationCallback (const std::function< void(FunctionAnalysisManager &)> &C)
 
void registerAnalysisRegistrationCallback (const std::function< void(LoopAnalysisManager &)> &C)
 
void registerAnalysisRegistrationCallback (const std::function< void(ModuleAnalysisManager &)> &C)
 
void registerPipelineParsingCallback (const std::function< bool(StringRef Name, CGSCCPassManager &, ArrayRef< PipelineElement >)> &C)
 {{@ Register pipeline parsing callbacks with this pass builder instance. More...
 
void registerPipelineParsingCallback (const std::function< bool(StringRef Name, FunctionPassManager &, ArrayRef< PipelineElement >)> &C)
 
void registerPipelineParsingCallback (const std::function< bool(StringRef Name, LoopPassManager &, ArrayRef< PipelineElement >)> &C)
 
void registerPipelineParsingCallback (const std::function< bool(StringRef Name, ModulePassManager &, ArrayRef< PipelineElement >)> &C)
 
void registerParseTopLevelPipelineCallback (const std::function< bool(ModulePassManager &, ArrayRef< PipelineElement >, bool VerifyEachPass, bool DebugLogging)> &C)
 Register a callback for a top-level pipeline entry. More...
 
void addPGOInstrPassesForO0 (ModulePassManager &MPM, bool DebugLogging, bool RunProfileGen, bool IsCS, std::string ProfileFile, std::string ProfileRemappingFile)
 Add PGOInstrumenation passes for O0 only. More...
 
PassInstrumentationCallbacksgetPassInstrumentationCallbacks () const
 Returns PIC. More...
 

Detailed Description

This class provides access to building LLVM's passes.

Its members provide the baseline state available to passes during their construction. The PassRegistry.def file specifies how to construct all of the built-in passes, and those may reference these members during construction.

Definition at line 120 of file PassBuilder.h.

Member Enumeration Documentation

◆ ThinLTOPhase

ThinLTO phase.

This enumerates the LLVM ThinLTO optimization phases.

Enumerator
None 

No ThinLTO behavior needed.

PreLink 

ThinLTO prelink (summary) phase.

PostLink 

ThinLTO postlink (backend compile) phase.

Definition at line 143 of file PassBuilder.h.

Constructor & Destructor Documentation

◆ PassBuilder()

llvm::PassBuilder::PassBuilder ( TargetMachine TM = nullptr,
PipelineTuningOptions  PTO = PipelineTuningOptions(),
Optional< PGOOptions PGOOpt = None,
PassInstrumentationCallbacks PIC = nullptr 
)
inlineexplicit

Definition at line 262 of file PassBuilder.h.

References Phase.

Member Function Documentation

◆ addPGOInstrPassesForO0()

void PassBuilder::addPGOInstrPassesForO0 ( ModulePassManager MPM,
bool  DebugLogging,
bool  RunProfileGen,
bool  IsCS,
std::string  ProfileFile,
std::string  ProfileRemappingFile 
)

◆ buildDefaultAAPipeline()

AAManager PassBuilder::buildDefaultAAPipeline ( )

Build the default AAManager with the default alias analysis pipeline registered.

Definition at line 1587 of file PassBuilder.cpp.

References llvm::AAManager::registerFunctionAnalysis(), and llvm::AAManager::registerModuleAnalysis().

◆ buildFunctionSimplificationPipeline()

FunctionPassManager PassBuilder::buildFunctionSimplificationPipeline ( OptimizationLevel  Level,
ThinLTOPhase  Phase,
bool  DebugLogging = false 
)

Construct the core LLVM function canonicalization and simplification pipeline.

This is a long pipeline and uses most of the per-function optimization passes in LLVM to canonicalize and simplify the IR. It is suitable to run repeatedly over the IR and is not expected to destroy important information about the semantics of the IR.

Note that Level cannot be O0 here. The pipelines produced are only intended for use when attempting to optimize code. If frontends require some transformations for semantic reasons, they should explicitly build them.

Phase indicates the current ThinLTO phase.

Definition at line 557 of file PassBuilder.cpp.

References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), assert(), C, llvm::createCGSCCToFunctionPassAdaptor(), llvm::createFunctionToLoopPassAdaptor(), llvm::createModuleToFunctionPassAdaptor(), llvm::InlineParams::DefaultThreshold, llvm::InstrProfOptions::DoCounterPromotion, EnableCHR, EnableGVNHoist, EnableGVNSink, llvm::EnableMSSALoopDependency, llvm::ModuleInlinerWrapperPass::getPM(), llvm::PassBuilder::OptimizationLevel::getSpeedupLevel(), llvm::InlineParams::HintThreshold, llvm::InstrProfOptions::InstrProfileOutput, llvm::PGOOptions::IRUse, llvm::PassBuilder::OptimizationLevel::isOptimizingForSize(), PreInlineThreshold, RunNewGVN, llvm::PGOOptions::SampleUse, and llvm::InstrProfOptions::UseBFIInPromotion.

◆ buildInlinerPipeline()

ModuleInlinerWrapperPass PassBuilder::buildInlinerPipeline ( OptimizationLevel  Level,
ThinLTOPhase  Phase,
bool  DebugLogging = false 
)

◆ buildLTODefaultPipeline()

ModulePassManager PassBuilder::buildLTODefaultPipeline ( OptimizationLevel  Level,
bool  DebugLogging,
ModuleSummaryIndex ExportSummary 
)

Build an LTO default optimization pipeline to a pass manager.

This provides a good default optimization pipeline for link-time optimization and code generation. It is particularly tuned to fit well when IR coming into the LTO phase was first run through addPreLinkLTODefaultPipeline, and the two coordinate closely.

Note that Level cannot be O0 here. The pipelines produced are only intended for use when attempting to optimize code. If frontends require some transformations for semantic reasons, they should explicitly build them.

Definition at line 1355 of file PassBuilder.cpp.

References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), llvm::createModuleToFunctionPassAdaptor(), llvm::createModuleToPostOrderCGSCCPassAdaptor(), llvm::PGOOptions::CSIRInstr, llvm::PGOOptions::CSIRUse, getInlineParamsFromOptLevel(), llvm::PassBuilder::OptimizationLevel::getSpeedupLevel(), RunNewGVN, and llvm::PGOOptions::SampleUse.

◆ buildLTOPreLinkDefaultPipeline()

ModulePassManager PassBuilder::buildLTOPreLinkDefaultPipeline ( OptimizationLevel  Level,
bool  DebugLogging = false 
)

Build a pre-link, LTO-targeting default optimization pipeline to a pass manager.

This adds the pre-link optimizations tuned to work well with a later LTO run. It works to minimize the IR which needs to be analyzed without making irreversible decisions which could be made better during the LTO run.

Note that Level cannot be O0 here. The pipelines produced are only intended for use when attempting to optimize code. If frontends require some transformations for semantic reasons, they should explicitly build them.

Definition at line 1345 of file PassBuilder.cpp.

References assert().

◆ buildModuleOptimizationPipeline()

ModulePassManager PassBuilder::buildModuleOptimizationPipeline ( OptimizationLevel  Level,
bool  DebugLogging = false,
bool  LTOPreLink = false 
)

Construct the core LLVM module optimization pipeline.

This pipeline focuses on optimizing the execution speed of the IR. It uses cost modeling and thresholds to balance code growth against runtime improvements. It includes vectorization and other information destroying transformations. It also cannot generally be run repeatedly on a module without potentially seriously regressing either runtime performance of the code or serious code size growth.

Note that Level cannot be O0 here. The pipelines produced are only intended for use when attempting to optimize code. If frontends require some transformations for semantic reasons, they should explicitly build them.

Definition at line 1035 of file PassBuilder.cpp.

References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), C, llvm::createFunctionToLoopPassAdaptor(), llvm::createModuleToFunctionPassAdaptor(), llvm::PGOOptions::CSIRInstr, llvm::PGOOptions::CSIRUse, llvm::EnableMSSALoopDependency, EnableUnrollAndJam, llvm::PassBuilder::OptimizationLevel::getSpeedupLevel(), and RunPartialInlining.

◆ buildModuleSimplificationPipeline()

ModulePassManager PassBuilder::buildModuleSimplificationPipeline ( OptimizationLevel  Level,
ThinLTOPhase  Phase,
bool  DebugLogging = false 
)

Construct the core LLVM module canonicalization and simplification pipeline.

This pipeline focuses on canonicalizing and simplifying the entire module of IR. Much like the function simplification pipeline above, it is suitable to run repeatedly over the IR and is not expected to destroy important information. It does, however, perform inlining and other heuristic based simplifications that are not strictly reversible.

Note that Level cannot be O0 here. The pipelines produced are only intended for use when attempting to optimize code. If frontends require some transformations for semantic reasons, they should explicitly build them.

Phase indicates the current ThinLTO phase.

Definition at line 895 of file PassBuilder.cpp.

References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), llvm::createModuleToFunctionPassAdaptor(), llvm::PGOOptions::CSIRInstr, EnableSyntheticCounts, llvm::PGOOptions::IRInstr, llvm::PGOOptions::IRUse, llvm::MODULE, and llvm::PGOOptions::SampleUse.

◆ buildPerModuleDefaultPipeline()

ModulePassManager PassBuilder::buildPerModuleDefaultPipeline ( OptimizationLevel  Level,
bool  DebugLogging = false,
bool  LTOPreLink = false 
)

Build a per-module default optimization pipeline.

This provides a good default optimization pipeline for per-module optimization and code generation without any link-time optimization. It typically correspond to frontend "-O[123]" options for optimization levels O1, O2 and O3 resp.

Note that Level cannot be O0 here. The pipelines produced are only intended for use when attempting to optimize code. If frontends require some transformations for semantic reasons, they should explicitly build them.

Definition at line 1230 of file PassBuilder.cpp.

References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), assert(), C, llvm::createModuleToFunctionPassAdaptor(), and llvm::None.

◆ buildThinLTODefaultPipeline()

ModulePassManager PassBuilder::buildThinLTODefaultPipeline ( OptimizationLevel  Level,
bool  DebugLogging,
const ModuleSummaryIndex ImportSummary 
)

Build an ThinLTO default optimization pipeline to a pass manager.

This provides a good default optimization pipeline for link-time optimization and code generation. It is particularly tuned to fit well when IR coming into the LTO phase was first run through addPreLinkLTODefaultPipeline, and the two coordinate closely.

Note that Level cannot be O0 here. The pipelines produced are only intended for use when attempting to optimize code. If frontends require some transformations for semantic reasons, they should explicitly build them.

Definition at line 1303 of file PassBuilder.cpp.

References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass().

◆ buildThinLTOPreLinkDefaultPipeline()

ModulePassManager PassBuilder::buildThinLTOPreLinkDefaultPipeline ( OptimizationLevel  Level,
bool  DebugLogging = false 
)

Build a pre-link, ThinLTO-targeting default optimization pipeline to a pass manager.

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 without making irreversible decisions which could be made better during the LTO run.

Note that Level cannot be O0 here. The pipelines produced are only intended for use when attempting to optimize code. If frontends require some transformations for semantic reasons, they should explicitly build them.

Definition at line 1258 of file PassBuilder.cpp.

References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), assert(), C, llvm::createModuleToFunctionPassAdaptor(), and RunPartialInlining.

◆ crossRegisterProxies()

void PassBuilder::crossRegisterProxies ( LoopAnalysisManager LAM,
FunctionAnalysisManager FAM,
CGSCCAnalysisManager CGAM,
ModuleAnalysisManager MAM 
)

Cross register the analysis managers through their proxies.

This is an interface that can be used to cross register each AnalysisManager with all the others analysis managers.

Definition at line 2521 of file PassBuilder.cpp.

References llvm::AnalysisManager< IRUnitT, ExtraArgTs >::registerPass().

◆ getPassInstrumentationCallbacks()

PassInstrumentationCallbacks* llvm::PassBuilder::getPassInstrumentationCallbacks ( ) const
inline

Returns PIC.

External libraries can use this to register pass instrumentation callbacks.

Definition at line 687 of file PassBuilder.h.

References E, function, and Name.

◆ isAAPassName()

bool PassBuilder::isAAPassName ( StringRef  PassName)

Returns true if the pass name is the name of an alias analysis pass.

Definition at line 2678 of file PassBuilder.cpp.

◆ isAnalysisPassName()

bool PassBuilder::isAnalysisPassName ( StringRef  PassName)

Returns true if the pass name is the name of a (non-alias) analysis pass.

Definition at line 2686 of file PassBuilder.cpp.

◆ parseAAPipeline()

Error PassBuilder::parseAAPipeline ( AAManager AA,
StringRef  PipelineText 
)

Parse a textual alias analysis pipeline into the provided AA manager.

The format of the textual AA pipeline is a comma separated list of AA pass names:

basic-aa,globals-aa,...

The AA manager is set up such that the provided alias analyses are tried in the order specified. See the AAManaager documentation for details about the logic used. This routine just provides the textual mapping between AA names and the analyses to register with the manager.

Returns false if the text cannot be parsed cleanly. The specific state of the AA manager is unspecified if such an error is encountered and this returns false.

Definition at line 2658 of file PassBuilder.cpp.

References llvm::StringRef::empty(), llvm::formatv(), llvm::inconvertibleErrorCode(), Name, llvm::StringRef::split(), and llvm::Error::success().

◆ parsePassPipeline() [1/4]

Error PassBuilder::parsePassPipeline ( ModulePassManager MPM,
StringRef  PipelineText,
bool  VerifyEachPass = true,
bool  DebugLogging = false 
)

Parse a textual pass pipeline description into a ModulePassManager.

The format of the textual pass pipeline description looks something like:

module(function(instcombine,sroa),dce,cgscc(inliner,function(...)),...)

Pass managers have ()s describing the nest structure of passes. All passes are comma separated. As a special shortcut, if the very first pass is not a module pass (as a module pass manager is), this will automatically form the shortest stack of pass managers that allow inserting that first pass. So, assuming function passes 'fpassN', CGSCC passes 'cgpassN', and loop passes 'lpassN', all of these are valid:

fpass1,fpass2,fpass3 cgpass1,cgpass2,cgpass3 lpass1,lpass2,lpass3

And they are equivalent to the following (resp.):

module(function(fpass1,fpass2,fpass3)) module(cgscc(cgpass1,cgpass2,cgpass3)) module(function(loop(lpass1,lpass2,lpass3)))

This shortcut is especially useful for debugging and testing small pass combinations. Note that these shortcuts don't introduce any other magic. If the sequence of passes aren't all the exact same kind of pass, it will be an error. You cannot mix different levels implicitly, you must explicitly form a pass manager in which to nest passes.

Definition at line 2550 of file PassBuilder.cpp.

References C, llvm::ArrayRef< T >::empty(), llvm::formatv(), llvm::ArrayRef< T >::front(), llvm::inconvertibleErrorCode(), isCGSCCPassName(), isFunctionPassName(), isLoopPassName(), isModulePassName(), and llvm::Error::success().

◆ parsePassPipeline() [2/4]

Error PassBuilder::parsePassPipeline ( CGSCCPassManager CGPM,
StringRef  PipelineText,
bool  VerifyEachPass = true,
bool  DebugLogging = false 
)

{{@ Parse a textual pass pipeline description into a specific PassManager

Automatic deduction of an appropriate pass manager stack is not supported. For example, to insert a loop pass 'lpass' into a FunctionPassManager, this is the valid pipeline text:

function(lpass)

Definition at line 2593 of file PassBuilder.cpp.

References llvm::ArrayRef< T >::empty(), llvm::formatv(), llvm::ArrayRef< T >::front(), llvm::inconvertibleErrorCode(), and isCGSCCPassName().

◆ parsePassPipeline() [3/4]

Error PassBuilder::parsePassPipeline ( FunctionPassManager FPM,
StringRef  PipelineText,
bool  VerifyEachPass = true,
bool  DebugLogging = false 
)

◆ parsePassPipeline() [4/4]

Error PassBuilder::parsePassPipeline ( LoopPassManager LPM,
StringRef  PipelineText,
bool  VerifyEachPass = true,
bool  DebugLogging = false 
)

◆ registerAnalysisRegistrationCallback() [1/4]

void llvm::PassBuilder::registerAnalysisRegistrationCallback ( const std::function< void(CGSCCAnalysisManager &)> &  C)
inline

{{@ Register callbacks for analysis registration with this PassBuilder instance.

Callees register their analyses with the given AnalysisManager objects.

Definition at line 623 of file PassBuilder.h.

References C.

◆ registerAnalysisRegistrationCallback() [2/4]

void llvm::PassBuilder::registerAnalysisRegistrationCallback ( const std::function< void(FunctionAnalysisManager &)> &  C)
inline

Definition at line 627 of file PassBuilder.h.

References C.

◆ registerAnalysisRegistrationCallback() [3/4]

void llvm::PassBuilder::registerAnalysisRegistrationCallback ( const std::function< void(LoopAnalysisManager &)> &  C)
inline

Definition at line 631 of file PassBuilder.h.

References C.

◆ registerAnalysisRegistrationCallback() [4/4]

void llvm::PassBuilder::registerAnalysisRegistrationCallback ( const std::function< void(ModuleAnalysisManager &)> &  C)
inline

Definition at line 635 of file PassBuilder.h.

References C.

◆ registerCGSCCAnalyses()

void PassBuilder::registerCGSCCAnalyses ( CGSCCAnalysisManager CGAM)

Registers all available CGSCC analysis passes.

This is an interface that can be used to populate a CGSCCAnalysisManager with all registered CGSCC analyses. Callers can still manually register any additional analyses. Callers can also pre-register analyses and this will not override those.

Definition at line 408 of file PassBuilder.cpp.

References C.

◆ registerCGSCCOptimizerLateEPCallback()

void llvm::PassBuilder::registerCGSCCOptimizerLateEPCallback ( const std::function< void(CGSCCPassManager &, OptimizationLevel)> &  C)
inline

Register a callback for a default optimizer pipeline extension point.

This extension point allows adding CallGraphSCC passes at the end of the main CallGraphSCC passes and before any function simplification passes run by CGPassManager.

Definition at line 575 of file PassBuilder.h.

References C.

◆ registerFunctionAnalyses()

void PassBuilder::registerFunctionAnalyses ( FunctionAnalysisManager FAM)

Registers all available function analysis passes.

This is an interface that can be used to populate a FunctionAnalysisManager with all registered function analyses. Callers can still manually register any additional analyses. Callers can also pre-register analyses and this will not override those.

Definition at line 417 of file PassBuilder.cpp.

References C.

Referenced by llvm::orc::BlockFreqQuery::operator()().

◆ registerLateLoopOptimizationsEPCallback()

void llvm::PassBuilder::registerLateLoopOptimizationsEPCallback ( const std::function< void(LoopPassManager &, OptimizationLevel)> &  C)
inline

Register a callback for a default optimizer pipeline extension point.

This extension point allows adding late loop canonicalization and simplification passes. This is the last point in the loop optimization pipeline before loop deletion. Each pass added here must be an instance of LoopPass. This is the place to add passes that can remove loops, such as target- specific loop idiom recognition.

Definition at line 544 of file PassBuilder.h.

References C.

◆ registerLoopAnalyses()

void PassBuilder::registerLoopAnalyses ( LoopAnalysisManager LAM)

Registers all available loop analysis passes.

This is an interface that can be used to populate a LoopAnalysisManager with all registered loop analyses. Callers can still manually register any additional analyses.

Definition at line 426 of file PassBuilder.cpp.

References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), C, llvm::createFunctionToLoopPassAdaptor(), llvm::EnableMSSALoopDependency, llvm::PassBuilder::OptimizationLevel::getSpeedupLevel(), Phase, and llvm::PGOOptions::SampleUse.

◆ registerLoopOptimizerEndEPCallback()

void llvm::PassBuilder::registerLoopOptimizerEndEPCallback ( const std::function< void(LoopPassManager &, OptimizationLevel)> &  C)
inline

Register a callback for a default optimizer pipeline extension point.

This extension point allows adding loop passes to the end of the loop optimizer.

Definition at line 554 of file PassBuilder.h.

References C.

◆ registerModuleAnalyses()

void PassBuilder::registerModuleAnalyses ( ModuleAnalysisManager MAM)

Registers all available module analysis passes.

This is an interface that can be used to populate a ModuleAnalysisManager with all registered module analyses. Callers can still manually register any additional analyses. Callers can also pre-register analyses and this will not override those.

Definition at line 399 of file PassBuilder.cpp.

References C.

◆ registerOptimizerLastEPCallback()

void llvm::PassBuilder::registerOptimizerLastEPCallback ( const std::function< void(ModulePassManager &, OptimizationLevel)> &  C)
inline

Register a callback for a default optimizer pipeline extension point.

This extension point allows adding optimizations at the very end of the function optimization pipeline. A key difference between this and the legacy PassManager's OptimizerLast callback is that this extension point is not triggered at O0. Extensions to the O0 pipeline should append their passes to the end of the overall pipeline.

Definition at line 608 of file PassBuilder.h.

References C.

◆ registerParseAACallback()

void llvm::PassBuilder::registerParseAACallback ( const std::function< bool(StringRef Name, AAManager &AA)> &  C)
inline

Register a callback for parsing an AliasAnalysis Name to populate the given AAManager AA.

Definition at line 615 of file PassBuilder.h.

References C.

◆ registerParseTopLevelPipelineCallback()

void llvm::PassBuilder::registerParseTopLevelPipelineCallback ( const std::function< bool(ModulePassManager &, ArrayRef< PipelineElement >, bool VerifyEachPass, bool DebugLogging)> &  C)
inline

Register a callback for a top-level pipeline entry.

If the PassManager type is not given at the top level of the pipeline text, this Callback should be used to determine the appropriate stack of PassManagers and populate the passed ModulePassManager.

Definition at line 672 of file PassBuilder.h.

References C, llvm::PGOOptions::ProfileFile, and llvm::PGOOptions::ProfileRemappingFile.

◆ registerPeepholeEPCallback()

void llvm::PassBuilder::registerPeepholeEPCallback ( const std::function< void(FunctionPassManager &, OptimizationLevel)> &  C)
inline

Register a callback for a default optimizer pipeline extension point.

This extension point allows adding passes that perform peephole optimizations similar to the instruction combiner. These passes will be inserted after each instance of the instruction combiner pass.

Definition at line 530 of file PassBuilder.h.

References C.

◆ registerPipelineParsingCallback() [1/4]

void llvm::PassBuilder::registerPipelineParsingCallback ( const std::function< bool(StringRef Name, CGSCCPassManager &, ArrayRef< PipelineElement >)> &  C)
inline

{{@ Register pipeline parsing callbacks with this pass builder instance.

Using these callbacks, callers can parse both a single pass name, as well as entire sub-pipelines, and populate the PassManager instance accordingly.

Definition at line 645 of file PassBuilder.h.

References C.

◆ registerPipelineParsingCallback() [2/4]

void llvm::PassBuilder::registerPipelineParsingCallback ( const std::function< bool(StringRef Name, FunctionPassManager &, ArrayRef< PipelineElement >)> &  C)
inline

Definition at line 650 of file PassBuilder.h.

References C.

◆ registerPipelineParsingCallback() [3/4]

void llvm::PassBuilder::registerPipelineParsingCallback ( const std::function< bool(StringRef Name, LoopPassManager &, ArrayRef< PipelineElement >)> &  C)
inline

Definition at line 655 of file PassBuilder.h.

References C.

◆ registerPipelineParsingCallback() [4/4]

void llvm::PassBuilder::registerPipelineParsingCallback ( const std::function< bool(StringRef Name, ModulePassManager &, ArrayRef< PipelineElement >)> &  C)
inline

Definition at line 660 of file PassBuilder.h.

References C.

◆ registerPipelineStartEPCallback()

void llvm::PassBuilder::registerPipelineStartEPCallback ( const std::function< void(ModulePassManager &)> &  C)
inline

Register a callback for a default optimizer pipeline extension point.

This extension point allows adding optimization once at the start of the pipeline. This does not apply to 'backend' compiles (LTO and ThinLTO link-time pipelines).

Definition at line 596 of file PassBuilder.h.

References C.

◆ registerScalarOptimizerLateEPCallback()

void llvm::PassBuilder::registerScalarOptimizerLateEPCallback ( const std::function< void(FunctionPassManager &, OptimizationLevel)> &  C)
inline

Register a callback for a default optimizer pipeline extension point.

This extension point allows adding optimization passes after most of the main optimizations, but before the last cleanup-ish optimizations.

Definition at line 564 of file PassBuilder.h.

References C.

◆ registerVectorizerStartEPCallback()

void llvm::PassBuilder::registerVectorizerStartEPCallback ( const std::function< void(FunctionPassManager &, OptimizationLevel)> &  C)
inline

Register a callback for a default optimizer pipeline extension point.

This extension point allows adding optimization passes before the vectorizer and other highly target specific optimization passes are executed.

Definition at line 586 of file PassBuilder.h.

References C.


The documentation for this class was generated from the following files: