From patchwork Tue Dec 1 14:48:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 550917 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 012CE1401DE for ; Wed, 2 Dec 2015 01:49:59 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=wmyUmJ8r; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=oCUCcyogLpyxd3UOr PeCrzH/GafD409ZLPGqPNJLQw09hOQoNCG1+mdklrGdSIkxqow0BR3BOW/v8h7v+ 3yhyyYvZGTaf6j7gsRU9uzI8Jh6/V7HXWFS+z/4wenUu9bt6cXd8RM49/NlWtXcv +FAxyplO1gd6SSyq8ehkpFYBVI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=iiZHrRG3KUQ9H3MipprIPRR SRbc=; b=wmyUmJ8rRLvaBkBe2003z9Ffs21HyFl/UQBaYOVcp7mEzLuulJrfJEy ehiXMcWoXuQjv58jxT130czanUO2BpGu2tT2NNoHWs4VRAvMsfLnKoaAc6w3utqL ZIodfOfZZ5d5dPaoMvx8t5o8st6AyULTcemtDIfVsTY1GqOkb++I= Received: (qmail 96895 invoked by alias); 1 Dec 2015 14:49:42 -0000 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 Received: (qmail 96803 invoked by uid 89); 1 Dec 2015 14:49:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 01 Dec 2015 14:49:35 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54229) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1a3mFJ-0005On-Hj for gcc-patches@gnu.org; Tue, 01 Dec 2015 09:49:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3mFC-0002fB-L6 for gcc-patches@gnu.org; Tue, 01 Dec 2015 09:49:33 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:62603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3mFC-0002e8-Db for gcc-patches@gnu.org; Tue, 01 Dec 2015 09:49:26 -0500 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1a3mFA-00054W-Lo from Tom_deVries@mentor.com ; Tue, 01 Dec 2015 06:49:25 -0800 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Tue, 1 Dec 2015 14:49:22 +0000 Subject: Re: [PATCH, PR46032] Handle BUILT_IN_GOMP_PARALLEL in ipa-pta To: Jakub Jelinek , Christophe Lyon References: <565C0F47.5020604@mentor.com> <565C3CEC.9040209@mentor.com> <565C7B09.6000206@mentor.com> <20151130164855.GH5675@tucnak.redhat.com> <565C8DA4.4030401@mentor.com> <20151201122952.GT5675@tucnak.redhat.com> CC: Richard Biener , "gcc-patches@gnu.org" From: Tom de Vries Message-ID: <565DB335.9080100@mentor.com> Date: Tue, 1 Dec 2015 15:48:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151201122952.GT5675@tucnak.redhat.com> X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 On 01/12/15 13:29, Jakub Jelinek wrote: > On Tue, Dec 01, 2015 at 01:27:32PM +0100, Christophe Lyon wrote: >> >I've committed the attached patch as obvious: it adds >> >dg-require-effective-target fopenmp to these new tests >> >so that they are skipped e.g. on arm bare-metal targets >> >(using newlib). >> > >> >Note that pr46032.c has some failures: >> >FAIL: gcc.dg/pr46032.c scan-tree-dump-times vect "note: vectorized 1 loop" 1 >> >on arm-none-linux-gnueabi, on arm-none-linux-gnueabihf with -mfpu=vfp*, >> >and on armeb-none-linux-gnueabihf >> > >> >I haven't looked at the details yet; see >> >http://people.linaro.org/~christophe.lyon/cross-validation/gcc/trunk/231076/report-build-info.html >> >for more information. > Supposedly pr46032-{2,3}.c should go into testsuite/gcc.dg/gomp/ instead and > pr46032.c into testsuite/gcc.dg/vect/ (with the fopenmp effective target and > perhaps some other effective target conditions)? I've moved the tests, and added dg-require-effective-target vect_int in pr46032.c. Committed to trunk as obvious. Thanks, - Tom Move pr46032*.c tests 2015-12-01 Tom de Vries * gcc.dg/pr46032.c: Move to ... * gcc.dg/vect/pr46032.c: here. Add dg-require-effective-target vect_int. * gcc.dg/pr46032-2.c: Move to ... * gcc.dg/gomp/pr46032-2.c: ... here. Drop dg-require-effective-target fopenmp. * gcc.dg/pr46032-3.c: Move to ... * gcc.dg/gomp/pr46032-3.c: ... here. Drop dg-require-effective-target fopenmp. --- gcc/testsuite/gcc.dg/gomp/pr46032-2.c | 29 +++++++++++++++++++++ gcc/testsuite/gcc.dg/gomp/pr46032-3.c | 28 ++++++++++++++++++++ gcc/testsuite/gcc.dg/pr46032-2.c | 30 --------------------- gcc/testsuite/gcc.dg/pr46032-3.c | 29 --------------------- gcc/testsuite/gcc.dg/pr46032.c | 48 ---------------------------------- gcc/testsuite/gcc.dg/vect/pr46032.c | 49 +++++++++++++++++++++++++++++++++++ 6 files changed, 106 insertions(+), 107 deletions(-) diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c new file mode 100644 index 0000000..e110880 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fopenmp -std=c99 -fipa-pta -fdump-tree-optimized" } */ + +#define N 2 + +int +foo (void) +{ + int a[N], b[N], c[N]; + int *ap = &a[0]; + int *bp = &b[0]; + int *cp = &c[0]; + +#pragma omp parallel for + for (unsigned int idx = 0; idx < N; idx++) + { + ap[idx] = 1; + bp[idx] = 2; + cp[idx] = ap[idx]; + } + + return *cp; +} + +/* { dg-final { scan-tree-dump-times "\\] = 1;" 2 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\\] = 2;" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\\] = _\[0-9\]*;" 0 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\\] = " 3 "optimized" } } */ + diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-3.c b/gcc/testsuite/gcc.dg/gomp/pr46032-3.c new file mode 100644 index 0000000..a4af7ec --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr46032-3.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fopenmp -std=c99 -fipa-pta -fdump-tree-optimized" } */ + +#define N 2 + +int +foo (void) +{ + int a[N], c[N]; + int *ap = &a[0]; + int *bp = &a[0]; + int *cp = &c[0]; + +#pragma omp parallel for + for (unsigned int idx = 0; idx < N; idx++) + { + ap[idx] = 1; + bp[idx] = 2; + cp[idx] = ap[idx]; + } + + return *cp; +} + +/* { dg-final { scan-tree-dump-times "\\] = 1;" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\\] = 2;" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\\] = _\[0-9\]*;" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\\] = " 3 "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/pr46032-2.c b/gcc/testsuite/gcc.dg/pr46032-2.c deleted file mode 100644 index d769597..0000000 --- a/gcc/testsuite/gcc.dg/pr46032-2.c +++ /dev/null @@ -1,30 +0,0 @@ -/* { dg-do compile } */ -/* { dg-require-effective-target fopenmp } */ -/* { dg-options "-O2 -fopenmp -std=c99 -fipa-pta -fdump-tree-optimized" } */ - -#define N 2 - -int -foo (void) -{ - int a[N], b[N], c[N]; - int *ap = &a[0]; - int *bp = &b[0]; - int *cp = &c[0]; - -#pragma omp parallel for - for (unsigned int idx = 0; idx < N; idx++) - { - ap[idx] = 1; - bp[idx] = 2; - cp[idx] = ap[idx]; - } - - return *cp; -} - -/* { dg-final { scan-tree-dump-times "\\] = 1;" 2 "optimized" } } */ -/* { dg-final { scan-tree-dump-times "\\] = 2;" 1 "optimized" } } */ -/* { dg-final { scan-tree-dump-times "\\] = _\[0-9\]*;" 0 "optimized" } } */ -/* { dg-final { scan-tree-dump-times "\\] = " 3 "optimized" } } */ - diff --git a/gcc/testsuite/gcc.dg/pr46032-3.c b/gcc/testsuite/gcc.dg/pr46032-3.c deleted file mode 100644 index a9e74d0..0000000 --- a/gcc/testsuite/gcc.dg/pr46032-3.c +++ /dev/null @@ -1,29 +0,0 @@ -/* { dg-do compile } */ -/* { dg-require-effective-target fopenmp } */ -/* { dg-options "-O2 -fopenmp -std=c99 -fipa-pta -fdump-tree-optimized" } */ - -#define N 2 - -int -foo (void) -{ - int a[N], c[N]; - int *ap = &a[0]; - int *bp = &a[0]; - int *cp = &c[0]; - -#pragma omp parallel for - for (unsigned int idx = 0; idx < N; idx++) - { - ap[idx] = 1; - bp[idx] = 2; - cp[idx] = ap[idx]; - } - - return *cp; -} - -/* { dg-final { scan-tree-dump-times "\\] = 1;" 1 "optimized" } } */ -/* { dg-final { scan-tree-dump-times "\\] = 2;" 1 "optimized" } } */ -/* { dg-final { scan-tree-dump-times "\\] = _\[0-9\]*;" 1 "optimized" } } */ -/* { dg-final { scan-tree-dump-times "\\] = " 3 "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/pr46032.c b/gcc/testsuite/gcc.dg/pr46032.c deleted file mode 100644 index aae0019..0000000 --- a/gcc/testsuite/gcc.dg/pr46032.c +++ /dev/null @@ -1,48 +0,0 @@ -/* { dg-do compile } */ -/* { dg-require-effective-target fopenmp } */ -/* { dg-options "-O2 -fopenmp -ftree-vectorize -std=c99 -fipa-pta -fdump-tree-vect-all" } */ - -extern void abort (void); - -#define nEvents 1000 - -static void __attribute__((noinline, noclone, optimize("-fno-tree-vectorize"))) -init (unsigned *results, unsigned *pData) -{ - unsigned int i; - for (i = 0; i < nEvents; ++i) - pData[i] = i % 3; -} - -static void __attribute__((noinline, noclone, optimize("-fno-tree-vectorize"))) -check (unsigned *results) -{ - unsigned sum = 0; - for (int idx = 0; idx < (int)nEvents; idx++) - sum += results[idx]; - - if (sum != 1998) - abort (); -} - -int -main (void) -{ - unsigned results[nEvents]; - unsigned pData[nEvents]; - unsigned coeff = 2; - - init (&results[0], &pData[0]); - -#pragma omp parallel for - for (int idx = 0; idx < (int)nEvents; idx++) - results[idx] = coeff * pData[idx]; - - check (&results[0]); - - return 0; -} - -/* { dg-final { scan-tree-dump-times "note: vectorized 1 loop" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-not "versioning for alias required" "vect" } } */ - diff --git a/gcc/testsuite/gcc.dg/vect/pr46032.c b/gcc/testsuite/gcc.dg/vect/pr46032.c new file mode 100644 index 0000000..8aa725a --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr46032.c @@ -0,0 +1,49 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target fopenmp } */ +/* { dg-require-effective-target vect_int } */ +/* { dg-options "-O2 -fopenmp -ftree-vectorize -std=c99 -fipa-pta -fdump-tree-vect-all" } */ + +extern void abort (void); + +#define nEvents 1000 + +static void __attribute__((noinline, noclone, optimize("-fno-tree-vectorize"))) +init (unsigned *results, unsigned *pData) +{ + unsigned int i; + for (i = 0; i < nEvents; ++i) + pData[i] = i % 3; +} + +static void __attribute__((noinline, noclone, optimize("-fno-tree-vectorize"))) +check (unsigned *results) +{ + unsigned sum = 0; + for (int idx = 0; idx < (int)nEvents; idx++) + sum += results[idx]; + + if (sum != 1998) + abort (); +} + +int +main (void) +{ + unsigned results[nEvents]; + unsigned pData[nEvents]; + unsigned coeff = 2; + + init (&results[0], &pData[0]); + +#pragma omp parallel for + for (int idx = 0; idx < (int)nEvents; idx++) + results[idx] = coeff * pData[idx]; + + check (&results[0]); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "note: vectorized 1 loop" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-not "versioning for alias required" "vect" } } */ +