]> granicus.if.org Git - llvm/commitdiff
[InlineCost] Small changes to early exit condition. NFC.
authorHaicheng Wu <haicheng@codeaurora.org>
Fri, 25 Aug 2017 19:00:33 +0000 (19:00 +0000)
committerHaicheng Wu <haicheng@codeaurora.org>
Fri, 25 Aug 2017 19:00:33 +0000 (19:00 +0000)
Change the early exit condition from Cost > Threshold to Cost >= Threshold
because the inline condition is Cost < Threshold.

Differential Revision: https://reviews.llvm.org/D37087

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

lib/Analysis/InlineCost.cpp

index c26388a19bc7bca0485d2ecd15db46b9391fe06c..8cdf20467024e0c8d2567a41158082b8bce4518d 100644 (file)
@@ -1384,7 +1384,7 @@ bool CallAnalyzer::analyzeBlock(BasicBlock *BB,
 
     // Check if we've past the maximum possible threshold so we don't spin in
     // huge basic blocks that will never inline.
-    if (Cost > Threshold && !ComputeFullInlineCost)
+    if (Cost >= Threshold && !ComputeFullInlineCost)
       return false;
   }
 
@@ -1470,7 +1470,7 @@ bool CallAnalyzer::analyzeCall(CallSite CS) {
     Cost += InlineConstants::ColdccPenalty;
 
   // Check if we're done. This can happen due to bonuses and penalties.
-  if (Cost > Threshold && !ComputeFullInlineCost)
+  if (Cost >= Threshold && !ComputeFullInlineCost)
     return false;
 
   if (F.empty())
@@ -1536,7 +1536,7 @@ bool CallAnalyzer::analyzeCall(CallSite CS) {
   for (unsigned Idx = 0; Idx != BBWorklist.size(); ++Idx) {
     // Bail out the moment we cross the threshold. This means we'll under-count
     // the cost, but only when undercounting doesn't matter.
-    if (Cost > Threshold && !ComputeFullInlineCost)
+    if (Cost >= Threshold && !ComputeFullInlineCost)
       break;
 
     BasicBlock *BB = BBWorklist[Idx];