This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Request for code review - (ZEE patch : Redundant Zero extension elimination)
- From: Sriraman Tallam <tmsriram at google dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: gcc at gcc dot gnu dot org, Ian Lance Taylor <iant at google dot com>, Diego Novillo <dnovillo at google dot com>
- Date: Wed, 23 Sep 2009 16:24:50 -0700
- Subject: Re: Request for code review - (ZEE patch : Redundant Zero extension elimination)
- References: <863b0cbf0908081459u33e84018h2e2b6cf871d9be5c@mail.gmail.com> <6dc9ffc80909231557n21c84e62v3961248a9ddcbc97@mail.gmail.com>
On Wed, Sep 23, 2009 at 3:57 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sat, Aug 8, 2009 at 2:59 PM, Sriraman Tallam <tmsriram@google.com> wrote:
>> Hi,
>>
>> ? ?Here is a patch to eliminate redundant zero-extension instructions
>> on x86_64.
>>
>> Tested: Ran the gcc regresssion testsuite on x86_64-linux and verified
>> that the results are the same with/without this patch.
>>
>>
>> Problem Description :
>> ---------------------------------
>>
>> This pass is intended to be applicable only to targets that implicitly
>> zero-extend 64-bit registers after writing to their lower 32-bit half.
>> For instance, x86_64 zero-extends the upper bits of a register
>> implicitly whenever an instruction writes to its lower 32-bit half.
>> For example, the instruction *add edi,eax* also zero-extends the upper
>> 32-bits of rax after doing the addition. ?These zero extensions come
>> for free and GCC does not always exploit this well. ?That is, it has
>> been observed that there are plenty of cases where GCC explicitly
>> zero-extends registers for x86_64 that are actually useless because
>> these registers were already implicitly zero-extended in a prior
>> instruction. ?This pass tries to eliminate such useless zero extension
>> instructions.
>>
>
> Does this fix:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17387
Yes, this patch fixes this problem. All the mov %eax, %eax are removed.
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34653
No, this patch does not fix this problem.
>
> --
> H.J.
>