Change condition for determining whether a function is small for inlining metrics...
authorEli Friedman <eli.friedman@gmail.com>
Tue, 24 May 2011 20:22:24 +0000 (20:22 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Tue, 24 May 2011 20:22:24 +0000 (20:22 +0000)
with few basic blocks are not re-analyzed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131994 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/InlineCost.cpp

index 9ea34959b998e27a29ec9bf2bdb75af39d55d8f1..efde5984c1157a069eb49dddcd37e1e94b95958a 100644 (file)
@@ -593,7 +593,7 @@ InlineCostAnalyzer::growCachedCostInfo(Function *Caller, Function *Callee) {
   CodeMetrics &CallerMetrics = CachedFunctionInfo[Caller].Metrics;
 
   // For small functions we prefer to recalculate the cost for better accuracy.
-  if (CallerMetrics.NumBlocks < 10 || CallerMetrics.NumInsts < 1000) {
+  if (CallerMetrics.NumBlocks < 10 && CallerMetrics.NumInsts < 1000) {
     resetCachedCostInfo(Caller);
     return;
   }