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

Chris Lattner lattner at cs.uiuc.edu
Tue Oct 7 14:34:01 PDT 2003


Changes in directory llvm/lib/Transforms/IPO:

InlineSimple.cpp updated: 1.51 -> 1.52

---
Log message:

Fix bugzilla bug #5


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

Index: llvm/lib/Transforms/IPO/InlineSimple.cpp
diff -u llvm/lib/Transforms/IPO/InlineSimple.cpp:1.51 llvm/lib/Transforms/IPO/InlineSimple.cpp:1.52
--- llvm/lib/Transforms/IPO/InlineSimple.cpp:1.51	Mon Oct  6 10:52:43 2003
+++ llvm/lib/Transforms/IPO/InlineSimple.cpp	Tue Oct  7 14:33:31 2003
@@ -97,7 +97,12 @@
     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;





More information about the llvm-commits mailing list