RFC patch: invariant addresses too cheap

Paolo Bonzini bonzini@gnu.org
Mon Oct 19 16:45:00 GMT 2009


> 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



More information about the Gcc-patches mailing list