From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29829 invoked by alias); 23 Sep 2009 23:24:58 -0000 Received: (qmail 29820 invoked by uid 22791); 23 Sep 2009 23:24:57 -0000 X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Sep 2009 23:24:54 +0000 Received: from zps37.corp.google.com (zps37.corp.google.com [172.25.146.37]) by smtp-out.google.com with ESMTP id n8NNOqxr019598 for ; Wed, 23 Sep 2009 16:24:52 -0700 Received: from pxi12 (pxi12.prod.google.com [10.243.27.12]) by zps37.corp.google.com with ESMTP id n8NNOoXv008979 for ; Wed, 23 Sep 2009 16:24:50 -0700 Received: by pxi12 with SMTP id 12so961906pxi.9 for ; Wed, 23 Sep 2009 16:24:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.8.3 with SMTP id 3mr219819wfh.72.1253748290380; Wed, 23 Sep 2009 16:24:50 -0700 (PDT) In-Reply-To: <6dc9ffc80909231557n21c84e62v3961248a9ddcbc97@mail.gmail.com> References: <863b0cbf0908081459u33e84018h2e2b6cf871d9be5c@mail.gmail.com> <6dc9ffc80909231557n21c84e62v3961248a9ddcbc97@mail.gmail.com> Date: Wed, 23 Sep 2009 23:24:00 -0000 Message-ID: <863b0cbf0909231624y7475ecfag6cf8ac6b6f41092f@mail.gmail.com> Subject: Re: Request for code review - (ZEE patch : Redundant Zero extension elimination) From: Sriraman Tallam To: "H.J. Lu" Cc: gcc@gcc.gnu.org, Ian Lance Taylor , Diego Novillo Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-09/txt/msg00489.txt.bz2 On Wed, Sep 23, 2009 at 3:57 PM, H.J. Lu wrote: > On Sat, Aug 8, 2009 at 2:59 PM, Sriraman Tallam wro= te: >> Hi, >> >> =A0 =A0Here 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. =A0These zero extensions come >> for free and GCC does not always exploit this well. =A0That 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. =A0This pass tries to eliminate such useless zero extension >> instructions. >> > > Does this fix: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D17387 Yes, this patch fixes this problem. All the mov %eax, %eax are removed. > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D34653 No, this patch does not fix this problem. > > -- > H.J. >