30 #define DEBUG_TYPE "inline" 59 bool RemarksEnabled =
false;
64 RemarksEnabled =
true;
68 std::function<AssumptionCache &(Function &)> GetAssumptionCache =
70 return ACT->getAssumptionCache(
F);
73 cast<CallBase>(*CS.
getInstruction()), Params, TTI, GetAssumptionCache,
74 None, PSI, RemarksEnabled ? &ORE :
nullptr);
105 unsigned SizeOptLevel,
106 bool DisableInlineHotCallSite) {
108 if (DisableInlineHotCallSite)
109 Param.HotCallSiteThreshold = 0;
110 return new SimpleInliner(Param);
114 return new SimpleInliner(Params);
118 TTIWP = &getAnalysis<TargetTransformInfoWrapperPass>();
122 void SimpleInliner::getAnalysisUsage(
AnalysisUsage &AU)
const {
Pass interface - Implemented by all 'passes'.
Thresholds to tune inline cost analysis.
InlineCost getInlineCost(CallBase &Call, const InlineParams &Params, TargetTransformInfo &CalleeTTI, std::function< AssumptionCache &(Function &)> &GetAssumptionCache, Optional< function_ref< BlockFrequencyInfo &(Function &)>> GetBFI, ProfileSummaryInfo *PSI, OptimizationRemarkEmitter *ORE=nullptr)
Get an InlineCost object representing the cost of inlining this callsite.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Function Integration Inlining
This class represents lattice values for constants.
void initializeSimpleInlinerPass(PassRegistry &)
An immutable pass that tracks lazily created AssumptionCache objects.
A cache of @llvm.assume calls within a function.
FunTy * getCalledFunction() const
Return the function being called if this is a direct call, otherwise return null (if it's an indirect...
Represents the cost of inlining a function.
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
bool runOnSCC(CallGraphSCC &SCC) override
Main run interface method, this implements the interface required by the Pass class.
An analysis pass based on legacy pass manager to deliver ProfileSummaryInfo.
This class contains all of the helper code which is used to perform the inlining operations that do n...
InstrTy * getInstruction() const
void getAnalysisUsage(AnalysisUsage &Info) const override
For this class, we declare that we require and preserve the call graph.
The ModulePass which wraps up a CallGraph and the logic to build it.
Represent the analysis usage information of a pass.
INITIALIZE_PASS_BEGIN(SimpleInliner, "inline", "Function Integration/Inlining", false, false) INITIALIZE_PASS_END(SimpleInliner
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
InlineParams getInlineParams()
Generate the parameters to tune the inline cost analysis based only on the commandline options...
Module.h This file contains the declarations for the Module class.
amdgpu Simplify well known AMD library false FunctionCallee Callee
static cl::opt< unsigned > Threshold("loop-unswitch-threshold", cl::desc("Max loop size to unswitch"), cl::init(100), cl::Hidden)
const BasicBlockListType & getBasicBlockList() const
Get the underlying elements of the Function...
Pass * createFunctionInliningPass()
createFunctionInliningPass - Return a new pass object that uses a heuristic to inline direct function...
CallGraphSCC - This is a single SCC that a CallGraphSCCPass is run on.
FunTy * getCaller() const
Return the caller function for this call site.