9#ifndef LLVM_TRANSFORMS_IPO_INLINER_H
10#define LLVM_TRANSFORMS_IPO_INLINER_H
40 : OnlyMandatory(OnlyMandatory), LTOPhase(LTOPhase) {}
52 InlineAdvisor &getAdvisor(
const ModuleAnalysisManagerCGSCCProxy::Result &
MAM,
54 std::unique_ptr<InlineAdvisor> OwnedAdvisor;
55 const bool OnlyMandatory;
71 unsigned MaxDevirtIterations = 0);
82 MPM.addPass(std::move(
Pass));
87 AfterCGMPM.addPass(std::move(
Pass));
This header provides classes for managing passes over SCCs of the call graph.
This header defines various interfaces for pass management in LLVM.
Implements a lazy call graph analysis and related passes for the new pass manager.
FunctionAnalysisManager FAM
ModuleAnalysisManager MAM
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
Interface for deciding whether to inline a call site or not.
InlinerPass(bool OnlyMandatory=false, ThinOrFullLTOPhase LTOPhase=ThinOrFullLTOPhase::None)
LLVM_ABI void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
LLVM_ABI PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &UR)
InlinerPass(InlinerPass &&Arg)=default
An SCC of the call graph.
A lazily constructed view of the call graph of a module.
void addModulePass(T Pass)
Add a module pass that runs before the CGSCC passes.
LLVM_ABI PreservedAnalyses run(Module &, ModuleAnalysisManager &)
CGSCCPassManager & getPM()
Allow adding more CGSCC passes, besides inlining.
void addLateModulePass(T Pass)
Add a module pass that runs after the CGSCC passes.
LLVM_ABI void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
ModuleInlinerWrapperPass(ModuleInlinerWrapperPass &&Arg)=default
LLVM_ABI ModuleInlinerWrapperPass(InlineParams Params=getInlineParams(), bool MandatoryFirst=true, InlineContext IC={}, InliningAdvisorMode Mode=InliningAdvisorMode::Default, unsigned MaxDevirtIterations=0)
A Module instance is used to store all the information related to an LLVM module.
Pass interface - Implemented by all 'passes'.
A set of analyses that are preserved following a run of a transformation pass.
StringRef - Represent a constant reference to a string, i.e.
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
InliningAdvisorMode
There are 4 scenarios we can use the InlineAdvisor:
PassManager< LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, CGSCCUpdateResult & > CGSCCPassManager
The CGSCC pass manager.
AnalysisManager< LazyCallGraph::SCC, LazyCallGraph & > CGSCCAnalysisManager
The CGSCC analysis manager.
ThinOrFullLTOPhase
This enumerates the LLVM full LTO or ThinLTO optimization phases.
@ None
No LTO/ThinLTO behavior needed.
PassManager< Module > ModulePassManager
Convenience typedef for a pass manager over modules.
LLVM_ABI InlineParams getInlineParams()
Generate the parameters to tune the inline cost analysis based only on the commandline options.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
cl::opt< unsigned > MaxDevirtIterations("max-devirt-iterations", cl::ReallyHidden, cl::init(4))
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Support structure for SCC passes to communicate updates the call graph back to the CGSCC pass manager...
Provides context on when an inline advisor is constructed in the pipeline (e.g., link phase,...
Thresholds to tune inline cost analysis.
A CRTP mix-in to automatically provide informational APIs needed for passes.