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

Methods

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)

Declared at: llvm/include/llvm/Analysis/InlineCost.h:91

Parameters

const char* Reason

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

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)

Declared at: llvm/include/llvm/Analysis/InlineCost.h:94

Parameters

const char* Reason

const char* getReason() const

Description

Get the reason of Always or Never.

Declared at: llvm/include/llvm/Analysis/InlineCost.h:121

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

Declared at: llvm/include/llvm/Analysis/InlineCost.h:103

bool isNever() const

Declared at: llvm/include/llvm/Analysis/InlineCost.h:104

bool isVariable() const

Declared at: llvm/include/llvm/Analysis/InlineCost.h:105

bool operator bool() const

Description

Test whether the inline cost is low enough for inlining.

Declared at: llvm/include/llvm/Analysis/InlineCost.h:99