From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18720 invoked by alias); 3 Jun 2011 12:22:09 -0000 Received: (qmail 18709 invoked by uid 22791); 3 Jun 2011 12:22:07 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Jun 2011 12:21:53 +0000 Received: by wye20 with SMTP id 20so1646004wye.20 for ; Fri, 03 Jun 2011 05:21:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.199.21 with SMTP id eq21mr1841704wbb.101.1307103712256; Fri, 03 Jun 2011 05:21:52 -0700 (PDT) Received: by 10.227.37.152 with HTTP; Fri, 3 Jun 2011 05:21:52 -0700 (PDT) In-Reply-To: References: Date: Fri, 03 Jun 2011 12:22:00 -0000 Message-ID: Subject: Re: [patch] Fix PR tree-optimization/49038 From: Richard Guenther To: Ira Rosen Cc: gcc-patches@gcc.gnu.org, Patch Tracking Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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: 2011-06/txt/msg00223.txt.bz2 On Thu, Jun 2, 2011 at 6:06 PM, Ira Rosen wrote: > On 26 May 2011 10:52, Ira Rosen wrote: >> Hi, >> >> The vectorizer supports strided loads with gaps, e.g., when only a[4i] >> and a[4i+2] are accessed, it generates a vector load a[4i:4i+3], i.e., >> creating an access to a[4i+3], which doesn't exist in the scalar code. >> This access maybe invalid as described in the PR. >> >> This patch creates an epilogue loop (with at least one iteration) for >> such cases. >> >> Bootstrapped and tested on powerpc64-suse-linux. >> Applied to trunk. I'll prepare patches for 4.5 and 4.6 next week. >> > > Here are the patches. Bootstrapped and tested on x86_64-suse-linux > (4.5) and on powerpc64-suse-linux (4.6). > OK to apply? Ok. Thanks, Richard. > Thanks, > Ira > > > 4.6 ChangeLog: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 PR tree-optimization/49038 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * tree-vect-loop-manip.c (vect_generate_t= mps_on_preheader): > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Ensure at least one epilogue iteration if= required by data > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 accesses with gaps. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * tree-vectorizer.h (struct _loop_vec_inf= o): Add new field > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 to mark loops that require peeling for ga= ps. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * tree-vect-loop.c (new_loop_vec_info): I= nitialize new field. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (vect_get_known_peeling_cost): Take peeli= ng for gaps into > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 account. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (vect_transform_loop): Generate epilogue = if required by data > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 access with gaps. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * tree-vect-data-refs.c (vect_analyze_gro= up_access): Mark the > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 loop as requiring an epilogue if there ar= e gaps in the end of > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 the strided group. > > 4.5 ChangeLog: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 PR tree-optimization/49038 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * tree-vect-loop-manip.c (vect_generate_t= mps_on_preheader): > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Ensure at least one epilogue iteration if= required by data > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 accesses with gaps. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * tree-vectorizer.h (struct _loop_vec_inf= o): Add new field > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 to mark loops that require peeling for ga= ps. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * tree-vect-loop.c (new_loop_vec_info): I= nitialize new field. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (vect_estimate_min_profitable_iters): Tak= e peeling for gaps into > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 account. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (vect_transform_loop): Generate epilogue = if required by data > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 access with gaps. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * tree-vect-data-refs.c (vect_analyze_gro= up_access): Mark the > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 loop as requiring an epilogue if there ar= e gaps in the end of > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 the strided group. > > 4.6 and 4.5 testsuite/ChangeLog: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 PR tree-optimization/49038 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * gcc.dg/vect/vect-strided-u8-i8-gap4-unk= nown.c: New test. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * gcc.dg/vect/pr49038.c: New test. >