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

Jun Bum Lim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 09:18:37 PDT 2017


junbuml added inline comments.


================
Comment at: lib/Analysis/InlineCost.cpp:1209
 
-  if (CostLowerBound > Threshold && !ComputeFullInlineCost) {
+  if (CostLowerBound >= Threshold && !ComputeFullInlineCost) {
     Cost = CostLowerBound;
----------------
eastig wrote:
> I don't think this is NFC. In visitSwitchInst I see the cost is calculating based on a result of TTI.getEstimatedNumberOfCaseClusters. If threshold is big (-O1 and above) this might not be a problem but if it is low (-Os, -Oz) this might be a problem.
> 
Specifically for this part, we cannot say that this is NFC in case when "CostLowerBound == Threshold" and the switch ends up with a bit test. See above "FIXME". However, I cannot see any big problem using ">=" here.


Repository:
  rL LLVM

https://reviews.llvm.org/D37087





More information about the llvm-commits mailing list