RFC patch: invariant addresses too cheap

Paolo Bonzini bonzini@gnu.org
Sat Oct 31 12:56:00 GMT 2009


On 10/31/2009 12:14 PM, Richard Guenther wrote:
> On Sat, Oct 31, 2009 at 11:58 AM, Paolo Bonzini<bonzini@gnu.org>  wrote:
>> On 10/31/2009 10:57 AM, Richard Sandiford wrote:
>>>
>>> So either I need to hack MIPS so that
>>> 2 is cheap and 3+ is "expensive", or we need some better way
>>> of determining this.
>>
>> -  return mips_address_insns (addr, SImode, false);
>> +  int insns = mips_address_insns (addr, SImode, false);
>> +  return insns == 1 ? 1 : COSTS_N_INSNS (insns - 1);
>>
>> ?
>>
>>> I don't think sticking an x86-specific magic number in the
>>> middle of generic code is acceptable, regardless of how big
>>> the comment above it is. ;)
>>
>> That's why I suggested using "<= COSTS_N_INSNS (1) / 2" instead of "<  3".
>>   Also ix86-specific calibration, but not so brutally. :-)
>
> But then you should document that address-cost is supposed to be
> insn-cost based.  Otherwise comparing apples with oranges doesn't
> make sense, even if it might look less magic to you.

That's true.

Paolo



More information about the Gcc-patches mailing list