From patchwork Thu Aug 25 11:47:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 111557 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 4DD5AB6F18 for ; Thu, 25 Aug 2011 21:46:55 +1000 (EST) Received: (qmail 14687 invoked by alias); 25 Aug 2011 11:46:53 -0000 Received: (qmail 14679 invoked by uid 22791); 25 Aug 2011 11:46:52 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_FAIL X-Spam-Check-By: sourceware.org Received: from smtp-vbr14.xs4all.nl (HELO smtp-vbr14.xs4all.nl) (194.109.24.34) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 25 Aug 2011 11:46:38 +0000 Received: from [192.168.1.68] (teejay.xs4all.nl [213.84.119.160]) (authenticated bits=0) by smtp-vbr14.xs4all.nl (8.13.8/8.13.8) with ESMTP id p7PBkSGe036607 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 25 Aug 2011 13:46:33 +0200 (CEST) (envelope-from vries@codesourcery.com) Message-ID: <4E563662.2080005@codesourcery.com> Date: Thu, 25 Aug 2011 13:47:46 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11 MIME-Version: 1.0 To: Zdenek Dvorak CC: Paolo Bonzini , Richard Guenther , gcc-patches@gcc.gnu.org, Bernd Schmidt , Maxim Kuvyrkov Subject: Re: ivopts improvement References: <20110304223704.GA9660@kam.mff.cuni.cz> <4D7D005B.6000002@codesourcery.com> <20110314095834.GA28388@kam.mff.cuni.cz> <4D7E041B.5080103@codesourcery.com> <20110314121415.GA20104@kam.mff.cuni.cz> <4D7E0EB1.6060004@codesourcery.com> <20110314125544.GA25477@kam.mff.cuni.cz> <4D7E1D5B.2070408@codesourcery.com> <20110314140305.GB32181@kam.mff.cuni.cz> <4D7F7561.7050302@codesourcery.com> <20110315151006.GA4520@kam.mff.cuni.cz> <4D7F8A1F.7040704@codesourcery.com> <4E56352D.4050401@codesourcery.com> In-Reply-To: <4E56352D.4050401@codesourcery.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 08/25/2011 01:42 PM, Tom de Vries wrote: > Hi Zdenek, > > here's the updated version of the patch. > > The goal is to remove the 'i' iterator from the following example, by > replacing 'i < n' with 'p < base + n'. > > void > f (char *base, unsigned long int i, unsigned long int n) > { > char *p = base + i; > do > { > *p = '\0'; > p++; > i++; > } > while (i < n); > } > > bootstrapped and reg-tested on x864_64, and build and reg-tested on MIPS. > > I will sent a test-case in a separate email. > OK for trunk? 2011-08-25 Tom de Vries * gcc.dg/tree-ssa/ivopts-lt.c: New test. Index: gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c =================================================================== --- /dev/null (new file) +++ gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c (revision 0) @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-ivopts" } */ + +void +f1 (char *p, unsigned long int i, unsigned long int n) +{ + p += i; + do + { + *p = '\0'; + p += 1; + i++; + } + while (i < n); +} + +/* { dg-final { scan-tree-dump-times "PHI" 1 "ivopts"} } */ +/* { dg-final { scan-tree-dump-times "PHI