[PATCH] D37087: [InlineCost] Small changes to early exit condition. NFC.
Evgeny Astigeevich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 25 02:03:39 PDT 2017
eastig added inline comments.
================
Comment at: lib/Analysis/InlineCost.cpp:1209
- if (CostLowerBound > Threshold && !ComputeFullInlineCost) {
+ if (CostLowerBound >= Threshold && !ComputeFullInlineCost) {
Cost = CostLowerBound;
----------------
junbuml wrote:
> 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.
I agree it does not look like a big problem but to be sure some benchmarking, especially code size, needs to be done.
Repository:
rL LLVM
https://reviews.llvm.org/D37087
More information about the llvm-commits
mailing list