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: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Sriraman Tallam <tmsriram at google 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 15:57:54 -0700
- Subject: Re: Request for code review - (ZEE patch : Redundant Zero extension elimination)
- References: <863b0cbf0908081459u33e84018h2e2b6cf871d9be5c@mail.gmail.com>
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
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34653
--
H.J.