summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/InlineSimple.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-15 06:38:14 +0000
committerChris Lattner <sabre@nondot.org>2004-03-15 06:38:14 +0000
commit6dd196f762c934981ede17e197746b11426cd23a (patch)
treebd482d12dec80d5195a111e72fbd659eb36987e6 /lib/Transforms/IPO/InlineSimple.cpp
parentfcead4f4266d2e944fd3f8a82f24aed21c481eb5 (diff)
downloadllvm-6dd196f762c934981ede17e197746b11426cd23a.tar.gz
llvm-6dd196f762c934981ede17e197746b11426cd23a.tar.bz2
llvm-6dd196f762c934981ede17e197746b11426cd23a.tar.xz
Restore old inlining heuristic. As the comment indicates, this is a nasty
horrible hack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12423 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/InlineSimple.cpp')
-rw-r--r--lib/Transforms/IPO/InlineSimple.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp
index d28fcbf85d..0c950c7ba3 100644
--- a/lib/Transforms/IPO/InlineSimple.cpp
+++ b/lib/Transforms/IPO/InlineSimple.cpp
@@ -216,7 +216,14 @@ int SimpleInliner::getInlineCost(CallSite CS) {
// 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()/20;
+ //
+ // FIXME: THIS IS A TOTAL HACK. The problem is that we don't keep track of
+ // which call sites are the result of an inlining operation. Because of this,
+ // if we inline a recursive function into a callee, we will see a new call to
+ // the recursive function. Every time we inline we get a new callsite for the
+ // function, which only stops when the caller reaches its inlining limit.
+ // Until the real problem is fixed, we apply this gnasty hack.
+ InlineCost += Caller->size();
// Look at the size of the callee. Each basic block counts as 20 units, and