This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, PR38785] Throttle PRE at -O3


Quoting Richard Guenther <richard.guenther@gmail.com>:

the function implementation is odd.  cost is always 1 when used, and
both memory loads and calls are always cheap, but for example casts are not?
Isn't

return EDGE_COUNT (block->preds) * cost >= inserts_needed;

always true? Or is inserts_needed not what it suggests?

The cost calculation and use is not an exact model of anything, but only a rough approximation, and thus, like any heuristic, should be considered subject to potential change when it can be shown that a change is beneficial in general. The idea was to write the code that changes to the cost calculation and use could be applied with ease. OTOH such changes shouldn't be adopted just because it looks like they'll make a more realistic mode, there should be some evidence that they make the compiler better in general.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]