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

2023-08-10 Thread Julian Brown
This patch enables use of 'declare mapper' for 'target update' directives, for each of C, C++ and Fortran. There are some implementation choices here and some "read-between-the-lines" consequences regarding this functionality, as follows: * It is possible to invoke a mapper which contains clause

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

2023-08-10 Thread Julian Brown
This patch moves 'declare mapper' lookup for OpenMP clauses from parse time to resolution time for Fortran, and adds diagnostics for missing named mappers. This changes clause lookup in a particular case -- where several 'declare mapper's are defined in a context, mappers declared earlier may now

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

2023-08-10 Thread Julian Brown
This patch adds C_ORT_DECLARE_MAPPER and C_ORT_OMP_DECLARE_MAPPER region types to the c_omp_region_type enum, and uses them in cp/pt.cc. Previously the C_ORT_DECLARE_SIMD code was being abused to inhibit calling finish_omp_clauses within mapper definitions, but this patch uses one of the new enumer

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

2023-08-10 Thread Julian Brown
This patch reprocesses expanded clauses after 'declare mapper' instantiation -- checking things such as duplicated clauses, illegal use of strided accesses, and so forth. Two functions are broken out of the 'resolve_omp_clauses' function and reused in a new function 'resolve_omp_mapper_clauses', c

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

2023-08-10 Thread Julian Brown
This patch moves the code for explicit 'declare mapper' directive instantiation in the Fortran front-end to openmp.cc from trans-openmp.cc. The transformation takes place entirely in the front end's own representation and doesn't involve middle-end trees at all. Also, having the code in openmp.cc i

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

2023-08-10 Thread Julian Brown
This series (for the og13 branch) implements 'declare mapper' support for 'target update' directives, and improves diagnostic behaviour relating to mapper expansion (mostly for Fortran) in several ways. Tested with offloading to AMD GCN. Further comments on individual patches. I will apply (to t