gcc/gcc/c-family
Jakub Jelinek 2c16eb3157 openmp: Add support for inoutset depend-kind
This patch adds support for inoutset depend-kind in depend
clauses.  It is very similar to the in depend-kind in that
a task with a dependency with that depend-kind is dependent
on all previously created sibling tasks with matching address
unless they have the same depend-kind.
In the in depend-kind case everything is dependent except
for in -> in dependency, for inoutset everything is
dependent except for inoutset -> inoutset dependency.
mutexinoutset is also similar (everything is dependent except
for mutexinoutset -> mutexinoutset dependency), but there is
also the additional restriction that only one task with
mutexinoutset for each address can be scheduled at once (i.e.
mutual exclusitivty).  For now we support mutexinoutset
the same as inout/out, but the inoutset support is full.

In order not to bump the ABI for dependencies each time
(we've bumped it already once, the old ABI supports only
inout/out and in depend-kind, the new ABI supports
inout/out, mutexinoutset, in and depobj), this patch arranges
for inoutset to be at least for the time being always handled
as if it was specified through depobj even when it is not.
So it uses the new ABI for that and inoutset are represented
like depobj - pointer to a pair of pointers where the first one
will be the actual address of the object mentioned in depend
clause and second pointer will be (void *) GOMP_DEPEND_INOUTSET.

2022-05-17  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* tree-core.h (enum omp_clause_depend_kind): Add
	OMP_CLAUSE_DEPEND_INOUTSET.
	* tree-pretty-print.cc (dump_omp_clause): Handle
	OMP_CLAUSE_DEPEND_INOUTSET.
	* gimplify.cc (gimplify_omp_depend): Likewise.
	* omp-low.cc (lower_depend_clauses): Likewise.
gcc/c-family/
	* c-omp.cc (c_finish_omp_depobj): Handle
	OMP_CLAUSE_DEPEND_INOUTSET.
gcc/c/
	* c-parser.cc (c_parser_omp_clause_depend): Parse
	inoutset depend-kind.
	(c_parser_omp_depobj): Likewise.
gcc/cp/
	* parser.cc (cp_parser_omp_clause_depend): Parse
	inoutset depend-kind.
	(cp_parser_omp_depobj): Likewise.
	* cxx-pretty-print.cc (cxx_pretty_printer::statement): Handle
	OMP_CLAUSE_DEPEND_INOUTSET.
gcc/testsuite/
	* c-c++-common/gomp/all-memory-1.c (boo): Add test with
	inoutset depend-kind.
	* c-c++-common/gomp/all-memory-2.c (boo): Likewise.
	* c-c++-common/gomp/depobj-1.c (f1): Likewise.
	(f2): Adjusted expected diagnostics.
	* g++.dg/gomp/depobj-1.C (f4): Adjust expected diagnostics.
include/
	* gomp-constants.h (GOMP_DEPEND_INOUTSET): Define.
libgomp/
	* libgomp.h (struct gomp_task_depend_entry): Change is_in type
	from bool to unsigned char.
	* task.c (gomp_task_handle_depend): Handle GOMP_DEPEND_INOUTSET.
	Ignore dependencies where
	task->depend[i].is_in && task->depend[i].is_in == ent->is_in
	rather than just task->depend[i].is_in && ent->is_in.  Remember
	whether GOMP_DEPEND_IN loop is needed and guard the loop with that
	conditional.
	(gomp_task_maybe_wait_for_dependencies): Handle GOMP_DEPEND_INOUTSET.
	Ignore dependencies where elem.is_in && elem.is_in == ent->is_in
	rather than just elem.is_in && ent->is_in.
	* testsuite/libgomp.c-c++-common/depend-1.c (test): Add task with
	inoutset depend-kind.
	* testsuite/libgomp.c-c++-common/depend-2.c (test): Likewise.
	* testsuite/libgomp.c-c++-common/depend-3.c (test): Likewise.
	* testsuite/libgomp.c-c++-common/depend-inoutset-1.c: New test.
2022-05-17 15:40:27 +02:00
..
ChangeLog Daily bump. 2022-05-17 00:16:28 +00:00
ChangeLog.gimple-classes
c-ada-spec.cc Fix issue for pointers to anonymous types with -fdump-ada-spec 2022-03-25 12:37:01 +01:00
c-ada-spec.h Change references of .c files to .cc files 2022-01-17 22:12:07 +01:00
c-attribs.cc attribs: fix typedefs in generic code [PR105492] 2022-05-16 17:32:46 -04:00
c-common.cc Use more ARRAY_SIZE. 2022-05-16 10:38:46 +02:00
c-common.def Update copyright years. 2022-01-03 10:42:10 +01:00
c-common.h openmp: Add omp_all_memory support (C/C++ only so far) 2022-05-12 08:31:20 +02:00
c-cppbuiltin.cc c++: P2493 feature test macro updates 2022-02-09 09:41:01 -05:00
c-dump.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
c-format.cc Use more ARRAY_SIZE. 2022-05-16 10:38:46 +02:00
c-format.h Update copyright years. 2022-01-03 10:42:10 +01:00
c-gimplify.cc Enable match.pd dumping with -fdump-tree-original 2022-05-09 09:43:08 +01:00
c-indentation.cc Update per-file selftest and finalization hooks for .c to .cc renaming 2022-01-19 11:33:53 -05:00
c-indentation.h Change references of .c files to .cc files 2022-01-17 22:12:07 +01:00
c-lex.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
c-objc.h Change references of .c files to .cc files 2022-01-17 22:12:07 +01:00
c-omp.cc openmp: Add support for inoutset depend-kind 2022-05-17 15:40:27 +02:00
c-opts.cc opts: do not allow Separate+Joined ending with = 2022-05-11 08:55:19 +02:00
c-pch.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
c-ppoutput.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
c-pragma.cc Use more ARRAY_SIZE. 2022-05-16 10:38:46 +02:00
c-pragma.h C, C++, Fortran, OpenMP: Add 'has_device_addr' clause to 'target' construct. 2022-02-09 23:47:12 -08:00
c-pretty-print.cc c-family: Fix up ICE during pretty-printing of PMF related expression [PR101515] 2022-03-19 08:40:47 +01:00
c-pretty-print.h Change references of .c files to .cc files 2022-01-17 22:12:07 +01:00
c-semantics.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
c-spellcheck.cc Update copyright years. 2022-01-03 10:42:10 +01:00
c-spellcheck.h Update copyright years. 2022-01-03 10:42:10 +01:00
c-target-def.h Update copyright years. 2022-01-03 10:42:10 +01:00
c-target.def texi + c-target.def: Fix typos 2022-03-13 10:23:07 +01:00
c-target.h Update copyright years. 2022-01-03 10:42:10 +01:00
c-ubsan.cc c, c++, c-family: -Wshift-negative-value and -Wshift-overflow* tweaks for -fwrapv and C++20+ [PR104711] 2022-03-09 09:15:28 +01:00
c-ubsan.h Update copyright years. 2022-01-03 10:42:10 +01:00
c-warn.cc c-family: Tweak -Woverflow diagnostic 2022-05-04 16:10:09 -04:00
c.opt opts: do not allow Separate+Joined ending with = 2022-05-11 08:55:19 +02:00
cppspec.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
known-headers.cc Use more ARRAY_SIZE. 2022-05-16 10:38:46 +02:00
known-headers.h Update copyright years. 2022-01-03 10:42:10 +01:00
name-hint.h Update copyright years. 2022-01-03 10:42:10 +01:00
stub-objc.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00