summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit3471ae8c5d3de87f5b064a3b0705830fc44bc328 (patch)
tree3ba9d397d46d9b4b1c88638625e791b450d95b23 /llvm/lib/Transforms/IPO/Inliner.cpp
parent1f5c2e7fc64afb886e022566ed36d6c51481cb3e (diff)
downloadbcm5719-llvm-3471ae8c5d3de87f5b064a3b0705830fc44bc328.tar.gz
bcm5719-llvm-3471ae8c5d3de87f5b064a3b0705830fc44bc328.zip
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. llvm-svn: 48725
Diffstat (limited to 'llvm/lib/Transforms/IPO/Inliner.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/Inliner.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp
index acd360464ca..f33f368fc0e 100644
--- a/llvm/lib/Transforms/IPO/Inliner.cpp
+++ b/llvm/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 {
OpenPOWER on IntegriCloud