This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC patch: invariant addresses too cheap
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: Michael Matz <matz at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 19 Oct 2009 18:42:56 +0200
- Subject: Re: RFC patch: invariant addresses too cheap
- References: <Pine.LNX.4.64.0910191743440.15566@wotan.suse.de>
> We could also change the i386 target hook to return something >
> COSTS_N_INSN(1) when two regs are mentioned and something smaller
> (0,1,2,3) when not. ?I.e. "half" insn costs. ?That doesn't sound too
> appealing either, OTOH that may be the reason why COSTS_N_INSN is scaled
> at all.
I have no qualms with your patch at all, but I think that fractional costs
do make sense if you want address_cost to have the same unit as
rtx_costs (which the default implementation suggests).
I would just write < 3 in your patch as "<= COSTS_N_INSN (1) / 2".
Which shows even more how it is taken from thin air :-) but at least
shows that it is supposed to be in the same unit as rtx_costs.
Paolo