From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89752 invoked by alias); 8 Jun 2015 15:56:07 -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 89741 invoked by uid 89); 8 Jun 2015 15:56:06 -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; Mon, 08 Jun 2015 15:56:04 +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 1Z1zP6-0003AN-Tm from Thomas_Schwinge@mentor.com for gcc-patches@gcc.gnu.org; Mon, 08 Jun 2015 08:56:01 -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; Mon, 8 Jun 2015 16:55:59 +0100 From: Thomas Schwinge To: Tom de Vries CC: GCC Patches Subject: Re: [PING][PATCH][PR65443] Add transform_to_exit_first_loop_alt In-Reply-To: <557571B5.1060903@mentor.com> References: <551564D0.2090308@mentor.com> <551E8A1F.5050908@mentor.com> <552E69ED.7020601@mentor.com> <55548A19.3000302@mentor.com> <55700C12.9000801@mentor.com> <557571B5.1060903@mentor.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) Date: Mon, 08 Jun 2015 15:59:00 -0000 Message-ID: <87twuigpo8.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-06/txt/msg00597.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 2894 Hi Tom! On Mon, 8 Jun 2015 12:43:01 +0200, Tom de Vries wr= ote: > There are two problems in try_transform_to_exit_first_loop_alt: > 1. In case the latch is not a singleton bb, the function should return > false rather than true. > 2. The check for singleton bb should ignore debug-insns. >=20 > Attached patch fixes these problems. > Fix try_transform_to_exit_first_loop_alt > PR tree-optimization/66442 > * gimple-iterator.h (gimple_seq_nondebug_singleton_p): Add function. > * tree-parloops.c (try_transform_to_exit_first_loop_alt): Return false > if the loop latch is not a singleton. Use > gimple_seq_nondebug_singleton_p instead of gimple_seq_singleton_p. Per my testing, the backport of this patch that you committed to gomp-4_0-branch, r224219, introduces a number of regressions in your OpenACC kernels test cases, specifically the =C2=BBscan-tree-dump-times parloops_oacc_kernels "(?n)pragma omp target oacc_parallel.*num_gangs\\(32\\)" 1=C2=AB tests. Would you please have a look? Gr=C3=BC=C3=9Fe, Thomas > gcc/gimple-iterator.h | 29 +++++++++++++++++++++++++++++ > gcc/tree-parloops.c | 4 ++-- > 2 files changed, 31 insertions(+), 2 deletions(-) >=20 > diff --git a/gcc/gimple-iterator.h b/gcc/gimple-iterator.h > index 87e943a..76fa456 100644 > --- a/gcc/gimple-iterator.h > +++ b/gcc/gimple-iterator.h > @@ -345,4 +345,33 @@ gsi_seq (gimple_stmt_iterator i) > return *i.seq; > } >=20=20 > +/* Determine whether SEQ is a nondebug singleton. */ > + > +static inline bool > +gimple_seq_nondebug_singleton_p (gimple_seq seq) > +{ > + gimple_stmt_iterator gsi; > + > + /* Find a nondebug gimple. */ > + gsi.ptr =3D gimple_seq_first (seq); > + gsi.seq =3D &seq; > + gsi.bb =3D NULL; > + while (!gsi_end_p (gsi) > + && is_gimple_debug (gsi_stmt (gsi))) > + gsi_next (&gsi); > + > + /* No nondebug gimple found, not a singleton. */ > + if (gsi_end_p (gsi)) > + return false; > + > + /* Find a next nondebug gimple. */ > + gsi_next (&gsi); > + while (!gsi_end_p (gsi) > + && is_gimple_debug (gsi_stmt (gsi))) > + gsi_next (&gsi); > + > + /* Only a singleton if there's no next nondebug gimple. */ > + return gsi_end_p (gsi); > +} > + > #endif /* GCC_GIMPLE_ITERATOR_H */ > diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c > index 02f44eb..c4b83fe 100644 > --- a/gcc/tree-parloops.c > +++ b/gcc/tree-parloops.c > @@ -1769,8 +1769,8 @@ try_transform_to_exit_first_loop_alt (struct loop *= loop, > tree nit) > { > /* Check whether the latch contains a single statement. */ > - if (!gimple_seq_singleton_p (bb_seq (loop->latch))) > - return true; > + if (!gimple_seq_nondebug_singleton_p (bb_seq (loop->latch))) > + return false; >=20=20 > /* Check whether the latch contains the loop iv increment. */ > edge back =3D single_succ_edge (loop->latch); > --=20 > 1.9.1 >=20 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" Content-length: 472 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVdbsHAAoJEK3/DN1sMFFtrI4H/2TwKATFgDC4n2Nb+1IUFgmy OKfLREdo47VkqdVIFC0RYcUEiPal20tBytX2YLVRzLkfAI3fLktKVC8rp/2ag2iI ipeCzv+sTPwACPfdVWBGapRp5loMQnbTvp+6RIS7wtH6GJhx6vJf6nnMs22rsefK uy1IXsbWWIjKuTEosbQIEt0Nf+SdtamuXn+5xQnc8G45M8JikFl/sTVYr3Kp3Y4g ENEBU1u54i1ivngYeyL6lDg5DQT7bizVUDLRslkwPSlmW3vdTddpF+W7j6h4uTZ4 towJjP73mlDglX9ajKaGY0frUyr3FGYVxJNZZ0yVfjIOZcf1tV++moKG3NLddX0= =Wdum -----END PGP SIGNATURE----- --=-=-=--