LLVM: llvm::InlineCost Class Reference (original) (raw)

Represents the cost of inlining a function. More...

#include "[llvm/Analysis/InlineCost.h](InlineCost%5F8h%5Fsource.html)"

Public Member Functions
operator bool () const
Test whether the inline cost is low enough for inlining.
bool isAlways () const
bool isNever () const
bool isVariable () const
int getCost () const
Get the inline cost estimate.
int getThreshold () const
Get the threshold against which the cost was computed.
int getStaticBonusApplied () const
Get the amount of StaticBonus applied.
std::optional< CostBenefitPair > getCostBenefit () const
Get the cost-benefit pair which was computed by cost-benefit analysis.
const char * getReason () const
Get the reason of Always or Never.
int getCostDelta () const
Get the cost delta from the threshold for inlining.

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 91 of file InlineCost.h.

get()

InlineCost llvm::InlineCost::get ( int Cost, int Threshold, int StaticBonus = 0 ) inlinestatic

getAlways()

getCost()

int llvm::InlineCost::getCost ( ) const inline

getCostBenefit()

std::optional< CostBenefitPair > llvm::InlineCost::getCostBenefit ( ) const inline

Get the cost-benefit pair which was computed by cost-benefit analysis.

Definition at line 164 of file InlineCost.h.

getCostDelta()

int llvm::InlineCost::getCostDelta ( ) const 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 176 of file InlineCost.h.

References getCost().

Referenced by shouldBeDeferred().

getNever()

getReason()

const char * llvm::InlineCost::getReason ( ) const inline

getStaticBonusApplied()

int llvm::InlineCost::getStaticBonusApplied ( ) const inline

getThreshold()

int llvm::InlineCost::getThreshold ( ) const inline

isAlways()

bool llvm::InlineCost::isAlways ( ) const inline

isNever()

bool llvm::InlineCost::isNever ( ) const inline

isVariable()

bool llvm::InlineCost::isVariable ( ) const inline

operator bool()

llvm::InlineCost::operator bool ( ) const inlineexplicit

Test whether the inline cost is low enough for inlining.

Definition at line 138 of file InlineCost.h.


The documentation for this class was generated from the following file: