[llvm-commits] CVS: llvm/lib/Transforms/IPO/InlineSimple.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Mar 15 00:39:01 PST 2004


Changes in directory llvm/lib/Transforms/IPO:

InlineSimple.cpp updated: 1.60 -> 1.61

---
Log message:

Restore old inlining heuristic.  As the comment indicates, this is a nasty
horrible hack.



---
Diffs of the changes:  (+8 -1)

Index: llvm/lib/Transforms/IPO/InlineSimple.cpp
diff -u llvm/lib/Transforms/IPO/InlineSimple.cpp:1.60 llvm/lib/Transforms/IPO/InlineSimple.cpp:1.61
--- llvm/lib/Transforms/IPO/InlineSimple.cpp:1.60	Sat Mar 13 17:15:45 2004
+++ llvm/lib/Transforms/IPO/InlineSimple.cpp	Mon Mar 15 00:38:14 2004
@@ -216,7 +216,14 @@
 
   // 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





More information about the llvm-commits mailing list