LLVM  13.0.0git
Namespaces | Macros | Functions | Variables
InlineAdvisor.cpp File Reference
#include "llvm/Analysis/InlineAdvisor.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/InlineCost.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/Analysis/ProfileSummaryInfo.h"
#include "llvm/Analysis/ReplayInlineAdvisor.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/raw_ostream.h"
Include dependency graph for InlineAdvisor.cpp:

Go to the source code of this file.

Namespaces

 llvm
 

Macros

#define DEBUG_TYPE   "inline"
 

Functions

 STATISTIC (NumCallerCallersAnalyzed, "Number of caller-callers analyzed")
 
static llvm::Optional< llvm::InlineCostgetDefaultInlineAdvice (CallBase &CB, FunctionAnalysisManager &FAM, const InlineParams &Params)
 
static bool shouldBeDeferred (Function *Caller, InlineCost IC, int &TotalSecondaryCost, function_ref< InlineCost(CallBase &CB)> GetInlineCost)
 Return true if inlining of CB can block the caller from being inlined which is proved to be more beneficial. More...
 
static raw_ostreamllvm::operator<< (raw_ostream &R, const ore::NV &Arg)
 
template<class RemarkT >
RemarkT & llvm::operator<< (RemarkT &&R, const InlineCost &IC)
 

Variables

static cl::opt< bool > InlineRemarkAttribute ("inline-remark-attribute", cl::init(false), cl::Hidden, cl::desc("Enable adding inline-remark attribute to" " callsites processed by inliner but decided" " to be not inlined"))
 Flag to add inline messages as callsite attributes 'inline-remark'. More...
 
static cl::opt< intInlineDeferralScale ("inline-deferral-scale", cl::desc("Scale to limit the cost of inline deferral"), cl::init(2), cl::Hidden)
 
cl::opt< InlinerFunctionImportStatsOpts > InlinerFunctionImportStats
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "inline"

Definition at line 28 of file InlineAdvisor.cpp.

Function Documentation

◆ getDefaultInlineAdvice()

static llvm::Optional<llvm::InlineCost> getDefaultInlineAdvice ( CallBase CB,
FunctionAnalysisManager FAM,
const InlineParams Params 
)
static

◆ shouldBeDeferred()

static bool shouldBeDeferred ( Function Caller,
InlineCost  IC,
int TotalSecondaryCost,
function_ref< InlineCost(CallBase &CB)>  GetInlineCost 
)
static

Return true if inlining of CB can block the caller from being inlined which is proved to be more beneficial.

IC is the estimated inline cost associated with callsite CB. TotalSecondaryCost will be set to the estimated cost of inlining the caller if CB is suppressed for inlining.

Definition at line 194 of file InlineAdvisor.cpp.

References llvm::CallBase::getCalledFunction(), llvm::InlineCost::getCost(), llvm::InlineCost::getCostDelta(), InlineDeferralScale, llvm::InlineCost::isAlways(), and llvm::InlineConstants::LastCallToStaticBonus.

Referenced by llvm::shouldInline().

◆ STATISTIC()

STATISTIC ( NumCallerCallersAnalyzed  ,
"Number of caller-callers analyzed"   
)

Variable Documentation

◆ InlineDeferralScale

cl::opt<int> InlineDeferralScale("inline-deferral-scale", cl::desc("Scale to limit the cost of inline deferral"), cl::init(2), cl::Hidden)
static

Referenced by shouldBeDeferred().

◆ InlineRemarkAttribute

cl::opt<bool> InlineRemarkAttribute("inline-remark-attribute", cl::init(false), cl::Hidden, cl::desc("Enable adding inline-remark attribute to" " callsites processed by inliner but decided" " to be not inlined"))
static

Flag to add inline messages as callsite attributes 'inline-remark'.

Referenced by llvm::setInlineRemark().

◆ InlinerFunctionImportStats

cl::opt<InlinerFunctionImportStatsOpts> InlinerFunctionImportStats