class InlineCost
Declaration
class InlineCost { /* full declaration omitted */ };
Description
Represents the cost of inlining a function. This supports special values for functions which should "always" or "never" be inlined. Otherwise, the cost represents a unitless amount; smaller values increase the likelihood of the function being inlined. Objects of this type also provide the adjusted threshold for inlining based on the information available for a particular callsite. They can be directly tested to determine if inlining should occur given the cost and threshold for this cost metric.
Declared at: llvm/include/llvm/Analysis/InlineCost.h:63
Method Overview
- public static llvm::InlineCost get(int Cost, int Threshold)
- public static llvm::InlineCost getAlways(const char * Reason)
- public int getCost() const
- public int getCostDelta() const
- public static llvm::InlineCost getNever(const char * Reason)
- public const char * getReason() const
- public int getThreshold() const
- public bool isAlways() const
- public bool isNever() const
- public bool isVariable() const
- public bool operator bool() const
Methods
¶static llvm::InlineCost get(int Cost,
int Threshold)
static llvm::InlineCost get(int Cost,
int Threshold)
Declared at: llvm/include/llvm/Analysis/InlineCost.h:86
Parameters
- int Cost
- int Threshold
¶static llvm::InlineCost getAlways(
const char* Reason)
static llvm::InlineCost getAlways(
const char* Reason)
Declared at: llvm/include/llvm/Analysis/InlineCost.h:91
Parameters
- const char* Reason
¶int getCost() const
int getCost() const
Description
Get the inline cost estimate. It is an error to call this on an "always" or "never" InlineCost.
Declared at: llvm/include/llvm/Analysis/InlineCost.h:109
¶int getCostDelta() const
int getCostDelta() const
Description
Get the cost delta from the threshold for inlining. Only valid if the cost is of the variable kind. Returns a negative value if the cost is too high to inline.
Declared at: llvm/include/llvm/Analysis/InlineCost.h:130
¶static llvm::InlineCost getNever(
const char* Reason)
static llvm::InlineCost getNever(
const char* Reason)
Declared at: llvm/include/llvm/Analysis/InlineCost.h:94
Parameters
- const char* Reason
¶const char* getReason() const
const char* getReason() const
Description
Get the reason of Always or Never.
Declared at: llvm/include/llvm/Analysis/InlineCost.h:121
¶int getThreshold() const
int getThreshold() const
Description
Get the threshold against which the cost was computed
Declared at: llvm/include/llvm/Analysis/InlineCost.h:115
¶bool isAlways() const
bool isAlways() const
Declared at: llvm/include/llvm/Analysis/InlineCost.h:103
¶bool isNever() const
bool isNever() const
Declared at: llvm/include/llvm/Analysis/InlineCost.h:104
¶bool isVariable() const
bool isVariable() const
Declared at: llvm/include/llvm/Analysis/InlineCost.h:105
¶bool operator bool() const
bool operator bool() const
Description
Test whether the inline cost is low enough for inlining.
Declared at: llvm/include/llvm/Analysis/InlineCost.h:99