[PATCH 0/8] OpenMP 5.0: C++ "declare mapper" support (plus struct rework, etc.)

2022-02-18 Thread Julian Brown
g now so others (mostly Jakub?) have a chance to look at it and comment on the general approach, etc.. Further commentary on individual patches. Thanks, Julian Julian Brown (8): OpenMP 5.0: Clause ordering for OpenMP 5.0 (topological sorting by base pointer) Remove omp_target_reorder_c

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

2022-02-18 Thread Julian Brown
of the patch has been moved to the front of the patch queue, thus isn't dependent on any of the following struct-rework patches. Tested with offloading to NVPTX and bootstrapped. OK (for stage 1)? Thanks, Julian 2022-02-18 Julian Brown gcc/ * gimplify.c (is_or_co

[PATCH 2/8] Remove omp_target_reorder_clauses

2022-02-18 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 (is_or_contains_p, omp_target_reorder_clauses): Delete. --- gcc/gimplify.cc | 207

[PATCH 3/8] OpenMP/OpenACC struct sibling list gimplification extension and rework

2022-02-18 Thread Julian Brown
The changes as a whole are all relating to increasing the variety of supported expressions in OpenMP and OpenACC map clauses, though. 2022-02-18 Julian Brown gcc/c-family/ * c-common.h (c_omp_decompose_attachable_address): Add prototype. * c-omp.cc (c_omp_decompose_attachable_add

[PATCH 4/8] OpenMP: Add inspector class to unify mapped address analysis

2022-02-18 Thread Julian Brown
the C and C++ front-ends to use it. 2021-11-15 Julian Brown gcc/c-family/ * c-common.h (c_omp_address_inspector): New class. * c-omp.c (c_omp_address_inspector::init, c_omp_address_inspector::analyze_components, c_omp_address_inspector::map_supported_p, c_o

[PATCH 5/8] OpenMP: lvalue parsing for map clauses (C++)

2022-02-18 Thread Julian Brown
s a little fiddly to get working though, and isn't unambiguously the right thing to do, so that might need more thought. 2022-02-18 Julian Brown gcc/c-family/ * c-omp.cc (c_omp_decompose_attachable_address): Handle more types of expressions. gcc/cp/ * err

[PATCH 7/8] Use OMP_ARRAY_SECTION instead of TREE_LIST in C++ FE

2022-02-18 Thread Julian Brown
er" definitions), and special-case handling TREE_LIST becomes necessary in more places, which starts to become unwieldy. 2022-02-18 Julian Brown gcc/c-family/ * c-omp.cc (c_omp_split_clauses): Support OMP_ARRAY_SECTION. gcc/cp/ * parser.cc (cp_parser_omp_var_list_no_open): U

[PATCH 6/8] OpenMP: lvalue parsing for map clauses (C)

2022-02-18 Thread Julian Brown
;arr[:N]") -- similar to the cp/semantics.c changes in the previous patch -- and adds a couple of new tests. 2021-11-24 Julian Brown gcc/c/ * c-parser.c (c_parser_postfix_expression_after_primary): Add support for OpenMP array section parsing. (c_parser_omp_variable_li

[PATCH 8/8] OpenMP 5.0 "declare mapper" support for C++

2022-02-18 Thread Julian Brown
uses resulting from instantiated mappers. (C and Fortran FE support are TBD.) Tested (alongside previous patches) with offloading to NVPTX, and bootstrapped. Any comments on this general approach? Thoughts on handling arrays of custom-mapped structs? OK (for stage 1)? Thanks, Julian

[PATCH v2 00/11] OpenMP 5.0: C & C++ "declare mapper" support (plus struct rework, etc.)

2022-03-18 Thread Julian Brown
"declare mapper" support for C as well as C++. Further commentary on individual patches. This version of the series has been tested (offloading to NVPTX) as a whole, for now. Thanks, Julian Julian Brown (11): OpenMP 5.0: Clause ordering for OpenMP 5.0 (topological so

[PATCH v2 02/11] Remove omp_target_reorder_clauses

2022-03-18 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.cc | 207

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

2022-03-18 Thread Julian Brown
of the patch has been moved to the front of the patch queue, thus isn't dependent on any of the following struct-rework patches. 2021-11-23 Julian Brown gcc/ * gimplify.c (is_or_contains_p, omp_target_reorder_clauses): Delete functions. (omp_tsort_mark): Add

[PATCH v2 03/11] OpenMP/OpenACC struct sibling list gimplification extension and rework

2022-03-18 Thread Julian Brown
uot;just a refactor" than the previously-posted version (hopefully easing review), though several behavioural changes still remain. 2022-03-17 Julian Brown gcc/fortran/ * trans-openmp.cc (gfc_trans_omp_clauses): Don't create GOMP_MAP_TO_PSET mappings for class metadata, nor

[PATCH v2 04/11] OpenMP/OpenACC: Add inspector class to unify mapped address analysis

2022-03-18 Thread Julian Brown
odes, which had become somewhat convoluted. It also now implements the functionality of the "c_omp_decompose_attachable_address" function from earlier versions of this patch series. 2022-03-17 Julian Brown gcc/c-family/ * c-common.h (c_omp_address_inspector): New cl

[PATCH v2 05/11] OpenMP: Handle reference-typed struct members

2022-03-18 Thread Julian Brown
This patch relates to OpenMP mapping clauses containing struct members of reference type, e.g. "mystruct.myref.myptr[:N]". To be able to access the array slice through the reference in the middle, we need to perform an attach action for that reference, since it is represented internally as a point

[PATCH v2 06/11] OpenMP: lvalue parsing for map clauses (C++)

2022-03-18 Thread Julian Brown
). 2022-03-17 Julian Brown gcc/c-family/ * c-omp.cc (c_omp_address_inspector::map_supported_p): Support OMP_ARRAY_SECTION. gcc/cp/ * error.cc (dump_expr): Handle OMP_ARRAY_SECTION. * parser.cc (cp_parser_new): Initialize parser->omp_array_sectio

[PATCH v2 07/11] OpenMP: lvalue parsing for map clauses (C)

2022-03-18 Thread Julian Brown
This patch adds support for parsing general lvalues for OpenMP "map" clauses to the C front-end, similar to the previous patch for C++. This version of the patch has been adjusted for changes to the address inspector patch, but is otherwise the same as the last posted version. 2022-03-

[PATCH v2 08/11] Use OMP_ARRAY_SECTION instead of TREE_LIST in C++ FE

2022-03-18 Thread Julian Brown
er" definitions), and special-case handling TREE_LIST becomes necessary in more places, which starts to become unwieldy. 2022-02-18 Julian Brown gcc/c-family/ * c-omp.cc (c_omp_split_clauses): Support OMP_ARRAY_SECTION. gcc/cp/ * parser.cc (cp_parser_omp_var_list_no_open): U

[PATCH v2 09/11] OpenMP 5.0 "declare mapper" support for C++

2022-03-18 Thread Julian Brown
es resulting from instantiated mappers. This version of the patch improves detection of explicitly-mapped struct accesses which inhibit implicitly-triggered user-defined mappers for a target region. 2022-03-17 Julian Brown gcc/cp/ * cp-gimplify.cc (cxx_omp_finis

[PATCH v2 10/11] OpenMP: Use OMP_ARRAY_SECTION instead of TREE_LIST for array sections in C FE

2022-03-18 Thread Julian Brown
le careful here because OMP_CLAUSE_DEPEND and OMP_CLAUSE_AFFINITY also use TREE_LIST for their own purposes, and we're not changing those ones. No behavioural changes should be introduced by this patch. 2022-03-04 Julian Brown gcc/c/ * c-parser.cc (c_parser_omp_variable_list): Use OM

[PATCH v2 11/11] OpenMP: Support OpenMP 5.0 "declare mapper" directives for C

2022-03-18 Thread Julian Brown
n the above differences. (Fortran FE support is TBD.) 2022-03-17 Julian Brown gcc/c-family/ * c-common.h (omp_mapper_list, c_omp_find_nested_mappers, c_omp_instantiate_mappers): Add forward declarations/prototypes. * c-omp.cc (c_omp_find_nested_mappers): New function.

[PATCH 0/6] OpenMP 5.0: Fortran "declare mapper" support

2022-06-01 Thread Julian Brown
offloading to NVPTX. OK? (Pending rework of the patch series it depends on?) Thanks, Julian Julian Brown (6): Fortran: Typo/unicode-o fixes OpenMP: Templatize omp_mapper_list OpenMP: Rename strip_components_and_deref to omp_get_root_term OpenMP: Tweak NOP handling in in omp_get_roo

[PATCH 1/6] Fortran: Typo/unicode-o fixes

2022-06-01 Thread Julian Brown
This patch fixes a minor typo in dump output and a stray unicode character in a comment. This one probably counts as obvious. 2022-06-01 Julian Brown gcc/fortran/ * dump-parse-tree.cc (show_attr): Fix OMP-UDR-ARTIFICIAL-VAR typo. * trans-openmp.cc (gfc_trans_omp_array_section

[PATCH 2/6] OpenMP: Templatize omp_mapper_list

2022-06-01 Thread Julian Brown
ed by this patch. OK? Julian 2022-06-01 Julian Brown gcc/c-family/ * c-common.h (omp_mapper_list): Add T type parameter. (c_omp_find_nested_mappers): Update prototype. * c-omp.cc (c_omp_find_nested_mappers): Use omp_mapper_list. gcc/c/ *

[PATCH 3/6] OpenMP: Rename strip_components_and_deref to omp_get_root_term

2022-06-01 Thread Julian Brown
This patch renames the strip_components_and_deref function to better describe what it does. I'll fold this into the originating patch series during rework. 2022-06-01 Julian Brown gcc/ * gimplify.cc (strip_components_and_deref): Rename to... (omp_get_root_term): This. ---

[PATCH 4/6] OpenMP: Tweak NOP handling in in omp_get_root_term and accumulate_sibling_list

2022-06-01 Thread Julian Brown
This patch strips NOPs in omp_get_root_term and accumulate_sibling_list to cover cases that came up writing tests for "omp declare mapper" functionality. I'll fold this into the originating patch series for those functions during rework. 2022-06-01 Julian Brown gcc/

[PATCH 5/6] OpenMP: Pointers and member mappings

2022-06-01 Thread Julian Brown
MAP_ALWAYS_POINTER tvar%arrptr%data (bias 3, etc.) OK? Thanks, Julian 2022-06-01 Julian Brown gcc/fortran/ * trans-openmp.cc (dependency.h): Include. (gfc_trans_omp_array_section): Do not map descriptors here for OpenMP. (gfc_trans_omp_clauses): Check subcomponent a

[PATCH 6/6] OpenMP: Fortran "!$omp declare mapper" support

2022-06-01 Thread Julian Brown
) ...before the mapping nodes go off to gimplify for processing. (This relates to the previous patch in the series.) We also need to handle module writing and reading for "declare mappers". This requires an ABI bump that I noticed one of Tobias's patches also does, so we&#

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

2022-06-08 Thread Julian Brown
Hi Jakub, Thanks for review! On Tue, 24 May 2022 15:03:07 +0200 Jakub Jelinek via Fortran wrote: > On Fri, Mar 18, 2022 at 09:24:51AM -0700, Julian Brown wrote: > > 2021-11-23 Julian Brown > > > > gcc/ > > * gimplify.c (is_or_contains_p, > > om

[PATCH v3 00/11] OpenMP 5.0: Struct & mapping clause expansion rework

2022-09-13 Thread Julian Brown
the "trivial" ones) and regression tested with offloading to NVPTX (up to "OpenMP/OpenACC: Rework clause expansion and nested struct handling"). Further commentary on individual patches. Julian Brown (11): OpenMP 5.0: Clause ordering for OpenMP 5.0 (topol

[PATCH v3 02/11] Remove omp_target_reorder_clauses

2022-09-13 Thread Julian Brown
This patch has been split out from the previous one to avoid a confusingly-interleaved diff. The two patches will be committed squashed together. 2022-09-13 Julian Brown gcc/ * gimplify.c (omp_target_reorder_clauses): Delete. --- gcc/gimplify.cc | 205

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

2022-09-13 Thread Julian Brown
at patch demonstrating a new approach to clause gimplification is included at the end of this series. 2022-09-13 Julian Brown gcc/ * gimplify.c (is_or_contains_p, omp_target_reorder_clauses): Delete functions. (omp_tsort_mark): Add enum. (omp_mapping_group

[PATCH v3 04/11] OpenMP/OpenACC: mapping group list-handling improvements

2022-09-13 Thread Julian Brown
check if a different clause on the same directive maps the whole of a struct that we have a component mapping for (for example) has been outlined, removing a bit of code duplication. (These changes could be split into different patches if necessary.) 2022-09-13 Julian Brown gcc/ * g

[PATCH v3 03/11] OpenMP/OpenACC struct sibling list gimplification extension and rework

2022-09-13 Thread Julian Brown
version was approved already, pending those changes.) 2022-09-13 Julian Brown gcc/fortran/ * trans-openmp.cc (gfc_trans_omp_clauses): Don't create GOMP_MAP_TO_PSET mappings for class metadata, nor GOMP_MAP_POINTER mappings for POINTER_TYPE_P decls. gcc/ * gimpl

[PATCH v3 05/11] OpenMP: push attaches to end of clause list in "target" regions

2022-09-13 Thread Julian Brown
gical case that can otherwise happen with struct sibling-list handling. 2022-09-13 Julian Brown gcc/ * gimplify.cc (omp_segregate_mapping_groups): Update comment. (omp_push_attaches_to_end): New function. (gimplify_scan_omp_clauses): Use omp_push_attaches_to_end for

[PATCH v3 06/11] OpenMP: Pointers and member mappings

2022-09-13 Thread Julian Brown
(to: tvar%arrptr) --> GOMP_MAP_ALLOC tvar%arrptr (the descriptor) map(tofrom: tvar%arrptr(3:8) --> GOMP_MAP_TOFROM tvar%arrptr%data(3) (size 8-3+1, etc.) GOMP_MAP_ALWAYS_POINTER tvar%arrptr%data (bias 3, etc.) 2022-09-13 Julian Brown gcc/fortran/ * trans-openmp.cc

[PATCH v3 09/11] FYI/unfinished: OpenMP: lvalue parsing for map clauses (C++)

2022-09-13 Thread Julian Brown
This patch changes parsing for OpenMP map clauses in C++ to use the generic expression parser, hence adds support for parsing general lvalues (as required by OpenMP 5.0+). This patch hasn't been fully revised following previous review comments yet, but I'm including it in support of the following

[PATCH v3 07/11] OpenMP/OpenACC: Reindent TO/FROM/_CACHE_ stanza in {c_}finish_omp_clause

2022-09-13 Thread Julian Brown
This patch trivially adds braces and reindents the OMP_CLAUSE_TO/OMP_CLAUSE_FROM/OMP_CLAUSE__CACHE_ stanza in c_finish_omp_clause and finish_omp_clause, in preparation for the following patch (to clarify the diff a little). 2022-09-13 Julian Brown gcc/c/ * c-typeck.cc

[PATCH v3 11/11] FYI/unfinished: OpenMP 5.0 "declare mapper" support for C++

2022-09-13 Thread Julian Brown
This patch implements OpenMP 5.0 "declare mapper" support for C++. This hasn't been fully revised yet following previous review comments, but I am including it in this series to demonstrate the new approach to gimplifying map clauses after "declare mapper" instantiation. The "gimplify_scan_omp_cla

[PATCH v3 10/11] Use OMP_ARRAY_SECTION instead of TREE_LIST in C++ FE

2022-09-13 Thread Julian Brown
er" definitions), and special-case handling TREE_LIST becomes necessary in more places, which starts to become unwieldy. Including this patch to support the surrounding unfinished/FYI patches. 2022-02-18 Julian Brown gcc/c-family/ * c-omp.cc (c_omp_split_clauses): Support OMP_AR

Re: [PATCH v3 08/11] OpenMP/OpenACC: Rework clause expansion and nested struct handling

2022-09-14 Thread Julian Brown
On Wed, 14 Sep 2022 15:24:12 +0200 Jakub Jelinek via Fortran wrote: > On Tue, Sep 13, 2022 at 02:03:18PM -0700, Julian Brown wrote: > > +class c_omp_address_inspector > > +{ > > + location_t loc; > > + tree root_term; > > + bool indirections; > > +

Re: [PATCH v3 11/11] FYI/unfinished: OpenMP 5.0 "declare mapper" support for C++

2022-09-14 Thread Julian Brown
On Wed, 14 Sep 2022 16:58:28 +0200 Jakub Jelinek wrote: > On Tue, Sep 13, 2022 at 02:04:30PM -0700, Julian Brown wrote: > > This patch implements OpenMP 5.0 "declare mapper" support for C++. > > This hasn't been fully revised yet following previous review > >

Re: [PATCH v3 05/11] OpenMP: push attaches to end of clause list in "target" regions

2022-09-18 Thread Julian Brown
On Wed, 14 Sep 2022 14:44:54 +0200 Jakub Jelinek wrote: > On Tue, Sep 13, 2022 at 02:03:15PM -0700, Julian Brown wrote: > > This patch moves GOMP_MAP_ATTACH{_ZERO_LENGTH_ARRAY_SECTION} nodes > > to the end of the clause list, for offload regions. This ensures > > that

Re: [PATCH v3 06/11] OpenMP: Pointers and member mappings

2022-09-18 Thread Julian Brown
On Wed, 14 Sep 2022 14:53:54 +0200 Jakub Jelinek wrote: > On Tue, Sep 13, 2022 at 02:03:16PM -0700, Julian Brown wrote: > > @@ -3440,6 +3437,50 @@ gfc_trans_omp_clauses (stmtblock_t *block, > > gfc_omp_clauses *clauses, { > > if (pointer || (o

Re: [PATCH v3 06/11] OpenMP: Pointers and member mappings

2022-09-23 Thread Julian Brown
xt to it) and you simply new the > hash_map when needed the first time and delete it at the end (which > does nothing if it is NULL). How about this version? (Re-tested.) Thanks, Julian >From 76ec4e82c3d7918f670d2048ad625c98b3f23921 Mon Sep 17 00:00:00 2001 From: Julian Brown Date: Tu

Re: [PATCH] OpenACC: whole struct vs. component mappings (PR107028)

2022-09-29 Thread Julian Brown
On Wed, 28 Sep 2022 17:17:30 +0200 Tobias Burnus wrote: > On 28.09.22 15:20, Julian Brown wrote: > > This patch fixes an ICE when both a complete struct variable and > components of that struct are mapped on the same directive for > OpenACC, using a modified version of the

Re: [PATCH v3 06/11] OpenMP: Pointers and member mappings

2022-09-30 Thread Julian Brown
On Fri, 23 Sep 2022 14:10:51 +0200 Tobias Burnus wrote: > Hi Julian and Jakub, hi all, > > On 23.09.22 09:29, Julian Brown wrote: > > How about this version? (Re-tested.) > > Some more generic (pre)remarks – not affecting the patch code, > but possibly the commit

[PATCH v4 0/4] Fortran pointers and unordered structs

2022-10-09 Thread Julian Brown
nd, GOMP_MAP_STRUCT_UNORD. Tested with offloading to NVPTX. OK? Julian Brown (4): OpenMP: Pointers and member mappings OpenMP/OpenACC: Reindent TO/FROM/_CACHE_ stanza in {c_}finish_omp_clause OpenMP/OpenACC: Rework clause expansion and nested struct handling OpenMP/OpenACC: Unordered/non-

[PATCH v4 1/4] OpenMP: Pointers and member mappings

2022-10-09 Thread Julian Brown
es equal if they can be proven the same, i.e. if they use the same index variable. Together with the "unordered struct" patch at the end of this series, that allows certain types of mapping to work that don't at present. 2022-10-09 Julian Brown gcc/fortran/

[PATCH v4 2/4] OpenMP/OpenACC: Reindent TO/FROM/_CACHE_ stanza in {c_}finish_omp_clause

2022-10-09 Thread Julian Brown
This patch trivially adds braces and reindents the OMP_CLAUSE_TO/OMP_CLAUSE_FROM/OMP_CLAUSE__CACHE_ stanza in c_finish_omp_clause and finish_omp_clause, in preparation for the following patch (to clarify the diff a little). 2022-09-13 Julian Brown gcc/c/ * c-typeck.cc

[PATCH v4 4/4] OpenMP/OpenACC: Unordered/non-constant component offset struct mapping

2022-10-09 Thread Julian Brown
he list is sorted in libgomp according to the dynamic values of the offsets after the newly-introduced GOMP_MAP_STRUCT_UNORD node. This mostly affects arrays of structs indexed by variables in C and C++, but can also affect derived-type arrays with constant indexes when they have an array descriptor.

[PATCH] [og12] amdgcn: Use FLAT addressing for all functions with pointer arguments

2022-10-14 Thread Julian Brown
now or in the future that this patch may be needed for. Tested with offloading to AMD GCN. I will apply shortly (to og12). 2022-10-14 Julian Brown gcc/ * config/gcn/gcn.cc (gcn_detect_incoming_pointer_arg): Any pointer argument forces FLAT addressing mode, not just poin

[PATCH] [og12] OpenACC: Don't gang-privatize artificial variables

2022-10-14 Thread Julian Brown
output patterns adjusted to compensate. Tested with offloading to AMD GCN. I will apply shortly (to og12). 2022-10-14 Julian Brown gcc/ * omp-low.cc (oacc_privatization_candidate_p): Artificial vars are not privatization candidates. libgomp/ * testsuite/libgomp.o

[PATCH v5 0/4] OpenMP/OpenACC: Fortran array descriptor mappings

2022-10-18 Thread Julian Brown
s) are not being used for multiple mappings -- for cases where we can't determine if the elements are the same or not at compile time. Retested with offloading to NVPTX. OK? Julian Brown (4): OpenMP/OpenACC: Reindent TO/FROM/_CACHE_ stanza in {c_}finish_omp_clause OpenMP/OpenACC: Rework c

[PATCH v5 1/4] OpenMP/OpenACC: Reindent TO/FROM/_CACHE_ stanza in {c_}finish_omp_clause

2022-10-18 Thread Julian Brown
This patch trivially adds braces and reindents the OMP_CLAUSE_TO/OMP_CLAUSE_FROM/OMP_CLAUSE__CACHE_ stanza in c_finish_omp_clause and finish_omp_clause, in preparation for the following patch (to clarify the diff a little). 2022-09-13 Julian Brown gcc/c/ * c-typeck.cc

[PATCH v5 4/4] OpenMP/OpenACC: Unordered/non-constant component offset runtime diagnostic

2022-10-18 Thread Julian Brown
. For now, multiple *constant* array indices are still supported (see map-arrayofstruct-1.c). That could perhaps be addressed with a follow-up patch, if necessary. 2022-10-18 Julian Brown gcc/ * gimplify.cc (extract_base_bit_offset): Add VARIABLE_OFFSET parameter. (omp_

[PATCH v5 3/4] OpenMP: Pointers and member mappings

2022-10-18 Thread Julian Brown
i)%arrptr%data Always moving "[implicit]" full-array mappings after array-section mappings (without that bit set) means that we'll avoid copying the whole array unnecessarily -- even in cases where we can't prove that the array accesses are the same. Additionally, the next patch

Re: [PATCH v5 2/4] OpenMP/OpenACC: Rework clause expansion and nested struct handling

2022-10-18 Thread Julian Brown
On Tue, 18 Oct 2022 03:39:03 -0700 Julian Brown wrote: > This patch is an extension and rewrite/rethink of the following two > patches: (This one is already approved, apart from minor fixes, rebasing and testsuite tweaks, so I don't think it needs re-review, but I'm holding o

Re: [PATCH] [og12] OpenACC: Don't gang-privatize artificial variables

2022-10-18 Thread Julian Brown
On Tue, 18 Oct 2022 16:46:07 +0200 Thomas Schwinge wrote: > Hi Julian! > > On 2022-10-14T13:38:56+0000, Julian Brown > wrote: > ..., but to my surprised, that did fire in one occasion: > > > --- a/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90 >

[PATCH] OpenMP: Duplicate checking for map clauses in Fortran (PR107214)

2022-10-20 Thread Julian Brown
ap(n) shared(n)"). Tested with offloading to NVPTX. OK? 2022-10-20 Julian Brown gcc/fortran/ PR fortran/107214 * gfortran.h (gfc_symbol): Add data_mark, dev_mark, gen_mark and reduc_mark bitfields. * openmp.cc (resolve_omp_clauses): Use above bitfields t

Re: [PATCH v2 06/11] OpenMP: lvalue parsing for map clauses (C++)

2022-11-01 Thread Julian Brown
Hi, On Tue, 24 May 2022 16:15:31 +0200 Jakub Jelinek via Fortran wrote: > On Fri, Mar 18, 2022 at 09:26:47AM -0700, Julian Brown wrote: > > --- a/gcc/cp/parser.cc > > +++ b/gcc/cp/parser.cc > > @@ -4266,6 +4266,9 @@ cp_parser_new (cp_lexer *lexer) > >pars

[PATCH 2/2] OpenMP: Use OMP_ARRAY_SECTION instead of TREE_LIST in C++ FE

2022-11-01 Thread Julian Brown
er" definitions), and special-case handling TREE_LIST becomes necessary in more places, which starts to become unwieldy. This patch has been rebased, but is largely unchanged from the last version posted. Tested alongside previous patch with offloading to NVPTX. OK? Thanks, Julian 2022-11-01

Re: [PATCH v2 06/11] OpenMP: lvalue parsing for map clauses (C++)

2022-11-02 Thread Julian Brown
On Wed, 2 Nov 2022 12:58:37 +0100 Jakub Jelinek via Fortran wrote: > On Tue, Nov 01, 2022 at 09:50:38PM +0000, Julian Brown wrote: > > > I think we should figure out when we should temporarily disable > > > parser->omp_array_section_p = false; > > > and resto

[PATCH 0/2] C++ "declare mapper" support and map clause expansion fixes

2022-11-30 Thread Julian Brown
offloading to NVPTX, and bootstrapped. Julian Brown (~2): OpenMP/OpenACC: Refine condition for when map clause expansion happens [...] OpenMP: C++ "declare mapper" support -- 2.29.2

[PATCH 1/7] OpenMP/OpenACC: Refine condition for when map clause expansion happens

2022-11-30 Thread Julian Brown
er patch named above.) 2022-11-30 Julian Brown gcc/ * c-family/c-common.h (c_omp_region_type): Add C_ORT_ACC_TARGET. (c_omp_address_inspector): Pass c_omp_region_type instead of "target" bool. * c-family/c-omp.cc (c_omp_address_inspector::expand_arra

[PATCH 2/2] OpenMP: C++ "declare mapper" support

2022-11-30 Thread Julian Brown
nt offset runtime diagnostic" https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603793.html [unreviewed also -- "QoI" improvement to above] "OpenMP: lvalue parsing for map/to/from clauses (C++)" https://gcc.gnu.org/pipermail/gcc-patches/2022-November/605367.htm

Re: [PATCH v5 2/4] OpenMP/OpenACC: Rework clause expansion and nested struct handling

2022-12-07 Thread Julian Brown
On Wed, 7 Dec 2022 15:54:42 +0100 Tobias Burnus wrote: > Hi Julian, > > If I understand Deepak's comment (on OpenMP.org's omp-lang list, sorry > it is a nonpublic list) correctly, the following wording implies that > a 'from: s.w[z:4]' for a pointer 's.w' also implies a mapping of > 's.w' - if '

[PATCH 1/2] OpenMP/Fortran: Combined directives with map/firstprivate of same symbol

2022-12-07 Thread Julian Brown
sted patches (in review or approved but waiting for other patches), i.e.: OpenMP/OpenACC: Rework clause expansion and nested struct handling OpenMP/OpenACC: Refine condition for when map clause expansion happens OpenMP: Pointers and member mappings and the patch following. OK? 2022-12-0

[PATCH 2/2] OpenMP: Duplicate checking for map clauses in Fortran (PR107214)

2022-12-07 Thread Julian Brown
> Hi Julian, > > I had a first quick lock at this patch, I should have a closer look > later. However, I stumbled over the following: > > On 20.10.22 18:14, Julian Brown wrote: > > typedef struct gfc_symbol > > { > > ... > >struct gfc_symbol *old_sym

Re: [PATCH 2/2] OpenMP: Duplicate checking for map clauses in Fortran (PR107214)

2022-12-10 Thread Julian Brown
show an error in all four cases - but > only once. I believe this patch covers all the above cases (hopefully appropriately generalised), at least for Fortran. I haven't attempted to fix any missing cases for C, for now. Re-tested with offloading to NVPTX (with a few supporting patches, as before). Does this look O

Re: [PATCH v5 2/4] OpenMP/OpenACC: Rework clause expansion and nested struct handling

2022-12-12 Thread Julian Brown
2-November/607543.html though it might actually make more sense to commit the three patches squashed together. Tested with offloading to NVPTX. OK? Thanks, Julian commit abb1e04f9ef93221ecd4292f43cc1ea901843766 Author: Julian Brown Date: Thu Dec 8 13:31:01 2022 + OpenMP: implicitly map

Re: [PATCH v5 3/4] OpenMP: Pointers and member mappings

2022-12-15 Thread Julian Brown
ives I found when adding a new test (map-subarray-8.f90). (I'm not sure if this patch fixes all the problems you saw previously with "alloc", etc. for enter/exit data -- there might still be work to do there.) Re-tested with offloading to NVPTX. Does this look OK now? Th

Re: [PATCH v5 3/4] OpenMP: Pointers and member mappings

2022-12-15 Thread Julian Brown
On Thu, 15 Dec 2022 14:54:58 + Julian Brown wrote: > On Wed, 7 Dec 2022 17:31:20 +0100 > Tobias Burnus wrote: > > > Hi Julian, > > > > I think this patch is OK; however, at least for gimplify.cc Jakub > > needs to have a second look. > > Thank

Re: [PATCH 1/6] Fortran: Typo/unicode-o fixes

2022-12-23 Thread Julian Brown
On Wed, 1 Jun 2022 11:39:19 -0700 Julian Brown wrote: > This patch fixes a minor typo in dump output and a stray unicode > character in a comment. > > This one probably counts as obvious. FYI, I committed this one now. Julian

[PATCH v6 00/11] OpenMP: C/C++ lvalue parsing, C/C++/Fortran "declare mapper" support

2022-12-23 Thread Julian Brown
tioned in that email. (Several of the earlier patches are approved already, but dependent or semi-dependent on other patches that haven't been yet.) The last three patches have been retested (each, cumulatively) with offloading to NVPTX. OK? Thanks, Julian Julian Brown (11): OpenMP/

[PATCH v6 01/11] OpenMP/OpenACC: Reindent TO/FROM/_CACHE_ stanza in {c_}finish_omp_clause

2022-12-23 Thread Julian Brown
This patch trivially adds braces and reindents the OMP_CLAUSE_TO/OMP_CLAUSE_FROM/OMP_CLAUSE__CACHE_ stanza in c_finish_omp_clause and finish_omp_clause, in preparation for the following patch (to clarify the diff a little). 2022-09-13 Julian Brown gcc/c/ * c-typeck.cc

[PATCH v6 04/11] OpenMP: implicitly map base pointer for array-section pointer components

2022-12-23 Thread Julian Brown
ot;. To get a pointer attachment with "enter data", you can do, e.g: #pragma omp target enter data map(s.ptr, s.ptr[0:10]) #pragma omp target { ...implicit use of 's'... } That is, once the attachment has happened, implicit mapping of 's&#

[PATCH v6 05/11] OpenMP: Pointers and member mappings

2022-12-23 Thread Julian Brown
P_MAP_TO_PSET dv%arr <-- deleted (array section mapping) GOMP_MAP_ATTACH_DETACH dv%arr%data For struct components, the GOMP_MAP_TO_PSET mapping is turned into GOMP_MAP_RELEASE at gimplify time for "exit data" directives. 2022-12-15 Julian Brown gcc/fortran/ * dep

[PATCH v6 06/11] OpenMP/OpenACC: Unordered/non-constant component offset runtime diagnostic

2022-12-23 Thread Julian Brown
. For now, multiple *constant* array indices are still supported (see map-arrayofstruct-1.c). That could perhaps be addressed with a follow-up patch, if necessary. 2022-10-18 Julian Brown gcc/ * gimplify.cc (extract_base_bit_offset): Add VARIABLE_OFFSET parameter. (omp_

[PATCH v6 08/11] OpenMP: C++ "declare mapper" support

2022-12-23 Thread Julian Brown
#x27;t been attempted yet. (I think that means Jakub's concerns about blow-up of element mappings won't be a problem until that's done.) New tests added in {gcc,libgomp}/c-c++-common have been restricted to C++ for now. 2022-11-30 Julian Brown gcc/c-family/ *

[PATCH v6 11/11] OpenMP: Fortran "!$omp declare mapper" support

2022-12-23 Thread Julian Brown
on of the patch is rebased wrt. current-ish mainline and refactorings that are now done higher up this patch series. 2022-12-23 Julian Brown gcc/fortran/ * dump-parse-tree.cc (show_attr): Show omp_udm_artificial_var flag. (show_omp_namelist): Support OMP_MAP_

[PATCH v6 03/11] OpenMP/OpenACC: Refine condition for when map clause expansion happens

2022-12-23 Thread Julian Brown
er patch named above.) 2022-11-30 Julian Brown gcc/ * c-family/c-common.h (c_omp_region_type): Add C_ORT_ACC_TARGET. (c_omp_address_inspector): Pass c_omp_region_type instead of "target" bool. * c-family/c-omp.cc (c_omp_address_inspector::expand_arra

[PATCH v6 10/11] OpenMP: Support OpenMP 5.0 "declare mapper" directives for C

2022-12-23 Thread Julian Brown
refactoring done higher up this patch series. 2022-12-23 Julian Brown gcc/c/ * c-decl.cc (c_omp_mapper_id, c_omp_mapper_decl, c_omp_mapper_lookup, c_omp_extract_mapper_directive, c_omp_map_array_section, c_omp_scan_mapper_bindings_r, c_omp_scan_mapper_bindings): New

[PATCH v6 09/11] OpenMP: lvalue parsing for map clauses (C)

2022-12-23 Thread Julian Brown
tree code to represent OpenMP array sections, and rejects array sections in certain expressions where they make no sense (see new tests). 2022-12-22 Julian Brown gcc/c/ * c-pretty-print.cc (c_pretty_printer::postfix_expression, c_pretty_printer::expression): Add OMP_ARRA

[PATCH] OpenMP: Noncontiguous "target update" for Fortran

2023-04-27 Thread Julian Brown
arget_memcpy_rect_worker. The method for doing this is described in comments in the patch body. Tested with offloading to nvptx. OK? 2023-04-27 Julian Brown gcc/fortran/ * openmp.cc (resolve_omp_clauses): Don't forbid "target update" with non-unit stride.

[PATCH] OpenACC: Stand-alone attach/detach clause fixes for Fortran [PR109622]

2023-04-27 Thread Julian Brown
cases that "happened to work" previously where the user attaches/detaches a pointer to array using a descriptor, and (I think!) the "_data" field has offset zero, hence the same address as the descriptor as a whole. Tested with offloading to nvptx. OK? Thanks, Julian 2023

[PATCH] OpenACC: Further attach/detach clause fixes for Fortran [PR109622]

2023-04-29 Thread Julian Brown
-pointer attaches, and a case where a pointer was incorrectly dereferenced. Tests are also adjusted for vector-length warnings on nvidia accelerators. Tested with offloading to nvptx. OK? 2023-04-29 Julian Brown PR fortran/109622 gcc/fortran/ * trans-openmp.cc

Re: [PATCH] OpenACC: Further attach/detach clause fixes for Fortran [PR109622]

2023-05-03 Thread Julian Brown
On Tue, 2 May 2023 12:29:22 +0200 Tobias Burnus wrote: > On 29.04.23 12:57, Julian Brown wrote: > > This patch moves several tests introduced by the following patch: > > > >https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616939.html > > > > I believe

[PATCH 00/14] [og13] OpenMP/OpenACC: map clause and OMP gimplify rework

2023-06-19 Thread Julian Brown
l apply shortly. Thanks, Julian Julian Brown (14): Revert "Assumed-size arrays with non-lexical data mappings" Revert "Fix references declared in lexically-enclosing OpenACC data region" Revert "Fix implicit mapping for array slices on lexically-enclosing dat

[PATCH 01/14] Revert "Assumed-size arrays with non-lexical data mappings"

2023-06-19 Thread Julian Brown
This reverts commit 72733f6e6f6ec1bb9884fea8bfbebd3de03d9374. 2023-06-16 Julian Brown gcc/ Revert: * gimplify.cc (gimplify_adjust_omp_clauses_1): Raise error for assumed-size arrays in map clauses for Fortran/OpenMP. * omp-low.cc (lower_omp_target): Set the

[PATCH 03/14] Revert "Fix implicit mapping for array slices on lexically-enclosing data constructs (PR70828)"

2023-06-19 Thread Julian Brown
This reverts commit a84b89b8f070f1efe86ea347e98d57e6bc32ae2d. Relevant tests are temporarily disabled or XFAILed. 2023-06-16 Julian Brown gcc/ Revert: * gimplify.cc (oacc_array_mapping_info): New struct. (gimplify_omp_ctx): Add decl_data_clause hash map

[PATCH 05/14] OpenMP/OpenACC: Reindent TO/FROM/_CACHE_ stanza in {c_}finish_omp_clause

2023-06-19 Thread Julian Brown
This patch trivially adds braces and reindents the OMP_CLAUSE_TO/OMP_CLAUSE_FROM/OMP_CLAUSE__CACHE_ stanza in c_finish_omp_clause and finish_omp_clause, in preparation for the following patch (to clarify the diff a little). 2022-09-13 Julian Brown gcc/c/ * c-typeck.cc

[PATCH 02/14] Revert "Fix references declared in lexically-enclosing OpenACC data region"

2023-06-19 Thread Julian Brown
This reverts commit c9cd2bac6a5127a01c6f47e5636a926ac39b5e21. 2023-06-16 Julian Brown gcc/fortran/ Revert: * trans-openmp.cc (gfc_omp_finish_clause): Guard addition of clauses for pointers with DECL_P. gcc/ Revert: * gimplify.cc

[PATCH 04/14] Revert "openmp: Handle C/C++ array reference base-pointers in array sections"

2023-06-19 Thread Julian Brown
This reverts commit 3385743fd2fa15a2a750a29daf6d4f97f5aad0ae. 2023-06-16 Julian Brown Revert: 2022-02-24 Chung-Lin Tang gcc/c/ChangeLog: * c-typeck.cc (handle_omp_array_sections): Add handling for creating array-reference base-pointer attachment clause. gcc/cp

[PATCH 08/14] OpenMP: Pointers and member mappings

2023-06-19 Thread Julian Brown
T dv%arr <-- deleted (array section mapping) GOMP_MAP_ATTACH_DETACH dv%arr%data To accommodate for recent changes to mapping nodes made by Tobias, this version of the patch avoids using GOMP_MAP_TO_PSET for "exit data" directives, in favour of using the "correct" GO

[PATCH 07/14] OpenMP: implicitly map base pointer for array-section pointer components

2023-06-19 Thread Julian Brown
ot;. To get a pointer attachment with "enter data", you can do, e.g: #pragma omp target enter data map(s.ptr, s.ptr[0:10]) #pragma omp target { ...implicit use of 's'... } That is, once the attachment has happened, implicit mapping of 's&#

[PATCH 09/14] OpenMP/OpenACC: Unordered/non-constant component offset runtime diagnostic

2023-06-19 Thread Julian Brown
. For now, multiple *constant* array indices are still supported (see map-arrayofstruct-1.c). That could perhaps be addressed with a follow-up patch, if necessary. This version of the patch renumbers the GOMP_MAP_STRUCT_UNORD kind to avoid clashing with the OpenACC "non-contiguous" dynamic

[PATCH 11/14] OpenACC: Reimplement "inheritance" for lexically-nested offload regions

2023-06-19 Thread Julian Brown
pointer mapping nodes on equivalent "omp data" regions are not needed, so remain suppressed during expansion. 2023-06-16 Julian Brown gcc/c-family/ * c-omp.cc (c_omp_address_inspector::expand_array_base): Don't omit pointer nodes for OpenACC. gcc/ * gimplify.c

[PATCH 13/14] OpenACC: Allow implicit uses of assumed-size arrays in offload regions

2023-06-19 Thread Julian Brown
"acc enter data"). This relates to upstream OpenACC issue 489 (not yet resolved). 2023-06-16 Julian Brown gcc/fortran/ * trans-openmp.cc (gfc_omp_finish_clause): Treat implicitly-mapped assumed-size arrays as zero-sized for OpenACC, rather than an e

[PATCH 10/14] OpenMP/OpenACC: Reorganise OMP map clause handling in gimplify.cc

2023-06-19 Thread Julian Brown
eimplements the "present" clause sorting code to avoid another sorting pass on mapping nodes. 2023-06-16 Julian Brown gcc/ * gimplify.cc (omp_segregate_mapping_groups): Handle "present" groups. (gimplify_scan_omp_clauses): Use mapping group functionality to

  1   2   >