LLVM  14.0.0git
Classes | Namespaces | Functions | Variables
InlineCost.h File Reference
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/CallGraphSCCPass.h"
#include "llvm/Analysis/InlineModelFeatureMaps.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include <cassert>
#include <climits>
Include dependency graph for InlineCost.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  llvm::CostBenefitPair
 
class  llvm::InlineCost
 Represents the cost of inlining a function. More...
 
class  llvm::InlineResult
 InlineResult is basically true or false. More...
 
struct  llvm::InlineParams
 Thresholds to tune inline cost analysis. More...
 
struct  llvm::InlineCostAnnotationPrinterPass
 

Namespaces

 llvm
 ---------------------— PointerInfo ------------------------------------—
 
 llvm::InlineConstants
 

Functions

InlineParams llvm::getInlineParams ()
 Generate the parameters to tune the inline cost analysis based only on the commandline options. More...
 
InlineParams llvm::getInlineParams (int Threshold)
 Generate the parameters to tune the inline cost analysis based on command line options. More...
 
InlineParams llvm::getInlineParams (unsigned OptLevel, unsigned SizeOptLevel)
 Generate the parameters to tune the inline cost analysis based on command line options. More...
 
int llvm::getCallsiteCost (CallBase &Call, const DataLayout &DL)
 Return the cost associated with a callsite, including parameter passing and the call/return instruction. More...
 
InlineCost llvm::getInlineCost (CallBase &Call, const InlineParams &Params, TargetTransformInfo &CalleeTTI, function_ref< AssumptionCache &(Function &)> GetAssumptionCache, function_ref< const TargetLibraryInfo &(Function &)> GetTLI, function_ref< BlockFrequencyInfo &(Function &)> GetBFI=nullptr, ProfileSummaryInfo *PSI=nullptr, OptimizationRemarkEmitter *ORE=nullptr)
 Get an InlineCost object representing the cost of inlining this callsite. More...
 
InlineCost llvm::getInlineCost (CallBase &Call, Function *Callee, const InlineParams &Params, TargetTransformInfo &CalleeTTI, function_ref< AssumptionCache &(Function &)> GetAssumptionCache, function_ref< const TargetLibraryInfo &(Function &)> GetTLI, function_ref< BlockFrequencyInfo &(Function &)> GetBFI=nullptr, ProfileSummaryInfo *PSI=nullptr, OptimizationRemarkEmitter *ORE=nullptr)
 Get an InlineCost with the callee explicitly specified. More...
 
Optional< InlineResultllvm::getAttributeBasedInliningDecision (CallBase &Call, Function *Callee, TargetTransformInfo &CalleeTTI, function_ref< const TargetLibraryInfo &(Function &)> GetTLI)
 Returns InlineResult::success() if the call site should be always inlined because of user directives, and the inlining is viable. More...
 
Optional< intllvm::getInliningCostEstimate (CallBase &Call, TargetTransformInfo &CalleeTTI, function_ref< AssumptionCache &(Function &)> GetAssumptionCache, function_ref< BlockFrequencyInfo &(Function &)> GetBFI=nullptr, ProfileSummaryInfo *PSI=nullptr, OptimizationRemarkEmitter *ORE=nullptr)
 Get the cost estimate ignoring thresholds. More...
 
Optional< InlineCostFeaturesllvm::getInliningCostFeatures (CallBase &Call, TargetTransformInfo &CalleeTTI, function_ref< AssumptionCache &(Function &)> GetAssumptionCache, function_ref< BlockFrequencyInfo &(Function &)> GetBFI=nullptr, ProfileSummaryInfo *PSI=nullptr, OptimizationRemarkEmitter *ORE=nullptr)
 Get the expanded cost features. More...
 
InlineResult llvm::isInlineViable (Function &Callee)
 Minimal filter to detect invalid constructs for inlining. More...
 

Variables

const int llvm::InlineConstants::OptSizeThreshold = 50
 Use when optsize (-Os) is specified. More...
 
const int llvm::InlineConstants::OptMinSizeThreshold = 5
 Use when minsize (-Oz) is specified. More...
 
const int llvm::InlineConstants::OptAggressiveThreshold = 250
 Use when -O3 is specified. More...
 
const int llvm::InlineConstants::InstrCost = 5
 
const int llvm::InlineConstants::IndirectCallThreshold = 100
 
const int llvm::InlineConstants::LoopPenalty = 25
 
const int llvm::InlineConstants::LastCallToStaticBonus = 15000
 
const int llvm::InlineConstants::ColdccPenalty = 2000
 
const unsigned llvm::InlineConstants::TotalAllocaSizeRecursiveCaller = 1024
 Do not inline functions which allocate this many bytes on the stack when the caller is recursive. More...
 
const uint64_t llvm::InlineConstants::MaxSimplifiedDynamicAllocaToInline = 65536
 Do not inline dynamic allocas that have been constant propagated to be static allocas above this amount in bytes. More...