[PATCH 0/4] OpenMP: Parsing of lvalues for "map" clauses for C andjC++

2021-11-15 Thread Julian Brown
/580721.html To add support for parsing general lvalues in "map" clauses in both C and C++. A new "address inspector" class is introduced in order to unify address analyses from several places in the C/C++ front-ends which had some level of duplication. Tested with offloading

[PATCH] [og11] nvptx: Revert "[nvptx] Expand OpenACC child function arguments to use CUDA params space"

2021-10-12 Thread Julian Brown
100644 --- a/gcc/ChangeLog.omp +++ b/gcc/ChangeLog.omp @@ -1,3 +1,14 @@ +2021-10-12 Julian Brown + + Revert: + + 2019-09-10 Chung-Lin Tang + + * config/nvptx/nvptx.c (nvptx_expand_to_rtl_hook): New function + implementing CUDA .params space transformation

Re: [PATCH 07/11] OpenMP: Fix non-zero attach/detach bias for struct dereferences

2021-10-11 Thread Julian Brown
On Fri, 1 Oct 2021 10:09:05 -0700 Julian Brown wrote: > libgomp/ > * testsuite/libgomp.c++/baseptrs-3.C: Add test (XFAILed for > now). This XFAILed test is addressed in the followup patch: https://gcc.gnu.org/pipermail/gcc-patches/2021-October/581342.html Cheers, Julian

[PATCH 2/2] OpenACC: Make deep-copy-arrayofstruct.c a libgomp/runtime test

2021-10-11 Thread Julian Brown
self-approve as a testsuite-only change, but the patch depends on previously-posted series). Julian 2021-10-11 Julian Brown gcc/testsuite/ * libgomp.oacc-c-c++-common/deep-copy-arrayofstruct.c: Move test from here. libgomp/ * testsuite/libgomp.oacc-c-c++-common/deep-copy

[PATCH 1/2] OpenMP: Handle reference-typed struct members

2021-10-11 Thread Julian Brown
nce, or the automatically-dereferenced data itself?). An attach/detach operation is thus synthesised for the reference. Tested with offloading to NVPTX and bootstrapped. OK (pending previously-posted series?). Julian Brown 2021-10-11 Julian Brown gcc/cp/ * semantics.c (finish_

Re: [PATCH 8/8] OpenMP 5.0: [WIP, RFC] Clause ordering for OpenMP 5.0 (topological sorting by base pointer)

2021-10-04 Thread Julian Brown
On Wed, 11 Aug 2021 09:59:35 -0700 Julian Brown wrote: > This patch reimplements the omp_target_reorder_clauses function in > anticipation of supporting "deeper" struct mappings (that is, with > several structure dereference operators, or similar). FWIW, this patch

Re: [PATCH 05/11] OpenMP/OpenACC: Hoist struct sibling list handling in gimplification

2021-10-01 Thread Julian Brown
Oops, editing: On Fri, 1 Oct 2021 10:09:03 -0700 Julian Brown wrote: > Secondly, it means that in the first pass gathering up sibling lists > from parsed OpenMP/OpenACC clauses, we don't need to worry about > gimplifying: that means we can see struct bases & components we need >

[PATCH 11/11] OpenMP/OpenACC: [WIP] Add gcc_unreachable to apparently-dead path in build_struct_comp_nodes

2021-10-01 Thread Julian Brown
ra node handling can probably be removed completely. (Otherwise we need test coverage for that path, ideally!) This is mostly posted as an FYI: a real patch would probably just remove the unused code path, if it really isn't needed any more. Thanks, Julian 2021-09-29 Julian Brown gcc/

[PATCH 10/11] Not for committing: noisy mapping-group taxonomy

2021-10-01 Thread Julian Brown
As a possible aid to review, this is code that can be used to enumerate all the mapping group forms currently in use across the GCC/libgomp testsuites for OpenMP/OpenACC. These groups have been added somewhat organically, so there might be a couple of surprises: see e.g. the patch following this

[PATCH 09/11] Not for committing: noisy sibling-list handling output

2021-10-01 Thread Julian Brown
As a possible aid to review, this is my "printf-style" debugging cruft for the sibling list handling hoist/rework. It's not meant for committing. --- gcc/gimplify.c | 131 + 1 file changed, 131 insertions(+) diff --git a/gcc/gimplify.c

[PATCH 07/11] OpenMP: Fix non-zero attach/detach bias for struct dereferences

2021-10-01 Thread Julian Brown
ata. (The "b" and "c" members would be array types here, not pointers themselves). In this example the difference (thus bias encoded in the attach/detach node) will be something like: (uintptr_t) >a.b[idx].c[0] - (uintptr_t) >a OK for mainline? Thanks, Julian 2

[PATCH 08/11] Not for committing: noisy topological sorting output

2021-10-01 Thread Julian Brown
As a possible aid to review, this is my "printf-style" debugging cruft for the topological sorting implementation. We might want to rework this into something that emits scannable output into the gimple dump in order to write tests to make sure base pointer dependencies are being found properly,

[PATCH 06/11] OpenMP: Allow array ref components for C & C++

2021-10-01 Thread Julian Brown
This patch fixes parsing for struct components that are array references in OMP clauses in both the C and C++ front ends. OK for mainline? Thanks, Julian 2021-09-29 Julian Brown gcc/c/ * c-typeck.c (c_finish_omp_clauses): Allow ARRAY_REF components. gcc/cp/ * semantics.c

[PATCH 05/11] OpenMP/OpenACC: Hoist struct sibling list handling in gimplification

2021-10-01 Thread Julian Brown
ACC doesn't do the topological sorting of nodes (yet?). OK for mainline? Thanks, Julian 2021-09-29 Julian Brown gcc/ * gimplify.c (gimplify_omp_var_data): Remove GOVD_MAP_HAS_ATTACHMENTS. (extract_base_bit_offset): Remove OFFSETP parameter. (strip_components_and_

[PATCH 04/11] Remove omp_target_reorder_clauses

2021-10-01 Thread Julian Brown
This patch has been split out from the previous one to avoid a confusingly-interleaved diff. The two patches should probably be committed squashed together. 2021-10-01 Julian Brown gcc/ * gimplify.c (omp_target_reorder_clauses): Delete. --- gcc/gimplify.c | 183

[PATCH 03/11] OpenMP 5.0: Clause ordering for OpenMP 5.0 (topological sorting by base pointer)

2021-10-01 Thread Julian Brown
atch is significantly improved over the version posted previously in order to support the subsequent patches in this series. OK for mainline? Thanks, Julian 2021-09-29 Julian Brown gcc/ * gimplify.c (is_or_contains_p, omp_target_reorder_clauses): Delete functions.

[PATCH 02/11] Remove base_ind/base_ref handling from extract_base_bit_offset

2021-10-01 Thread Julian Brown
parts further. OK for mainline? Thanks, Julian 2021-09-29 Julian Brown gcc/ * gimplify.c (extract_base_bit_offset): Remove BASE_IND, BASE_REF and OPENMP parameters. (strip_indirections): New function. (build_struct_group): Update calls to extract_base_bit_offset

[PATCH 01/11] libgomp: Release device lock on cbuf error path

2021-10-01 Thread Julian Brown
to NVPTX. OK? 2021-09-29 Julian Brown libgomp/ * target.c (gomp_copy_host2dev): Release device lock on cbuf error path. --- libgomp/target.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libgomp/target.c b/libgomp/target.c index 65bb40100e5..84c6fdf2c47

[PATCH 00/11] OpenMP: Deep struct dereferences

2021-10-01 Thread Julian Brown
7 of that series. The patches have been bootstrapped & regression tested individually with offloading to NVPTX (though some prior to the most recent rebase). OK? Thanks, Julian Julian Brown (11): libgomp: Release device lock on cbuf error path Remove base_ind/base_ref handling from ext

Re: [PATCH] [og10] OpenACC: Shared memory layout optimisation

2021-09-20 Thread Julian Brown
On Fri, 17 Sep 2021 16:26:50 +0200 Thomas Schwinge wrote: > > @@ -1449,8 +1634,120 @@ oacc_do_neutering (void) > > > + addr_range ar > > + = first_fit_range (conflicts, size, align, > > _shm_bounds); + > > + splay_tree_delete (conflicts); > > + > > + if (ar.invalid ()) > >

[PATCH 8/8] OpenMP 5.0: [WIP, RFC] Clause ordering for OpenMP 5.0 (topological sorting by base pointer)

2021-08-11 Thread Julian Brown
esses the first node in each group.) Jakub, Chung-Lin -- does this approach seem reasonable? Any comments at this stage? 2021-08-10 Julian Brown gcc/ * gimplify.c (is_or_contains_p, omp_target_reorder_clauses): Delete function. (omp_tsort_mark):

[PATCH 7/8] OpenACC: Rework indirect struct handling in gimplify.c

2021-08-11 Thread Julian Brown
such mappings will trigger an attach/detach operation. To properly use such a construct on the target, you must still manually map "mystruct->a[:1]" first -- but there's no need to map "mystruct[:1]" explicitly before that. This version of the patch avoids altering code paths for Op

[PATCH 6/8] OpenACC/OpenMP: Refactor struct lowering in gimplify.c

2021-08-11 Thread Julian Brown
e the code self-document better also. 2021-06-02 Julian Brown gcc/ * gimplify.c (insert_struct_comp_map): Refactor function into... (build_struct_comp_nodes): This new function. Remove list handling and improve self-documentation. (insert_node_after, move_

[PATCH 5/8] OpenMP/OpenACC: Move array_ref/indirect_ref handling code out of extract_base_bit_offset

2021-08-11 Thread Julian Brown
posted for the og11 branch here (patch & reversion/rework): https://gcc.gnu.org/pipermail/gcc-patches/2021-June/571712.html https://gcc.gnu.org/pipermail/gcc-patches/2021-June/571884.html 2021-06-03 Julian Brown gcc/ * gimplify.c (extract_base_bit_offset): Don't look thr

[PATCH 3/8] Remove array section base-pointer mapping semantics, and other front-end adjustments (mainline trunk)

2021-08-11 Thread Julian Brown
From: Chung-Lin Tang This is a version of a patch by Chung-Lin, merged to current mainline. Any errors introduced are my own! It was previously posted here: https://gcc.gnu.org/pipermail/gcc-patches/2021-May/571195.html Chung-Lin's description from the previous submission follows (edited a

[PATCH 4/8] Rewrite GOMP_MAP_ATTACH_DETACH mappings unconditionally

2021-08-11 Thread Julian Brown
done already in the preceding code. Previously posted here: https://gcc.gnu.org/pipermail/gcc-patches/2021-May/570399.html https://gcc.gnu.org/pipermail/gcc-patches/2021-June/571711.html (og11) 2021-06-02 Julian Brown gcc/ * gimplify.c (gimplify_scan_omp_clauses): Simplify condition

[PATCH 1/8] Improve OpenMP target support for C++ [PR92120 v4b]

2021-08-11 Thread Julian Brown
From: Chung-Lin Tang This is a version "v4b" of a patch by Chung-Lin, merged to current mainline. All errors introduced are my own! Previously posted here: https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573166.html Chung-Lin's description from the last submission follows. This patch is

[PATCH 2/8] OpenMP 5.0: Implement relaxation of implicit map vs. existing device mappings

2021-08-11 Thread Julian Brown
From: Chung-Lin Tang This is a version of a patch by Chung-Lin, merged to current mainline. Any errors introduced are my own! It was previously posted here: https://gcc.gnu.org/pipermail/gcc-patches/2021-May/570365.html Chung-Lin's description from the previous submission follows. (Edit: it

[PATCH 0/8] OpenMP 5.0: Topological sort for OpenMP 5.0 base pointers

2021-08-11 Thread Julian Brown
relaxation of implicit map vs. existing device mappings Remove array section base-pointer mapping semantics, and other front-end adjustments (mainline trunk) Julian Brown (5): Rewrite GOMP_MAP_ATTACH_DETACH mappings unconditionally OpenMP/OpenACC: Move array_ref/indirect_ref handlin

Re: [PATCH, libgomp, OpenMP 5.0, OG11, committed] Implement omp_get_device_num

2021-08-09 Thread Julian Brown
On Mon, 9 Aug 2021 15:16:45 +0800 Chung-Lin Tang wrote: > This commit also effective reverts the one-liner patch by Cesar: > https://gcc.gnu.org/pipermail/gcc-patches/2017-October/484844.html > > (which was still kept in OG11 at > 59ef9fea377db72f198b2bd5a95d5aef58b3f9c4) > > That small patch

Re: [OpenACC] Extract 'pass_oacc_loop_designation' out of 'pass_oacc_device_lower' (was: [PATCH 1/4] openacc: Middle-end worker-partitioning support)

2021-08-06 Thread Julian Brown
On Thu, 29 Jul 2021 09:49:05 +0200 Thomas Schwinge wrote: > > namespace { > > > > +const pass_data pass_data_oacc_loop_designation = > > +{ > > + GIMPLE_PASS, /* type */ > > + "oaccloops", /* name */ > > + OPTGROUP_OMP, /* optinfo_flags */ > > + TV_NONE, /* tv_id */ > > + PROP_cfg, /*

Re: [PATCH 1/4] openacc: Middle-end worker-partitioning support

2021-08-06 Thread Julian Brown
On Wed, 4 Aug 2021 15:56:49 +0200 Thomas Schwinge wrote: > > This version of the patch [...] > > avoids moving SESE-region finding code out > > of the NVPTX backend > > So that's 'struct bb_sese' and following functions. > > > since that code isn't used by the middle-end worker > >

Re: [PATCH 1/4] openacc: Middle-end worker-partitioning support

2021-08-06 Thread Julian Brown
On Wed, 4 Aug 2021 15:13:30 +0200 Thomas Schwinge wrote: > 'oacc_do_neutering' is the 'execute' function of the pass, so that > means every time this executes, a fresh 'field_map' is set up, no > state persists across runs (assuming I'm understanding that > correctly). Why don't we simply use

Re: [PATCH 0/4] openacc: Async fixes

2021-07-02 Thread Julian Brown
On Wed, 30 Jun 2021 11:40:33 +0100 Julian Brown wrote: > On Wed, 30 Jun 2021 10:28:00 +0200 > Thomas Schwinge wrote: > > > > - The OpenACC profiling-interface implementation did not measure > > >asynchronous operations properly. > > > > We'll

Re: [PATCH 0/4] openacc: Async fixes

2021-06-30 Thread Julian Brown
On Wed, 30 Jun 2021 10:28:00 +0200 Thomas Schwinge wrote: > > - The OpenACC profiling-interface implementation did not measure > >asynchronous operations properly. > > We'll need to be careful: (possibly, an older version of) that one we > internally had identified to be causing some

Re: [PATCH 2/4] openacc: Fix async bugs in several OpenACC test cases

2021-06-29 Thread Julian Brown
On Tue, 29 Jun 2021 16:42:02 -0700 Julian Brown wrote: > Several OpenACC tests accidentally abuse async semantics, leading to > race conditions & test failures. This patch fixes those tests. > > Tested with offloading to AMD GCN. I can probably self-approve this as > a t

[PATCH 4/4] openacc: Profiling-interface fixes for asynchronous operations

2021-06-29 Thread Julian Brown
This patch was posted for the og9 branch here: https://gcc.gnu.org/legacy-ml/gcc-patches/2019-09/msg01024.html Tested with offloading to AMD GCN. OK for mainline? Thanks, Julian 2021-06-29 Julian Brown libgomp/ * oacc-host.c (host_openacc_async_queue_callback): Invok

[PATCH 3/4] openacc: Fix asynchronous host-to-device copies in libgomp runtime

2021-06-29 Thread Julian Brown
This patch exposes a problem with OpenACC profiling support that is fixed by the next patch in the series. The acc_prof-parallel-1.c test is XFAILed for now. Tested with offloading to AMD GCN. OK? Julian 2021-06-29 Julian Brown libgomp/ * libgomp.h (gomp_copy_host2dev): Update

[PATCH 2/4] openacc: Fix async bugs in several OpenACC test cases

2021-06-29 Thread Julian Brown
Several OpenACC tests accidentally abuse async semantics, leading to race conditions & test failures. This patch fixes those tests. Tested with offloading to AMD GCN. I can probably self-approve this as a testcase change only, unless anyone objects. Thanks, Julian 2021-06-29 Julian B

[PATCH 1/4] openacc: Async fix for lib-94 testcase

2021-06-29 Thread Julian Brown
a testcase change only, unless anyone objects. Thanks, Julian 2021-06-29 Julian Brown libgomp/ * testsuite/libgomp.oacc-c-c++-common/lib-94.c: Fix race condition. --- libgomp/testsuite/libgomp.oacc-c-c++-common/lib-94.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH 0/4] openacc: Async fixes

2021-06-29 Thread Julian Brown
with offloading to AMD GCN. OK for mainline? Thanks, Julian Julian Brown (4): openacc: Async fix for lib-94 testcase openacc: Fix async bugs in several OpenACC test cases openacc: Fix asynchronous host-to-device copies in libgomp runtime openacc: Profiling-interface fixes for asynchronous operations

Re: [wwwdocs] gcc-12/changes.html: GCN - add TI mode, mention -foffload(-options)

2021-06-29 Thread Julian Brown
On Tue, 29 Jun 2021 17:34:00 +0200 Tobias Burnus wrote: > This documents AMD GCN's new much-more complete TI-mode > (__int128_t) support, that was as v2 just posted by Julian > and should get committed very soon. Thank you! > gcc-12/changes.html: GCN - add TI mode, mention -foffload(-options)

Re: [PATCH 2/5] amdgcn: Add [us]mulsi3_highpart SGPR alternatives & [us]mulsid3/muldi3 expanders

2021-06-29 Thread Julian Brown
On Fri, 18 Jun 2021 15:55:09 +0100 Andrew Stubbs wrote: > On 18/06/2021 15:19, Julian Brown wrote: > > This patch improves 64-bit multiplication for AMD GCN: patterns for > > unsigned and signed 32x32->64 bit multiplication have been added, > > and also 64x64->64 bit

[PATCH 3/3] amdgcn: Add [us]mulsid3/muldi3 patterns

2021-06-29 Thread Julian Brown
evious approach using an expander. I will apply shortly. Julian 2021-06-29 Julian Brown gcc/ * config/gcn/gcn.md (mulsidi3, mulsidi3_reg, mulsidi3_imm, muldi3): Add patterns. --- gcc/config/gcn/gcn.md | 94 +++ 1 file changed, 94 inse

[PATCH 2/3] amdgcn: Add [us]mulsi3_highpart SGPR alternatives

2021-06-29 Thread Julian Brown
This patch splits the mulsi3_highpart pattern into an expander and register/immediate alternatives (to avoid meaningless sign/zero_extends on constants), and adds alternatives for SGPR high-part multiply instructions on GCN5+. I will apply shortly. Julian 2021-06-29 Julian Brown gcc

[PATCH 1/3] amdgcn: Mark s_mulk_i32 as clobbering SCC

2021-06-29 Thread Julian Brown
2021-06-29 Julian Brown gcc/ * config/gcn/gcn.md (mulsi3): Make s_mulk_i32 variant clobber SCC. --- gcc/config/gcn/gcn.md | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/config/gcn/gcn.md b/gcc/config/gcn/gcn.md index b5f895a93e2..cca45522fba 100644 --- a/gcc/

[PATCH 0/3] amdgcn: Integer multiplication improvements

2021-06-29 Thread Julian Brown
until register-allocation time. This indeed seems to improve generated code. I also noticed that SImode multiplication can silently clobber SCC if the "s_mulk_i32" alternative is chosen, so I've done a drive-by fix for that too. Re-tested on GCN bare metal. Julian Julian Brown (3): am

[PATCH 5/5] Fortran: Re-enable 128-bit integers for AMD GCN

2021-06-18 Thread Julian Brown
This patch reverts the part of Tobias's patch for PR target/96306 that disables 128-bit integer support for AMD GCN. OK for mainline (assuming the previous patches are in first)? Thanks, Julian 2021-06-18 Julian Brown libgfortran/ PR target/96306 * configure.ac: Remove

[PATCH 4/5] amdgcn: Enable support for TImode for AMD GCN

2021-06-18 Thread Julian Brown
be needed). Those gaps are filled in by this patch, or by the preceding patches in the series. I can probably self-approve this, but I'll give Andrew Stubbs a chance to comment. Thanks, Julian 2021-06-18 Julian Brown gcc/ * config/gcn/gcn.c (gcn_init_libfuncs): New function. (TARG

[PATCH 3/5] amdgcn: Add clrsbsi2/clrsbdi2 implementation

2021-06-18 Thread Julian Brown
are lost from libgcc if we build it for DImode/TImode rather than SImode/DImode, a change we make in a later patch in this series. I can probably self-approve this, but I'll give Andrew Stubbs a chance to comment. Thanks, Julian 2021-06-18 Julian Brown gcc/ * config/gcn/gcn.md

[PATCH 2/5] amdgcn: Add [us]mulsi3_highpart SGPR alternatives & [us]mulsid3/muldi3 expanders

2021-06-18 Thread Julian Brown
rather than SImode/DImode, a change we make in a later patch in this series. I can probably self-approve this, but I'll give Andrew Stubbs a chance to comment. Thanks, Julian 2021-06-18 Julian Brown gcc/ * config/gcn/gcn.md (mulsi3_highpart): Add SGPR alternatives for

[PATCH 1/5] amdgcn: Use unsigned types for udivsi3/umodsi3 libgcc helper args/return

2021-06-18 Thread Julian Brown
-18 Julian Brown libgcc/ * config/gcn/lib2-divmod.c (__udivsi3, __umodsi3): Change argument and return types to USItype. * config/gcn/lib2-gcn.h (__udivsi3, __umodsi3): Update prototypes. --- libgcc/config/gcn/lib2-divmod.c | 8 libgcc/config/gcn/lib2-gcn.h| 4

[PATCH 0/5] amdgcn: Improve TImode support

2021-06-18 Thread Julian Brown
s. Thanks, Julian Julian Brown (5): amdgcn: Use unsigned types for udivsi3/umodsi3 libgcc helper args/return amdgcn: Add [us]mulsi3_highpart SGPR alternatives & [us]mulsid3/muldi3 expanders amdgcn: Add clrsbsi2/clrsbdi2 implementation amdgcn: Enable support for TImode for AMD

Re: [PATCH] gcc/configure.ac: fix register issue for global_load assembler functions

2021-06-16 Thread Julian Brown
At the risk of overstepping my GCN backend review remit... On Wed, 16 Jun 2021 11:34:53 +0200 Marcel Vollweiler wrote: > index d9fc3c2..e179ce1 100644 > --- a/gcc/configure.ac > +++ b/gcc/configure.ac > @@ -5357,6 +5357,30 @@ case "$target" in > ;; > esac > > +# This tests if the

Re: [PATCH] gcc/configure.ac: fix register issue for global_load assembler functions

2021-06-14 Thread Julian Brown
On Mon, 14 Jun 2021 13:36:54 +0100 Julian Brown wrote: > On Wed, 9 Jun 2021 16:47:21 +0200 > Marcel Vollweiler wrote: > > In this patch a compatibility check is added to the configure.ac. > > The implementation of the solution looks fine, but I worry it's the > wrong

Re: [PATCH] gcc/configure.ac: fix register issue for global_load assembler functions

2021-06-14 Thread Julian Brown
On Wed, 9 Jun 2021 16:47:21 +0200 Marcel Vollweiler wrote: > This patch fixes an issue with global_load assembler functions leading > to a "invalid operand for instruction" error since in different LLVM > versions those functions use either one or two registers. LLVM is neither forward- nor

[PATCH] [og11] OpenMP/OpenACC: Move array_ref/indirect_ref handling code out of extract_base_bit_offset

2021-06-03 Thread Julian Brown
potentially introducing a bug. Tested with offloading to NVPTX. I will apply to the og11 branch after the weekend. 2021-06-03 Julian Brown gcc/ * gimplify.c (extract_base_bit_offset): Don't look through ARRAY_REFs or INDIRECT_REFs here. (build_struct_group): Reinstate

Re: [PATCH 2/4] [og11] Unify ARRAY_REF/INDIRECT_REF stripping code in extract_base_bit_offset

2021-06-02 Thread Julian Brown
On Wed, 2 Jun 2021 13:59:05 +0200 Richard Biener wrote: > On Wed, Jun 2, 2021 at 12:47 PM Julian Brown > wrote: > > > > For historical reasons, it seems that extract_base_bit_offset > > unnecessarily used two different ways to strip > > ARRAY_REF/INDIRECT_REF no

[PATCH 4/4] [og11] Rework indirect struct handling for OpenACC in gimplify.c

2021-06-02 Thread Julian Brown
arget, you must still manually map "mystruct->a[:1]" first -- but there's no need to map "mystruct[:1]" explicitly before that. This version of the patch avoids altering code paths for OpenMP, where possible. 2021-06-02 Julian Brown gcc/fortran/ * trans-openmp.c (

[PATCH 3/4] [og11] Refactor struct lowering for OpenACC/OpenMP in gimplify.c

2021-06-02 Thread Julian Brown
I've also gone through the list-handling code and attempted to add comments documenting how it works to the best of my understanding, and broken out a couple of helper functions in order to (hopefully) have the code self-document better also. 2021-06-02 Julian Brown gcc/ *

[PATCH 2/4] [og11] Unify ARRAY_REF/INDIRECT_REF stripping code in extract_base_bit_offset

2021-06-02 Thread Julian Brown
re calling get_inner_reference, but it appears that there is not, so one can go away. 2021-06-02 Julian Brown gcc/ * gimplify.c (extract_base_bit_offset): Unify ARRAY_REF/INDIRECT_REF stripping code in first call/subsequent call cases. --- gcc/gimpl

[PATCH 1/4] [og11] Rewrite GOMP_MAP_ATTACH_DETACH mappings unconditionally

2021-06-02 Thread Julian Brown
done already in the preceding code. 2021-06-02 Julian Brown gcc/ * gimplify.c (gimplify_scan_omp_clauses): Simplify condition for changing GOMP_MAP_ATTACH_DETACH to GOMP_MAP_ATTACH or GOMP_MAP_DETACH. --- gcc/gimplify.c | 10 +- 1 file changed, 1 insertion(+), 9

[PATCH 0/4] [og11] OpenACC: Rework struct component handling

2021-06-02 Thread Julian Brown
to the og11 branch shortly. Thanks, Julian Julian Brown (4): [og11] Rewrite GOMP_MAP_ATTACH_DETACH mappings unconditionally [og11] Unify ARRAY_REF/INDIRECT_REF stripping code in extract_base_bit_offset [og11] Refactor struct lowering for OpenACC/OpenMP in gimplify.c [og11] Rework indirect

[PATCH] OpenMP: Use build_indirect_ref for struct deferences in C FE

2021-05-27 Thread Julian Brown
TX (and bootstrapped). Thanks, Julian 2021-05-27 Julian Brown gcc/c/ * c-parser.c (c_parser_omp_variable_list); Call build_indirect_ref instead of build_simple_mem_ref for struct dereferences. gcc/testsuite/ * c-c++-common/gomp/target-indir-struct-1.c: N

[PATCH v2 4/4] [og10] Rework indirect struct handling for OpenACC in gimplify.c

2021-05-19 Thread Julian Brown
arget, you must still manually map "mystruct->a[:1]" first -- but there's no need to map "mystruct[:1]" explicitly before that. This version of the patch avoids altering code paths for OpenMP, where possible. I will apply shortly to the og10 branch. Thanks, Julian 2021-05-1

[PATCH v2 3/4] [og10] Refactor struct lowering for OpenACC/OpenMP in gimplify.c

2021-05-19 Thread Julian Brown
n 2021-05-19 Julian Brown gcc/ * gimplify.c (insert_struct_comp_map): Refactor function into... (build_struct_comp_nodes): This new function. Remove list handling and improve self-documentation. (insert_node_after, move_node_after, move_n

[PATCH v2 2/4] [og10] Unify ARRAY_REF/INDIRECT_REF stripping code in extract_base_bit_offset

2021-05-19 Thread Julian Brown
re calling get_inner_reference, but it appears that there is not, so one can go away. I will apply shortly to the og10 branch. Thanks, Julian 2021-05-11 Julian Brown gcc/ * gimplify.c (extract_base_bit_offset): Unify ARRAY_REF/INDIRECT_REF stripping code in first call/subse

[PATCH v2 1/4] [og10] Rewrite GOMP_MAP_ATTACH_DETACH mappings unconditionally

2021-05-19 Thread Julian Brown
done already in the preceding code. I will apply shortly to the og10 branch. Thanks, Julian 2021-05-19 Julian Brown gcc/ * gimplify.c (gimplify_scan_omp_clauses): Simplify condition for changing GOMP_MAP_ATTACH_DETACH to GOMP_MAP_ATTACH or GOMP_MAP_DETACH. --- gcc

[PATCH v2 0/4] [og10] OpenACC: Rework struct component handling

2021-05-19 Thread Julian Brown
probably remove some of the duplication that remains after these patches are committed. Tested with offloading to nvptx. I will apply to the og10 branch shortly. Julian Julian Brown (4): [og10] Rewrite GOMP_MAP_ATTACH_DETACH mappings unconditionally [og10] Unify ARRAY_REF/INDIRECT_REF

Re: [PATCH 7/7] [og10] WIP GOMP_MAP_ATTACH_ZERO_LENGTH_ARRAY_SECTION changes

2021-05-17 Thread Julian Brown
On Mon, 17 May 2021 21:14:26 +0800 Chung-Lin Tang wrote: > On 2021/5/11 4:57 PM, Julian Brown wrote: > > This work-in-progress patch tries to get > > GOMP_MAP_ATTACH_ZERO_LENGTH_ARRAY_SECTION to behave more like > > GOMP_MAP_ATTACH_DETACH -- in that the mapping i

Re: [PATCH 5/5] Mapping of components of references to pointers to structs for OpenMP/OpenACC

2021-05-17 Thread Julian Brown
On Mon, 17 May 2021 21:07:19 +0800 Chung-Lin Tang wrote: > Hi Julian, > > On 2021/5/15 5:27 AM, Julian Brown wrote: > > GCC currently raises a parse error for indirect accesses to struct > > members, where the base of the access is a reference to a pointer. > >

Re: [PATCH 4/5] Rework indirect struct handling for OpenACC/OpenMP in gimplify.c

2021-05-17 Thread Julian Brown
On Mon, 17 May 2021 14:12:00 +0200 Bernd Edlinger wrote: > > */ @@ -8715,19 +8770,26 @@ static tree > > build_struct_group (struct gimplify_omp_ctx *ctx, > > enum omp_region_type region_type, enum > > tree_code code, tree decl, unsigned int *flags, tree c, > > -

[PATCH 5/5] Mapping of components of references to pointers to structs for OpenMP/OpenACC

2021-05-14 Thread Julian Brown
GCC currently raises a parse error for indirect accesses to struct members, where the base of the access is a reference to a pointer. This patch fixes that case. OK for trunk? Thanks, Julian 2021-05-14 Julian Brown gcc/cp/ * semantics.c (finish_omp_clauses): Handle components

[PATCH 4/5] Rework indirect struct handling for OpenACC/OpenMP in gimplify.c

2021-05-14 Thread Julian Brown
struct on the target, you must still manually map "mystruct->a[:1]" first -- but there's no need to map "mystruct[:1]" explicitly before that. This patch incorporates parts of Chung-Lin's patch "Recommit "Enable gimplify GOMP_MAP_STRUCT handling of (COMPONE

[PATCH 3/5] Rewrite GOMP_MAP_ATTACH_DETACH mappings for OpenMP also

2021-05-14 Thread Julian Brown
unconditionally for both OpenACC and OpenMP, in cases where it hasn't otherwise been handled already in the preceding code. OK for trunk? Thanks, Julian 2021-05-14 Julian Brown gcc/ * gimplify.c (gimplify_scan_omp_clauses): Remove OpenACC-only condition for changing

[PATCH 2/5] Refactor struct lowering for OpenMP/OpenACC in gimplify.c

2021-05-14 Thread Julian Brown
I've also gone through the list-handling code and attempted to add comments documenting how it works to the best of my understanding, and broken out a couple of helper functions in order to (hopefully) have the code self-document better also. OK for trunk? Thanks, Julian 2021-05-14 Julian Br

[PATCH 1/5] Unify ARRAY_REF/INDIRECT_REF stripping code in extract_base_bit_offset

2021-05-14 Thread Julian Brown
re calling get_inner_reference, but it appears that there is not, so one can go away. OK for trunk? Thanks, Julian 2021-05-14 Julian Brown gcc/ * gimplify.c (extract_base_bit_offset): Unify ARRAY_REF/INDIRECT_REF stripping code in first call/subsequent call cases. --- gcc/

[PATCH 0/5] OpenACC/OpenMP: Rework struct component handling

2021-05-14 Thread Julian Brown
member functions" "Fix regression of array members in OpenMP map clauses." The tests in question have been XFAILed for now. Tested with offloading to NVPTX (as a series). Further comments on individual patches. Thanks, Julian Julian Brown (5): Unify ARRAY_REF/INDIRECT_REF s

Re: [PATCH, OG10, OpenMP 5.0, committed] Remove array section base-pointer mapping semantics, and other front-end adjustments.

2021-05-11 Thread Julian Brown
On Tue, 11 May 2021 19:28:04 +0800 Chung-Lin Tang wrote: > This patch largely implements three pieces of functionality: > > (1) Per discussion and clarification on the omp-lang mailing list, > standards conforming behavior for mapping array sections should *NOT* > also map the base-pointer, i.e

[PATCH 7/7] [og10] WIP GOMP_MAP_ATTACH_ZERO_LENGTH_ARRAY_SECTION changes

2021-05-11 Thread Julian Brown
of mappings for array sections are handled in other cases. This patch isn't sufficient by itself to fix a couple of broken test cases at present (libgomp.c++/target-lambda-1.C, libgomp.c++/target-this-4.C), though. 2021-05-11 Julian Brown gcc/ * gimplify.c (build_struct_comp_nodes): Add

[PATCH 6/7] [og10] Rework indirect struct handling for OpenACC/OpenMP in gimplify.c

2021-05-11 Thread Julian Brown
struct on the target, you must still manually map "mystruct->a[:1]" first -- but there's no need to map "mystruct[:1]" explicitly before that. 2021-05-11 Julian Brown gcc/fortran/ * trans-openmp.c (gfc_trans_omp_clauses): Don't create GOMP_MAP_TO

[PATCH 5/7] [og10] Rewrite GOMP_MAP_ATTACH_DETACH mappings for OpenMP also

2021-05-11 Thread Julian Brown
unconditionally for both OpenACC and OpenMP, in cases where it hasn't otherwise been handled already in the preceding code. 2021-05-11 Julian Brown gcc/ * gimplify.c (gimplify_scan_omp_clauses): Remove OpenACC-only condition for changing GOMP_MAP_ATTACH_DETACH to GOMP_MAP_ATTACH

[PATCH 4/7] [og10] Revert gimplify.c parts of "Arrow operator handling for C front-end in OpenMP map clauses"

2021-05-11 Thread Julian Brown
ries fixes it again. 2021-05-11 Julian Brown gcc/ * gimplify.c (build_struct_group): Remove COMPONENT_REF_P parameter. Don't call gimplify_expr on decl in non-reference case. Remove code to add FIRSTPRIVATE_POINTER for *pointer-to-struct e

[PATCH 3/7] [og10] Revert gimplify.c parts of "Fix template case of non-static member access inside member functions"

2021-05-11 Thread Julian Brown
With the "rework indirect struct handling" patch later in this series, some parts of this earlier patch (by Chung-Lin) become unnecessary. This patch reverts those bits. 2021-05-11 Julian Brown gcc/ * gimplify.c (gimplify_scan_omp_clauses): Don't strip nops in indir_p

[PATCH 2/7] [og10] Refactor struct lowering for OpenMP/OpenACC in gimplify.c

2021-05-11 Thread Julian Brown
I've also gone through the list-handling code and attempted to add comments documenting how it works to the best of my understanding, and broken out a couple of helper functions in order to (hopefully) have the code self-document better also. 2021-05-11 Julian Brown gcc/ *

[PATCH 1/7] [og10] Unify ARRAY_REF/INDIRECT_REF stripping code in extract_base_bit_offset

2021-05-11 Thread Julian Brown
re calling get_inner_reference, but it appears that there is not, so one can go away. 2021-05-11 Julian Brown gcc/ * gimplify.c (extract_base_bit_offset): Unify ARRAY_REF/INDIRECT_REF stripping code in first call/subsequent call cases. --- gcc/gimpl

[PATCH 0/7] [og10] OpenACC/OpenMP: Rework struct component handling

2021-05-11 Thread Julian Brown
ready for og10 yet. Hopefully posting now will help us resolve those last bits! The first two patches in the series have been tested by themselves however, and those ones do *not* cause regressions. If it seems helpful, I can commit those now. Julian Julian Brown (7): [og10] Unify ARRAY_REF

Re: [PATCH 1/3] openacc: Add support for gang local storage allocation in shared memory

2021-04-19 Thread Julian Brown
Hi, (Chung-Lin, question for you buried below.) On Thu, 15 Apr 2021 19:26:54 +0200 Thomas Schwinge wrote: > Hi! > > On 2021-02-26T04:34:50-0800, Julian Brown > wrote: > > This patch > > Thanks, Julian, for your continued improving of these changes! You're welco

[PATCH 4/4] openacc: Reference-typed reduction and private variable rewriting

2021-03-02 Thread Julian Brown
for stage 1? Julian 2021-03-02 Cesar Philippidis Julian Brown Kwok Cheung Yeung gcc/ * gimplify.c (privatize_reduction): New struct. (localize_reductions_r, localize_reductions): New functions. (gimplify_omp_for): Call localize_reductions

[PATCH 3/4] amdgcn: Enable OpenACC worker partitioning for AMD GCN

2021-03-02 Thread Julian Brown
the other patches in the series are committed in stage 1. Julian 2021-03-02 Julian Brown Kwok Cheung Yeung gcc/ * config/gcn/gcn-protos.h (gcn_goacc_adjust_propagation_record): Rename prototype to... (gcn_goacc_create_propagation_record

[PATCH 1/4] openacc: Middle-end worker-partitioning support

2021-03-02 Thread Julian Brown
atches posted previously here: https://gcc.gnu.org/pipermail/gcc-patches/2021-February/565925.html Tested with offloading to AMD GCN. OK for stage 1? Julian 2021-03-02 Julian Brown Nathan Sidwell Kwok Cheung Yeung gcc/ * Makefile.in (OBJS): Add

[PATCH 2/4] openacc: Fix async bugs in several OpenACC test cases

2021-03-02 Thread Julian Brown
Enabling worker-partitioning support in the middle end (for AMD GCN) reveals several bugs in existing tests relating to async usage. This patch fixes those up. Tested with offloading to AMD GCN. OK for stage 1? (Or now?) Julian 2021-03-02 Julian Brown libgomp/ * testsuite

[PATCH 0/4] openacc: Worker partitioning in the middle end

2021-03-02 Thread Julian Brown
these patches for review now, but I don't expect to commit them until stage 1. Thanks, Julian Julian Brown (4): openacc: Middle-end worker-partitioning support openacc: Fix async bugs in several OpenACC test cases amdgcn: Enable OpenACC worker partitioning for AMD GCN openacc: Reference-typed

[PATCH 3/3] nvptx: NVPTX parts for OpenACC private variables patch

2021-02-26 Thread Julian Brown
it at the same time as the rest of the series. (https://gcc.gnu.org/pipermail/gcc-patches/2018-October/507909.html) Thanks, Julian 2021-02-23 Chung-Lin Tang Julian Brown gcc/ * config/nvptx/nvptx.c (tree-pretty-print.h): Include. (gangprivate_shared_size): New

[PATCH 1/3] openacc: Add support for gang local storage allocation in shared memory

2021-02-26 Thread Julian Brown
xpand time. The first or both of these target hooks can be used by a given offload target, depending on its strategy for implementing private variables. Tested with offloading to AMD GCN and (separately) to NVPTX. OK (for stage 1)? Thanks, Julian 2021-02-22 Julian Brown Chung-Lin Tang

[PATCH 2/3] amdgcn: AMD GCN parts for OpenACC private variables patch

2021-02-26 Thread Julian Brown
This patch updates the TARGET_GOACC_ADJUST_PRIVATE_DECL target hook in the AMD GCN backend to the current name and prototype. (An earlier version of the hook was already present, but dormant.) (I can self-approve this. I will commit as/when the previous patch is approved.) Thanks, Julian gcc/

[PATCH 0/3] openacc: Gang-private variables in shared memory

2021-02-26 Thread Julian Brown
would not expect to commit it until stage 1. Thanks, Julian Julian Brown (3): openacc: Add support for gang local storage allocation in shared memory amdgcn: AMD GCN parts for OpenACC private variables patch nvptx: NVPTX parts for OpenACC private variables patch gcc/config/gcn/gcn

[PATCH] openacc: Warnings for strange partitioning choices for parallel regions

2021-02-26 Thread Julian Brown
)? Julian 2021-02-22 Nathan Sidwell Tom de Vries Thomas Schwinge Julian Brown Kwok Cheung Yeung gcc/ (oacc_validate_dims): Emit warnings about strange partitioning choices. gcc/testsuite/ * c-c++-common/goacc/acc-icf.c

[PATCH] middle-end: Pretty-print address space of aggregates

2021-02-26 Thread Julian Brown
It's possible for an aggregate to be declared in a non-default address space, but the tree pretty-printer doesn't currently show that address space in dumps, which can be confusing. This patch adds printing of "" markers for aggregates in non-default address spaces. OK (now or for stage 1)?

[PATCH 6/7] [og10] openacc: Fix lowering for derived-type mappings through array elements

2021-02-24 Thread Julian Brown
..a59c25b79763 100644 --- a/gcc/ChangeLog.omp +++ b/gcc/ChangeLog.omp @@ -1,3 +1,10 @@ +2021-02-24 Julian Brown + + Backport from mainline + + * gimplify.c (gimplify_scan_omp_clauses): Handle ATTACH_DETACH + for non-decls. + 2021-02-16 Tobias Burnus * doc/invoke.texi

<    1   2   3   4   5   6   7   8   9   >