[PATCH] OpenMP 5.1: WIP delimited (begin/end) 'declare variant' support

2024-01-11 Thread Julian Brown
so far make those problems worse! Restrictions listed in e.g. OpenMP 5.2, "7.5.5 begin declare variant Directive", are not yet checked against. It would be nice if the "overload"-type declare variant functions worked smoothly alongside the existing function multiversion supp

Re: [PATCH 1/8] OpenMP: lvalue parsing for map/to/from clauses (C++)

2024-01-10 Thread Julian Brown
On Wed, 10 Jan 2024 10:14:41 +0100 Jakub Jelinek wrote: > On Fri, Jan 05, 2024 at 12:23:26PM +0000, Julian Brown wrote: > > * g++.dg/gomp/bad-array-section-10.C: New test. > > This test FAILs in C++23/C++26 modes, just try > make check-g++ GXX_TESTSUITE_STDS=98

[PATCH] OpenMP: Fix g++.dg/gomp/bad-array-section-10.C for C++23 and up

2024-01-10 Thread Julian Brown
This patch adjusts diagnostic output for C++23 and above for the test case mentioned in the commit title. I will apply shortly as obvious. 2024-01-10 Julian Brown gcc/testsuite/ * g++.dg/gomp/bad-array-section-10.C: Adjust diagnostics for C++23 and up. --- gcc/testsuite/g

[PATCH] OpenMP: Fix new lvalue-parsing map/to/from tests for 32-bit targets

2024-01-10 Thread Julian Brown
This patch fixes several tests introduced by the commit r14-7033-g1413af02d62182 for 32-bit targets. I will commit as obvious. 2024-01-10 Julian Brown gcc/testsuite/ * g++.dg/gomp/array-section-1.C: Fix scan output for 32-bit target. * g++.dg/gomp/array-section-2.C: Likewise

Re: [PATCH, OpenACC 2.7] Implement reductions for arrays and structs

2024-01-10 Thread Julian Brown
On Tue, 2 Jan 2024 23:21:21 +0800 Chung-Lin Tang wrote: > To Julian, there is a patch to the middle-end neutering, a hack > actually, that detects SSA_NAMEs used in reduction array MEM_REFs, > and avoids single->parallel copying (by moving those definitions > before

Re: [PATCH] OpenMP: Support accelerated 2D/3D memory copies for AMD GCN

2024-01-08 Thread Julian Brown
lian commit 34c6e9132b3ea33c2e15c88e127c4134a5e88b8d Author: Julian Brown Date: Thu Jan 4 16:44:18 2024 + OpenMP: Support accelerated 2D/3D memory copies for AMD GCN This patch adds support for 2D/3D memory copies for omp_target_memcpy_rect using AMD extensions to the HSA API. This is just

Re: [PATCH v7 5/5] OpenMP/OpenACC: Reorganise OMP map clause handling in gimplify.cc

2023-12-20 Thread Julian Brown
Hi Tobias, Thanks for review! Here's a new version of the patch which hopefully addresses this round of comments. On Tue, 19 Dec 2023 16:41:54 +0100 Tobias Burnus wrote: > On 16.12.23 14:25, Julian Brown wrote: > > --- a/gcc/gimplify.cc > > +++ b/gcc/gimplify.cc > >

Re: [PATCH v7 5/5] OpenMP/OpenACC: Reorganise OMP map clause handling in gimplify.cc

2023-12-16 Thread Julian Brown
On Fri, 18 Aug 2023 15:47:51 -0700 Julian Brown wrote: > This patch has been separated out from the C++ "declare mapper" > support patch. It contains just the gimplify.cc rearrangement > work, mostly moving gimplification from gimplify_scan_omp_clauses > to gimplify_adju

Re: [committed] testsuite: Fix up target-enter-data-1.c on 32-bit targets

2023-12-14 Thread Julian Brown
On Thu, 14 Dec 2023 08:14:56 +0100 Jakub Jelinek wrote: > On Wed, Nov 29, 2023 at 11:43:05AM +0000, Julian Brown wrote: > > * c-c++-common/gomp/target-enter-data-1.c: Adjust scan > > output. > > struct bar { int num_vectors; double *vectors; }; > > is 16 b

Re: [PATCH v7 3/5] OpenMP: Pointers and member mappings

2023-12-07 Thread Julian Brown
is part of my Fortran allocatable-components deep-mapping patch > that is currently only on OG9 (?) to OG13, badly needs to be > upstreamed but required that Jakub had a look at it - well, I still > would like that he has a look at the omp-low.cc parts and it needs to > be re-diffed. >

Re: [PATCH 1/5] OpenMP, NVPTX: memcpy[23]D bias correction

2023-10-02 Thread Julian Brown
On Wed, 27 Sep 2023 00:57:58 +0200 Thomas Schwinge wrote: > On 2023-09-06T02:34:30-0700, Julian Brown > wrote: > > This patch works around behaviour of the 2D and 3D memcpy > > operations in the CUDA driver runtime. Particularly in Fortran, > > the "base pointer&

[PATCH] OpenMP: Support accelerated 2D/3D memory copies for AMD GCN

2023-09-20 Thread Julian Brown
on parts of that work (regarding strided/rectangular updates). A stand-alone version that just works for the OpenMP API routine omp_target_memcpy_rect could be prepared to apply separately, if preferable. This version has been re-tested and bootstrapped. OK? 2023-09-20 Julian Brown libgo

[PATCH 3/3] [og13] OpenMP: Support accelerated 2D/3D memory copies for AMD GCN

2023-09-20 Thread Julian Brown
imensional strided accesses: these are treated as a special case of 2-dimensional transfers, where the innermost dimension is formed from the stride length (in bytes). 2023-09-19 Julian Brown libgomp/ * plugin/plugin-gcn.c (hsa_runtime_fn_info): Add hsa_amd_memo

[PATCH 1/3] [og13] OpenMP: Call cuMemcpy2D/cuMemcpy3D for nvptx for omp_target_memcpy_rect

2023-09-20 Thread Julian Brown
a temporary variable on the host. 2023-09-19 Tobias Burnus Julian Brown include/ * cuda/cuda.h (CUlimit): Add CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_INVALID_HANDLE. (CUarray, CUmemorytype, CUDA_MEMCPY2D, CUDA_MEMCPY3D, CUDA

[PATCH 2/3] [og13] OpenMP, NVPTX: memcpy[23]D bias correction

2023-09-20 Thread Julian Brown
is to make sure that we use the first element of data to be transferred instead, and adjust parameters accordingly. This is a merge of the patch previously posted for mainline to the og13 branch. 2023-09-19 Julian Brown libgomp/ * plugin/plugin-nvptx.c (GOMP_OFFLOAD_memcpy2d): Adjust

[PATCH 0/3] [og13] OpenMP: Accelerated 2D/3D host<->target memory copies

2023-09-20 Thread Julian Brown
inline, so this is a backport, and another is a bug fix that has been submitted for mainline but not yet reviewed. The final patch is new (the AMD support for 2D/3D copies). Tested with offloading to both NVPTX and AMD GCN. I will push (to the og13 branch) shortly. Julian Brown (2): [og13] OpenMP, NVPTX: m

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

2023-09-18 Thread Julian Brown
On Thu, 14 Sep 2023 17:13:02 +0200 Bernhard Reutner-Fischer via Gcc-patches wrote: > On Tue, 5 Sep 2023 12:28:28 -0700 > Julian Brown wrote: > > > + static bool > > + equal (const omp_name_type , > > +const omp_name_type ) > > + { > > +if (a.n

[PATCH] OpenMP: Enable 'declare mapper' mappers for 'target update' directives

2023-09-06 Thread Julian Brown
and strided/rectangular 'target update' support series: https://gcc.gnu.org/pipermail/gcc-patches/2023-September/629422.html Tested with offloading to NVPTX. OK? 2023-09-06 Julian Brown gcc/c-family/ * c-common.h (c_omp_region_type): Add C_ORT_UPDATE and C_ORT_OMP_UPDATE code

[PATCH 4/5] OpenMP: Array shaping operator and strided "target update" for C

2023-09-06 Thread Julian Brown
ecessarily differ for C, but the general ideas are the same. This version of the patch has been rebased and contains a couple of minor fixes relative to versions posted previously. 2023-09-05 Julian Brown gcc/c/ * c-parser.cc (c_parser_braced_init): Disallow array-shapin

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

2023-09-06 Thread Julian Brown
o a form that can ultimately be consumed by omp_target_memcpy_rect_worker. The method for doing this is described in comments in the patch body. This version of the patch has been rebased and contains some additional minor fixes relative to the version posted for the og13 branch. 2023-09-05 Julian B

[PATCH 2/5] OpenMP: Allow complete replacement of clause during map/to/from expansion

2023-09-06 Thread Julian Brown
st pointer to the node to various functions rather than the node itself. This is needed by the following patch. There shouldn't be any functional changes introduced by this patch itself. 2023-09-05 Julian Brown gcc/c-family/ * c-common.h (expand_array_base, expand_componen

[PATCH 0/5] OpenMP: Array-shaping operator and strided/rectangular 'target update' support

2023-09-06 Thread Julian Brown
tches/2023-July/623502.html This version of the series contains several follow-up fixes relative to the og13 version, and omits some parts that are only present on the branch for now. Further comments on individual patches. Tested with offloading to NVPTX and bootstrapped. OK? Julian Brown (5)

[PATCH 1/5] OpenMP, NVPTX: memcpy[23]D bias correction

2023-09-06 Thread Julian Brown
is to make sure that we use the first element of data to be transferred instead, and adjust parameters accordingly. 2023-09-05 Julian Brown libgomp/ * plugin/plugin-nvptx.c (GOMP_OFFLOAD_memcpy2d): Adjust parameters to avoid out-of-bounds array checks in CU

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

2023-09-05 Thread Julian Brown
nu.org/pipermail/gcc-patches/2023-August/627006.html "OpenMP: Look up 'declare mapper' definitions at resolution time not parse time": https://gcc.gnu.org/pipermail/gcc-patches/2023-August/627007.html 2023-09-05 Julian Brown gcc/fortran/ * dump-parse-tree.cc (show_attr): Sh

[PATCH 7/8] OpenMP, Fortran: Split out OMP clause checking

2023-09-05 Thread Julian Brown
ious lines are still executed in the same order, though there is a little harmless reshuffling in a couple of places to make things fit. There shouldn't be any behavioural changes introduced by this patch. 2023-09-05 Julian Brown gcc/fortran/ * openmp.cc (omp_verify_clauses_s

[PATCH 6/8] OpenMP, Fortran: Per-directive control for gfc_trans_omp_clauses

2023-09-05 Thread Julian Brown
2023-09-05 Julian Brown gcc/fortran/ * gfortran.h (toc_directive): New enum. * trans-openmp.cc (gfc_trans_omp_array_section): Take toc_directive parameter instead of gfc_exec_op and 'openmp' boolean. (gfc_trans_omp_clauses): Take toc_directive paramet

[PATCH 5/8] OpenMP, Fortran: Pass list number to gfc_free_omp_namelist

2023-09-05 Thread Julian Brown
This is a cleanup to avoid passing an ever-longer list of boolean arguments to gfc_free_omp_namelist, in support of the Fortran "declare mapper" implementation further along this patch series. This patch isn't intended to cause any behavioural changes. 2023-09-05 Julian Brown g

[PATCH 4/8] OpenMP: Support OpenMP 5.0 "declare mapper" directives for C

2023-09-05 Thread Julian Brown
ps://gcc.gnu.org/pipermail/gcc-patches/2023-June/623356.html This version supports mappers on "target data", "target enter data" and "target exit data" directives as well as on "target" directives. 2023-09-05 Julian Brown gcc/c/

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

2023-09-05 Thread Julian Brown
pipermail/gcc-patches/2023-August/627005.html 2023-09-05 Julian Brown gcc/c-family/ * c-common.h (c_omp_region_type): Add C_ORT_EXIT_DATA, C_ORT_DECLARE_MAPPER, C_ORT_OMP_EXIT_DATA, C_ORT_OMP_DECLARE_MAPPER values. (omp_mapper_list): Add forward declara

[PATCH 2/8] OpenMP: lvalue parsing for map/to/from clauses (C)

2023-09-05 Thread Julian Brown
ously posted for mainline here: https://gcc.gnu.org/pipermail/gcc-patches/2022-December/609038.html and for the og13 branch here: https://gcc.gnu.org/pipermail/gcc-patches/2023-June/623355.html 2023-09-05 Julian Brown gcc/c/ * c-pretty-print.cc (c_pretty_printer::postfix_expressi

[PATCH 0/8] OpenMP: lvalue parsing and "declare mapper" support

2023-09-05 Thread Julian Brown
rastructural support series posted here: https://gcc.gnu.org/pipermail/gcc-patches/2023-August/627895.html Tested with offloading to NVPTX and bootstrapped. OK? Julian Brown (8): OpenMP: lvalue parsing for map/to/from clauses (C++) OpenMP: lvalue parsing for map/to/from clauses (C) OpenMP:

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

2023-08-21 Thread Julian Brown
On Fri, 18 Aug 2023 15:47:50 -0700 Julian Brown wrote: > This version of the patch scales back the previously-posted version to > merely add a diagnostic for incorrect usage of component accesses with > variably-indexed arrays of structs: the only permitted variant is > where we h

[PATCH v7 3/5] OpenMP: Pointers and member mappings

2023-08-18 Thread Julian Brown
r of using the "correct" GOMP_MAP_RELEASE/GOMP_MAP_DELETE kinds during early expansion. A new flag is introduced so the middle-end knows when the latter two kinds are being used specifically for an array descriptor. This version of the patch is based on the version posted for the og13 b

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

2023-08-18 Thread Julian Brown
ic array support (though that is not yet applied to mainline). 2023-08-18 Julian Brown gcc/ * gimplify.cc (extract_base_bit_offset): Add VARIABLE_OFFSET parameter. (omp_get_attachment, omp_group_last, omp_group_base, omp_directive_maps_explic

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

2023-08-18 Thread Julian Brown
Reorganise OMP map clause handling in gimplify.cc" https://gcc.gnu.org/pipermail/gcc-patches/2023-June/63.html Parts of: "OpenMP: OpenMP 5.2 semantics for pointers with unmapped target" https://gcc.gnu.org/pipermail/gcc-patches/2023-June/623351.html 2023-08-18 Ju

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

2023-08-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). 2023-08-18 Julian Brown gcc/c/ * c-typeck.cc

[PATCH v7 0/5] OpenMP/OpenACC: map clause and OMP gimplify rework

2023-08-18 Thread Julian Brown
ttps://gcc.gnu.org/pipermail/gcc-patches/2023-June/622213.html Though rearranged somewhat and without several of the later OpenACC-specific patches. Further comments on individual patches. Tested with offloading to NVPTX and bootstrapped. OK for mainline? Julian Brown (5): OpenMP/O

[PATCH 5/5] OpenMP: Enable 'declare mapper' mappers for 'target update' directives

2023-08-10 Thread Julian Brown
ta", etc.), an error will be raised. Support is also added for the "mapper" modifier on to/from clauses for all three base languages. 2023-08-10 Julian Brown gcc/c-family/ * c-common.h (c_omp_region_type): Add C_ORT_UPDATE and C_ORT_OMP_UPDATE codes. * c

[PATCH 2/5] OpenMP: Reprocess expanded clauses after 'declare mapper' instantiation

2023-08-10 Thread Julian Brown
', called after mapper instantiation. This improves diagnostic output. 2023-08-10 Julian Brown gcc/fortran/ * gfortran.h (gfc_omp_clauses): Add NS field. * openmp.cc (verify_omp_clauses_symbol_dups, omp_verify_map_motion_clauses): New functions, broken out

[PATCH 4/5] OpenMP: Look up 'declare mapper' definitions at resolution time not parse time

2023-08-10 Thread Julian Brown
-10 Julian Brown gcc/fortran/ * gfortran.h (gfc_omp_namelist_udm): Add MAPPER_ID field to store the mapper name to use for lookup during resolution. * match.cc (gfc_free_omp_namelist): Handle OMP_LIST_TO and OMP_LIST_FROM when freeing mapper references

[PATCH 1/5] OpenMP: Move Fortran 'declare mapper' instantiation code

2023-08-10 Thread Julian Brown
is more convenient for the following patch that introduces the 'resolve_omp_mapper_clauses' function. 2023-08-10 Julian Brown gcc/fortran/ * gfortran.h (toc_directive): Move here. (gfc_omp_instantiate_mappers, gfc_get_location): Add prototypes. * openmp.cc

[PATCH 3/5] OpenMP: Introduce C_ORT_{, OMP_}DECLARE_MAPPER c_omp_region_type types

2023-08-10 Thread Julian Brown
enumeration values for that purpose instead. This shouldn't result in any behaviour change, but improves self-documentation. 2023-08-10 Julian Brown gcc/c-family/ * c-common.h (c_omp_region_type): Add C_ORT_DECLARE_MAPPER and C_ORT_OMP_DECLARE_MAPPER codes. gcc/cp/ * pt.cc

[PATCH 0/5] [og13] OpenMP: Implement 'declare mapper' for 'target update' directives

2023-08-10 Thread Julian Brown
(to the og13 branch) shortly. Julian Brown (5): OpenMP: Move Fortran 'declare mapper' instantiation code OpenMP: Reprocess expanded clauses after 'declare mapper' instantiation OpenMP: Introduce C_ORT_{,OMP_}DECLARE_MAPPER c_omp_region_type types OpenMP: Look up 'declare mapper' definitions

[PATCH] [og13] OpenMP: Dimension ordering for array-shaping operator for C and C++

2023-07-14 Thread Julian Brown
. the indices, lengths or strides for array sections. This patch reverses the order used in both omp-low.cc and the Fortran front-end, so the order should now be correct for all supported base languages. Tested with offloading to AMD GCN. I will apply (to og13) shortly. 2023-07-14 Julian Brown

[PATCH] [og13] OpenMP: Enable c-c++-common/gomp/declare-mapper-3.c for C

2023-07-14 Thread Julian Brown
This patch enables the c-c++-common/gomp/declare-mapper-3.c test for C. This was seemingly overlooked in commit 393fd99c90e. Tested with offloading to AMD GCN. I will apply (to og13) shortly. 2023-07-14 Julian Brown gcc/testsuite/ * c-c++-common/gomp/declare-mapper-3.c: Enable for C

[PATCH] OpenMP: Strided/rectangular 'target update' out-of-bounds array lookup fix

2023-07-12 Thread Julian Brown
a size for the array that encloses the elements to be transferred, and is guaranteed to be entirely within the array (user errors excepted). Tested with offloading to NVPTX. I will apply (to og13) shortly. 2023-07-11 Julian Brown gcc/ * omp-low.cc (lower_omp_target): Calcul

[PATCH] [og13] OpenACC: Vector length warning fixes for implicit mapping/declare create tests

2023-07-12 Thread Julian Brown
This patch adds expected "vector length" warnings to several tests for NVPTX. Tested with offloading to NVPTX. I will apply (to og13) shortly. 2023-07-11 Julian Brown libgomp/ * testsuite/libgomp.oacc-c-c++-common/implicit-mapping-1.c: Add expect

[PATCH] [og13] OpenMP: Expand "declare mapper" mappers for target {enter, exit, } data directives

2023-07-06 Thread Julian Brown
Julian Brown gcc/c-family/ * c-common.h (c_omp_region_type): Add C_ORT_EXIT_DATA, C_ORT_OMP_EXIT_DATA. (c_omp_instantiate_mappers): Add region type parameter. * c-omp.cc (omp_split_map_kind, omp_join_map_kind, omp_map_decayed_kind): New functions

[PATCH 5/5] OpenMP: Array shaping operator and strided "target update" for C

2023-07-03 Thread Julian Brown
me details of parsing necessarily differ for C, but the general ideas are the same. 2023-07-03 Julian Brown gcc/c/ * c-parser.cc (c_parser_braced_init): Disallow array-shaping operator in braced init. (c_parser_conditional_expression): Disallow array-shapin

[PATCH 4/5] OpenMP: Noncontiguous "target update" for Fortran

2023-07-03 Thread Julian Brown
onsumed by omp_target_memcpy_rect_worker. The method for doing this is described in comments in the patch body. 2023-07-03 Julian Brown gcc/fortran/ * trans-openmp.cc (gfc_omp_deep_map_kind_p): Handle GOMP_MAP_{TO,FROM}_GRID, GOMP_MAP_GRID_{DIM,STRIDE}. (gfc_trans_om

[PATCH 2/5] OpenMP: Allow complete replacement of clause during map/to/from expansion

2023-07-03 Thread Julian Brown
st pointer to the node to various functions rather than the node itself. This is needed by the following patch. There shouldn't be any functional changes introduced by this patch itself. 2023-07-03 Julian Brown gcc/c-family/ * c-common.h (expand_array_base, expand_componen

[PATCH 0/5] [og13] OpenMP: strides, rectangular updates and array-shaping operator for "target update"

2023-07-03 Thread Julian Brown
MD GCN. I will apply shortly. Julian Brown (5): OpenMP: Fix "exit data" for array sections for ref-to-ptr components OpenMP: Allow complete replacement of clause during map/to/from expansion OpenMP: Support strided and shaped-array updates for C++ OpenMP: Nonconti

[PATCH 1/5] OpenMP: Fix "exit data" for array sections for ref-to-ptr components

2023-07-03 Thread Julian Brown
as a single mapping group as it should be. This patch fixes that. (This is covered by a test case added in later patches in this series, e.g. libgomp/testsuite/libgomp.c++/array-shaping-8.C.) 2023-07-03 Julian Brown gcc/ * gimplify.cc (omp_get_attachment): Handle GOMP_MAP_DETACH her

[PATCH 6/7] OpenMP: Support OpenMP 5.0 "declare mapper" directives for C

2023-06-30 Thread Julian Brown
This patch adds support for "declare mapper" directives (and the "mapper" modifier on "map" clauses) for C. 2023-06-30 Julian Brown gcc/c/ * c-decl.cc (c_omp_mapper_id, c_omp_mapper_decl, c_omp_mapper_lookup, c_omp_extract_mapper_dire

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

2023-06-30 Thread Julian Brown
This patch adds support for parsing general lvalues ("locator list item types") for OpenMP "map", "to" and "from" clauses to the C front-end, similar to the previously-posted patch for C++. 2023-06-30 Julian Brown gcc/c/ * c-pretty-print.

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

2023-06-30 Thread Julian Brown
ropriately transferred to the offload target (see "OMP_MAP_POINTER_ONLY" and gimplify.cc:omp_maybe_get_descriptor_from_ptr). 2023-06-30 Julian Brown gcc/fortran/ * dump-parse-tree.cc (show_attr): Show omp_udm_artificial_var flag. (show_omp_namelist): Support

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

2023-06-30 Thread Julian Brown
traversal in gimplify.cc:omp_instantiate_implicit_mappers, and this patch omits the rearrangement of gimplify.cc:gimplify_{scan,adjust}_omp_clauses that I separated out into its own patch and applied (to og13) already. 2023-06-30 Julian Brown gcc/c-family/ * c-common.h (omp_mapper_list): Add forward d

[PATCH 2/7] OpenMP: OpenMP 5.2 semantics for pointers with unmapped target

2023-06-30 Thread Julian Brown
with DECL_VALUE_EXPR handling in gimplify.cc, which this patch also fixes. 2023-06-30 Julian Brown gcc/ * gimplify.cc (gimplify_scan_omp_clauses): Add note about DECL_VALUE_EXPR handling for struct mapping nodes. (gimplify_adjust_omp_clauses): Perform DECL_VALUE_EXPR

[PATCH 0/7] [og13] OpenMP: lvalue parsing and "declare mapper" support

2023-06-30 Thread Julian Brown
tream previously: https://gcc.gnu.org/pipermail/gcc-patches/2022-December/609031.html (parts 7, 8, 9, 10 and 11), with adjustments necessary due to other patches already on og13 and also a few follow-up fixes. Tested with offloading to AMD GCN. I will apply (to og13) shortly. Julian Brown (7):

[PATCH 1/7] Fix up merge/formatting errors

2023-06-30 Thread Julian Brown
This patch fixes a couple of minor merge/formatting errors. 2023-06-30 Julian Brown gcc/fortran/ * parse.cc (decode_omp_directive): Add missing break. gcc/ * gimplify.cc (gimplify_adjust_omp_clauses): Fix indentation. --- gcc/fortran/parse.cc | 1 + gcc/gimplify.cc | 4

[PATCH 12/14] OpenACC: "declare create" fixes wrt. "allocatable" variables

2023-06-19 Thread Julian Brown
en allocated/deallocated on the host instead. Then, "declare create" variables are implicitly turned into "present" clauses on in-scope offload regions. 2023-06-16 Julian Brown gcc/fortran/ * trans-openmp.cc (gfc_omp_finish_clause): Handle "declare create"

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

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

2023-06-19 Thread Julian Brown
implements 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

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

2023-06-19 Thread Julian Brown
%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" GOMP_MAP_REL

[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 14/14] OpenACC: Improve implicit mapping for non-lexically nested offload regions

2023-06-19 Thread Julian Brown
contiguous" dynamic array support, so the GOMP_MAP_NONCONTIG_ARRAY_P macro has been adjusted to account for that. This behaviour relates to upstream OpenACC issue 490 (not yet resolved). 2023-06-16 Julian Brown gcc/ * gimplify.cc (gimplify_adjust_omp_clauses_1): Set OMP

[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 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 07/14] OpenMP: implicitly map base pointer for array-section pointer components

2023-06-19 Thread Julian Brown
;, 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' and uses of 's.ptr[...]' work correctly in the target region. ChangeLog 2

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

[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 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] OpenMP: Array shaping operator and strided "target update" for C

2023-05-16 Thread Julian Brown
ml Tested with offloading to NVPTX, and bootstrapped. OK? Thanks, Julian 2023-05-16 Julian Brown gcc/c/ * c-parser.cc (c_parser_braced_init): Disallow array-shaping operator in braced init. (c_parser_conditional_expression): Disallow array-shaping operator in c

[PATCH] OpenMP: Constructors and destructors for "declare target" static aggregates

2023-05-12 Thread Julian Brown
ing to AMD GCN and bootstrapped. OK for mainline? Thanks, Julian 2023-05-12 Julian Brown gcc/cp/ * decl2.cc (tree-inline.h): Include. (static_init_fini_fns): Bump to four entries. Update comment. (start_objects, start_partial_init_fini_fn): Add 'omp_target'

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

[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] OpenMP: Noncontiguous "target update" for Fortran

2023-04-27 Thread Julian Brown
mp_target_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.

Re: [PATCH] [og12] OpenMP: Constructors and destructors for "declare target" static aggregates

2023-04-05 Thread Julian Brown
On Sun, 2 Apr 2023 11:38:42 +0200 Thomas Schwinge wrote: > Hi Julian! > > On 2023-03-27T18:54:30+0000, Julian Brown > wrote: > > This patch adds support for running constructors and destructors for > > static (file-scope) aggregates for C++ objects which are marked

[PATCH] [og12] OpenMP: Fix checking ICE in "declare target" ctor/dtor support

2023-04-05 Thread Julian Brown
sufficient to clone the initialization statement for use in the on-target constructor/destructor function. Instead we now use walk_tree with "copy_tree_body_r" and appropriate configuration parameters. Tested with offloading to AMD GCN. I will commit (to og12) shortly. Julian 2023-04-05

[PATCH] [og12] OpenMP: Constructors and destructors for "declare target" static aggregates

2023-03-27 Thread Julian Brown
ructs them properly, so they end up zero-initialised. Tested with offloading to AMD GCN. I will apply to the og12 branch shortly. ChangeLog 2023-03-27 Julian Brown gcc/cp/ * decl2.cc (priority_info): Add omp_tgt_initializations_p and omp_tgt_destructions_p. (sta

Re: I have questions regarding the 4.3 codebase...

2023-03-23 Thread Julian Brown
On Wed, 22 Mar 2023 18:27:28 -0400 Sid Maxwell via Gcc wrote: > Is there anyone on the list with experience with the gcc 4.3 > codebase? I'm currently maintaining a fork of it, with a PDP10 code > generator. > > I've run into an issue involving the transformation of a movmemhi to a > single

[PATCH 2/3] OpenMP: Allow complete replacement of clause during map/to/from expansion

2023-03-10 Thread Julian Brown
st pointer to the node to various functions rather than the node itself. This is needed by the following patch. There shouldn't be any functional changes introduced by this patch itself. 2023-03-10 Julian Brown gcc/c-family/ * c-common.h (expand_array_base, expand_componen

[PATCH 1/3] OpenMP: Fix "exit data" for array sections for ref-to-ptr components

2023-03-10 Thread Julian Brown
as a single mapping group as it should be. This patch fixes that. (This is covered by a test case added in later patches in this series, e.g. libgomp/testsuite/libgomp.c++/array-shaping-8.C.) 2023-03-10 Julian Brown gcc/ * gimplify.cc (omp_get_attachment): Handle GOMP_MAP_DETACH her

[PATCH 0/3] OpenMP 5.0: Strided updates and array shape-operator support (C++)

2023-03-10 Thread Julian Brown
introduced in those patches. Further comments on individual patches. Tested with offloading to NVPTX. OK (for stage 1)? Thanks, Julian Julian Brown (3): OpenMP: Fix "exit data" for array sections for ref-to-ptr components OpenMP: Allow complete replacement of clause during map/t

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

2023-01-09 Thread Julian Brown
On Fri, 23 Dec 2022 04:13:03 -0800 Julian Brown wrote: > This patch adds support for "declare mapper" directives (and the > "mapper" modifier on "map" clauses) for C. As for C++, arrays of > custom-mapped objects are not supported yet. Here's a s

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

2022-12-23 Thread Julian Brown
On Thu, 15 Dec 2022 16:46:50 + Julian Brown wrote: > 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 O

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

2022-12-23 Thread Julian Brown
ctoring 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 08/11] OpenMP: C++ "declare mapper" support

2022-12-23 Thread Julian Brown
d 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/ * c-common.h (omp_mapper_list): Add

[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 v6 05/11] OpenMP: Pointers and member mappings

2022-12-23 Thread Julian Brown
SET 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/ * dependency.cc

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

2022-12-23 Thread Julian Brown
rent-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_UNSET. * f95-lang.cc (LANG_

[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 04/11] OpenMP: implicitly map base pointer for array-section pointer components

2022-12-23 Thread Julian Brown
;, 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' and uses of 's.ptr[...]' work correctly in the target region. ChangeLog 2

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

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

  1   2   3   4   5   6   7   8   9   >