gcc/libgomp
Chung-Lin Tang b7e2048063 openmp: Relax handling of implicit map vs. existing device mappings
This patch implements relaxing the requirements when a map with the implicit
attribute encounters an overlapping existing map. As the OpenMP 5.0 spec
describes on page 320, lines 18-27 (and 5.1 spec, page 352, lines 13-22):

"If a single contiguous part of the original storage of a list item with an
 implicit data-mapping attribute has corresponding storage in the device data
 environment prior to a task encountering the construct that is associated with
 the map clause, only that part of the original storage will have corresponding
 storage in the device data environment as a result of the map clause."

2021-11-12  Chung-Lin Tang  <cltang@codesourcery.com>

include/ChangeLog:

	* gomp-constants.h (GOMP_MAP_FLAG_SPECIAL_3): Define special bit macro.
	(GOMP_MAP_IMPLICIT): New special map kind bits value.
	(GOMP_MAP_FLAG_SPECIAL_BITS): Define helper mask for whole set of
	special map kind bits.
	(GOMP_MAP_IMPLICIT_P): New predicate macro for implicit map kinds.

gcc/ChangeLog:

	* tree.h (OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P): New access macro for
	'implicit' bit, using 'base.deprecated_flag' field of tree_node.
	* tree-pretty-print.c (dump_omp_clause): Add support for printing
	implicit attribute in tree dumping.
	* gimplify.c (gimplify_adjust_omp_clauses_1):
	Set OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P to 1 if map clause is implicitly
	created.
	(gimplify_adjust_omp_clauses): Adjust place of adding implicitly created
	clauses, from simple append, to starting of list, after non-map clauses.
	* omp-low.c (lower_omp_target): Add GOMP_MAP_IMPLICIT bits into kind
	values passed to libgomp for implicit maps.

gcc/testsuite/ChangeLog:

	* c-c++-common/gomp/target-implicit-map-1.c: New test.
	* c-c++-common/goacc/combined-reduction.c: Adjust scan test pattern.
	* c-c++-common/goacc/firstprivate-mappings-1.c: Likewise.
	* c-c++-common/goacc/mdc-1.c: Likewise.
	* g++.dg/goacc/firstprivate-mappings-1.C: Likewise.

libgomp/ChangeLog:

	* target.c (gomp_map_vars_existing): Add 'bool implicit' parameter, add
	implicit map handling to allow a "superset" existing map as valid case.
	(get_kind): Adjust to filter out GOMP_MAP_IMPLICIT bits in return value.
	(get_implicit): New function to extract implicit status.
	(gomp_map_fields_existing): Adjust arguments in calls to
	gomp_map_vars_existing, and add uses of get_implicit.
	(gomp_map_vars_internal): Likewise.
	* testsuite/libgomp.c-c++-common/target-implicit-map-1.c: New test.
2021-11-12 20:29:48 +08:00
..
config openmp: Honor OpenMP 5.1 num_teams lower bound 2021-11-12 12:41:22 +01:00
plugin amdgcn: Enable OpenACC worker partitioning for AMD GCN 2021-08-09 15:08:44 +02:00
testsuite openmp: Relax handling of implicit map vs. existing device mappings 2021-11-12 20:29:48 +08:00
.gitattributes
acc_prof.h
acinclude.m4
aclocal.m4
affinity-fmt.c openmp: Avoid PLT relocations for omp_* symbols in libgomp 2021-10-01 10:42:07 +02:00
affinity.c
alloc.c
allocator.c libgomp: Add tests for omp_atv_serialized and deprecate omp_atv_sequential. 2021-10-11 04:34:51 -07:00
atomic.c
barrier.c
ChangeLog Daily bump. 2021-11-12 00:16:32 +00:00
ChangeLog.graphite
config.h.in
configure libgomp: Only check for 2*sizeof(void*) int type with Fortran [PR96661] 2021-09-28 15:15:47 +02:00
configure.ac libgomp: Only check for 2*sizeof(void*) int type with Fortran [PR96661] 2021-09-28 15:15:47 +02:00
configure.tgt [gcn] Work-around libgomp 'error: array subscript 0 is outside array bounds of ‘__lds struct gomp_thread * __lds[0]’ [-Werror=array-bounds]' some more [PR101484] 2021-07-20 09:14:28 +02:00
critical.c
env.c Restore 'GOMP_OPENACC_DIM' environment variable parsing 2021-11-09 16:51:57 +01:00
error.c openmp: Implement the error directive 2021-08-20 11:36:52 +02:00
fortran.c openmp: Add omp_set_num_teams, omp_get_max_teams, omp_[gs]et_teams_thread_limit 2021-10-11 12:20:22 +02:00
hashtab.h
icv-device.c openmp: Avoid PLT relocations for omp_* symbols in libgomp 2021-10-01 10:42:07 +02:00
icv.c openmp: Add omp_set_num_teams, omp_get_max_teams, omp_[gs]et_teams_thread_limit 2021-10-11 12:20:22 +02:00
iter_ull.c
iter.c
libgomp_f.h.in
libgomp_g.h openmp: Honor OpenMP 5.1 num_teams lower bound 2021-11-12 12:41:22 +01:00
libgomp-plugin.c
libgomp-plugin.h openmp: Implement omp_get_device_num routine 2021-08-05 23:29:03 +08:00
libgomp.h libgomp: Use TLS storage for omp_get_num_teams()/omp_get_team_num() values 2021-11-11 13:57:31 +01:00
libgomp.map openmp: Honor OpenMP 5.1 num_teams lower bound 2021-11-12 12:41:22 +01:00
libgomp.spec.in
libgomp.texi openmp: Document that non-rect loops are not supported in Fortran yet 2021-10-27 09:24:46 +02:00
lock.c
loop_ull.c
loop.c
Makefile.am openmp: Implement OpenMP 5.1 scope construct 2021-08-17 09:30:09 +02:00
Makefile.in openmp: Implement OpenMP 5.1 scope construct 2021-08-17 09:30:09 +02:00
oacc-async.c
oacc-cuda.c
oacc-host.c
oacc-init.c
oacc-int.h
oacc-mem.c Fix OpenACC "ephemeral" asynchronous host-to-device copies 2021-07-27 11:16:27 +02:00
oacc-parallel.c
oacc-plugin.c
oacc-plugin.h
oacc-profiling.c
oacc-target.c
omp_lib.f90.in libgomp: Add tests for omp_atv_serialized and deprecate omp_atv_sequential. 2021-10-11 04:34:51 -07:00
omp_lib.h.in openmp: Add omp_set_num_teams, omp_get_max_teams, omp_[gs]et_teams_thread_limit 2021-10-11 12:20:22 +02:00
omp.h.in libgomp: Add tests for omp_atv_serialized and deprecate omp_atv_sequential. 2021-10-11 04:34:51 -07:00
openacc_lib.h
openacc.f90
openacc.h
ordered.c
parallel.c
priority_queue.c
priority_queue.h
scope.c openmp: Implement OpenMP 5.1 scope construct 2021-08-17 09:30:09 +02:00
sections.c
secure_getenv.h
single.c
splay-tree.c
splay-tree.h
target.c openmp: Relax handling of implicit map vs. existing device mappings 2021-11-12 20:29:48 +08:00
task.c
taskloop.c openmp: Add support for strict modifier on grainsize/num_tasks clauses 2021-08-23 10:16:24 +02:00
team.c libgomp: Use TLS storage for omp_get_num_teams()/omp_get_team_num() values 2021-11-11 13:57:31 +01:00
teams.c libgomp: Use TLS storage for omp_get_num_teams()/omp_get_team_num() values 2021-11-11 13:57:31 +01:00
work.c openmp: Fix up struct gomp_work_share handling [PR102838] 2021-10-20 09:34:51 +02:00