14 #ifndef LLVM_ANALYSIS_INLINECOST_H
15 #define LLVM_ANALYSIS_INLINECOST_H
25 class TargetTransformInfo;
27 namespace InlineConstants {
52 AlwaysInlineCost = INT_MIN,
53 NeverInlineCost = INT_MAX
63 InlineCost(
int Cost,
int Threshold) : Cost(Cost), Threshold(Threshold) {}
67 assert(Cost > AlwaysInlineCost &&
"Cost crosses sentinel value");
68 assert(Cost < NeverInlineCost &&
"Cost crosses sentinel value");
80 return Cost < Threshold;
83 bool isAlways()
const {
return Cost == AlwaysInlineCost; }
84 bool isNever()
const {
return Cost == NeverInlineCost; }
90 assert(
isVariable() &&
"Invalid access of InlineCost");
Represents the cost of inlining a function.
int getCost() const
Get the inline cost estimate. It is an error to call this on an "always" or "never" InlineCost...
void getAnalysisUsage(AnalysisUsage &AU) const
const int LastCallToStaticBonus
int getCostDelta() const
Get the cost delta from the threshold for inlining. Only valid if the cost is of the variable kind...
bool runOnSCC(CallGraphSCC &SCC)
bool isInlineViable(Function &Callee)
Minimal filter to detect invalid constructs for inlining.
const int IndirectCallThreshold
Cost analyzer used by inliner.
static InlineCost getNever()
#define LLVM_EXPLICIT
Expands to explicit on compilers which support explicit conversion operators. Otherwise expands to no...
InlineCost getInlineCost(CallSite CS, int Threshold)
Get an InlineCost object representing the cost of inlining this callsite.
static int const Threshold
const unsigned TotalAllocaSizeRecursiveCaller
CallGraphSCC - This is a single SCC that a CallGraphSCCPass is run on.
static InlineCost getAlways()
const int NoreturnPenalty