This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Tweak reload to const propagate into matching constraint output
- From: Bernd Schmidt <bernds at codesourcery dot com>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: Richard Henderson <rth at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Vladimir Makarov <vmakarov at redhat dot com>, <uweigand at de dot ibm dot com>
- Date: Wed, 27 Jun 2012 17:43:20 +0200
- Subject: Re: [RFC] Tweak reload to const propagate into matching constraint output
- References: <4FEA77E0.4020501@redhat.com> <CAFiYyc0h2wUJeoRrj1j25TJNUd7Pdr2ZP--A-wMTaFDuhS=Bsg@mail.gmail.com>
On 06/27/2012 10:45 AM, Richard Guenther wrote:
> On Wed, Jun 27, 2012 at 5:02 AM, Richard Henderson <rth@redhat.com> wrote:
>> sometimes not (increased code size):
>>
>> -: 41 bd 01 00 00 00 mov $0x1,%r13d
>> -: 4d 89 ec mov %r13,%r12
>> +: 41 bc 01 00 00 00 mov $0x1,%r12d
>> +: 41 bd 01 00 00 00 mov $0x1,%r13d
>
> I suppose that might be fixed if instead of
>
> + /* Only use the constant when it's just as cheap as a reg move. */
> + if (set_src_cost (c, optimize_function_for_speed_p (cfun)) == 0)
> + return c;
>
> you'd unconditionall use size costs?
I've added some code last year or so in rtl.h to operate on
full_rtx_costs, taking both into account (use the primary cost
comparison, and if that's equal, use the secondary). Would that work here?
Bernd