[llvm] r311791 - [InlineCost] Small changes to early exit condition. NFC.

Haicheng Wu via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 12:00:33 PDT 2017


Author: haicheng
Date: Fri Aug 25 12:00:33 2017
New Revision: 311791

URL: http://llvm.org/viewvc/llvm-project?rev=311791&view=rev
Log:
[InlineCost] Small changes to early exit condition. NFC.

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

Modified:
    llvm/trunk/lib/Analysis/InlineCost.cpp

Modified: llvm/trunk/lib/Analysis/InlineCost.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InlineCost.cpp?rev=311791&r1=311790&r2=311791&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/InlineCost.cpp (original)
+++ llvm/trunk/lib/Analysis/InlineCost.cpp Fri Aug 25 12:00:33 2017
@@ -1384,7 +1384,7 @@ bool CallAnalyzer::analyzeBlock(BasicBlo
 
     // 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
     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
   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];




More information about the llvm-commits mailing list