From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60422 invoked by alias); 22 Sep 2015 15:11:37 -0000 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 Received: (qmail 59470 invoked by uid 89); 22 Sep 2015 15:11:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 Sep 2015 15:11:34 +0000 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 1ZePEB-0006hV-11 from Thomas_Schwinge@mentor.com for gcc-patches@gcc.gnu.org; Tue, 22 Sep 2015 08:11:31 -0700 Received: from feldtkeller.schwinge.homeip.net (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, 22 Sep 2015 16:10:48 +0100 From: Thomas Schwinge To: Nathan Sidwell , GCC Patches Subject: Re: [gomp4] ptx reduction simplification In-Reply-To: <55FCA6DC.1040802@acm.org> References: <55FCA6DC.1040802@acm.org> User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (i586-pc-linux-gnu) Date: Tue, 22 Sep 2015 15:12:00 -0000 Message-ID: <87k2rizdzi.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-SW-Source: 2015-09/txt/msg01659.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 3755 Hi! On Fri, 18 Sep 2015 20:05:48 -0400, Nathan Sidwell wrote: > I've committed this patch to rework and simplify [...] > the reduction lowering hooks. >=20 > The current implementation [...] > [was] overcomplicated in a number of ways. > * omp-low.h (omp_reduction_init_op): Declare. > * omp-low.c (omp_reduction_init_op): New, broken out of ... > (omp_reduction_init): ... here. Call it. > * tree-parloops.c (initialize_reductions): Use > omp_redutction_init_op. Should this go into trunk already? (I can test it, if you'd like me to.) > --- tree-parloops.c (revision 227903) > +++ tree-parloops.c (working copy) > @@ -566,7 +566,7 @@ reduc_stmt_res (gimple stmt) > int > initialize_reductions (reduction_info **slot, struct loop *loop) > { > - tree init, c; > + tree init; > tree bvar, type, arg; > edge e; >=20=20 > @@ -582,12 +582,8 @@ initialize_reductions (reduction_info ** > type =3D TREE_TYPE (PHI_RESULT (reduc->reduc_phi)); > bvar =3D create_tmp_var (type, "reduction"); >=20=20 > - c =3D build_omp_clause (gimple_location (reduc->reduc_stmt), > - OMP_CLAUSE_REDUCTION); > - OMP_CLAUSE_REDUCTION_CODE (c) =3D reduc->reduction_code; > - OMP_CLAUSE_DECL (c) =3D SSA_NAME_VAR (reduc_stmt_res (reduc->reduc_stm= t)); > - > - init =3D omp_reduction_init (c, TREE_TYPE (bvar)); > + init =3D omp_reduction_init_op (gimple_location (reduc->reduc_stmt), > + reduc->reduction_code, type); > reduc->init =3D init; >=20=20 > /* Replace the argument representing the initialization value [...]/source-gcc/gcc/tree-parloops.c: In function 'int initialize_reduc= tions(reduction_info**, loop*)': [...]/source-gcc/gcc/tree-parloops.c:570:8: error: variable 'bvar' set = but not used [-Werror=3Dunused-but-set-variable] tree bvar, type, arg; ^ Committed to gomp-4_0-branch in r228016: commit f858a76ae899a95b712beaaa8c110f708fd06a7a Author: tschwinge Date: Tue Sep 22 15:07:23 2015 +0000 Address -Werror=3Dunused-but-set-variable diagnostic =20=20=20=20 gcc/ * tree-parloops.c (initialize_reductions): Remove local variable bvar. =20=20=20=20 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@2280= 16 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog.gomp | 5 +++++ gcc/tree-parloops.c | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp index e70d6cb..b7dbba0 100644 --- gcc/ChangeLog.gomp +++ gcc/ChangeLog.gomp @@ -1,3 +1,8 @@ +2015-09-22 Thomas Schwinge + + * tree-parloops.c (initialize_reductions): Remove local variable + bvar. + 2015-09-18 Nathan Sidwell =20 * omp-low.h (omp_reduction_init_op): Declare. diff --git gcc/tree-parloops.c gcc/tree-parloops.c index 5062732..04ec254 100644 --- gcc/tree-parloops.c +++ gcc/tree-parloops.c @@ -567,7 +567,7 @@ int initialize_reductions (reduction_info **slot, struct loop *loop) { tree init; - tree bvar, type, arg; + tree type, arg; edge e; =20 struct reduction_info *const reduc =3D *slot; @@ -578,10 +578,8 @@ initialize_reductions (reduction_info **slot, struct l= oop *loop) /* In the phi node at the header, replace the argument coming from the preheader with the reduction initialization value. */ =20 - /* Create a new variable to initialize the reduction. */ + /* Initialize the reduction. */ type =3D TREE_TYPE (PHI_RESULT (reduc->reduc_phi)); - bvar =3D create_tmp_var (type, "reduction"); - init =3D omp_reduction_init_op (gimple_location (reduc->reduc_stmt), reduc->reduction_code, type); reduc->init =3D init; Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature; name="signature.asc" Content-length: 472 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJWAW9xAAoJEK3/DN1sMFFtz80IAKcVff7t3bFyl3tDs/sMfY+H c13+LeoGlLwmTqVz7Adxh5c9LzU8vTtAJOlBQaYQyD4dy0+hlIjSMPNJnVhuTIdr wlG/rSWMMWPkbQ8jHojLue8s17giTnmygUKS2Xfkby56GhDBWzkMjo2o7P9oEkSg 79NLY2NdxrFvfd9xd3U5wgGYMPED8LMwN0sPjYTrekzFTIPNq5UmzTNz45SC53p9 tLmKrZa1sYyCFaZysEwfQHq5n1u9lXGpxdN9UnB6vRIsmzNiQ7SFjNTYh5Pr2e7B 82scLuXx08FVbbU1EFBYhNl/LAd9lRQwg7fMvoZ9CmxdKxZLmWIlV0iux/kHr7A= =aT4M -----END PGP SIGNATURE----- --=-=-=--