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

2022-12-15 Thread Julian Brown
eviously 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? Thanks, Julian commit 377dba3ca7dc6fdf86bdb82936e80100ef2dbf4f Author: Julian Brown Date: Mon Oct 17 16:44:31 2022 + Op

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

2022-12-12 Thread Julian Brown
lly 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 base pointer for array-section pointer compon

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

2022-12-10 Thread Julian Brown
ll 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 OK now? Thanks, Julian commit c5e0cb20a07fcce4822dba2731b7af7b372b3376 Author: Julian Bro

[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

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

2022-12-07 Thread Julian Brown
iew 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-06 Julian Brown g

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/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
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.html [reviewed, but needs a little r

[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

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

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] 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] [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 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 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 3/4] OpenMP: Pointers and member mappings

2022-10-18 Thread Julian Brown
rptr%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 in the series

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

2022-10-18 Thread Julian Brown
of structs) 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 clause

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

2022-10-14 Thread Julian Brown
ut 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.oacc-f

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

2022-10-14 Thread Julian Brown
space 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 v4 4/4] OpenMP/OpenACC: Unordered/non-constant component offset struct mapping

2022-10-09 Thread Julian Brown
: the 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 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 1/4] OpenMP: Pointers and member mappings

2022-10-09 Thread Julian Brown
y 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/ * dependency.cc

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

2022-10-09 Thread Julian Brown
OMP_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-const

[PATCH] OpenACC: Fix struct-component-kind-1.c test

2022-10-01 Thread Julian Brown
-patches/2022-September/602504.html Re-tested with offloading to NVPTX. OK? Thanks, Julian 2022-10-01 Julian Brown gcc/ * gimplify.cc (omp_group_base): Fix IF_PRESENT (no_create) handling. --- gcc/gimplify.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

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 possibl

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

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

2022-09-28 Thread Julian Brown
function has been added to make sure that the mapping kinds of the whole struct and the member access are compatible -- conservatively, so as not to copy more to/from the device than the user expects. Tested with offloading to NVPTX. OK? Thanks, Julian 2022-09-28 Julian Brown gcc/ PR

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

2022-09-23 Thread Julian Brown
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: Tue, 31 May

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 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

[PATCH] Fix c-c++-common/gomp/target-50.c test

2022-09-15 Thread Julian Brown
The expected scan dump output for this test will change after the following patch is committed: https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601558.html But for now, this patch reverts to the old expected pattern so the test passes. I will apply as obvious. 2022-09-15 Julian

[PATCH] Fix c-c++-common/goacc/mdc-2.c and g++.dg/goacc/mdc.C tests

2022-09-15 Thread Julian Brown
These testsuite hunks got left attached to the wrong patch in the series I just posted. I will apply as obvious. 2022-09-15 Julian Brown gcc/testsuite/ * c-c++-common/goacc/mdc-2.c: Update expected errors. * g++.dg/goacc/mdc.C: Likewise. --- gcc/testsuite/c-c++-common/goacc

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 > &g

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; > > +

[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

[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

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

2022-09-13 Thread Julian Brown
r) --> 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 (dependency.h):

[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 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 04/11] OpenMP/OpenACC: mapping group list-handling improvements

2022-09-13 Thread Julian Brown
e to 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/ * gimplify.c

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

2022-09-13 Thread Julian Brown
h 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): Add str

[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 00/11] OpenMP 5.0: Struct & mapping clause expansion rework

2022-09-13 Thread Julian Brown
xcept 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

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 6/6] OpenMP: Fortran "!$omp declare mapper" support

2022-06-01 Thread Julian Brown
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'll probably need to synchronize

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

2022-06-01 Thread Julian Brown
TER 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 and subarray/

[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/ * g

[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. --- gcc

[PATCH 2/6] OpenMP: Templatize omp_mapper_list

2022-06-01 Thread Julian Brown
introduced 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 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 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

Re: [PATCH, OpenMP, C/C++] Handle array reference base-pointers in array sections

2022-05-05 Thread Julian Brown
On Thu, 5 May 2022 14:40:38 +0200 Jakub Jelinek via Gcc-patches wrote: > On Thu, May 05, 2022 at 12:46:29PM +0100, Julian Brown wrote: > > All the above (at least) has been done as part of the patch series > > posted here: > > > > https://gcc.gnu.org/pipermail/gcc-pat

Re: [PATCH, OpenMP, C/C++] Handle array reference base-pointers in array sections

2022-05-05 Thread Julian Brown
On Thu, 5 May 2022 10:52:57 +0200 Jakub Jelinek via Gcc-patches wrote: > On Mon, Feb 21, 2022 at 11:18:57PM +0800, Chung-Lin Tang wrote: > > as encountered in cases where a program constructs its own > > deep-copying for arrays-of-pointers, e.g: > > > >#pragma omp target enter data

Re: Multiple types of load/store: how to create .md rules?

2022-05-04 Thread Julian Brown
On Mon, 02 May 2022 19:10:41 -0700 Andras Tantos wrote: > To a previous problem I've asked, Andrew Pinski replied that I should > merge all *movsi patterns into a single one to avoid (in that case) > strange deletions in the generated assembly. Is that possible here? It > appears to me that I

Re: GCN: Make "gang-private data-share memory exhausted" error more verbose (was: [PATCH] [og10] OpenACC: Shared memory layout optimisation)

2022-04-26 Thread Julian Brown
On Tue, 26 Apr 2022 13:12:23 +0200 Thomas Schwinge wrote: > > @@ -5240,14 +5286,14 @@ gcn_print_lds_decl (FILE *f, tree var) > >if (size > align && size > 4 && align < 8) > > align = 8; > > > > - machfun->lds_allocated = ((machfun->lds_allocated + align - > > 1) > > -

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

2022-03-18 Thread Julian Brown
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 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 OMP_ARR

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

2022-03-18 Thread Julian Brown
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_finish_mapper_clauses): N

[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 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 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 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

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

2022-03-18 Thread Julian Brown
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 class.

[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 GOMP

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

2022-03-18 Thread Julian Brown
ch 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 enum. (

[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 00/11] OpenMP 5.0: C & C++ "declare mapper" support (plus struct rework, etc.)

2022-03-18 Thread Julian Brown
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 sorting by ba

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

2022-02-18 Thread Julian Brown
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 2022-02-18 Julian B

[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

[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 5/8] OpenMP: lvalue parsing for map clauses (C++)

2022-02-18 Thread Julian Brown
tle 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/ * error.cc (dump_exp

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

2022-02-18 Thread Julian Brown
he 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_omp_ad

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

2022-02-18 Thread Julian Brown
ce. 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

[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 1/8] OpenMP 5.0: Clause ordering for OpenMP 5.0 (topological sorting by base pointer)

2022-02-18 Thread Julian Brown
ch 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_contains_p, omp_t

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

2022-02-18 Thread Julian Brown
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_clause

Re: [PATCH, OpenACC] Add support for gang local storage allocation in shared memory

2022-02-15 Thread Julian Brown
On Mon, 14 Feb 2022 16:56:35 +0100 Thomas Schwinge wrote: > Hi Julian! > > Two more questions here, in context of <https://gcc.gnu.org/PR102330> > "[12 Regression] ICE in expand_gimple_stmt_1, at cfgexpand.c:3932 > since r12-980-g29a2f51806c": > > On 2

[PATCH 15/16] OpenMP: lvalue parsing for map clauses (C++)

2021-11-25 Thread Julian Brown
-- and really only a handful of the rejected cases would be plausible in the context of an OpenMP "map" clause anyway, IMO. OK? Thanks, Julian 2021-11-24 Julian Brown gcc/c-family/ * c-omp.c (c_omp_decompose_attachable_address): Handle more types of expression

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

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

[PATCH 14/16] OpenMP: Add inspector class to unify mapped address analysis

2021-11-25 Thread Julian Brown
he C and C++ front-ends to use it. (The adjacent "c_omp_decompose_attachable_address" function could also be moved into the address inspector class, perhaps. That's not been done yet.) OK? Thanks, Julian 2021-11-15 Julian Brown gcc/c-family/ * c-common.h (c_omp_address_

[PATCH 13/16] Add debug_omp_expr

2021-11-25 Thread Julian Brown
sections to use the soon-to-be-introduced OMP_ARRAY_SECTION tree code throughout instead, at which point this patch will no longer be necessary. OK? Thanks, Julian 2021-11-15 Julian Brown gcc/ * tree-pretty-print.c (print_omp_expr, debug_omp_expr): New functions. * tree-pretty

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

2021-11-25 Thread Julian Brown
nce, or the automatically-dereferenced data itself?). An attach/detach operation is thus synthesised for the reference. OK? Thanks, Julian 2021-10-11 Julian Brown gcc/cp/ * semantics.c (finish_omp_clauses): Handle reference-typed members. gcc/ * gimplify.c (bu

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

2021-11-25 Thread Julian Brown
I noticed that the test in question now compiles properly, and in fact runs properly too. Thus it's more useful as a runtime test than a passing compilation test that otherwise doesn't do much. This patch moves it to libgomp. OK? Thanks, Julian 2021-10-11 Julian Brown gcc/testsuite

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

2021-11-25 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? Thanks, Julian 2021-09-29 Julian Brow

[PATCH 09/16] OpenMP: Allow array ref components for C & C++

2021-11-25 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? 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 08/16] OpenMP/OpenACC: Hoist struct sibling list handling in gimplification

2021-11-25 Thread Julian Brown
are now shared where appropriate, though OpenACC doesn't do the topological sorting of nodes (yet?). OK? Thanks, Julian 2021-09-29 Julian Brown gcc/ * gimplify.c (gimplify_omp_var_data): Remove GOVD_MAP_HAS_ATTACHMENTS. (extract_base_bit_offset): Remove OFF

[PATCH 07/16] Remove omp_target_reorder_clauses

2021-11-25 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 06/16] OpenMP 5.0: Clause ordering for OpenMP 5.0 (topological sorting by base pointer)

2021-11-25 Thread Julian Brown
rsion of the patch fixes a bug in omp_reorder_mapping_groups, relative to the last version posted. OK? Thanks, Julian 2021-11-23 Julian Brown gcc/ * gimplify.c (is_or_contains_p, omp_target_reorder_clauses): Delete functions. (omp_tsort_mark): Add enum. (

[PATCH 05/16] Remove base_ind/base_ref handling from extract_base_bit_offset

2021-11-25 Thread Julian Brown
parts further. (This one has already been approved, pending approval of the rest of the series: https://gcc.gnu.org/pipermail/gcc-patches/2021-October/581426.html) 2021-09-29 Julian Brown gcc/ * gimplify.c (extract_base_bit_offset): Remove BASE_IND, BASE_REF and OPENMP parameters

[PATCH 04/16] OpenACC: Rework indirect struct handling in gimplify.c

2021-11-25 Thread Julian Brown
enMP, where possible. (Those are dealt with by later patches in this series.) OK? Thanks, Julian 2021-06-02 Julian Brown gcc/fortran/ * trans-openmp.c (gfc_trans_omp_clauses): Don't create GOMP_MAP_TO_PSET mappings for class metadata, nor GOMP_MAP_POINTER mappings

[PATCH 03/16] OpenACC/OpenMP: Refactor struct lowering in gimplify.c

2021-11-25 Thread Julian Brown
e the code self-document better also. OK? Thanks, Julian 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_

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

2021-11-25 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 OK? Thanks, Julian 2021-06-03 Julian Brown gcc/ * gimplify.c (extract_base_bit_of

[PATCH 01/16] Rewrite GOMP_MAP_ATTACH_DETACH mappings unconditionally

2021-11-25 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) OK? Thanks, Julian 2021-06-02 Julian Brown gcc/ * gimplify.c (gimplify_scan_omp_clauses

[PATCH 00/16] OpenMP: lvalues in "map" clauses and struct handling rework

2021-11-25 Thread Julian Brown
d C++" https://gcc.gnu.org/pipermail/gcc-patches/2021-November/584445.html Tested with offloading to NVPTX and bootstrapped. Further commentary on individual patches. OK? Thanks, Julian Julian Brown (16): Rewrite GOMP_MAP_ATTACH_DETACH mappings unconditionally O

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

2021-11-15 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++. OK? Thanks, Julian 2021-11-15 Julian Brown gcc/c/ * c-parser.c (c_parser_postfix_expression_after_primary): Add support for Op

[PATCH 3/4] OpenMP: lvalue parsing for map clauses (C++)

2021-11-15 Thread Julian Brown
in the testsuite of course, and newly-added tests), and we attempt to reject unsupported expressions in order to avoid surprises for the user. The intention is to incrementally add support for further kinds of lvalues on top of this patch. OK? Thanks, Julian 2021-11-15 Julian Brown gcc/c-family

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

2021-11-15 Thread Julian Brown
C++ front-ends to use it. OK? Thanks, Julian 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_addr

[PATCH 1/4] Add debug_omp_expr

2021-11-15 Thread Julian Brown
sections to use the soon-to-be-introduced OMP_ARRAY_SECTION tree code throughout instead, at which point this patch will no longer be necessary. OK? Thanks, Julian 2021-11-15 Julian Brown gcc/ * tree-pretty-print.c (print_omp_expr, debug_omp_expr): New functions. * tree-pretty

<    1   2   3   4   5   6   7   8   9   >