summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/Inliner.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-03-24 06:37:48 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-03-24 06:37:48 +0000
commit8d84d5b62cdf2a772d51338136c7022a6e1ff931 (patch)
tree4ad44203af29e98cb7c89ddd60b731e582e9fd4a /lib/Transforms/IPO/Inliner.cpp
parent16b412c6e278d84bcf71b1bf07a7d3c24e81a49e (diff)
downloadllvm-8d84d5b62cdf2a772d51338136c7022a6e1ff931.tar.gz
llvm-8d84d5b62cdf2a772d51338136c7022a6e1ff931.tar.bz2
llvm-8d84d5b62cdf2a772d51338136c7022a6e1ff931.tar.xz
Increasing the inline limit from (overly conservative) 200 to 300. Given each BB costs 20 and each instruction costs 5, 200 means a 4 BB function + 24 instructions (actually less because caller's size also contributes to it).
Furthermore, double the limit when more than 10% of the callee instructions are vector instructions. Multimedia kernels tend to love inlining. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48725 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/Inliner.cpp')
-rw-r--r--lib/Transforms/IPO/Inliner.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp
index acd360464c..f33f368fc0 100644
--- a/lib/Transforms/IPO/Inliner.cpp
+++ b/lib/Transforms/IPO/Inliner.cpp
@@ -31,9 +31,9 @@ STATISTIC(NumInlined, "Number of functions inlined");
STATISTIC(NumDeleted, "Number of functions deleted because all callers found");
namespace {
- cl::opt<int> // FIXME: 200 is VERY conservative
- InlineLimit("inline-threshold", cl::Hidden, cl::init(200),
- cl::desc("Control the amount of inlining to perform (default = 200)"));
+ cl::opt<int>
+ InlineLimit("inline-threshold", cl::Hidden, cl::init(400),
+ cl::desc("Control the amount of inlining to perform (default = 400)"));
}
Inliner::Inliner(const void *ID)
@@ -140,7 +140,9 @@ bool Inliner::runOnSCC(const std::vector<CallGraphNode*> &SCC) {
// try to do so.
CallSite CS = CallSites[CSi];
int InlineCost = getInlineCost(CS);
- if (InlineCost >= (int)InlineThreshold) {
+ float FudgeFactor = getInlineFudgeFactor(CS);
+
+ if (InlineCost >= (int)(InlineThreshold * FudgeFactor)) {
DOUT << " NOT Inlining: cost=" << InlineCost
<< ", Call: " << *CS.getInstruction();
} else {