[PATCH] D37087: [InlineCost] Small changes to early exit condition. NFC.

Haicheng Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 12:01:39 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL311791: [InlineCost] Small changes to early exit condition. NFC. (authored by haicheng).

Changed prior to commit:
  https://reviews.llvm.org/D37087?vs=112568&id=112726#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D37087

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


Index: llvm/trunk/lib/Analysis/InlineCost.cpp
===================================================================
--- llvm/trunk/lib/Analysis/InlineCost.cpp
+++ llvm/trunk/lib/Analysis/InlineCost.cpp
@@ -1384,7 +1384,7 @@
 
     // 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 @@
     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 @@
   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];


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37087.112726.patch
Type: text/x-patch
Size: 1160 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170825/d9c5364d/attachment.bin>


More information about the llvm-commits mailing list