On Wed, Sep 23, 2009 at 3:57 PM, H.J. Lu <hjl.to...@gmail.com> wrote:
> On Sat, Aug 8, 2009 at 2:59 PM, Sriraman Tallam <tmsri...@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.
>

Reply via email to