From bacb17906a5976ea734a9f5e9533a20e07a8a2fd Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 24 May 2011 20:22:24 +0000 Subject: [PATCH] Change condition for determining whether a function is small for inlining metrics so that very long functions with few basic blocks are not re-analyzed. llvm-svn: 131994 --- llvm/lib/Analysis/InlineCost.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index 9ea34959b998..efde5984c115 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -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; }