LLVM 20.0.0git
Classes | Public Member Functions | Static 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

struct  PipelineElement
 A struct to capture parsed pass pipeline names. More...
 

Public Member Functions

 PassBuilder (TargetMachine *TM=nullptr, PipelineTuningOptions PTO=PipelineTuningOptions(), std::optional< PGOOptions > PGOOpt=std::nullopt, PassInstrumentationCallbacks *PIC=nullptr)
 
void crossRegisterProxies (LoopAnalysisManager &LAM, FunctionAnalysisManager &FAM, CGSCCAnalysisManager &CGAM, ModuleAnalysisManager &MAM, MachineFunctionAnalysisManager *MFAM=nullptr)
 Cross register the analysis managers through their proxies.
 
void registerModuleAnalyses (ModuleAnalysisManager &MAM)
 Registers all available module analysis passes.
 
void registerCGSCCAnalyses (CGSCCAnalysisManager &CGAM)
 Registers all available CGSCC analysis passes.
 
void registerFunctionAnalyses (FunctionAnalysisManager &FAM)
 Registers all available function analysis passes.
 
void registerLoopAnalyses (LoopAnalysisManager &LAM)
 Registers all available loop analysis passes.
 
void registerMachineFunctionAnalyses (MachineFunctionAnalysisManager &MFAM)
 Registers all available machine function analysis passes.
 
FunctionPassManager buildFunctionSimplificationPipeline (OptimizationLevel Level, ThinOrFullLTOPhase Phase)
 Construct the core LLVM function canonicalization and simplification pipeline.
 
ModulePassManager buildModuleSimplificationPipeline (OptimizationLevel Level, ThinOrFullLTOPhase Phase)
 Construct the core LLVM module canonicalization and simplification pipeline.
 
ModuleInlinerWrapperPass buildInlinerPipeline (OptimizationLevel Level, ThinOrFullLTOPhase Phase)
 Construct the module pipeline that performs inlining as well as the inlining-driven cleanups.
 
ModulePassManager buildModuleInlinerPipeline (OptimizationLevel Level, ThinOrFullLTOPhase Phase)
 Construct the module pipeline that performs inlining with module inliner pass.
 
ModulePassManager buildModuleOptimizationPipeline (OptimizationLevel Level, ThinOrFullLTOPhase LTOPhase)
 Construct the core LLVM module optimization pipeline.
 
ModulePassManager buildPerModuleDefaultPipeline (OptimizationLevel Level, bool LTOPreLink=false)
 Build a per-module default optimization pipeline.
 
ModulePassManager buildFatLTODefaultPipeline (OptimizationLevel Level, bool ThinLTO, bool EmitSummary)
 Build a fat object default optimization pipeline.
 
ModulePassManager buildThinLTOPreLinkDefaultPipeline (OptimizationLevel Level)
 Build a pre-link, ThinLTO-targeting default optimization pipeline to a pass manager.
 
ModulePassManager buildThinLTODefaultPipeline (OptimizationLevel Level, const ModuleSummaryIndex *ImportSummary)
 Build a ThinLTO default optimization pipeline to a pass manager.
 
ModulePassManager buildLTOPreLinkDefaultPipeline (OptimizationLevel Level)
 Build a pre-link, LTO-targeting default optimization pipeline to a pass manager.
 
ModulePassManager buildLTODefaultPipeline (OptimizationLevel Level, ModuleSummaryIndex *ExportSummary)
 Build an LTO default optimization pipeline to a pass manager.
 
ModulePassManager buildO0DefaultPipeline (OptimizationLevel Level, bool LTOPreLink=false)
 Build an O0 pipeline with the minimal semantically required passes.
 
AAManager buildDefaultAAPipeline ()
 Build the default AAManager with the default alias analysis pipeline registered.
 
Error parsePassPipeline (ModulePassManager &MPM, StringRef PipelineText)
 Parse a textual pass pipeline description into a ModulePassManager.
 
Error parsePassPipeline (CGSCCPassManager &CGPM, StringRef PipelineText)
 {{@ Parse a textual pass pipeline description into a specific PassManager
 
Error parsePassPipeline (FunctionPassManager &FPM, StringRef PipelineText)
 
Error parsePassPipeline (LoopPassManager &LPM, StringRef PipelineText)
 
Error parsePassPipeline (MachineFunctionPassManager &MFPM, StringRef PipelineText)
 Parse a textual MIR pipeline into the provided MachineFunctionPass manager.
 
Error parseAAPipeline (AAManager &AA, StringRef PipelineText)
 Parse a textual alias analysis pipeline into the provided AA manager.
 
std::optional< RegAllocFilterFuncparseRegAllocFilter (StringRef RegAllocFilterName)
 Parse RegAllocFilterName to get RegAllocFilterFunc.
 
void printPassNames (raw_ostream &OS)
 Print pass names.
 
void registerPeepholeEPCallback (const std::function< void(FunctionPassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point.
 
void registerLateLoopOptimizationsEPCallback (const std::function< void(LoopPassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point.
 
void registerLoopOptimizerEndEPCallback (const std::function< void(LoopPassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point.
 
void registerScalarOptimizerLateEPCallback (const std::function< void(FunctionPassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point.
 
void registerCGSCCOptimizerLateEPCallback (const std::function< void(CGSCCPassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point.
 
void registerVectorizerStartEPCallback (const std::function< void(FunctionPassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point.
 
void registerPipelineStartEPCallback (const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point.
 
void registerPipelineEarlySimplificationEPCallback (const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point.
 
void registerOptimizerEarlyEPCallback (const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point.
 
void registerOptimizerLastEPCallback (const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point.
 
void registerFullLinkTimeOptimizationEarlyEPCallback (const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point.
 
void registerFullLinkTimeOptimizationLastEPCallback (const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
 Register a callback for a default optimizer pipeline extension point.
 
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.
 
void registerAnalysisRegistrationCallback (const std::function< void(CGSCCAnalysisManager &)> &C)
 {{@ Register callbacks for analysis registration with this PassBuilder instance.
 
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 registerAnalysisRegistrationCallback (const std::function< void(MachineFunctionAnalysisManager &)> &C)
 
void registerPipelineParsingCallback (const std::function< bool(StringRef Name, CGSCCPassManager &, ArrayRef< PipelineElement >)> &C)
 {{@ Register pipeline parsing callbacks with this pass builder instance.
 
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 registerPipelineParsingCallback (const std::function< bool(StringRef Name, MachineFunctionPassManager &, ArrayRef< PipelineElement >)> &C)
 
void registerRegClassFilterParsingCallback (const std::function< RegAllocFilterFunc(StringRef)> &C)
 Register callbacks to parse target specific filter field if regalloc pass needs it.
 
void registerParseTopLevelPipelineCallback (const std::function< bool(ModulePassManager &, ArrayRef< PipelineElement >)> &C)
 Register a callback for a top-level pipeline entry.
 
void addPGOInstrPassesForO0 (ModulePassManager &MPM, bool RunProfileGen, bool IsCS, bool AtomicCounterUpdate, std::string ProfileFile, std::string ProfileRemappingFile, IntrusiveRefCntPtr< vfs::FileSystem > FS)
 Add PGOInstrumenation passes for O0 only.
 
PassInstrumentationCallbacksgetPassInstrumentationCallbacks () const
 Returns PIC.
 
void invokePeepholeEPCallbacks (FunctionPassManager &FPM, OptimizationLevel Level)
 
void invokeLateLoopOptimizationsEPCallbacks (LoopPassManager &LPM, OptimizationLevel Level)
 
void invokeLoopOptimizerEndEPCallbacks (LoopPassManager &LPM, OptimizationLevel Level)
 
void invokeScalarOptimizerLateEPCallbacks (FunctionPassManager &FPM, OptimizationLevel Level)
 
void invokeCGSCCOptimizerLateEPCallbacks (CGSCCPassManager &CGPM, OptimizationLevel Level)
 
void invokeVectorizerStartEPCallbacks (FunctionPassManager &FPM, OptimizationLevel Level)
 
void invokeOptimizerEarlyEPCallbacks (ModulePassManager &MPM, OptimizationLevel Level)
 
void invokeOptimizerLastEPCallbacks (ModulePassManager &MPM, OptimizationLevel Level)
 
void invokeFullLinkTimeOptimizationEarlyEPCallbacks (ModulePassManager &MPM, OptimizationLevel Level)
 
void invokeFullLinkTimeOptimizationLastEPCallbacks (ModulePassManager &MPM, OptimizationLevel Level)
 
void invokePipelineStartEPCallbacks (ModulePassManager &MPM, OptimizationLevel Level)
 
void invokePipelineEarlySimplificationEPCallbacks (ModulePassManager &MPM, OptimizationLevel Level)
 

Static Public Member Functions

static bool checkParametrizedPassName (StringRef Name, StringRef PassName)
 
template<typename ParametersParseCallableT >
static auto parsePassParameters (ParametersParseCallableT &&Parser, StringRef Name, StringRef PassName) -> decltype(Parser(StringRef{}))
 This performs customized parsing of pass name with parameters.
 
static Expected< boolparseSinglePassOption (StringRef Params, StringRef OptionName, StringRef PassName)
 Handle passes only accept one bool-valued parameter.
 

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 106 of file PassBuilder.h.

Constructor & Destructor Documentation

◆ PassBuilder()

PassBuilder::PassBuilder ( TargetMachine TM = nullptr,
PipelineTuningOptions  PTO = PipelineTuningOptions(),
std::optional< PGOOptions PGOOpt = std::nullopt,
PassInstrumentationCallbacks PIC = nullptr 
)
explicit

Member Function Documentation

◆ addPGOInstrPassesForO0()

void PassBuilder::addPGOInstrPassesForO0 ( ModulePassManager MPM,
bool  RunProfileGen,
bool  IsCS,
bool  AtomicCounterUpdate,
std::string  ProfileFile,
std::string  ProfileRemappingFile,
IntrusiveRefCntPtr< vfs::FileSystem FS 
)

Add PGOInstrumenation passes for O0 only.

Definition at line 868 of file PassBuilderPipelines.cpp.

References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), assert(), llvm::CSFDO, llvm::FDO, and Options.

Referenced by buildO0DefaultPipeline().

◆ buildDefaultAAPipeline()

AAManager PassBuilder::buildDefaultAAPipeline ( )

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

This also adds target-specific alias analyses registered via TargetMachine::registerDefaultAliasAnalyses().

Definition at line 2197 of file PassBuilderPipelines.cpp.

References EnableGlobalAnalyses, llvm::TargetMachine::registerDefaultAliasAnalyses(), llvm::AAManager::registerFunctionAnalysis(), and llvm::AAManager::registerModuleAnalysis().

Referenced by parseAAPipeline(), and registerFunctionAnalyses().

◆ buildFatLTODefaultPipeline()

ModulePassManager PassBuilder::buildFatLTODefaultPipeline ( OptimizationLevel  Level,
bool  ThinLTO,
bool  EmitSummary 
)

Build a fat object default optimization pipeline.

This builds a pipeline that runs the LTO/ThinLTO pre-link pipeline, and emits a section containing the pre-link bitcode along side the object code generated in non-LTO compilation.

Definition at line 1627 of file PassBuilderPipelines.cpp.

References addAnnotationRemarksPass(), llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), buildLTOPreLinkDefaultPipeline(), buildModuleOptimizationPipeline(), buildThinLTODefaultPipeline(), buildThinLTOPreLinkDefaultPipeline(), llvm::None, and llvm::PGOOptions::SampleUse.

◆ buildFunctionSimplificationPipeline()

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

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 549 of file PassBuilderPipelines.cpp.

References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), llvm::PassManager< Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & >::addPass(), llvm::AreStatisticsEnabled(), assert(), llvm::createFunctionToLoopPassAdaptor(), EnableConstraintElimination, EnableDFAJumpThreading, EnableGVNHoist, EnableGVNSink, EnableJumpTableToSwitch, llvm::EnableKnowledgeRetention, EnableLoopFlatten, EnableLoopHeaderDuplication, EnableLoopInterchange, llvm::PipelineTuningOptions::ForgetAllSCEVInLoopUnroll, invokeLateLoopOptimizationsEPCallbacks(), invokeLoopOptimizerEndEPCallbacks(), invokePeepholeEPCallbacks(), invokeScalarOptimizerLateEPCallbacks(), llvm::PGOOptions::IRUse, isLTOPreLink(), llvm::PipelineTuningOptions::LicmMssaNoAccForPromotionCap, llvm::PipelineTuningOptions::LicmMssaOptCap, llvm::PipelineTuningOptions::LoopUnrolling, llvm::ModifyCFG, llvm::OptimizationLevel::O0, llvm::OptimizationLevel::O3, llvm::OptimizationLevel::Oz, Phase, RunNewGVN, llvm::PGOOptions::SampleUse, and llvm::ThinLTOPreLink.

Referenced by buildInlinerPipeline(), and buildModuleInlinerPipeline().

◆ buildInlinerPipeline()

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

◆ buildLTODefaultPipeline()

ModulePassManager PassBuilder::buildLTODefaultPipeline ( OptimizationLevel  Level,
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 buildLTOPreLinkDefaultPipeline, and the two coordinate closely.

Definition at line 1772 of file PassBuilderPipelines.cpp.

References addAnnotationRemarksPass(), llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), llvm::PassManager< Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & >::addPass(), llvm::PipelineTuningOptions::CallGraphProfile, llvm::CGSCCInliner, llvm::createFunctionToLoopPassAdaptor(), llvm::createModuleToFunctionPassAdaptor(), llvm::createModuleToPostOrderCGSCCPassAdaptor(), llvm::PGOOptions::CSIRInstr, llvm::PGOOptions::CSIRUse, llvm::PipelineTuningOptions::EagerlyInvalidateAnalyses, EnableConstraintElimination, EnableGlobalAnalyses, EnableHotColdSplit, EnableLoopFlatten, llvm::EnableMemProfContextDisambiguation, EnableModuleInliner, llvm::PipelineTuningOptions::ForgetAllSCEVInLoopUnroll, llvm::FullLTOPostLink, getInlineParamsFromOptLevel(), invokeFullLinkTimeOptimizationEarlyEPCallbacks(), invokeFullLinkTimeOptimizationLastEPCallbacks(), invokePeepholeEPCallbacks(), llvm::PipelineTuningOptions::LicmMssaNoAccForPromotionCap, llvm::PipelineTuningOptions::LicmMssaOptCap, llvm::PipelineTuningOptions::LoopUnrolling, llvm::PipelineTuningOptions::MergeFunctions, llvm::ModifyCFG, llvm::OptimizationLevel::O0, llvm::OptimizationLevel::O1, llvm::Optimize, llvm::OptimizationLevel::Os, llvm::OptimizationLevel::Oz, RunNewGVN, llvm::PGOOptions::SampleUse, and UseInlineAdvisor.

Referenced by runNewPMPasses().

◆ buildLTOPreLinkDefaultPipeline()

ModulePassManager PassBuilder::buildLTOPreLinkDefaultPipeline ( OptimizationLevel  Level)

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.

Definition at line 1765 of file PassBuilderPipelines.cpp.

References buildPerModuleDefaultPipeline().

Referenced by buildFatLTODefaultPipeline().

◆ buildModuleInlinerPipeline()

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

◆ buildModuleOptimizationPipeline()

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

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 1395 of file PassBuilderPipelines.cpp.

References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), llvm::PassManager< Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & >::addPass(), llvm::PipelineTuningOptions::CallGraphProfile, llvm::createFunctionToLoopPassAdaptor(), llvm::createModuleToFunctionPassAdaptor(), llvm::PGOOptions::CSIRInstr, llvm::PGOOptions::CSIRUse, llvm::PipelineTuningOptions::EagerlyInvalidateAnalyses, EnableCHR, EnableGlobalAnalyses, EnableHotColdSplit, EnableIROutliner, EnableLoopHeaderDuplication, EnableMatrix, EnableOrderFileInstrumentation, llvm::FullLTOPostLink, invokeOptimizerEarlyEPCallbacks(), invokeOptimizerLastEPCallbacks(), invokeVectorizerStartEPCallbacks(), isLTOPreLink(), llvm::PipelineTuningOptions::LicmMssaNoAccForPromotionCap, llvm::PipelineTuningOptions::LicmMssaOptCap, llvm::PipelineTuningOptions::MergeFunctions, llvm::OptimizationLevel::O3, llvm::OptimizationLevel::Oz, RunPartialInlining, llvm::ThinLTOPostLink, and UseLoopVersioningLICM.

Referenced by buildFatLTODefaultPipeline(), buildPerModuleDefaultPipeline(), and buildThinLTODefaultPipeline().

◆ buildModuleSimplificationPipeline()

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

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 1038 of file PassBuilderPipelines.cpp.

References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), assert(), AttributorRun, buildInlinerPipeline(), buildModuleInlinerPipeline(), llvm::createModuleToFunctionPassAdaptor(), llvm::PGOOptions::CSIRInstr, llvm::CTXPROF, llvm::PipelineTuningOptions::EagerlyInvalidateAnalyses, EnableModuleInliner, EnablePGOForceFunctionAttrs, EnableSampledInstr, EnableSyntheticCounts, FlattenedProfileUsed, llvm::FullLTOPostLink, invokePeepholeEPCallbacks(), invokePipelineEarlySimplificationEPCallbacks(), llvm::PGOOptions::IRInstr, llvm::PGOOptions::IRUse, llvm::PGOCtxProfLoweringPass::isCtxIRPGOInstrEnabled(), isLTOPreLink(), llvm::ModifyCFG, llvm::MODULE, llvm::OptimizationLevel::O0, llvm::OptimizationLevel::O3, llvm::OptimizationLevel::Os, llvm::OptimizationLevel::Oz, Phase, llvm::PGOOptions::SampleUse, llvm::ThinLTOPostLink, llvm::ThinLTOPreLink, and UseCtxProfile.

Referenced by buildPerModuleDefaultPipeline(), buildThinLTODefaultPipeline(), and buildThinLTOPreLinkDefaultPipeline().

◆ buildO0DefaultPipeline()

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

◆ buildPerModuleDefaultPipeline()

ModulePassManager PassBuilder::buildPerModuleDefaultPipeline ( OptimizationLevel  Level,
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.

Definition at line 1586 of file PassBuilderPipelines.cpp.

References addAnnotationRemarksPass(), llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), buildModuleOptimizationPipeline(), buildModuleSimplificationPipeline(), buildO0DefaultPipeline(), llvm::createModuleToFunctionPassAdaptor(), llvm::FullLTOPreLink, invokePipelineStartEPCallbacks(), llvm::None, llvm::OptimizationLevel::O0, and llvm::PGOOptions::SampleUse.

Referenced by buildLTOPreLinkDefaultPipeline().

◆ buildThinLTODefaultPipeline()

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

Build a 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 buildThinLTOPreLinkDefaultPipeline, and the two coordinate closely.

Definition at line 1709 of file PassBuilderPipelines.cpp.

References addAnnotationRemarksPass(), llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), buildModuleOptimizationPipeline(), buildModuleSimplificationPipeline(), llvm::EnableMemProfContextDisambiguation, llvm::OptimizationLevel::O0, and llvm::ThinLTOPostLink.

Referenced by buildFatLTODefaultPipeline(), and runNewPMPasses().

◆ buildThinLTOPreLinkDefaultPipeline()

ModulePassManager PassBuilder::buildThinLTOPreLinkDefaultPipeline ( OptimizationLevel  Level)

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.

Definition at line 1650 of file PassBuilderPipelines.cpp.

References addAnnotationRemarksPass(), llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), buildModuleSimplificationPipeline(), buildO0DefaultPipeline(), llvm::createModuleToFunctionPassAdaptor(), invokeOptimizerEarlyEPCallbacks(), invokeOptimizerLastEPCallbacks(), invokePipelineStartEPCallbacks(), llvm::OptimizationLevel::O0, RunPartialInlining, llvm::PGOOptions::SampleUse, llvm::ThinLTOPreLink, and UseCtxProfile.

Referenced by buildFatLTODefaultPipeline().

◆ checkParametrizedPassName()

static bool llvm::PassBuilder::checkParametrizedPassName ( StringRef  Name,
StringRef  PassName 
)
inlinestatic

Definition at line 643 of file PassBuilder.h.

References Name, and PassName.

Referenced by isLoopNestPassName(), and isLoopPassName().

◆ crossRegisterProxies()

void PassBuilder::crossRegisterProxies ( LoopAnalysisManager LAM,
FunctionAnalysisManager FAM,
CGSCCAnalysisManager CGAM,
ModuleAnalysisManager MAM,
MachineFunctionAnalysisManager MFAM = nullptr 
)

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 2030 of file PassBuilder.cpp.

References CGAM, FAM, LAM, MAM, and llvm::AnalysisManager< IRUnitT, ExtraArgTs >::registerPass().

Referenced by runNewPMPasses(), and llvm::AMDGPUTargetMachine::splitModule().

◆ getPassInstrumentationCallbacks()

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

Returns PIC.

External libraries can use this to register pass instrumentation callbacks.

Definition at line 611 of file PassBuilder.h.

References PIC.

◆ invokeCGSCCOptimizerLateEPCallbacks()

void PassBuilder::invokeCGSCCOptimizerLateEPCallbacks ( CGSCCPassManager CGPM,
OptimizationLevel  Level 
)

Definition at line 355 of file PassBuilderPipelines.cpp.

References llvm::CallingConv::C.

Referenced by buildInlinerPipeline(), and buildO0DefaultPipeline().

◆ invokeFullLinkTimeOptimizationEarlyEPCallbacks()

void PassBuilder::invokeFullLinkTimeOptimizationEarlyEPCallbacks ( ModulePassManager MPM,
OptimizationLevel  Level 
)

Definition at line 375 of file PassBuilderPipelines.cpp.

References llvm::CallingConv::C.

Referenced by buildLTODefaultPipeline().

◆ invokeFullLinkTimeOptimizationLastEPCallbacks()

void PassBuilder::invokeFullLinkTimeOptimizationLastEPCallbacks ( ModulePassManager MPM,
OptimizationLevel  Level 
)

Definition at line 380 of file PassBuilderPipelines.cpp.

References llvm::CallingConv::C.

Referenced by buildLTODefaultPipeline().

◆ invokeLateLoopOptimizationsEPCallbacks()

void PassBuilder::invokeLateLoopOptimizationsEPCallbacks ( LoopPassManager LPM,
OptimizationLevel  Level 
)

◆ invokeLoopOptimizerEndEPCallbacks()

void PassBuilder::invokeLoopOptimizerEndEPCallbacks ( LoopPassManager LPM,
OptimizationLevel  Level 
)

◆ invokeOptimizerEarlyEPCallbacks()

void PassBuilder::invokeOptimizerEarlyEPCallbacks ( ModulePassManager MPM,
OptimizationLevel  Level 
)

◆ invokeOptimizerLastEPCallbacks()

void PassBuilder::invokeOptimizerLastEPCallbacks ( ModulePassManager MPM,
OptimizationLevel  Level 
)

◆ invokePeepholeEPCallbacks()

void PassBuilder::invokePeepholeEPCallbacks ( FunctionPassManager FPM,
OptimizationLevel  Level 
)

◆ invokePipelineEarlySimplificationEPCallbacks()

void PassBuilder::invokePipelineEarlySimplificationEPCallbacks ( ModulePassManager MPM,
OptimizationLevel  Level 
)

◆ invokePipelineStartEPCallbacks()

void PassBuilder::invokePipelineStartEPCallbacks ( ModulePassManager MPM,
OptimizationLevel  Level 
)

◆ invokeScalarOptimizerLateEPCallbacks()

void PassBuilder::invokeScalarOptimizerLateEPCallbacks ( FunctionPassManager FPM,
OptimizationLevel  Level 
)

◆ invokeVectorizerStartEPCallbacks()

void PassBuilder::invokeVectorizerStartEPCallbacks ( FunctionPassManager FPM,
OptimizationLevel  Level 
)

◆ 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 2190 of file PassBuilder.cpp.

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

Referenced by if(), and runNewPMPasses().

◆ parsePassParameters()

template<typename ParametersParseCallableT >
static auto llvm::PassBuilder::parsePassParameters ( ParametersParseCallableT &&  Parser,
StringRef  Name,
StringRef  PassName 
) -> decltype(Parser(StringRef{}))
inlinestatic

This performs customized parsing of pass name with parameters.

We do not need parametrization of passes in textual pipeline very often, yet on a rare occasion ability to specify parameters right there can be useful.

Name - parameterized specification of a pass from a textual pipeline is a string in a form of : PassName '<' parameter-list '>'

Parameter list is being parsed by the parser callable argument, Parser, It takes a string-ref of parameters and returns either StringError or a parameter list in a form of a custom parameters type, all wrapped into Expected<> template class.

Definition at line 668 of file PassBuilder.h.

◆ parsePassPipeline() [1/5]

Error PassBuilder::parsePassPipeline ( CGSCCPassManager CGPM,
StringRef  PipelineText 
)

{{@ 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 2117 of file PassBuilder.cpp.

References llvm::formatv(), llvm::StringRef::front(), llvm::inconvertibleErrorCode(), isCGSCCPassName(), and llvm::Error::success().

◆ parsePassPipeline() [2/5]

Error PassBuilder::parsePassPipeline ( FunctionPassManager FPM,
StringRef  PipelineText 
)

◆ parsePassPipeline() [3/5]

Error PassBuilder::parsePassPipeline ( LoopPassManager LPM,
StringRef  PipelineText 
)

◆ parsePassPipeline() [4/5]

Error PassBuilder::parsePassPipeline ( MachineFunctionPassManager MFPM,
StringRef  PipelineText 
)

Parse a textual MIR pipeline into the provided MachineFunctionPass manager.

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

machine-funciton-pass,machine-module-pass,...

There is no need to specify the pass nesting, and this function currently cannot handle the pass nesting.

Definition at line 2176 of file PassBuilder.cpp.

References llvm::formatv(), llvm::inconvertibleErrorCode(), and llvm::Error::success().

◆ parsePassPipeline() [5/5]

Error PassBuilder::parsePassPipeline ( ModulePassManager MPM,
StringRef  PipelineText 
)

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.

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

Definition at line 2066 of file PassBuilder.cpp.

References llvm::CallingConv::C, llvm::formatv(), llvm::StringRef::front(), llvm::inconvertibleErrorCode(), isCGSCCPassName(), isFunctionPassName(), isLoopNestPassName(), isLoopPassName(), isMachineFunctionPassName(), isModulePassName(), and llvm::Error::success().

Referenced by if(), and runNewPMPasses().

◆ parseRegAllocFilter()

std::optional< RegAllocFilterFunc > PassBuilder::parseRegAllocFilter ( StringRef  RegAllocFilterName)

Parse RegAllocFilterName to get RegAllocFilterFunc.

Definition at line 2211 of file PassBuilder.cpp.

References llvm::CallingConv::C, and F.

◆ parseSinglePassOption()

Expected< bool > PassBuilder::parseSinglePassOption ( StringRef  Params,
StringRef  OptionName,
StringRef  PassName 
)
static

Handle passes only accept one bool-valued parameter.

Returns
false when Params is empty.

Definition at line 572 of file PassBuilder.cpp.

References llvm::StringRef::empty(), llvm::formatv(), llvm::inconvertibleErrorCode(), PassName, and llvm::StringRef::split().

Referenced by parseBPFPreserveStaticOffsetOptions().

◆ printPassNames()

void PassBuilder::printPassNames ( raw_ostream OS)

Print pass names.

Definition at line 2228 of file PassBuilder.cpp.

References OS.

◆ registerAnalysisRegistrationCallback() [1/5]

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 532 of file PassBuilder.h.

References llvm::CallingConv::C.

◆ registerAnalysisRegistrationCallback() [2/5]

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

Definition at line 536 of file PassBuilder.h.

References llvm::CallingConv::C.

◆ registerAnalysisRegistrationCallback() [3/5]

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

Definition at line 540 of file PassBuilder.h.

References llvm::CallingConv::C.

◆ registerAnalysisRegistrationCallback() [4/5]

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

Definition at line 548 of file PassBuilder.h.

References llvm::CallingConv::C.

◆ registerAnalysisRegistrationCallback() [5/5]

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

Definition at line 544 of file PassBuilder.h.

References llvm::CallingConv::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 487 of file PassBuilder.cpp.

References llvm::CallingConv::C, and CGAM.

Referenced by runNewPMPasses().

◆ 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 451 of file PassBuilder.h.

References llvm::CallingConv::C.

Referenced by llvm::AMDGPUTargetMachine::registerPassBuilderCallbacks().

◆ registerFullLinkTimeOptimizationEarlyEPCallback()

void llvm::PassBuilder::registerFullLinkTimeOptimizationEarlyEPCallback ( 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 start of the full LTO pipeline.

Definition at line 508 of file PassBuilder.h.

References llvm::CallingConv::C.

◆ registerFullLinkTimeOptimizationLastEPCallback()

void llvm::PassBuilder::registerFullLinkTimeOptimizationLastEPCallback ( 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 end of the full LTO pipeline.

Definition at line 517 of file PassBuilder.h.

References llvm::CallingConv::C.

Referenced by llvm::AMDGPUTargetMachine::registerPassBuilderCallbacks().

◆ 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 496 of file PassBuilder.cpp.

References buildDefaultAAPipeline(), llvm::CallingConv::C, FAM, and llvm::AnalysisManager< IRUnitT, ExtraArgTs >::registerPass().

Referenced by llvm::orc::BlockFreqQuery::operator()(), runNewPMPasses(), and llvm::AMDGPUTargetMachine::splitModule().

◆ 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 420 of file PassBuilder.h.

References llvm::CallingConv::C.

Referenced by llvm::AArch64TargetMachine::registerPassBuilderCallbacks(), llvm::HexagonTargetMachine::registerPassBuilderCallbacks(), and llvm::RISCVTargetMachine::registerPassBuilderCallbacks().

◆ 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 521 of file PassBuilder.cpp.

References llvm::CallingConv::C, and LAM.

Referenced by runNewPMPasses().

◆ 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 430 of file PassBuilder.h.

References llvm::CallingConv::C.

Referenced by llvm::HexagonTargetMachine::registerPassBuilderCallbacks().

◆ registerMachineFunctionAnalyses()

void PassBuilder::registerMachineFunctionAnalyses ( MachineFunctionAnalysisManager MFAM)

Registers all available machine function analysis passes.

This is an interface that can be used to populate a MachineFunctionAnalysisManager 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 510 of file PassBuilder.cpp.

References llvm::CallingConv::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 478 of file PassBuilder.cpp.

References llvm::CallingConv::C, and MAM.

Referenced by runNewPMPasses(), and llvm::AMDGPUTargetMachine::splitModule().

◆ registerOptimizerEarlyEPCallback()

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

Register a callback for a default optimizer pipeline extension point.

This extension point allows adding optimizations before the function optimization pipeline.

Definition at line 490 of file PassBuilder.h.

References llvm::CallingConv::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.

Definition at line 499 of file PassBuilder.h.

References llvm::CallingConv::C.

Referenced by llvm::AMDGPUTargetMachine::registerPassBuilderCallbacks().

◆ 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 524 of file PassBuilder.h.

References llvm::CallingConv::C.

◆ registerParseTopLevelPipelineCallback()

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

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 2308 of file PassBuilder.cpp.

References llvm::CallingConv::C.

◆ 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 406 of file PassBuilder.h.

References llvm::CallingConv::C.

Referenced by llvm::AMDGPUTargetMachine::registerPassBuilderCallbacks(), and llvm::BPFTargetMachine::registerPassBuilderCallbacks().

◆ registerPipelineEarlySimplificationEPCallback()

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

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.

Definition at line 481 of file PassBuilder.h.

References llvm::CallingConv::C.

Referenced by llvm::AMDGPUTargetMachine::registerPassBuilderCallbacks(), and llvm::BPFTargetMachine::registerPassBuilderCallbacks().

◆ registerPipelineParsingCallback() [1/5]

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 558 of file PassBuilder.h.

References llvm::CallingConv::C.

◆ registerPipelineParsingCallback() [2/5]

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

Definition at line 563 of file PassBuilder.h.

References llvm::CallingConv::C.

◆ registerPipelineParsingCallback() [3/5]

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

Definition at line 568 of file PassBuilder.h.

References llvm::CallingConv::C.

◆ registerPipelineParsingCallback() [4/5]

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

Definition at line 578 of file PassBuilder.h.

References llvm::CallingConv::C.

◆ registerPipelineParsingCallback() [5/5]

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

Definition at line 573 of file PassBuilder.h.

References llvm::CallingConv::C.

◆ registerPipelineStartEPCallback()

void llvm::PassBuilder::registerPipelineStartEPCallback ( const std::function< void(ModulePassManager &, OptimizationLevel)> &  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 472 of file PassBuilder.h.

References llvm::CallingConv::C.

Referenced by llvm::AMDGPUTargetMachine::registerPassBuilderCallbacks(), llvm::BPFTargetMachine::registerPassBuilderCallbacks(), and llvm::NVPTXTargetMachine::registerPassBuilderCallbacks().

◆ registerRegClassFilterParsingCallback()

void llvm::PassBuilder::registerRegClassFilterParsingCallback ( const std::function< RegAllocFilterFunc(StringRef)> &  C)
inline

Register callbacks to parse target specific filter field if regalloc pass needs it.

E.g. AMDGPU requires regalloc passes can handle sgpr and vgpr separately.

Definition at line 588 of file PassBuilder.h.

References llvm::CallingConv::C.

Referenced by llvm::AMDGPUTargetMachine::registerPassBuilderCallbacks().

◆ 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 440 of file PassBuilder.h.

References llvm::CallingConv::C.

Referenced by llvm::BPFTargetMachine::registerPassBuilderCallbacks().

◆ 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 462 of file PassBuilder.h.

References llvm::CallingConv::C.


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