32 #define DEBUG_TYPE "inline"
37 class AlwaysInliner :
public Inliner {
42 AlwaysInliner() :
Inliner(
ID, -2000000000,
true),
47 AlwaysInliner(
bool InsertLifetime)
48 :
Inliner(
ID, -2000000000, InsertLifetime), ICA(
nullptr) {
60 bool doFinalization(
CallGraph &CG)
override {
61 return removeDeadFunctions(CG,
true);
69 "Inliner for always_inline functions",
false,
false)
80 return new AlwaysInliner(InsertLifetime);
103 ICA->isInlineViable(*Callee))
110 ICA = &getAnalysis<InlineCostAnalysis>();
114 void AlwaysInliner::getAnalysisUsage(
AnalysisUsage &AU)
const {
Pass interface - Implemented by all 'passes'.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
An immutable pass that tracks lazily created AssumptionCache objects.
Pass * createAlwaysInlinerPass()
createAlwaysInlinerPass - Return a new pass object that inlines only functions that are marked as "al...
Represents the cost of inlining a function.
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
virtual bool doFinalization(Module &)
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
bool hasFnAttr(Attribute::AttrKind A) const
Return true if this function has the given attribute.
This file provides interfaces used to build and manipulate a call graph, which is a very useful tool ...
void getAnalysisUsage(AnalysisUsage &Info) const override
getAnalysisUsage - For this class, we declare that we require and preserve the call graph...
Inliner - This class contains all of the helper code which is used to perform the inlining operations...
The ModulePass which wraps up a CallGraph and the logic to build it.
FunTy * getCalledFunction() const
getCalledFunction - Return the function being called if this is a direct call, otherwise return null ...
Cost analyzer used by inliner.
always Inliner for always_inline false
Represent the analysis usage information of a pass.
static InlineCost getNever()
for(unsigned i=0, e=MI->getNumOperands();i!=e;++i)
#define INITIALIZE_AG_DEPENDENCY(depName)
bool runOnSCC(CallGraphSCC &SCC) override
runOnSCC - This method should be implemented by the subclass to perform whatever action is necessary ...
void initializeAlwaysInlinerPass(PassRegistry &)
Module.h This file contains the declarations for the Module class.
The basic data container for the call graph of a Module of IR.
bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
INITIALIZE_PASS_BEGIN(AlwaysInliner,"always-inline","Inliner for always_inline functions", false, false) INITIALIZE_PASS_END(AlwaysInliner
CallGraphSCC - This is a single SCC that a CallGraphSCCPass is run on.
always Inliner for always_inline functions
static InlineCost getAlways()