gcc/libgomp
Chung-Lin Tang 9e62802422 openmp: Implement OpenMP 5.0 base-pointer attachement and clause ordering
This patch implements some parts of the target variable mapping changes
specified in OpenMP 5.0, including base-pointer attachment/detachment
behavior for array section list-items in map clauses, and ordering of
map clauses according to map kind.

2020-11-10  Chung-Lin Tang  <cltang@codesourcery.com>

gcc/c-family/ChangeLog:

	* c-common.h (c_omp_adjust_map_clauses): New declaration.
	* c-omp.c (struct map_clause): Helper type for c_omp_adjust_map_clauses.
	(c_omp_adjust_map_clauses): New function.

gcc/c/ChangeLog:

	* c-parser.c (c_parser_omp_target_data): Add use of
	new c_omp_adjust_map_clauses function. Add GOMP_MAP_ATTACH_DETACH as
	handled map clause kind.
	(c_parser_omp_target_enter_data): Likewise.
	(c_parser_omp_target_exit_data): Likewise.
	(c_parser_omp_target): Likewise.
	* c-typeck.c (handle_omp_array_sections): Adjust COMPONENT_REF case to
	use GOMP_MAP_ATTACH_DETACH map kind for C_ORT_OMP region type.
	(c_finish_omp_clauses): Adjust bitmap checks to allow struct decl and
	same struct field access to co-exist on OpenMP construct.

gcc/cp/ChangeLog:

	* parser.c (cp_parser_omp_target_data): Add use of
	new c_omp_adjust_map_clauses function. Add GOMP_MAP_ATTACH_DETACH as
	handled map clause kind.
	(cp_parser_omp_target_enter_data): Likewise.
	(cp_parser_omp_target_exit_data): Likewise.
	(cp_parser_omp_target): Likewise.
	* semantics.c (handle_omp_array_sections): Adjust COMPONENT_REF case to
	use GOMP_MAP_ATTACH_DETACH map kind for C_ORT_OMP region type. Fix
	interaction between reference case and attach/detach.
	(finish_omp_clauses): Adjust bitmap checks to allow struct decl and
	same struct field access to co-exist on OpenMP construct.

gcc/ChangeLog:

	* gimplify.c (is_or_contains_p): New static helper function.
	(omp_target_reorder_clauses): New function.
	(gimplify_scan_omp_clauses): Add use of omp_target_reorder_clauses to
	reorder clause list according to OpenMP 5.0 rules. Add handling of
	GOMP_MAP_ATTACH_DETACH for OpenMP cases.
	* omp-low.c (is_omp_target): New static helper function.
	(scan_sharing_clauses): Add scan phase handling of GOMP_MAP_ATTACH/DETACH
	for OpenMP cases.
	(lower_omp_target): Add lowering handling of GOMP_MAP_ATTACH/DETACH for
	OpenMP cases.

gcc/testsuite/ChangeLog:

	* c-c++-common/gomp/clauses-2.c: Remove dg-error cases now valid.
	* gfortran.dg/gomp/map-2.f90: Likewise.
	* c-c++-common/gomp/map-5.c: New testcase.

libgomp/ChangeLog:

	* libgomp.h (enum gomp_map_vars_kind): Adjust enum values to be bit-flag
	usable.
	* oacc-mem.c (acc_map_data): Adjust gomp_map_vars argument flags to
	'GOMP_MAP_VARS_OPENACC | GOMP_MAP_VARS_ENTER_DATA'.
	(goacc_enter_datum): Likewise for call to gomp_map_vars_async.
	(goacc_enter_data_internal): Likewise.
	* target.c (gomp_map_vars_internal):
	Change checks of GOMP_MAP_VARS_ENTER_DATA to use bit-and (&). Adjust use
	of gomp_attach_pointer for OpenMP cases.
	(gomp_exit_data): Add handling of GOMP_MAP_DETACH.
	(GOMP_target_enter_exit_data): Add handling of GOMP_MAP_ATTACH.
	* testsuite/libgomp.c-c++-common/ptr-attach-1.c: New testcase.
2020-11-10 03:36:58 -08:00
..
config openmp: Change omp_get_initial_device () to match OpenMP 5.1 requirements 2020-10-22 09:31:01 +02:00
plugin [libgomp, nvptx] Report launch dimensions in GOMP_OFFLOAD_run 2020-10-08 11:03:29 +02:00
testsuite openmp: Implement OpenMP 5.0 base-pointer attachement and clause ordering 2020-11-10 03:36:58 -08:00
.gitattributes libgomp: Fixes + cleanup for OpenACC's Fortran module + openacc_lib.h 2020-02-19 09:13:44 +01:00
ChangeLog Daily bump. 2020-11-06 00:16:34 +00:00
ChangeLog.graphite
Makefile.am openmp: Mark deprecated symbols in OpenMP 5.0 2020-11-05 10:32:56 -08:00
Makefile.in openmp: Mark deprecated symbols in OpenMP 5.0 2020-11-05 10:32:56 -08:00
acc_prof.h Update copyright years. 2020-01-01 12:51:42 +01:00
acinclude.m4 re PR other/79543 (Inappropriate "ld --version" checking) 2019-09-03 14:10:26 +00:00
aclocal.m4 libgomp: Regenerate configure files with automake 1.15.1 2020-10-02 12:08:47 +02:00
affinity-fmt.c re PR libgomp/93219 (unused return value in affinity-fmt.c) 2020-01-10 21:42:00 +01:00
affinity.c Update copyright years. 2020-01-01 12:51:42 +01:00
alloc.c Update copyright years. 2020-01-01 12:51:42 +01:00
allocator.c libgomp: Add Fortran routine support for allocators 2020-07-15 08:33:20 +02:00
atomic.c Update copyright years. 2020-01-01 12:51:42 +01:00
barrier.c Update copyright years. 2020-01-01 12:51:42 +01:00
config.h.in Removal of HSA offloading from gcc and libgomp 2020-08-03 18:13:00 +02:00
configure libgomp: Regenerate configure files with automake 1.15.1 2020-10-02 12:08:47 +02:00
configure.ac libomp: Add omp_depend_kind to omp_lib.{f90,h} 2020-07-23 15:02:15 +02:00
configure.tgt aix: Add GCC64 configuration and FAT target libraries. 2020-06-21 14:14:46 -04:00
critical.c Update copyright years. 2020-01-01 12:51:42 +01:00
env.c libgomp: Hopefully avoid false positive warnings in env.c on solaris 2020-10-21 10:21:52 +02:00
error.c Update copyright years. 2020-01-01 12:51:42 +01:00
fortran.c openmp: Mark deprecated symbols in OpenMP 5.0 2020-11-05 10:32:56 -08:00
hashtab.h Update copyright years. 2020-01-01 12:51:42 +01:00
icv-device.c openmp: Change omp_get_initial_device () to match OpenMP 5.1 requirements 2020-10-22 09:31:01 +02:00
icv.c openmp: Mark deprecated symbols in OpenMP 5.0 2020-11-05 10:32:56 -08:00
iter.c Update copyright years. 2020-01-01 12:51:42 +01:00
iter_ull.c Update copyright years. 2020-01-01 12:51:42 +01:00
libgomp-plugin.c Update copyright years. 2020-01-01 12:51:42 +01:00
libgomp-plugin.h OpenACC 'acc_get_property' cleanup 2020-01-10 23:24:36 +01:00
libgomp.h openmp: Implement OpenMP 5.0 base-pointer attachement and clause ordering 2020-11-10 03:36:58 -08:00
libgomp.map openmp: Add support for the omp_get_supported_active_levels runtime library routine 2020-10-13 13:21:02 -07:00
libgomp.spec.in
libgomp.texi openmp: Change omp_get_initial_device () to match OpenMP 5.1 requirements 2020-10-22 09:31:01 +02:00
libgomp_f.h.in libomp: Add omp_depend_kind to omp_lib.{f90,h} 2020-07-23 15:02:15 +02:00
libgomp_g.h Update copyright years. 2020-01-01 12:51:42 +01:00
lock.c Update copyright years. 2020-01-01 12:51:42 +01:00
loop.c Update copyright years. 2020-01-01 12:51:42 +01:00
loop_ull.c Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-async.c Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-cuda.c Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-host.c OpenACC 'acc_get_property' cleanup 2020-01-10 23:24:36 +01:00
oacc-init.c libgomp: Fix hang when profiling OpenACC programs with CUDA 9.0 nvprof 2020-07-14 10:31:35 -07:00
oacc-int.h Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-mem.c openmp: Implement OpenMP 5.0 base-pointer attachement and clause ordering 2020-11-10 03:36:58 -08:00
oacc-parallel.c OpenACC – support "if" + "if_present" clauses with "host_data" 2020-01-10 16:08:41 +01:00
oacc-plugin.c Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-plugin.h Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-profiling.c Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-target.c GCN libgomp port 2019-11-13 12:38:04 +00:00
omp.h.in openmp: Mark deprecated symbols in OpenMP 5.0 2020-11-05 10:32:56 -08:00
omp_lib.f90.in openmp: Mark deprecated symbols in OpenMP 5.0 2020-11-05 10:32:56 -08:00
omp_lib.h.in openmp: Add support for the omp_get_supported_active_levels runtime library routine 2020-10-13 13:21:02 -07:00
openacc.f90 [OpenACC] Set 'acc_device_current = -1' 2020-04-29 09:54:37 +02:00
openacc.h [OpenACC] Set 'acc_device_current = -1' 2020-04-29 09:54:37 +02:00
openacc_lib.h [OpenACC] Set 'acc_device_current = -1' 2020-04-29 09:54:37 +02:00
ordered.c Update copyright years. 2020-01-01 12:51:42 +01:00
parallel.c libgomp: Enforce 1-thread limit in subteams 2020-09-30 17:37:31 +01:00
priority_queue.c Update copyright years. 2020-01-01 12:51:42 +01:00
priority_queue.h Update copyright years. 2020-01-01 12:51:42 +01:00
sections.c Update copyright years. 2020-01-01 12:51:42 +01:00
secure_getenv.h Update copyright years. 2020-01-01 12:51:42 +01:00
single.c Update copyright years. 2020-01-01 12:51:42 +01:00
splay-tree.c Update copyright years. 2020-01-01 12:51:42 +01:00
splay-tree.h Update copyright years. 2020-01-01 12:51:42 +01:00
target.c openmp: Implement OpenMP 5.0 base-pointer attachement and clause ordering 2020-11-10 03:36:58 -08:00
task.c Update copyright years. 2020-01-01 12:51:42 +01:00
taskloop.c Update copyright years. 2020-01-01 12:51:42 +01:00
team.c openmp: Add basic library allocator support. 2020-05-19 10:11:01 +02:00
teams.c Update copyright years. 2020-01-01 12:51:42 +01:00
work.c Update copyright years. 2020-01-01 12:51:42 +01:00