From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id DBB503857415; Fri, 28 Oct 2022 08:20:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DBB503857415 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.95,220,1661846400"; d="scan'208,223";a="85728210" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 28 Oct 2022 00:20:32 -0800 IronPort-SDR: m6kZNAqq89o3+qh6AXVEnEj0wMKKnJRFjBsUGj37mE6VFqeZr747lwIcEQpb8N6ZScmSPGeqJX ejjjrZTgJitLUqrFyKr0ATiS41DXCvEuqhQFvFlSvmAC3tPifibyJSRW+dnVqH3c2PNhNonSlK 4hQRqeY2JZVsDaTCtHx4LPVIAWhGd6RY0Wf56GetK8c7N9yDWX0DrDEUSB04wEFSCoelTEc6a+ 7e2W1TYK5V/zt05rHgkOZ1duVgdY4+fWgTP+dpVrmYvxKdNzbT+59p+wFKuLMWrmtvsXMvEjWZ zW0= From: Thomas Schwinge To: Julian Brown , , CC: Andrew Stubbs Subject: Re: [og12] OpenACC: Don't gang-privatize artificial variables: restrict to blocks (was: [PATCH] [og12] OpenACC: Don't gang-privatize artificial variables) In-Reply-To: <87a65g4bc7.fsf@euler.schwinge.homeip.net> References: <20221014133856.3388109-1-julian@codesourcery.com> <20221014133856.3388109-2-julian@codesourcery.com> <878rldur4g.fsf@euler.schwinge.homeip.net> <20221018155924.058c4b6c@squid.athome> <87a65g4bc7.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Fri, 28 Oct 2022 10:20:26 +0200 Message-ID: <875yg44awl.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi! On 2022-10-28T10:11:04+0200, I wrote: > On 2022-10-18T15:59:24+0100, Julian Brown wrote= : >> On Tue, 18 Oct 2022 16:46:07 +0200 Thomas Schwinge wrote: >>> On 2022-10-14T13:38:56+0000, Julian Brown wro= te: >>> ..., but to my surprised, that did fire in one occasion: >>> >>> > --- a/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90 >>> > +++ b/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90 >>> > @@ -94,9 +94,7 @@ contains >>> > !$acc parallel copy(array) >>> > !$acc loop gang private(array) ! { dg-line l_loop[incr c_loop] } >>> > ! { dg-note {variable 'i' in 'private' clause isn't candidate fo= r adjusting OpenACC privatization level: not addressable} "" { target *-*-*= } l_loop$c_loop } >>> > - ! { dg-note {variable 'array\.[0-9]+' in 'private' clause is can= didate for adjusting OpenACC privatization level} "" { target *-*-* } l_loo= p$c_loop } >>> > - ! { dg-note {variable 'array\.[0-9]+' ought to be adjusted for O= penACC privatization level: 'gang'} "" { target *-*-* } l_loop$c_loop } >>> > - ! { dg-note {variable 'array\.[0-9]+' adjusted for OpenACC priva= tization level: 'gang'} "" { target { ! { openacc_host_selected || { openac= c_nvidia_accel_selected && __OPTIMIZE__ } } } } l_loop$c_loop } >>> > + ! { dg-note {variable 'array\.[0-9]+' in 'private' clause isn't = candidate for adjusting OpenACC privatization level: artificial} "" { targe= t *-*-* } l_loop$c_loop } >>> > ! { dg-message {sorry, unimplemented: target cannot support allo= ca} PR65181 { target openacc_nvidia_accel_selected } l_loop$c_loop } >>> > do i =3D 1, 10 >>> > array(i) =3D 9*i >>> >>> ... here. Note "variable 'array\.[0-9]+' in 'private' clause"; >>> everywhere else we have "declared in block". >>> >>> As part of your verification, have you already looked into whether the >>> new behavior is correct here, or does this one need to continue to be >>> "adjusted for OpenACC privatization level: 'gang'"? If the latter, >>> should we check 'if (res && block && DECL_ARTIFICIAL (decl))' instead >>> of 'if (res && DECL_ARTIFICIAL (decl))', or is there some wrong >>> setting of 'DECL_ARTIFICIAL' -- or are we maybe looking at an >>> inappropriate 'decl'? (Thinking of commit >>> r12-7580-g7a5e036b61aa088e6b8564bc9383d37dfbb4801e "[OpenACC >>> privatization] Analyze 'lookup_decl'-translated DECL [PR90115, >>> PR102330, PR104774]", for example.) >> >> I haven't looked in detail, but it seems to me that the "artificial" >> flag isn't appropriate for that decl, which is (derived from?) a >> user-visible symbol. So, I'm not sure what's going on there (and yes >> the commit you mention looks like it could be relevant, I think?). >> There are probably subtleties I'm not aware of... > > Until we've got that worked out, let's simply restrict the > 'DECL_ARTIFICIAL' handling to 'block's only; pushed to devel/omp/gcc-12 > commit 9a50d282f03f7f1e1ad00de917143a2a8e0c0ee0 > "[og12] OpenACC: Don't gang-privatize artificial variables: restrict to b= locks" ..., see attached now really. Gr=C3=BC=C3=9Fe Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename="0001-og12-OpenACC-Don-t-gang-privatize-artificial-va.og12.patch" >From 9a50d282f03f7f1e1ad00de917143a2a8e0c0ee0 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 18 Oct 2022 16:59:54 +0200 Subject: [PATCH] [og12] OpenACC: Don't gang-privatize artificial variables: restrict to blocks Follow-up to og12 commit d4504346d2a1d6ffecb8b2d8e3e04ab8ea259785 "[og12] OpenACC: Don't gang-privatize artificial variables", to restore the previous behavior, until we understand what it means for a 'DECL_ARTIFICIAL' to appear in a 'private' clause. gcc/ * omp-low.cc (oacc_privatization_candidate_p) : Restrict to 'block's. libgomp/ * testsuite/libgomp.oacc-fortran/privatized-ref-2.f90: Adjust. --- gcc/omp-low.cc | 2 +- libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90 | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/omp-low.cc b/gcc/omp-low.cc index 002f91d930a..66aa11cd32d 100644 --- a/gcc/omp-low.cc +++ b/gcc/omp-low.cc @@ -11409,7 +11409,7 @@ oacc_privatization_candidate_p (const location_t loc, const tree c, At present, no compiler-generated artificial variables require such sharing semantics, so this is safe. */ - if (res && DECL_ARTIFICIAL (decl)) + if (res && block && DECL_ARTIFICIAL (decl)) { res = false; diff --git a/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90 b/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90 index 936285e9f69..498ef70b63a 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90 @@ -94,7 +94,9 @@ contains !$acc parallel copy(array) !$acc loop gang private(array) ! { dg-line l_loop[incr c_loop] } ! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } - ! { dg-note {variable 'array\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: artificial} "" { target *-*-* } l_loop$c_loop } + ! { dg-note {variable 'array\.[0-9]+' in 'private' clause is candidate for adjusting OpenACC privatization level} "" { target *-*-* } l_loop$c_loop } + ! { dg-note {variable 'array\.[0-9]+' ought to be adjusted for OpenACC privatization level: 'gang'} "" { target *-*-* } l_loop$c_loop } + ! { dg-note {variable 'array\.[0-9]+' adjusted for OpenACC privatization level: 'gang'} "" { target { ! { openacc_host_selected || { openacc_nvidia_accel_selected && __OPTIMIZE__ } } } } l_loop$c_loop } ! { dg-message {sorry, unimplemented: target cannot support alloca} PR65181 { target openacc_nvidia_accel_selected } l_loop$c_loop } do i = 1, 10 array(i) = 9*i -- 2.35.1 --=-=-=--