summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-07 19:33:31 +0000
committerChris Lattner <sabre@nondot.org>2003-10-07 19:33:31 +0000
commitf8492537eb9200b562149dd795c9b722d41bcab9 (patch)
treeca662ca012a7da16cc5cf84c8fa87478d6261f7b /llvm/lib
parentf6e32a4164e3889703e1d61659acee8e087750ec (diff)
downloadbcm5719-llvm-f8492537eb9200b562149dd795c9b722d41bcab9.tar.gz
bcm5719-llvm-f8492537eb9200b562149dd795c9b722d41bcab9.zip
Fix bugzilla bug #5
llvm-svn: 8930
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/IPO/InlineSimple.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/InlineSimple.cpp b/llvm/lib/Transforms/IPO/InlineSimple.cpp
index 966ac2eab5a..5e72d8a2e64 100644
--- a/llvm/lib/Transforms/IPO/InlineSimple.cpp
+++ b/llvm/lib/Transforms/IPO/InlineSimple.cpp
@@ -97,7 +97,12 @@ int SimpleInliner::getInlineCost(CallSite CS) {
CalleeFI.NumInsts = NumInsts;
}
- // Look at the size of the callee. Each basic block counts as 21 units, and
+ // Don't inline into something too big, which would make it bigger. Here, we
+ // count each basic block as a single unit.
+ InlineCost += Caller->size()*2;
+
+
+ // Look at the size of the callee. Each basic block counts as 20 units, and
// each instruction counts as 10.
InlineCost += CalleeFI.NumInsts*10 + CalleeFI.NumBlocks*20;
return InlineCost;
OpenPOWER on IntegriCloud