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] Add X86_TUNE_AVOID_LEA_FOR_ADDR


On Fri, Jan 17, 2014 at 4:26 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Fri, Jan 17, 2014 at 04:24:50PM +0100, Uros Bizjak wrote:
>> On Fri, Jan 17, 2014 at 3:50 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> >
>> > Wrong example.  It should be
>> >
>> > lea 0x400(%edx, %ecx, 8), %edx
>> >
>> > we get
>> >
>> > add %ecx, %edx
>> > add %ecx, %edx
>> > add %ecx, %edx
>> > add %ecx, %edx
>> > add %ecx, %edx
>> > add %ecx, %edx
>> > add %ecx, %edx
>> > add %ecx, %edx
>> > add $0x400, %edx
>>
>> Even for this example, the code can be substantially improved:
>>
>> shl $3, %ecx
>> add %ecx, %edx
>> add $0x400, %edx
>
> Only if ecx is dead after the statement.

True. Do we have this information at the point transformation is performed?

Uros.


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