LLVM API Documentation

Public Member Functions | Static Public Attributes
llvm::InlineCostAnalysis Class Reference

Cost analyzer used by inliner. More...

#include <InlineCost.h>

Inheritance diagram for llvm::InlineCostAnalysis:
Inheritance graph
[legend]
Collaboration diagram for llvm::InlineCostAnalysis:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 InlineCostAnalysis ()
 ~InlineCostAnalysis ()
void getAnalysisUsage (AnalysisUsage &AU) const override
bool runOnSCC (CallGraphSCC &SCC) override
InlineCost getInlineCost (CallSite CS, int Threshold)
 Get an InlineCost object representing the cost of inlining this callsite.
InlineCost getInlineCost (CallSite CS, Function *Callee, int Threshold)
 Get an InlineCost with the callee explicitly specified. This allows you to calculate the cost of inlining a function via a pointer. This behaves exactly as the version with no explicit callee parameter in all other respects.
bool isInlineViable (Function &Callee)
 Minimal filter to detect invalid constructs for inlining.

Static Public Attributes

static char ID = 0

Detailed Description

Cost analyzer used by inliner.

Definition at line 102 of file InlineCost.h.


Constructor & Destructor Documentation

Definition at line 1242 of file InlineCost.cpp.

Definition at line 1244 of file InlineCost.cpp.


Member Function Documentation

void InlineCostAnalysis::getAnalysisUsage ( AnalysisUsage AU) const [override, virtual]

getAnalysisUsage - For this class, we declare that we require and preserve the call graph. If the derived class implements this method, it should always explicitly call the implementation here.

Reimplemented from llvm::CallGraphSCCPass.

Definition at line 1246 of file InlineCost.cpp.

References llvm::AnalysisUsage::addRequired(), and llvm::AnalysisUsage::setPreservesAll().

Get an InlineCost object representing the cost of inlining this callsite.

Note that threshold is passed into this function. Only costs below the threshold are computed with any accuracy. The threshold can be used to bound the computation necessary to determine whether the cost is sufficiently low to warrant inlining.

Also note that calling this function *dynamically* computes the cost of inlining the callsite. It is an expensive, heavyweight call.

Definition at line 1259 of file InlineCost.cpp.

References llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledFunction(), and Threshold.

InlineCost InlineCostAnalysis::getInlineCost ( CallSite  CS,
Function Callee,
int  Threshold 
)
bool InlineCostAnalysis::runOnSCC ( CallGraphSCC SCC) [override, virtual]

runOnSCC - This method should be implemented by the subclass to perform whatever action is necessary for the specified SCC. Note that non-recursive (or only self-recursive) functions will have an SCC size of 1, where recursive portions of the call graph will have SCC size > 1.

SCC passes that add or delete functions to the SCC are required to update the SCC list, otherwise stale pointers may be dereferenced.

Implements llvm::CallGraphSCCPass.

Definition at line 1253 of file InlineCost.cpp.


Member Data Documentation

Inline Cost true char InlineCostAnalysis::ID = 0 [inline, static]

Definition at line 107 of file InlineCost.h.


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