LLVM API Documentation
#include <InlinerPass.h>
Public Member Functions | |
| Inliner (void *ID) | |
| Inliner (void *ID, int Threshold) | |
| virtual void | getAnalysisUsage (AnalysisUsage &Info) const |
| virtual bool | runOnSCC (const std::vector< CallGraphNode * > &SCC) |
| virtual bool | doFinalization (CallGraph &CG) |
| unsigned | getInlineThreshold () const |
| virtual InlineCost | getInlineCost (CallSite CS)=0 |
| virtual float | getInlineFudgeFactor (CallSite CS)=0 |
| virtual void | resetCachedCostInfo (Function *Caller)=0 |
| bool | removeDeadFunctions (CallGraph &CG, SmallPtrSet< const Function *, 16 > *DNR=NULL) |
Definition at line 29 of file InlinerPass.h.
| Inliner::Inliner | ( | void * | ID | ) | [explicit] |
Definition at line 37 of file Inliner.cpp.
| Inliner::Inliner | ( | void * | ID, | |
| int | Threshold | |||
| ) | [explicit] |
Definition at line 40 of file Inliner.cpp.
| void Inliner::getAnalysisUsage | ( | AnalysisUsage & | Info | ) | 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.
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 46 of file Inliner.cpp.
References llvm::AnalysisUsage::addRequired(), and llvm::CallGraphSCCPass::getAnalysisUsage().
| bool Inliner::runOnSCC | ( | const std::vector< CallGraphNode * > & | 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.
Implements llvm::CallGraphSCCPass.
Definition at line 124 of file Inliner.cpp.
References BB, llvm::MachineBasicBlock::begin(), Caller, Changed, DOUT, E, llvm::MachineBasicBlock::end(), F, llvm::CallSite::get(), llvm::CallSite::getCalledFunction(), llvm::CallSite::getCaller(), llvm::CallSite::getInstruction(), llvm::Value::getName(), InlineCallIfPossible(), llvm::Function::isDeclaration(), resetCachedCostInfo(), and std::swap().
| 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 221 of file Inliner.cpp.
References removeDeadFunctions().
| 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 50 of file InlinerPass.h.
| 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.
| virtual float llvm::Inliner::getInlineFudgeFactor | ( | CallSite | CS | ) | [pure virtual] |
| virtual void llvm::Inliner::resetCachedCostInfo | ( | Function * | Caller | ) | [pure virtual] |
resetCachedCostInfo - erase any cached cost data from the derived class. If the derived class has no such data this can be empty.
Referenced by runOnSCC().
| bool Inliner::removeDeadFunctions | ( | CallGraph & | CG, | |
| SmallPtrSet< const Function *, 16 > * | DNR = NULL | |||
| ) |
removeDeadFunctions - Remove dead functions that are not included in DNR (Do Not Remove) list.
Definition at line 227 of file Inliner.cpp.
References llvm::CallGraph::begin(), Changed, llvm::SmallPtrSet< PtrType, SmallSize >::count(), E, llvm::CallGraph::end(), F, llvm::CallGraph::getExternalCallingNode(), llvm::CallGraphNode::getFunction(), llvm::CallGraphNode::removeAllCalledFunctions(), llvm::CallGraphNode::removeAnyCallEdgeTo(), and llvm::CallGraph::removeFunctionFromModule().
Referenced by doFinalization().