LLVM API Documentation
Represents the cost of inlining a function. More...
#include <InlineCost.h>
Public Member Functions | |
LLVM_EXPLICIT | operator bool () const |
Test whether the inline cost is low enough for inlining. More... | |
bool | isAlways () const |
bool | isNever () const |
bool | isVariable () const |
int | getCost () const |
Get the inline cost estimate. It is an error to call this on an "always" or "never" InlineCost. More... | |
int | getCostDelta () const |
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. More... | |
Static Public Member Functions | |
static InlineCost | get (int Cost, int Threshold) |
static InlineCost | getAlways () |
static InlineCost | getNever () |
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.
Definition at line 50 of file InlineCost.h.
|
inlinestatic |
Definition at line 66 of file InlineCost.h.
Referenced by llvm::InlineCostAnalysis::getInlineCost().
|
inlinestatic |
Definition at line 71 of file InlineCost.h.
Referenced by llvm::InlineCostAnalysis::getInlineCost().
|
inline |
Get the inline cost estimate. It is an error to call this on an "always" or "never" InlineCost.
Definition at line 89 of file InlineCost.h.
References isVariable().
Referenced by getCostDelta().
|
inline |
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.
Definition at line 97 of file InlineCost.h.
References getCost().
|
inlinestatic |
Definition at line 74 of file InlineCost.h.
Referenced by llvm::InlineCostAnalysis::getInlineCost().
|
inline |
Definition at line 83 of file InlineCost.h.
Referenced by isVariable().
|
inline |
Definition at line 84 of file InlineCost.h.
Referenced by isVariable().
|
inline |
Definition at line 85 of file InlineCost.h.
References isAlways(), and isNever().
Referenced by getCost().
|
inline |
Test whether the inline cost is low enough for inlining.
Definition at line 79 of file InlineCost.h.