diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-01-12 06:49:13 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-01-12 06:49:13 +0000 |
| commit | 22ad7abdfe6bfbe807cb797b0a446a3a15097afe (patch) | |
| tree | 60405c28bbffd1904be98f2a613d9ee2e2c31559 /llvm/lib/Transforms | |
| parent | 459dc52df400fdaa5a8334d16579d67ec2cdaee1 (diff) | |
| download | bcm5719-llvm-22ad7abdfe6bfbe807cb797b0a446a3a15097afe.tar.gz bcm5719-llvm-22ad7abdfe6bfbe807cb797b0a446a3a15097afe.zip | |
Allow clients to specify the inline threshold when creating
the inliner pass. Patch by Robert Zeh.
llvm-svn: 45903
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/IPO/InlineSimple.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/Transforms/IPO/Inliner.cpp | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/InlineSimple.cpp b/llvm/lib/Transforms/IPO/InlineSimple.cpp index d72edf84805..fe0ea5a4e89 100644 --- a/llvm/lib/Transforms/IPO/InlineSimple.cpp +++ b/llvm/lib/Transforms/IPO/InlineSimple.cpp @@ -35,6 +35,7 @@ namespace { InlineCostAnalyzer CA; public: SimpleInliner() : Inliner(&ID) {} + SimpleInliner(int Threshold) : Inliner(&ID, Threshold) {} static char ID; // Pass identification, replacement for typeid int getInlineCost(CallSite CS) { return CA.getInlineCost(CS, NeverInline); @@ -47,6 +48,10 @@ namespace { Pass *llvm::createFunctionInliningPass() { return new SimpleInliner(); } +Pass *llvm::createFunctionInliningPass(int Threshold) { + return new SimpleInliner(Threshold); +} + // doInitialization - Initializes the vector of functions that have been // annotated with the noinline attribute. bool SimpleInliner::doInitialization(CallGraph &CG) { diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp index ca8eec48b4a..7ad7dc4c6ae 100644 --- a/llvm/lib/Transforms/IPO/Inliner.cpp +++ b/llvm/lib/Transforms/IPO/Inliner.cpp @@ -39,6 +39,9 @@ namespace { Inliner::Inliner(const void *ID) : CallGraphSCCPass((intptr_t)ID), InlineThreshold(InlineLimit) {} +Inliner::Inliner(const void *ID, int Threshold) + : CallGraphSCCPass((intptr_t)ID), InlineThreshold(Threshold) {} + /// 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. |

