[llvm-commits] [llvm] r45903 - in /llvm/trunk: include/llvm/Transforms/IPO.h include/llvm/Transforms/IPO/InlinerPass.h lib/Transforms/IPO/InlineSimple.cpp lib/Transforms/IPO/Inliner.cpp
Chris Lattner
sabre at nondot.org
Fri Jan 11 22:49:13 PST 2008
Author: lattner
Date: Sat Jan 12 00:49:13 2008
New Revision: 45903
URL: http://llvm.org/viewvc/llvm-project?rev=45903&view=rev
Log:
Allow clients to specify the inline threshold when creating
the inliner pass. Patch by Robert Zeh.
Modified:
llvm/trunk/include/llvm/Transforms/IPO.h
llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h
llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp
llvm/trunk/lib/Transforms/IPO/Inliner.cpp
Modified: llvm/trunk/include/llvm/Transforms/IPO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO.h?rev=45903&r1=45902&r2=45903&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/IPO.h (original)
+++ llvm/trunk/include/llvm/Transforms/IPO.h Sat Jan 12 00:49:13 2008
@@ -91,6 +91,7 @@
/// to inline direct function calls to small functions.
///
Pass *createFunctionInliningPass();
+Pass *createFunctionInliningPass(int Threshold);
//===----------------------------------------------------------------------===//
/// createPruneEHPass - Return a new pass object which transforms invoke
Modified: llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h?rev=45903&r1=45902&r2=45903&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h (original)
+++ llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h Sat Jan 12 00:49:13 2008
@@ -27,6 +27,7 @@
///
struct Inliner : public CallGraphSCCPass {
explicit Inliner(const void *ID);
+ explicit Inliner(const void *ID, int Threshold);
/// getAnalysisUsage - For this class, we declare that we require and preserve
/// the call graph. If the derived class implements this method, it should
Modified: llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp?rev=45903&r1=45902&r2=45903&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp Sat Jan 12 00:49:13 2008
@@ -35,6 +35,7 @@
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 @@
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) {
Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=45903&r1=45902&r2=45903&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Sat Jan 12 00:49:13 2008
@@ -39,6 +39,9 @@
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.
More information about the llvm-commits
mailing list