[PATCH] D17584: Cleanup inline cost analysis code
Akira Hatanaka via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 25 19:24:57 PST 2016
ahatanak added a subscriber: llvm-commits.
ahatanak added a comment.
I'm confused with the meaning of threshold here.
In the loop which visits the subset of basic blocks in the function, we use this exit condition:
if (Cost > Threshold)
This indicates as long as Cost doesn't exceed Threshold, the function is still eligible for inlining. If the function's Cost is equal to Threshold, it can still be inlined.
However, the last statement indicates that Cost has to be smaller than Threshold in order for it to be inlined:
return Cost < std::max(1, Threshold);
Shouldn't the loop exit when Cost >= Threshold? In that case, the minimum value of Threshold should be 1, not 0, to enable inlining zero-cost functions.
More information about the llvm-commits