From patchwork Sun Jul 4 12:34:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Rosen X-Patchwork-Id: 57841 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 A455B1007D3 for ; Sun, 4 Jul 2010 22:34:36 +1000 (EST) Received: (qmail 28383 invoked by alias); 4 Jul 2010 12:34:34 -0000 Received: (qmail 28363 invoked by uid 22791); 4 Jul 2010 12:34:33 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.17.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 04 Jul 2010 12:34:28 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.1/8.13.1) with ESMTP id o64CYOht031595 for ; Sun, 4 Jul 2010 12:34:24 GMT Received: from d12av04.megacenter.de.ibm.com (d12av04.megacenter.de.ibm.com [9.149.165.229]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o64CYGNM1806422 for ; Sun, 4 Jul 2010 14:34:24 +0200 Received: from d12av04.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o64CYGor030137 for ; Sun, 4 Jul 2010 14:34:16 +0200 Received: from d12mc102.megacenter.de.ibm.com (d12mc102.megacenter.de.ibm.com [9.149.167.114]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id o64CYG3s030134 for ; Sun, 4 Jul 2010 14:34:16 +0200 Subject: [patch, testsuite] Fix ppc and spu vectorization tests X-KeepSent: 97E08577:25DCC34C-C2257756:00438ADD; type=4; name=$KeepSent To: gcc-patches@gcc.gnu.org Message-ID: From: Ira Rosen Date: Sun, 4 Jul 2010 15:34:12 +0300 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=4DBBFDC5DFD00C4D8f9e8a93df938690918c4DBBFDC5DFD00C4D" Content-Disposition: inline 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, This patch removes two vectorization cost model tests for ppc: the loops are either unrolled or the vectorization is always profitable with bigger loop bounds. It also increases loop bounds in two other cost model tests. In pr35821-altivec.c the loop is optimized out. I can't change the code in such way that the loop is not optimized out and there is an ICE without the patch for pr35821. So, I suggest to remove this testcase, and pr35821-spu.c as well. Tested on powerpc64-suse-linux. OK for trunk? Thanks, Ira testsuite/ChangeLog: * gcc.dg/vect/costmodel/ppc/costmodel-vect-31d.c: Remove. * gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c: Increase loop bound. * gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c: Likewise. * gcc.dg/vect/costmodel/ppc/costmodel-vect-68d.c: Remove. * gcc.dg/vect/pr35821-altivec.c, gcc.dg/vect/pr35821-spu.c: Likewise. (See attached file: tests.txt) Index: testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31d.c =================================================================== --- testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31d.c (revision 161798) +++ testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31d.c (working copy) @@ -1,51 +0,0 @@ -/* { dg-require-effective-target vect_int } */ - -#include -#include "../../tree-vect.h" - -#define N 5 - -struct t{ - int k[N]; - int l; -}; - -struct s{ - char a; /* aligned */ - char b[N-1]; /* unaligned (offset 1B) */ - char c[N]; /* aligned (offset NB) */ - struct t d; /* aligned (offset 2NB) */ - struct t e; /* unaligned (offset 2N+4N+4 B) */ -}; - -int main1 () -{ - int i; - struct s tmp; - - /* unaligned */ - for (i = 0; i < N; i++) - { - tmp.e.k[i] = 8; - } - - /* check results: */ - for (i = 0; i < N; i++) - { - if (tmp.e.k[i] != 8) - abort (); - } - - return 0; -} - -int main (void) -{ - check_vect (); - - return main1 (); -} - -/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ -/* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c =================================================================== --- testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c (revision 161798) +++ testsuite/gcc.dg/vect/costmodel/ppc/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: testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c =================================================================== --- testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c (revision 161798) +++ testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.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: testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68d.c =================================================================== --- testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68d.c (revision 161798) +++ testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68d.c (working copy) @@ -1,50 +0,0 @@ -/* { dg-require-effective-target vect_int } */ - -#include -#include "../../tree-vect.h" - -#define N 11 - -struct s{ - int m; - int n[N][N][N]; -}; - -struct test1{ - struct s a; /* array a.n is unaligned */ - int b; - int c; - struct s e; /* array e.n is aligned */ -}; - -int main1 () -{ - int i,j; - struct test1 tmp1; - - /* 4. unaligned */ - for (i = 3; i < N-3; i++) - { - tmp1.e.n[1][2][i] = 8; - } - - /* check results: */ - for (i = 3; i