This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, i386]: Further ADD/LEA improvements


On Thu, Aug 19, 2010 at 2:21 AM, H.J. Lu <hjl.tools@gmail.com> wrote:

>> Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu
>> {,-m32} with and without --with-cpu=atom configure option. Committed
>> to SVN mainline.
>>
>
> I took another look. When we added Atom optimization, we changed condition
> of DI/SI LEA split patterns from
>
> && true_regnum (operands[0]) != true_regnum (operands[1])"
>
> to
>
> && ix86_lea_for_add_ok (PLUS, insn, operands)"
>
> The current ix86_lea_for_add_ok has
>
> ?unsigned int regno0 = true_regnum (operands[0]);
> ?unsigned int regno1 = true_regnum (operands[1]);
> ?unsigned int regno2 = true_regnum (operands[2]);
>
> ?/* If a = b + c, (a!=b && a!=c), must use lea form. */
> ?if (regno0 != regno1 && regno0 != regno2)
> ? ?return true;
>
> ?if (!TARGET_OPT_AGU || optimize_function_for_size_p (cfun))
> ? ?return false;
>
> Otherwise, you won't get ADD. We may need to add
>
> && true_regnum (operands[0]) != true_regnum (operands[2])"
>
> to other LEA split patterns.

All other lea splits are handled through the second lea splitter that
already uses ix86_lea_for_add_ok. The only missing change is for
zero_extend lea pattern. I'll add ix86_lea_for_add_ok call there (and
also move these splitters to better home near add<mode>_1 patterns).

Thanks,
Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]