LLVM 24.0.0git
InlineCost.cpp File Reference

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
namespace  llvm::InlineConstants

Macros

#define DEBUG_TYPE   "inline-cost"
#define DEBUG_PRINT_STAT(x)

Functions

 STATISTIC (NumCallsAnalyzed, "Number of call sites analyzed")
std::optional< int > llvm::getStringFnAttrAsInt (const Attribute &Attr)
LLVM_ABI std::optional< int > llvm::getStringFnAttrAsInt (CallBase &CB, StringRef AttrKind)
std::optional< int > llvm::getStringFnAttrAsInt (Function *F, StringRef AttrKind)
LLVM_ABI int llvm::InlineConstants::getInstrCost ()
static bool functionsHaveCompatibleAttributes (const AnalysisOptions &Opts, Function *Caller, Function *Callee, function_ref< const TargetLibraryInfo &(Function &)> &GetTLI)
 Test that there are no attribute conflicts between Caller and Callee that prevent inlining.

Variables

static cl::opt< int > DefaultThreshold ("inlinedefault-threshold", cl::Hidden, cl::init(225), cl::desc("Default amount of inlining to perform"))
static cl::opt< int > InlineThreshold ("inline-threshold", cl::Hidden, cl::init(225), cl::desc("Control the amount of inlining to perform (default = 225)"))
static cl::opt< int > HintThreshold ("inlinehint-threshold", cl::Hidden, cl::init(325), cl::desc("Threshold for inlining functions with inline hint"))
static cl::opt< int > ColdCallSiteThreshold ("inline-cold-callsite-threshold", cl::Hidden, cl::init(45), cl::desc("Threshold for inlining cold callsites"))
static cl::opt< int > ColdThreshold ("inlinecold-threshold", cl::Hidden, cl::init(45), cl::desc("Threshold for inlining functions with cold attribute"))
static cl::opt< int > HotCallSiteThreshold ("hot-callsite-threshold", cl::Hidden, cl::init(3000), cl::desc("Threshold for hot callsites "))
static cl::opt< int > LocallyHotCallSiteThreshold ("locally-hot-callsite-threshold", cl::Hidden, cl::init(525), cl::desc("Threshold for locally hot callsites "))
static cl::opt< int > InstrCost ("inline-instr-cost", cl::Hidden, cl::init(5), cl::desc("Cost of a single instruction when inlining"))

Macro Definition Documentation

◆ DEBUG_PRINT_STAT

#define DEBUG_PRINT_STAT ( x)
Value:
OS << " " #x ": " << x << "\n"

◆ DEBUG_TYPE

#define DEBUG_TYPE   "inline-cost"

Definition at line 55 of file InlineCost.cpp.

Function Documentation

◆ functionsHaveCompatibleAttributes()

bool functionsHaveCompatibleAttributes ( const AnalysisOptions & Opts,
Function * Caller,
Function * Callee,
function_ref< const TargetLibraryInfo &(Function &)> & GetTLI )
static

Test that there are no attribute conflicts between Caller and Callee that prevent inlining.

Definition at line 3003 of file InlineCost.cpp.

Referenced by llvm::getAttributeBasedInliningDecision().

◆ STATISTIC()

STATISTIC ( NumCallsAnalyzed ,
"Number of call sites analyzed"  )

Variable Documentation

◆ ColdCallSiteThreshold

cl::opt< int > ColdCallSiteThreshold("inline-cold-callsite-threshold", cl::Hidden, cl::init(45), cl::desc("Threshold for inlining cold callsites")) ( "inline-cold-callsite-threshold" ,
cl::Hidden ,
cl::init(45) ,
cl::desc("Threshold for inlining cold callsites")  )
static

Referenced by llvm::getInlineParams().

◆ ColdThreshold

cl::opt< int > ColdThreshold("inlinecold-threshold", cl::Hidden, cl::init(45), cl::desc("Threshold for inlining functions with cold attribute")) ( "inlinecold-threshold" ,
cl::Hidden ,
cl::init(45) ,
cl::desc("Threshold for inlining functions with cold attribute")  )
static

Referenced by llvm::getInlineParams().

◆ DefaultThreshold

cl::opt< int > DefaultThreshold("inlinedefault-threshold", cl::Hidden, cl::init(225), cl::desc("Default amount of inlining to perform")) ( "inlinedefault-threshold" ,
cl::Hidden ,
cl::init(225) ,
cl::desc("Default amount of inlining to perform")  )
static

◆ HintThreshold

cl::opt< int > HintThreshold("inlinehint-threshold", cl::Hidden, cl::init(325), cl::desc("Threshold for inlining functions with inline hint")) ( "inlinehint-threshold" ,
cl::Hidden ,
cl::init(325) ,
cl::desc("Threshold for inlining functions with inline hint")  )
static

Referenced by llvm::getInlineParams().

◆ HotCallSiteThreshold

cl::opt< int > HotCallSiteThreshold("hot-callsite-threshold", cl::Hidden, cl::init(3000), cl::desc("Threshold for hot callsites ")) ( "hot-callsite-threshold" ,
cl::Hidden ,
cl::init(3000) ,
cl::desc("Threshold for hot callsites ")  )
static

Referenced by llvm::getInlineParams().

◆ InlineThreshold

cl::opt< int > InlineThreshold("inline-threshold", cl::Hidden, cl::init(225), cl::desc("Control the amount of inlining to perform (default = 225)")) ( "inline-threshold" ,
cl::Hidden ,
cl::init(225) ,
cl::desc("Control the amount of inlining to perform (default = 225)")  )
static

Referenced by llvm::getInlineParams().

◆ InstrCost

cl::opt< int > InstrCost("inline-instr-cost", cl::Hidden, cl::init(5), cl::desc("Cost of a single instruction when inlining")) ( "inline-instr-cost" ,
cl::Hidden ,
cl::init(5) ,
cl::desc("Cost of a single instruction when inlining")  )
static

◆ LocallyHotCallSiteThreshold

cl::opt< int > LocallyHotCallSiteThreshold("locally-hot-callsite-threshold", cl::Hidden, cl::init(525), cl::desc("Threshold for locally hot callsites ")) ( "locally-hot-callsite-threshold" ,
cl::Hidden ,
cl::init(525) ,
cl::desc("Threshold for locally hot callsites ")  )
static