14 #ifndef LLVM_ANALYSIS_INLINECOST_H
15 #define LLVM_ANALYSIS_INLINECOST_H
23 class AssumptionCacheTracker;
27 class ProfileSummaryInfo;
28 class TargetTransformInfo;
30 namespace InlineConstants {
65 AlwaysInlineCost = INT_MIN,
66 NeverInlineCost = INT_MAX
76 InlineCost(
int Cost,
int Threshold) : Cost(Cost), Threshold(Threshold) {}
80 assert(Cost > AlwaysInlineCost &&
"Cost crosses sentinel value");
81 assert(Cost < NeverInlineCost &&
"Cost crosses sentinel value");
92 explicit operator bool()
const {
93 return Cost < Threshold;
96 bool isAlways()
const {
return Cost == AlwaysInlineCost; }
97 bool isNever()
const {
return Cost == NeverInlineCost; }
Thresholds to tune inline cost analysis.
Optional< int > OptSizeThreshold
Threshold to use when the caller is optimized for size.
Analysis providing profile information.
const int OptMinSizeThreshold
Use when minsize (-Oz) is specified.
A cache of .assume calls within a function.
Represents the cost of inlining a function.
int getCost() const
Get the inline cost estimate.
InlineCost getInlineCost(CallSite CS, const InlineParams &Params, TargetTransformInfo &CalleeTTI, std::function< AssumptionCache &(Function &)> &GetAssumptionCache, ProfileSummaryInfo *PSI)
Get an InlineCost object representing the cost of inlining this callsite.
Optional< int > HintThreshold
Threshold to use for callees with inline hint.
bool isInlineViable(Function &Callee)
Minimal filter to detect invalid constructs for inlining.
const int LastCallToStaticBonus
int getCostDelta() const
Get the cost delta from the threshold for inlining.
const int IndirectCallThreshold
const int OptAggressiveThreshold
Use when -O3 is specified.
Optional< int > OptMinSizeThreshold
Threshold to use when the caller is optimized for minsize.
static InlineCost getNever()
InlineParams getInlineParams()
Generate the parameters to tune the inline cost analysis based only on the commandline options...
Optional< int > ColdThreshold
Threshold to use for cold callees.
static int const Threshold
TODO: Write a new FunctionPass AliasAnalysis so that it can keep a cache.
const unsigned TotalAllocaSizeRecursiveCaller
Do not inline functions which allocate this many bytes on the stack when the caller is recursive...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
print Print MemDeps of function
const int OptSizeThreshold
Use when optsize (-Os) is specified.
static InlineCost getAlways()
const int NoreturnPenalty
Optional< int > HotCallSiteThreshold
Threshold to use when the callsite is considered hot.
int DefaultThreshold
The default threshold to start with for a callee.