[llvm-commits] [llvm] r83675 - in /llvm/trunk: include/llvm/Transforms/Utils/InlineCost.h lib/Transforms/IPO/Inliner.cpp lib/Transforms/Utils/InlineCost.cpp
Dale Johannesen
dalej at apple.com
Mon Oct 12 11:33:50 PDT 2009
On Oct 10, 2009, at 12:42 PMPDT, Daniel Dunbar wrote:
>>
>> + namespace InlineConstants {
>> + // Various magic constants used to adjust heuristics.
>> + const int CallPenalty = 5;
>> + const int LastCallToStaticBonus = -15000;
>
> Seems strange to call this a "Bonus", but have a the negative value be
> the "bonus". Wouldn't it make more sense to name it penalty as well?
> Or perhaps replace {Penalty,Bonus} with a more neutral word like Cost?
These numbers are used to compute a Cost. Penalties increase the
cost. Bonuses decrease it. I do find it mildly confusing to have
negative values mean more inlining; I wouldn't have done it that way,
but I can live with it.
More information about the llvm-commits
mailing list