class PassBuilder

Declaration

class PassBuilder { /* full declaration omitted */ };

Description

This class provides access to building LLVM's passes. Its members provide the baseline state available to passes during their construction. The \c PassRegistry.def file specifies how to construct all of the built-in passes, and those may reference these members during construction.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:94

Member Variables

private llvm::TargetMachine* TM
private llvm::PipelineTuningOptions PTO
private Optional<llvm::PGOOptions> PGOOpt
private llvm::PassInstrumentationCallbacks* PIC
private SmallVector< std::function<void(FunctionPassManager&, OptimizationLevel)>, 2> PeepholeEPCallbacks
private SmallVector< std::function<void(LoopPassManager&, OptimizationLevel)>, 2> LateLoopOptimizationsEPCallbacks
private SmallVector< std::function<void(LoopPassManager&, OptimizationLevel)>, 2> LoopOptimizerEndEPCallbacks
private SmallVector< std::function<void(FunctionPassManager&, OptimizationLevel)>, 2> ScalarOptimizerLateEPCallbacks
private SmallVector< std::function<void(CGSCCPassManager&, OptimizationLevel)>, 2> CGSCCOptimizerLateEPCallbacks
private SmallVector< std::function<void(FunctionPassManager&, OptimizationLevel)>, 2> VectorizerStartEPCallbacks
private SmallVector< std::function<void(ModulePassManager&, OptimizationLevel)>, 2> OptimizerEarlyEPCallbacks
private SmallVector< std::function<void(ModulePassManager&, OptimizationLevel)>, 2> OptimizerLastEPCallbacks
private SmallVector< std::function<void(ModulePassManager&, OptimizationLevel)>, 2> FullLinkTimeOptimizationEarlyEPCallbacks
private SmallVector< std::function<void(ModulePassManager&, OptimizationLevel)>, 2> FullLinkTimeOptimizationLastEPCallbacks
private SmallVector< std::function<void(ModulePassManager&, OptimizationLevel)>, 2> PipelineStartEPCallbacks
private SmallVector< std::function<void(ModulePassManager&, OptimizationLevel)>, 2> PipelineEarlySimplificationEPCallbacks
private SmallVector< std::function<void(ModuleAnalysisManager&)>, 2> ModuleAnalysisRegistrationCallbacks
private SmallVector<std::function<bool( StringRef, ModulePassManager&, ArrayRef<PipelineElement>)>, 2> ModulePipelineParsingCallbacks
private SmallVector<std::function<bool( ModulePassManager&, ArrayRef<PipelineElement>)>, 2> TopLevelPipelineParsingCallbacks
private SmallVector< std::function<void(CGSCCAnalysisManager&)>, 2> CGSCCAnalysisRegistrationCallbacks
private SmallVector<std::function<bool( StringRef, CGSCCPassManager&, ArrayRef<PipelineElement>)>, 2> CGSCCPipelineParsingCallbacks
private SmallVector< std::function<void(FunctionAnalysisManager&)>, 2> FunctionAnalysisRegistrationCallbacks
private SmallVector<std::function<bool( StringRef, FunctionPassManager&, ArrayRef<PipelineElement>)>, 2> FunctionPipelineParsingCallbacks
private SmallVector< std::function<void(LoopAnalysisManager&)>, 2> LoopAnalysisRegistrationCallbacks
private SmallVector<std::function<bool( StringRef, LoopPassManager&, ArrayRef<PipelineElement>)>, 2> LoopPipelineParsingCallbacks
private SmallVector< std::function<bool(StringRef, AAManager&)>, 2> AAParsingCallbacks

Method Overview

Methods

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

Declared at: llvm/include/llvm/Passes/PassBuilder.h:114

Parameters

llvm::TargetMachine* TM = nullptr
llvm::PipelineTuningOptions PTO = llvm::PipelineTuningOptions()
Optional<llvm::PGOOptions> PGOOpt = None
llvm::PassInstrumentationCallbacks* PIC = nullptr

void addPGOInstrPasses(
    llvm::ModulePassManager& MPM,
    llvm::OptimizationLevel Level,
    bool RunProfileGen,
    bool IsCS,
    std::string ProfileFile,
    std::string ProfileRemappingFile,
    llvm::ThinOrFullLTOPhase LTOPhase)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:611

Parameters

llvm::ModulePassManager& MPM
llvm::OptimizationLevel Level
bool RunProfileGen
bool IsCS
std::string ProfileFile
std::string ProfileRemappingFile
llvm::ThinOrFullLTOPhase LTOPhase

void addPGOInstrPassesForO0(
    llvm::ModulePassManager& MPM,
    bool RunProfileGen,
    bool IsCS,
    std::string ProfileFile,
    std::string ProfileRemappingFile)

Description

Add PGOInstrumenation passes for O0 only.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:572

Parameters

llvm::ModulePassManager& MPM
bool RunProfileGen
bool IsCS
std::string ProfileFile
std::string ProfileRemappingFile

void addRequiredLTOPreLinkPasses(
    llvm::ModulePassManager& MPM)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:588

Parameters

llvm::ModulePassManager& MPM

void addVectorPasses(
    llvm::OptimizationLevel Level,
    llvm::FunctionPassManager& FPM,
    bool IsFullLTO)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:590

Parameters

llvm::OptimizationLevel Level
llvm::FunctionPassManager& FPM
bool IsFullLTO

llvm::AAManager buildDefaultAAPipeline()

Description

Build the default `AAManager` with the default alias analysis pipeline registered. This also adds target-specific alias analyses registered via TargetMachine::registerDefaultAliasAnalyses().

Declared at: llvm/include/llvm/Passes/PassBuilder.h:304

llvm::FunctionPassManager
buildFunctionSimplificationPipeline(
    llvm::OptimizationLevel Level,
    llvm::ThinOrFullLTOPhase Phase)

Description

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 \p 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. \p Phase indicates the current ThinLTO phase.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:174

Parameters

llvm::OptimizationLevel Level
llvm::ThinOrFullLTOPhase Phase

llvm::ModuleInlinerWrapperPass
buildInlinerPipeline(
    llvm::OptimizationLevel Level,
    llvm::ThinOrFullLTOPhase Phase)

Description

Construct the module pipeline that performs inlining as well as the inlining-driven cleanups.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:197

Parameters

llvm::OptimizationLevel Level
llvm::ThinOrFullLTOPhase Phase

llvm::ModulePassManager buildLTODefaultPipeline(
    llvm::OptimizationLevel Level,
    llvm::ModuleSummaryIndex* ExportSummary)

Description

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 \c addPreLinkLTODefaultPipeline, and the two coordinate closely. Note that \p 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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:290

Parameters

llvm::OptimizationLevel Level
llvm::ModuleSummaryIndex* ExportSummary

llvm::ModulePassManager
buildLTOPreLinkDefaultPipeline(
    llvm::OptimizationLevel Level)

Description

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 \p 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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:277

Parameters

llvm::OptimizationLevel Level

llvm::ModulePassManager
buildModuleInlinerPipeline(
    llvm::OptimizationLevel Level,
    llvm::ThinOrFullLTOPhase Phase)

Description

Construct the module pipeline that performs inlining with module inliner pass.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:202

Parameters

llvm::OptimizationLevel Level
llvm::ThinOrFullLTOPhase Phase

llvm::ModulePassManager
buildModuleOptimizationPipeline(
    llvm::OptimizationLevel Level,
    llvm::ThinOrFullLTOPhase LTOPhase)

Description

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 \p 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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:219

Parameters

llvm::OptimizationLevel Level
llvm::ThinOrFullLTOPhase LTOPhase

llvm::ModulePassManager
buildModuleSimplificationPipeline(
    llvm::OptimizationLevel Level,
    llvm::ThinOrFullLTOPhase Phase)

Description

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 \p 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. \p Phase indicates the current ThinLTO phase.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:192

Parameters

llvm::OptimizationLevel Level
llvm::ThinOrFullLTOPhase Phase

llvm::ModulePassManager buildO0DefaultPipeline(
    llvm::OptimizationLevel Level,
    bool LTOPreLink = false)

Description

Build an O0 pipeline with the minimal semantically required passes. This should only be used for non-LTO and LTO pre-link pipelines.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:296

Parameters

llvm::OptimizationLevel Level
bool LTOPreLink = false

llvm::FunctionPassManager
buildO1FunctionSimplificationPipeline(
    llvm::OptimizationLevel Level,
    llvm::ThinOrFullLTOPhase Phase)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:585

Parameters

llvm::OptimizationLevel Level
llvm::ThinOrFullLTOPhase Phase

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

Description

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 \c O1, \c O2 and \c O3 resp. Note that \p 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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:233

Parameters

llvm::OptimizationLevel Level
bool LTOPreLink = false

llvm::ModulePassManager
buildThinLTODefaultPipeline(
    llvm::OptimizationLevel Level,
    const llvm::ModuleSummaryIndex* ImportSummary)

Description

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 \c addPreLinkLTODefaultPipeline, and the two coordinate closely. Note that \p 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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:262

Parameters

llvm::OptimizationLevel Level
const llvm::ModuleSummaryIndex* ImportSummary

llvm::ModulePassManager
buildThinLTOPreLinkDefaultPipeline(
    llvm::OptimizationLevel Level)

Description

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 \p 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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:248

Parameters

llvm::OptimizationLevel Level

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

Description

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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:123

Parameters

llvm::LoopAnalysisManager& LAM
llvm::FunctionAnalysisManager& FAM
llvm::CGSCCAnalysisManager& CGAM
llvm::ModuleAnalysisManager& MAM

llvm::PassInstrumentationCallbacks*
getPassInstrumentationCallbacks() const

Description

Returns PIC. External libraries can use this to register pass instrumentation callbacks.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:578

void invokePeepholeEPCallbacks(
    llvm::FunctionPassManager&,
    llvm::OptimizationLevel)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:615

Parameters

llvm::FunctionPassManager&
llvm::OptimizationLevel

bool isAAPassName(llvm::StringRef PassName)

Description

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

Declared at: llvm/include/llvm/Passes/PassBuilder.h:378

Parameters

llvm::StringRef PassName

bool isAnalysisPassName(llvm::StringRef PassName)

Description

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

Declared at: llvm/include/llvm/Passes/PassBuilder.h:381

Parameters

llvm::StringRef PassName

bool parseAAPassName(llvm::AAManager& AA,
                     llvm::StringRef Name)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:600

Parameters

llvm::AAManager& AA
llvm::StringRef Name

llvm::Error parseAAPipeline(
    llvm::AAManager& AA,
    llvm::StringRef PipelineText)

Description

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 \c 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 \p AA manager is unspecified if such an error is encountered and this returns false.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:375

Parameters

llvm::AAManager& AA
llvm::StringRef PipelineText

llvm::Error parseCGSCCPass(
    llvm::CGSCCPassManager& CGPM,
    const llvm::PassBuilder::PipelineElement& E)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:597

Parameters

llvm::CGSCCPassManager& CGPM
const llvm::PassBuilder::PipelineElement& E

llvm::Error parseCGSCCPassPipeline(
    llvm::CGSCCPassManager& CGPM,
    ArrayRef<llvm::PassBuilder::PipelineElement>
        Pipeline)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:606

Parameters

llvm::CGSCCPassManager& CGPM
ArrayRef<llvm::PassBuilder::PipelineElement> Pipeline

llvm::Error parseFunctionPass(
    llvm::FunctionPassManager& FPM,
    const llvm::PassBuilder::PipelineElement& E)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:598

Parameters

llvm::FunctionPassManager& FPM
const llvm::PassBuilder::PipelineElement& E

llvm::Error parseFunctionPassPipeline(
    llvm::FunctionPassManager& FPM,
    ArrayRef<llvm::PassBuilder::PipelineElement>
        Pipeline)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:604

Parameters

llvm::FunctionPassManager& FPM
ArrayRef<llvm::PassBuilder::PipelineElement> Pipeline

llvm::Error parseLoopPass(
    llvm::LoopPassManager& LPM,
    const llvm::PassBuilder::PipelineElement& E)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:599

Parameters

llvm::LoopPassManager& LPM
const llvm::PassBuilder::PipelineElement& E

llvm::Error parseLoopPassPipeline(
    llvm::LoopPassManager& LPM,
    ArrayRef<llvm::PassBuilder::PipelineElement>
        Pipeline)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:602

Parameters

llvm::LoopPassManager& LPM
ArrayRef<llvm::PassBuilder::PipelineElement> Pipeline

llvm::Error parseModulePass(
    llvm::ModulePassManager& MPM,
    const llvm::PassBuilder::PipelineElement& E)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:596

Parameters

llvm::ModulePassManager& MPM
const llvm::PassBuilder::PipelineElement& E

llvm::Error parseModulePassPipeline(
    llvm::ModulePassManager& MPM,
    ArrayRef<llvm::PassBuilder::PipelineElement>
        Pipeline)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:608

Parameters

llvm::ModulePassManager& MPM
ArrayRef<llvm::PassBuilder::PipelineElement> Pipeline

llvm::Error parsePassPipeline(
    llvm::CGSCCPassManager& CGPM,
    llvm::StringRef PipelineText)

Description

{{ @ 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)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:355

Parameters

llvm::CGSCCPassManager& CGPM
llvm::StringRef PipelineText

llvm::Error parsePassPipeline(
    llvm::LoopPassManager& LPM,
    llvm::StringRef PipelineText)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:357

Parameters

llvm::LoopPassManager& LPM
llvm::StringRef PipelineText

llvm::Error parsePassPipeline(
    llvm::ModulePassManager& MPM,
    llvm::StringRef PipelineText)

Description

Parse a textual pass pipeline description into a \c 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. The sequence of passes aren't necessarily the exact same kind of pass. You can mix different levels implicitly if adaptor passes are defined to make them work. For example, mpass1,fpass1,fpass2,mpass2,lpass1 This pipeline uses only one pass manager: the top-level module manager. fpass1,fpass2 and lpass1 are added into the the top-level module manager using only adaptor passes. No nested function/loop pass managers are added. The purpose is to allow easy pass testing when the user specifically want the pass to run under a adaptor directly. This is preferred when a pipeline is largely of one type, but one or just a few passes are of different types(See PassBuilder.cpp for examples).

Declared at: llvm/include/llvm/Passes/PassBuilder.h:346

Parameters

llvm::ModulePassManager& MPM
llvm::StringRef PipelineText

llvm::Error parsePassPipeline(
    llvm::FunctionPassManager& FPM,
    llvm::StringRef PipelineText)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:356

Parameters

llvm::FunctionPassManager& FPM
llvm::StringRef PipelineText

static Optional<std::vector<PipelineElement>>
parsePipelineText(llvm::StringRef Text)

Declared at: llvm/include/llvm/Passes/PassBuilder.h:594

Parameters

llvm::StringRef Text

void printPassNames(llvm::raw_ostream& OS)

Description

Print pass names.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:384

Parameters

llvm::raw_ostream& OS

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

Description

{{ @ Register callbacks for analysis registration with this PassBuilder instance. Callees register their analyses with the given AnalysisManager objects.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:518

Parameters

const std::function<void(CGSCCAnalysisManager&)>& C

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

Declared at: llvm/include/llvm/Passes/PassBuilder.h:522

Parameters

const std::function<void( FunctionAnalysisManager&)>& C

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

Declared at: llvm/include/llvm/Passes/PassBuilder.h:526

Parameters

const std::function<void(LoopAnalysisManager&)>& C

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

Declared at: llvm/include/llvm/Passes/PassBuilder.h:530

Parameters

const std::function<void(ModuleAnalysisManager&)>& C

void registerCGSCCAnalyses(
    llvm::CGSCCAnalysisManager& CGAM)

Description

Registers all available CGSCC analysis passes. This is an interface that can be used to populate a \c 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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:142

Parameters

llvm::CGSCCAnalysisManager& CGAM

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

Description

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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:437

Parameters

const std::function<void(CGSCCPassManager&, OptimizationLevel)>& C

void registerFullLinkTimeOptimizationEarlyEPCallback(
    const std::function<void(ModulePassManager&,
                             OptimizationLevel)>&
        C)

Description

Register a callback for a default optimizer pipeline extension point This extension point allows adding optimizations at the start of the full LTO pipeline.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:494

Parameters

const std::function<void(ModulePassManager&, OptimizationLevel)>& C

void registerFullLinkTimeOptimizationLastEPCallback(
    const std::function<void(ModulePassManager&,
                             OptimizationLevel)>&
        C)

Description

Register a callback for a default optimizer pipeline extension point This extension point allows adding optimizations at the end of the full LTO pipeline.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:503

Parameters

const std::function<void(ModulePassManager&, OptimizationLevel)>& C

void registerFunctionAnalyses(
    llvm::FunctionAnalysisManager& FAM)

Description

Registers all available function analysis passes. This is an interface that can be used to populate a \c 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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:150

Parameters

llvm::FunctionAnalysisManager& FAM

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

Description

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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:406

Parameters

const std::function<void(LoopPassManager&, OptimizationLevel)>& C

void registerLoopAnalyses(
    llvm::LoopAnalysisManager& LAM)

Description

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

Declared at: llvm/include/llvm/Passes/PassBuilder.h:157

Parameters

llvm::LoopAnalysisManager& LAM

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

Description

Register a callback for a default optimizer pipeline extension point This extension point allows adding loop passes to the end of the loop optimizer.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:416

Parameters

const std::function<void(LoopPassManager&, OptimizationLevel)>& C

void registerModuleAnalyses(
    llvm::ModuleAnalysisManager& MAM)

Description

Registers all available module analysis passes. This is an interface that can be used to populate a \c 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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:134

Parameters

llvm::ModuleAnalysisManager& MAM

void registerOptimizerEarlyEPCallback(
    const std::function<void(ModulePassManager&,
                             OptimizationLevel)>&
        C)

Description

Register a callback for a default optimizer pipeline extension point This extension point allows adding optimizations before the function optimization pipeline.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:476

Parameters

const std::function<void(ModulePassManager&, OptimizationLevel)>& C

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

Description

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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:485

Parameters

const std::function<void(ModulePassManager&, OptimizationLevel)>& C

void registerParseAACallback(
    const std::function<bool(StringRef,
                             AAManager&)>& C)

Description

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

Declared at: llvm/include/llvm/Passes/PassBuilder.h:510

Parameters

const std::function<bool(StringRef, AAManager&)>& C

void registerParseTopLevelPipelineCallback(
    const std::function<
        bool(ModulePassManager&,
             ArrayRef<PipelineElement>)>& C)

Description

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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:567

Parameters

const std::function<bool( ModulePassManager&, ArrayRef<PipelineElement>)>& C

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

Description

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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:392

Parameters

const std::function<void(FunctionPassManager&, OptimizationLevel)>& C

void registerPipelineEarlySimplificationEPCallback(
    const std::function<void(ModulePassManager&,
                             OptimizationLevel)>&
        C)

Description

Register a callback for a default optimizer pipeline extension point. This extension point allows adding optimization right after passes that do basic simplification of the input IR.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:467

Parameters

const std::function<void(ModulePassManager&, OptimizationLevel)>& C

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

Declared at: llvm/include/llvm/Passes/PassBuilder.h:555

Parameters

const std::function<bool( StringRef, ModulePassManager&, ArrayRef<PipelineElement>)>& C

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

Declared at: llvm/include/llvm/Passes/PassBuilder.h:550

Parameters

const std::function<bool( StringRef, LoopPassManager&, ArrayRef<PipelineElement>)>& C

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

Declared at: llvm/include/llvm/Passes/PassBuilder.h:545

Parameters

const std::function<bool( StringRef, FunctionPassManager&, ArrayRef<PipelineElement>)>& C

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

Description

{{ @ 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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:540

Parameters

const std::function<bool( StringRef, CGSCCPassManager&, ArrayRef<PipelineElement>)>& C

void registerPipelineStartEPCallback(
    const std::function<void(ModulePassManager&,
                             OptimizationLevel)>&
        C)

Description

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).

Declared at: llvm/include/llvm/Passes/PassBuilder.h:458

Parameters

const std::function<void(ModulePassManager&, OptimizationLevel)>& C

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

Description

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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:426

Parameters

const std::function<void(FunctionPassManager&, OptimizationLevel)>& C

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

Description

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.

Declared at: llvm/include/llvm/Passes/PassBuilder.h:448

Parameters

const std::function<void(FunctionPassManager&, OptimizationLevel)>& C