From patchwork Thu Jan 20 10:13:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Rosen X-Patchwork-Id: 79664 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 B2EDBB70CD for ; Thu, 20 Jan 2011 21:14:03 +1100 (EST) Received: (qmail 24994 invoked by alias); 20 Jan 2011 10:14:00 -0000 Received: (qmail 24986 invoked by uid 22791); 20 Jan 2011 10:13:59 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL, BAYES_00, MAY_BE_FORGED, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate2.uk.ibm.com (HELO mtagate2.uk.ibm.com) (194.196.100.162) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Jan 2011 10:13:47 +0000 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate2.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p0KADibK015601 for ; Thu, 20 Jan 2011 10:13:44 GMT Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p0KADl6n1208556 for ; Thu, 20 Jan 2011 10:13:47 GMT Received: from d06av09.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p0KADiu8025145 for ; Thu, 20 Jan 2011 03:13:44 -0700 Received: from d12mc102.megacenter.de.ibm.com (d12nrml1506.megacenter.de.ibm.com [9.149.164.56] (may be forged)) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p0KADhuI025133 for ; Thu, 20 Jan 2011 03:13:43 -0700 Subject: [patch, testsuite] Fix vectorizer cost model test failures on SPU X-KeepSent: 37480A04:D78477C4-C225781E:0036AA3B; type=4; name=$KeepSent To: gcc-patches@gcc.gnu.org Cc: Ulrich Weigand , Revital1 Eres Message-ID: From: Ira Rosen Date: Thu, 20 Jan 2011 12:13:40 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-IsSubscribed: yes 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 Hi, Uli noticed several vectorizer cost model test failures on SPU. Two of them are because the loops are now unrolled, so I increased the loop bounds. And the third failure is caused by different realignment technique. I fixed the test accordingly. Tested by Revital on Cell SPU. OK for mainline? Thanks, Ira testsuite/ChangeLog: * gcc.dg/vect/costmodel/spu/costmodel-vect-33.c: Expect vectorization to be not profitable if peeling is used to realign the memory access. * gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c: Increase loop bound to avoid loop unrolling. * gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c: Likewise. Index: costmodel/spu/costmodel-vect-33.c =================================================================== --- costmodel/spu/costmodel-vect-33.c (revision 168537) +++ costmodel/spu/costmodel-vect-33.c (working copy) @@ -4,7 +4,7 @@ #include #include "../../tree-vect.h" -#define N 17 +#define N 16 struct test { char ca[N]; }; @@ -35,6 +35,9 @@ int main (void) return main1 (); } -/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* Peeling to align the store is used. Overhead of peeling is too high. */ +/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { target vector_alignment_reachable } } } */ + +/* Versioning to align the store is used. Overhead of versioning is not too high. */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target {! vector_alignment_reachable} } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: costmodel/spu/costmodel-vect-76a.c =================================================================== --- costmodel/spu/costmodel-vect-76a.c (revision 168537) +++ costmodel/spu/costmodel-vect-76a.c (working copy) @@ -3,7 +3,7 @@ #include #include "../../tree-vect.h" -#define N 8 +#define N 16 #define OFF 4 /* Check handling of accesses for which the "initial condition" - Index: costmodel/spu/costmodel-vect-76c.c =================================================================== --- costmodel/spu/costmodel-vect-76c.c (revision 168537) +++ costmodel/spu/costmodel-vect-76c.c (working copy) @@ -3,7 +3,7 @@ #include #include "../../tree-vect.h" -#define N 8 +#define N 32 #define OFF 4 /* Check handling of accesses for which the "initial condition" -