From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46907 invoked by alias); 9 Jun 2015 22:15:35 -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 46403 invoked by uid 89); 9 Jun 2015 22:15:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 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, 09 Jun 2015 22:15:33 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1Z2Rnt-0000ZK-Jh from Thomas_Schwinge@mentor.com ; Tue, 09 Jun 2015 15:15:29 -0700 Received: from tftp-cs (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.224.2; Tue, 9 Jun 2015 15:15:28 -0700 Received: by tftp-cs (Postfix, from userid 49978) id 373E3C232C; Tue, 9 Jun 2015 15:15:28 -0700 (PDT) From: Thomas Schwinge To: Tom de Vries CC: GCC Patches , Richard Biener Subject: Re: [PING^2][PATCH][3/3][PR65460] Mark offloaded functions as parallelized In-Reply-To: <5576F43C.3010201@mentor.com> References: <5509B43E.802@mentor.com> <550AAD8B.9080900@mentor.com> <550C06BB.1050500@mentor.com> <5530DBA0.2000703@mentor.com> <557588BA.6060409@mentor.com> <5576F43C.3010201@mentor.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) Date: Tue, 09 Jun 2015 23:46:00 -0000 Message-ID: <87a8w8h6kl.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/msg00716.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 2771 Hi Tom! On Tue, 9 Jun 2015 16:12:12 +0200, Tom de Vries wr= ote: > On 09/06/15 13:07, Richard Biener wrote: > > On Mon, 8 Jun 2015, Tom de Vries wrote: > > > >> On 17/04/15 12:08, Tom de Vries wrote: > >>> On 20-03-15 12:38, Tom de Vries wrote: > >>>> On 19-03-15 12:05, Tom de Vries wrote: > >>>>> On 18-03-15 18:22, Tom de Vries wrote: > >>>>>> this patch fixes PR65460. > >>>>>> > >>>>>> The patch marks offloaded functions as parallelized, which means t= he > >>>>>> parloops > >>>>>> pass no longer attempts to modify that function. > > Ok, but shouldn't it be set before calling add_new_function as > > add_new_function might run passes that wouldn't identify the > > function as parallelized? >=20 > Hm, indeed sometimes add_new_function executes some passes itself,=20 > besides queueing the function for further processing. I suppose the=20 > existing settings of parallelized_function should be modified in a=20 > similar way. (I took note of this small change of the trunk patch vs. the version present on gomp-4_0-branch, and will adapt the latter as required as part of the next merge.) > I'll bootstrap and reg-test attached two patches on x86_64, and commit=20 > unless objections. > Mark offloaded functions as parallelized >=20 > 2015-06-09 Tom de Vries >=20 > PR tree-optimization/65460 > * omp-low.c (expand_omp_target): Set parallelized_function on > cgraph_node for child_fn. (Committed to trunk in r224303.) > --- a/gcc/omp-low.c > +++ b/gcc/omp-low.c > @@ -8959,6 +8959,8 @@ expand_omp_target (struct omp_region *region) >=20=20 > /* Inform the callgraph about the new function. */ > DECL_STRUCT_FUNCTION (child_fn)->curr_properties =3D cfun->curr_pr= operties; > + cgraph_node *node =3D cgraph_node::get_create (child_fn); Would you please committ a fix: in offloading configurations (ENABLE_OFFLOADING), this new node variable will clash with an existing definition a little later: > + node->parallelized_function =3D 1; > cgraph_node::add_new_function (child_fn, true); >=20=20 > #ifdef ENABLE_OFFLOADING | /* Add the new function to the offload table. */ | vec_safe_push (offload_funcs, child_fn); | #endif |=20=20 | /* Fix the callgraph edges for child_cfun. Those for cfun will be | fixed in a following pass. */ | push_cfun (child_cfun); | cgraph_edge::rebuild_edges (); |=20=20 | #ifdef ENABLE_OFFLOADING | /* Prevent IPA from removing child_fn as unreachable, since there = are no | refs from the parent function to child_fn in offload LTO mode. */ | struct cgraph_node *node =3D cgraph_node::get (child_fn); | node->mark_force_output (); | #endif Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature; name="signature.asc" Content-length: 472 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVd2V6AAoJEK3/DN1sMFFtDYEIAJJDmQJxzd18gGjTOmG5Jo7z 6CjEflp9Lz3o/WBP0VBavUjb0eBEs8br5Znrflb52VWXHsHPeGLcBSiRQe5jJDdC On5mnVJe6/Q35uKNDSGyfyxGDEtYahJWg5GdeIVsvN0ujW2fkj+/SPtuY6IkYItV Pd8z5u6VlKBhonv81R1JAZE9HEATts24mRfm/Cufn4Wkme8RBlEPr4AMU5HR5O97 LbvNy5Crr0LNedGHcvwXsYR8HlS79p+PaLzQZCb4yfEKKlidtr2uuCa5Qs6gqwwn M8Msy/PzmooyfnpCsbypA7NhOLIIhDTHhdQM+Np9GXyTL0J/ghalqxWTZahq1mM= =o1tf -----END PGP SIGNATURE----- --=-=-=--