aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-06-28 15:57:04 +0000
committerChris Lattner <sabre@nondot.org>2003-06-28 15:57:04 +0000
commitcf6bac3b565d02fe3a7e270e0d652303aa1279da (patch)
tree78b1c6d9010973ed580f731c0b13678195ea2a45
parentd2a6fc397ee982936dee7dd5692b1481bcd9fe8f (diff)
downloadexternal_llvm-cf6bac3b565d02fe3a7e270e0d652303aa1279da.zip
external_llvm-cf6bac3b565d02fe3a7e270e0d652303aa1279da.tar.gz
external_llvm-cf6bac3b565d02fe3a7e270e0d652303aa1279da.tar.bz2
Allow the inlining limit to be controlled from the command line!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6929 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/IPO/InlineSimple.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp
index 0151a2d..4839186 100644
--- a/lib/Transforms/IPO/InlineSimple.cpp
+++ b/lib/Transforms/IPO/InlineSimple.cpp
@@ -11,10 +11,14 @@
#include "llvm/iOther.h"
#include "llvm/iMemory.h"
#include "Support/Statistic.h"
+#include "Support/CommandLine.h"
#include <set>
namespace {
Statistic<> NumInlined("inline", "Number of functions inlined");
+ cl::opt<unsigned> // FIXME: 200 is VERY conservative
+ InlineLimit("inline-threshold", cl::Hidden, cl::init(200),
+ cl::desc("Control the amount of inlining to perform (default = 200)"));
struct FunctionInlining : public Pass {
virtual bool run(Module &M) {
@@ -55,7 +59,7 @@ static inline bool ShouldInlineFunction(const CallInst *CI) {
// inliner is. If this value is negative after the final computation,
// inlining is not performed.
//
- int InlineQuality = 200; // FIXME: This is VERY conservative
+ int InlineQuality = InlineLimit;
// If there is only one call of the function, and it has internal linkage,
// make it almost guaranteed to be inlined.