9#ifndef LLVM_TRANSFORMS_IPO_INLINER_H
10#define LLVM_TRANSFORMS_IPO_INLINER_H
22class AssumptionCacheTracker;
24class ProfileSummaryInfo;
73 bool InsertLifetime =
true;
100 : OnlyMandatory(OnlyMandatory), LTOPhase(LTOPhase) {}
112 std::unique_ptr<InlineAdvisor> OwnedAdvisor;
113 const bool OnlyMandatory;
129 unsigned MaxDevirtIterations = 0);
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
This header provides classes for managing passes over SCCs of the call graph.
Analysis containing CSE Info
Implements a lazy call graph analysis and related passes for the new pass manager.
FunctionAnalysisManager FAM
ModuleAnalysisManager MAM
This header defines various interfaces for pass management in LLVM.
A container for analyses that lazily runs them and caches their results.
Represent the analysis usage information of a pass.
An immutable pass that tracks lazily created AssumptionCache objects.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
CallGraphSCC - This is a single SCC that a CallGraphSCCPass is run on.
The basic data container for the call graph of a Module of IR.
Calculate and dump ThinLTO specific inliner stats.
Interface for deciding whether to inline a call site or not.
Represents the cost of inlining a function.
The inliner pass for the new pass manager.
InlinerPass(bool OnlyMandatory=false, ThinOrFullLTOPhase LTOPhase=ThinOrFullLTOPhase::None)
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
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.
Module pass, wrapping the inliner pass.
void addModulePass(T Pass)
Add a module pass that runs before the CGSCC passes.
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.
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
ModuleInlinerWrapperPass(ModuleInlinerWrapperPass &&Arg)=default
A Module instance is used to store all the information related to an LLVM module.
Result proxy object for OuterAnalysisManagerProxy.
LLVM_ATTRIBUTE_MINSIZE std::enable_if_t<!std::is_same< PassT, PassManager >::value > addPass(PassT &&Pass)
Pass interface - Implemented by all 'passes'.
virtual bool doInitialization(Module &)
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
virtual bool doFinalization(Module &)
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
A set of analyses that are preserved following a run of a transformation pass.
Analysis providing profile information.
StringRef - Represent a constant reference to a string, i.e.
Provides information about what library functions are available for the current target.
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:
ThinOrFullLTOPhase
This enumerates the LLVM full LTO or ThinLTO optimization phases.
@ None
No LTO/ThinLTO behavior needed.
InlineParams getInlineParams()
Generate the parameters to tune the inline cost analysis based only on the commandline options.
cl::opt< unsigned > MaxDevirtIterations("max-devirt-iterations", cl::ReallyHidden, cl::init(4))
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.
This class contains all of the helper code which is used to perform the inlining operations that do n...
bool removeDeadFunctions(CallGraph &CG, bool AlwaysInlineOnly=false)
Remove dead functions.
ImportedFunctionsInliningStatistics ImportedFunctionsStats
std::function< const TargetLibraryInfo &(Function &)> GetTLI
AssumptionCacheTracker * ACT
virtual InlineCost getInlineCost(CallBase &CB)=0
This method must be implemented by the subclass to determine the cost of inlining the specified call ...
bool doFinalization(CallGraph &CG) override
Remove now-dead linkonce functions at the end of processing to avoid breaking the SCC traversal.
bool inlineCalls(CallGraphSCC &SCC)
This function performs the main work of the pass.
bool doInitialization(CallGraph &CG) override
doInitialization - This method is called before the SCC's of the program has been processed,...
void getAnalysisUsage(AnalysisUsage &Info) const override
For this class, we declare that we require and preserve the call graph.
bool runOnSCC(CallGraphSCC &SCC) override
Main run interface method, this implements the interface required by the Pass class.
A CRTP mix-in to automatically provide informational APIs needed for passes.