LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
llvm::Inliner Struct Referenceabstract

#include <InlinerPass.h>

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

Public Member Functions

 Inliner (char &ID)
 
 Inliner (char &ID, int Threshold, bool InsertLifetime)
 
virtual void getAnalysisUsage (AnalysisUsage &Info) const
 
virtual bool runOnSCC (CallGraphSCC &SCC)
 
virtual bool doFinalization (CallGraph &CG)
 
unsigned getInlineThreshold () const
 
unsigned getInlineThreshold (CallSite CS) const
 
virtual InlineCost getInlineCost (CallSite CS)=0
 
bool removeDeadFunctions (CallGraph &CG, bool AlwaysInlineOnly=false)
 
- Public Member Functions inherited from llvm::CallGraphSCCPass
 CallGraphSCCPass (char &pid)
 
PasscreatePrinterPass (raw_ostream &O, const std::string &Banner) const
 
virtual bool doInitialization (CallGraph &CG)
 
virtual void assignPassManager (PMStack &PMS, PassManagerType PMT)
 Assign pass manager to manager this pass. More...
 
virtual PassManagerType getPotentialPassManagerType () const
 Return what kind of Pass Manager can manage this pass. More...
 
- Public Member Functions inherited from llvm::Pass
 Pass (PassKind K, char &pid)
 
virtual ~Pass ()
 
PassKind getPassKind () const
 
virtual const char * getPassName () const
 
AnalysisID getPassID () const
 getPassID - Return the PassID number that corresponds to this pass. More...
 
virtual bool doInitialization (Module &)
 
virtual bool doFinalization (Module &)
 
virtual void print (raw_ostream &O, const Module *M) const
 
void dump () const
 
virtual void preparePassManager (PMStack &)
 Check if available pass managers are suitable for this pass or not. More...
 
void setResolver (AnalysisResolver *AR)
 
AnalysisResolvergetResolver () const
 
virtual void releaseMemory ()
 
virtual void * getAdjustedAnalysisPointer (AnalysisID ID)
 
virtual ImmutablePassgetAsImmutablePass ()
 
virtual PMDataManagergetAsPMDataManager ()
 
virtual void verifyAnalysis () const
 
virtual void dumpPassStructure (unsigned Offset=0)
 
template<typename AnalysisType >
AnalysisType * getAnalysisIfAvailable () const
 
bool mustPreserveAnalysisID (char &AID) const
 
template<typename AnalysisType >
AnalysisType & getAnalysis () const
 
template<typename AnalysisType >
AnalysisType & getAnalysis (Function &F)
 
template<typename AnalysisType >
AnalysisType & getAnalysisID (AnalysisID PI) const
 
template<typename AnalysisType >
AnalysisType & getAnalysisID (AnalysisID PI, Function &F)
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::Pass
static const PassInfolookupPassInfo (const void *TI)
 
static const PassInfolookupPassInfo (StringRef Arg)
 
static PasscreatePass (AnalysisID ID)
 

Detailed Description

Inliner - This class contains all of the helper code which is used to perform the inlining operations that do not depend on the policy.

Definition at line 32 of file InlinerPass.h.

Constructor & Destructor Documentation

Inliner::Inliner ( char &  ID)
explicit

Definition at line 56 of file Inliner.cpp.

Inliner::Inliner ( char &  ID,
int  Threshold,
bool  InsertLifetime 
)
explicit

Definition at line 59 of file Inliner.cpp.

Member Function Documentation

bool Inliner::doFinalization ( CallGraph CG)
virtual

doFinalization - This method is called after the SCC's of the program has been processed, allowing the pass to do final cleanup as necessary.

Reimplemented from llvm::CallGraphSCCPass.

Definition at line 572 of file Inliner.cpp.

References removeDeadFunctions().

void Inliner::getAnalysisUsage ( AnalysisUsage AU) const
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 67 of file Inliner.cpp.

References llvm::CallGraphSCCPass::getAnalysisUsage().

virtual InlineCost llvm::Inliner::getInlineCost ( CallSite  CS)
pure virtual

getInlineCost - This method must be implemented by the subclass to determine the cost of inlining the specified call site. If the cost returned is greater than the current inline threshold, the call site is not inlined.

unsigned llvm::Inliner::getInlineThreshold ( ) const
inline

This method returns the value specified by the -inline-threshold value, specified on the command line. This is typically not directly needed.

Definition at line 53 of file InlinerPass.h.

unsigned Inliner::getInlineThreshold ( CallSite  CS) const

Calculate the inline threshold for given Caller. This threshold is lower if the caller is marked with OptimizeForSize and -inline-threshold is not given on the comand line. It is higher if the callee is marked with the inlinehint attribute.

Definition at line 255 of file Inliner.cpp.

References llvm::Function::getAttributes(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledFunction(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getCaller(), llvm::AttributeSet::hasAttribute(), HintThreshold, llvm::Attribute::InlineHint, InlineLimit, llvm::GlobalValue::isDeclaration(), llvm::Attribute::MinSize, llvm::Attribute::OptimizeForSize, and OptSizeThreshold.

bool Inliner::removeDeadFunctions ( CallGraph CG,
bool  AlwaysInlineOnly = false 
)
bool Inliner::runOnSCC ( CallGraphSCC SCC)
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 397 of file Inliner.cpp.

References llvm::SmallVectorTemplateCommon< T >::back(), llvm::CallGraphSCC::begin(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::Function::begin(), llvm::dbgs(), DEBUG, llvm::SmallVectorBase::empty(), llvm::CallGraphSCC::end(), llvm::Function::end(), llvm::SmallVectorImpl< T >::erase(), llvm::Instruction::eraseFromParent(), F(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledFunction(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getCaller(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::Value::getName(), llvm::GlobalValue::hasLocalLinkage(), I, InlineCallIfPossible(), llvm::InlineFunctionInfo::InlinedCalls, InlineHistoryIncludes(), llvm::GlobalValue::isDeclaration(), llvm::isInstructionTriviallyDead(), llvm::CallGraphSCC::isSingular(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::pop_back(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::CallGraph::removeFunctionFromModule(), llvm::SmallVectorTemplateCommon< T >::size(), std::swap(), TD, and llvm::Value::use_empty().


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