summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/InlineSimple.cpp
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
commitda78b002ca6bdaf9fd58443d943f60b8529bcf36 (patch)
treed0d5742bef9f9a0f355c93b60a77f47c825416f3 /lib/Transforms/IPO/InlineSimple.cpp
parent8324fa7cf2617cde336783ea7ae7dc4390efbe1d (diff)
downloadllvm-da78b002ca6bdaf9fd58443d943f60b8529bcf36.tar.gz
llvm-da78b002ca6bdaf9fd58443d943f60b8529bcf36.tar.bz2
llvm-da78b002ca6bdaf9fd58443d943f60b8529bcf36.tar.xz
Fix bugzilla bug #5
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8930 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/InlineSimple.cpp')
-rw-r--r--lib/Transforms/IPO/InlineSimple.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp
index 966ac2eab5..5e72d8a2e6 100644
--- a/lib/Transforms/IPO/InlineSimple.cpp
+++ b/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;