RFD: rtx_cost changes

Bernd Schmidt bernds@codesourcery.com
Mon Aug 16 10:48:00 GMT 2010


On 08/14/2010 10:07 AM, Richard Sandiford wrote:
> Bernd Schmidt <bernds@codesourcery.com> writes:
>> The patch below extends the rtx_costs interface by adding a SET_LHS
>> argument.  I've left the old rtx_costs available as a macro; the new one
>> is called rtx_costs2, and there's a new target macro as well.  This
>> allows for a more gradual transition, converting ports one by one.  Some
>> re-tuning is probably needed to take full advantage of the new
>> possibilities.
> 
> I'm playing Devil's Advocate here really, because you didn't seem
> to mention it explicitly, but... while I can see why this is useful
> in postreload (and beyond), is the SET_DEST really that meaningful
> before reload?  If we consider:
> 
>     (set (reg PSEUDO1) (plus (reg PSUEDO1) (const_int 16)))
> 
> to have a different cost from:
> 
>     (set (reg PSEUDO1) (plus (reg PSUEDO2) (const_int 16)))
> 
> (as the thumb patch appears to) then won't that put an artificial
> barrier in the way of pre-reload optimisations?  I wouldn't have
> thought having two different pseudos meant a great deal here.
> If PSEUDO2 dies in the instruction, then we can still tie
> the registers.

Good point.  It's probably best not done for pseudos, at least in the
first iteration.
I had been wondering whether distinguishing between 2-operand and
3-operand insns could make a difference for synth_mult, but I'll leave
that for later.


Bernd



More information about the Gcc-patches mailing list