30 #define DEBUG_TYPE "inline"
39 class SimpleInliner :
public Inliner {
43 SimpleInliner() :
Inliner(
ID), ICA(
nullptr) {
48 :
Inliner(
ID, Threshold,
true), ICA(
nullptr) {
55 return ICA->getInlineCost(CS, getInlineThreshold(CS));
62 static int computeThresholdFromOptLevels(
unsigned OptLevel,
63 unsigned SizeOptLevel) {
66 if (SizeOptLevel == 1)
68 if (SizeOptLevel == 2)
77 "Function Integration/Inlining",
false,
false)
88 return new SimpleInliner(Threshold);
92 unsigned SizeOptLevel) {
93 return new SimpleInliner(
94 computeThresholdFromOptLevels(OptLevel, SizeOptLevel));
98 ICA = &getAnalysis<InlineCostAnalysis>();
102 void SimpleInliner::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...
Function Integration Inlining
void initializeSimpleInlinerPass(PassRegistry &)
An immutable pass that tracks lazily created AssumptionCache objects.
Represents the cost of inlining a function.
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
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.
Cost analyzer used by inliner.
Represent the analysis usage information of a pass.
Function Integration false
#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 ...
Module.h This file contains the declarations for the Module class.
static int const Threshold
TODO: Write a new FunctionPass AliasAnalysis so that it can keep a cache.
Pass * createFunctionInliningPass()
createFunctionInliningPass - Return a new pass object that uses a heuristic to inline direct function...
CallGraphSCC - This is a single SCC that a CallGraphSCCPass is run on.
INITIALIZE_PASS_BEGIN(SimpleInliner,"inline","Function Integration/Inlining", false, false) INITIALIZE_PASS_END(SimpleInliner