On 10/09/2017 01:35 PM, Segher Boessenkool wrote:
This adds a new hook that the insn_cost function uses if a target has
implemented it (it uses the old pattern_cost nee insn_rtx_cost if not).
I'll commit this now; it was okayed by Jeff at
https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00204.html .
Segher
2017-10-09 Segher Boessenkool <seg...@kernel.crashing.org>
* target.def (insn_cost): New hook.
* doc/tm.texi.in (TARGET_INSN_COST): New hook.
* doc/tm.texi: Regenerate.
* rtlanal.c (insn_cost): Use the new hook.
As a target maintainer, I'm kind of confused by this patch, and I don't
think the tm.texi change gives sufficient guidance about the default
hook behavior, how it interacts with TARGET_RTX_COSTS and/or
TARGET_ADDRESS_COST, or the different contexts the three hooks are used
in. Do target maintainers need to do something to define this new hook
to prevent performance regressions?
I could try to write up some advice about cost models and tuning for the
internals manual, but at present I don't feel like I have any
understanding of what motivated this change or how it changed the
recommended practices for back end tuning. :-(
-Sandra the missing-some-brain-cells