From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20889 invoked by alias); 28 Oct 2010 19:28:45 -0000 Received: (qmail 20877 invoked by uid 22791); 28 Oct 2010 19:28:45 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,TW_FW,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Oct 2010 19:28:37 +0000 Received: (qmail 20371 invoked from network); 28 Oct 2010 19:28:35 -0000 Received: from unknown (HELO ?192.168.1.66?) (vries@127.0.0.2) by mail.codesourcery.com with ESMTPA; 28 Oct 2010 19:28:35 -0000 Message-ID: <4CC9CF40.2020904@codesourcery.com> Date: Thu, 28 Oct 2010 21:12:00 -0000 From: Tom de Vries User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: Andrew Pinski CC: gcc-patches@gcc.gnu.org, Bernd Schmidt Subject: Re: new sign/zero extension elimination pass References: <4CBC698B.3080204@codesourcery.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-10/txt/msg02438.txt.bz2 Andrew, Andrew Pinski wrote: > On Thu, Oct 28, 2010 at 12:03 PM, Andrew Pinski wrote: >> On Mon, Oct 18, 2010 at 8:36 AM, Tom de Vries wrote: >>> I created a new sign/zero extension elimination pass. >>> >>> The motivating example for this pass is: >> In the above case fwprop could do the majority of the work. In fact >> it simplifies the (subreg (zero_extend (subreg))) into (subreg) but >> does not replace it. I think you could extend fwprop to the correct >> thing. > > Something like the attached patch. I have not bootstrap/tested it yet > but it works for your simple example. > This allows us not to add another pass. > > Thanks, > Andrew Pinski > thanks for this patch. I agreed with Paolo in http://gcc.gnu.org/ml/gcc-patches/2010-10/msg01897.html that for the example with which I submitted the pass initially, it would make sense to handle it in fwprop. However, I also think that for the example mentioned in http://gcc.gnu.org/ml/gcc-patches/2010-10/msg01796.html, that wouldn't work, so we still need the new pass. Thanks, - Tom