gcc/include
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
..
gdb
ansidecl.h include: Fix -Wundef warnings in ansidecl.h 2021-07-24 12:51:00 -04:00
btf.h BTF: Support for BTF_KIND_FLOAT 2021-07-02 08:32:44 -07:00
ChangeLog Daily bump. 2021-11-06 00:16:24 +00:00
ChangeLog-9103
ChangeLog.jit
COPYING
COPYING3
ctf.h CTF/BTF debug formats 2021-06-28 18:47:20 +02:00
demangle.h
dwarf2.def
dwarf2.h
dyn-string.h
environ.h
fibheap.h
filenames.h
floatformat.h Update pathname for IBM long double description. 2021-09-27 10:56:14 -04:00
fnmatch.h
gcc-c-fe.def
gcc-c-interface.h
gcc-cp-fe.def
gcc-cp-interface.h
gcc-interface.h
getopt.h
gomp-constants.h openmp: Relax handling of implicit map vs. existing device mappings 2021-11-12 20:29:48 +08:00
hashtab.h
hsa_ext_amd.h
hsa_ext_image.h
hsa.h
leb128.h
libiberty.h
longlong.h
lto-symtab.h
md5.h include: Allow for our md5.h to defer to the system header 2021-11-05 13:06:34 +01:00
objalloc.h
obstack.h obstack.h __PTR_ALIGN vs. ubsan 2021-09-22 17:14:17 +09:30
partition.h
plugin-api.h
safe-ctype.h
sha1.h
simple-object.h
sort.h
splay-tree.h
symcat.h
timeval-utils.h
unique-ptr.h
vtv-change-permission.h
xregex2.h
xregex.h
xtensa-config.h