Go to the documentation of this file.
9 #ifndef LLVM_TRANSFORMS_IPO_INLINER_H
10 #define LLVM_TRANSFORMS_IPO_INLINER_H
22 class AssumptionCacheTracker;
24 class ProfileSummaryInfo;
73 bool InsertLifetime =
true;
100 : OnlyMandatory(OnlyMandatory), LTOPhase(LTOPhase) {}
112 std::unique_ptr<InlineAdvisor> OwnedAdvisor;
113 const bool OnlyMandatory;
129 unsigned MaxDevirtIterations = 0);
163 #endif // LLVM_TRANSFORMS_IPO_INLINER_H
A set of analyses that are preserved following a run of a transformation pass.
This is an optimization pass for GlobalISel generic memory operations.
virtual InlineCost getInlineCost(CallBase &CB)=0
This method must be implemented by the subclass to determine the cost of inlining the specified call ...
A CRTP mix-in to automatically provide informational APIs needed for passes.
LLVM_ATTRIBUTE_MINSIZE std::enable_if_t<!std::is_same< PassT, PassManager >::value > addPass(PassT &&Pass)
bool inlineCalls(CallGraphSCC &SCC)
This function performs the main work of the pass.
std::function< const TargetLibraryInfo &(Function &)> GetTLI
Calculate and dump ThinLTO specific inliner stats.
The basic data container for the call graph of a Module of IR.
FunctionAnalysisManager FAM
Thresholds to tune inline cost analysis.
LegacyInlinerBase(char &ID)
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
ThinOrFullLTOPhase
This enumerates the LLVM full LTO or ThinLTO optimization phases.
Module pass, wrapping the inliner pass.
CallGraphSCC - This is a single SCC that a CallGraphSCCPass is run on.
An SCC of the call graph.
(vector float) vec_cmpeq(*A, *B) C
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
ModuleAnalysisManager MAM
CGSCCPassManager & getPM()
Allow adding more CGSCC passes, besides inlining.
Represent the analysis usage information of a pass.
Represents the cost of inlining a function.
Result proxy object for OuterAnalysisManagerProxy.
This class implements an extremely fast bulk output stream that can only output to a stream.
Analysis containing CSE Info
InlineParams getInlineParams()
Generate the parameters to tune the inline cost analysis based only on the commandline options.
Provides context on when an inline advisor is constructed in the pipeline (e.g., link phase,...
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
AssumptionCacheTracker * ACT
bool removeDeadFunctions(CallGraph &CG, bool AlwaysInlineOnly=false)
Remove dead functions.
Analysis providing profile information.
An efficient, type-erasing, non-owning reference to a callable.
InliningAdvisorMode
There are 3 scenarios we can use the InlineAdvisor:
bool runOnSCC(CallGraphSCC &SCC) override
Main run interface method, this implements the interface required by the Pass class.
This class contains all of the helper code which is used to perform the inlining operations that do n...
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
print Print MemDeps of function
A Module instance is used to store all the information related to an LLVM module.
virtual bool doFinalization(Module &)
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
An immutable pass that tracks lazily created AssumptionCache objects.
virtual bool doInitialization(Module &)
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
StringRef - Represent a constant reference to a string, i.e.
Interface for deciding whether to inline a call site or not.
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
void addModulePass(T Pass)
Add a module pass that runs before the CGSCC passes.
Support structure for SCC passes to communicate updates the call graph back to the CGSCC pass manager...
ModuleInlinerWrapperPass(InlineParams Params=getInlineParams(), bool MandatoryFirst=true, InlineContext IC={}, InliningAdvisorMode Mode=InliningAdvisorMode::Default, unsigned MaxDevirtIterations=0)
Provides information about what library functions are available for the current target.
@ None
No LTO/ThinLTO behavior needed.
void addLateModulePass(T Pass)
Add a module pass that runs after the CGSCC passes.
PreservedAnalyses run(Module &, ModuleAnalysisManager &)
Pass interface - Implemented by all 'passes'.
InlinerPass(bool OnlyMandatory=false, ThinOrFullLTOPhase LTOPhase=ThinOrFullLTOPhase::None)
The inliner pass for the new pass manager.
PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &UR)
bool doFinalization(CallGraph &CG) override
Remove now-dead linkonce functions at the end of processing to avoid breaking the SCC traversal.
void getAnalysisUsage(AnalysisUsage &Info) const override
For this class, we declare that we require and preserve the call graph.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
A container for analyses that lazily runs them and caches their results.
A lazily constructed view of the call graph of a module.
cl::opt< unsigned > MaxDevirtIterations("max-devirt-iterations", cl::ReallyHidden, cl::init(4))
bool doInitialization(CallGraph &CG) override
doInitialization - This method is called before the SCC's of the program has been processed,...
ImportedFunctionsInliningStatistics ImportedFunctionsStats