summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
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
commit95ce36da0d75ae8f969a12a8454c2104ad75ed94 (patch)
tree6e54e6598b61a03297be7955c2b50ab2c916e3c7 /llvm/lib/Transforms/IPO
parent7f04ebc85863157ea0b49f19b73641d4ae91da5f (diff)
downloadbcm5719-llvm-95ce36da0d75ae8f969a12a8454c2104ad75ed94.tar.gz
bcm5719-llvm-95ce36da0d75ae8f969a12a8454c2104ad75ed94.zip
Restore old inlining heuristic. As the comment indicates, this is a nasty
horrible hack. llvm-svn: 12423
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/InlineSimple.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/InlineSimple.cpp b/llvm/lib/Transforms/IPO/InlineSimple.cpp
index d28fcbf85d5..0c950c7ba3f 100644
--- a/llvm/lib/Transforms/IPO/InlineSimple.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud