summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/InlineSimple.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-04-08 06:34:31 +0000
committerChris Lattner <sabre@nondot.org>2004-04-08 06:34:31 +0000
commit775cbdd51a3b33dd5eb343689f65ab5cc8ac7118 (patch)
treed4ac4edefcd38d6a7e233374c3464492c5f1b347 /lib/Transforms/IPO/InlineSimple.cpp
parent0c199a7628acd1c887ef3b9149538268d68efc97 (diff)
downloadllvm-775cbdd51a3b33dd5eb343689f65ab5cc8ac7118.tar.gz
llvm-775cbdd51a3b33dd5eb343689f65ab5cc8ac7118.tar.bz2
llvm-775cbdd51a3b33dd5eb343689f65ab5cc8ac7118.tar.xz
Remove the "really gross hacks" that are there to deal with recursive functions.
Now we collect all of the call sites we are interested in inlining, then inline them. This entirely avoids issues with trying to inline a call site we got by inlining another call site. This also eliminates iterator invalidation issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12770 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/InlineSimple.cpp')
-rw-r--r--lib/Transforms/IPO/InlineSimple.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp
index 0c950c7ba3..c0d97c5515 100644
--- a/lib/Transforms/IPO/InlineSimple.cpp
+++ b/lib/Transforms/IPO/InlineSimple.cpp
@@ -217,13 +217,7 @@ 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.
//
- // 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();
+ InlineCost += Caller->size()/20;
// Look at the size of the callee. Each basic block counts as 20 units, and