gcc/gcc/cp
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-1993
ChangeLog-1994
ChangeLog-1995
ChangeLog-1996
ChangeLog-1997
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020
ChangeLog-2021 Rotate ChangeLog files - part 1 - add ChangeLog-2021. 2022-01-03 10:18:16 +01:00
ChangeLog.ptr
ChangeLog.tree-ssa
Make-lang.in Change references of .c files to .cc files 2022-01-17 22:12:07 +01:00
call.cc c++: constexpr init of union sub-aggr w/ base [PR105491] 2022-05-09 09:53:27 -04:00
cfns.gperf Update copyright years. 2022-01-03 10:42:10 +01:00
cfns.h Update copyright years. 2022-01-03 10:42:10 +01:00
class.cc c++: constexpr init of union sub-aggr w/ base [PR105491] 2022-05-09 09:53:27 -04:00
config-lang.in Change references of .c files to .cc files 2022-01-17 22:12:07 +01:00
constexpr.cc Make gimple_build main workers more flexible 2022-05-13 08:18:33 +02:00
constraint.cc tree: introduce range adaptor for TREE_VEC 2022-05-11 16:14:59 -04:00
coroutines.cc c++: Remove SET_PACK_EXPANSION_PATTERN / SET_ARGUMENT_PACK_ARGS 2022-05-10 11:52:29 -04:00
cp-gimplify.cc c++: constexpr init of union sub-aggr w/ base [PR105491] 2022-05-09 09:53:27 -04:00
cp-lang.cc Update per-file selftest and finalization hooks for .c to .cc renaming 2022-01-19 11:33:53 -05:00
cp-name-hint.h Update copyright years. 2022-01-03 10:42:10 +01:00
cp-objcp-common.cc c++: Handle __builtin_clear_padding on non-trivially-copyable types [PR102586] 2022-04-07 09:14:07 +02:00
cp-objcp-common.h c++: Handle __builtin_clear_padding on non-trivially-copyable types [PR102586] 2022-04-07 09:14:07 +02:00
cp-tree.def c++: Remove SET_PACK_EXPANSION_PATTERN / SET_ARGUMENT_PACK_ARGS 2022-05-10 11:52:29 -04:00
cp-tree.h c++: tighten TMPL_ARGS_LEVEL macro 2022-05-12 16:52:06 -04:00
cp-ubsan.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
cvt.cc Fix up duplicated duplicated words in comments 2022-03-07 15:00:20 +01:00
cxx-pretty-print.cc openmp: Add support for inoutset depend-kind 2022-05-17 15:40:27 +02:00
cxx-pretty-print.h Update copyright years. 2022-01-03 10:42:10 +01:00
decl.cc [c++] Add module attachment 2022-05-11 06:38:19 -07:00
decl.h Update copyright years. 2022-01-03 10:42:10 +01:00
decl2.cc c++: reorganize friend template matching [PR91618] 2022-04-29 17:25:03 -04:00
dump.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
error.cc c++: add color to function decl printing 2022-05-06 16:34:51 -04:00
except.cc c++: non-constant non-dependent decltype folding [PR104823] 2022-03-09 08:42:37 -05:00
expr.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
friend.cc c++: hidden friend access [DR1699] 2022-05-15 12:43:30 -04:00
g++spec.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
init.cc c++: array {}-init [PR105589] 2022-05-15 05:45:06 -04:00
lambda.cc c++: constexpr init of union sub-aggr w/ base [PR105491] 2022-05-09 09:53:27 -04:00
lang-specs.h opts: do not allow Separate+Joined ending with = 2022-05-11 08:55:19 +02:00
lex.cc openmp: Add omp_all_memory support (C/C++ only so far) 2022-05-12 08:31:20 +02:00
logic.cc Update copyright years. 2022-01-03 10:42:10 +01:00
mangle.cc c++: Local symbols do not get module manglings 2022-05-13 07:18:52 -07:00
mapper-client.cc Update copyright years. 2022-01-03 10:42:10 +01:00
mapper-client.h Update copyright years. 2022-01-03 10:42:10 +01:00
mapper-resolver.cc Update copyright years. 2022-01-03 10:42:10 +01:00
method.cc c++: constexpr init of union sub-aggr w/ base [PR105491] 2022-05-09 09:53:27 -04:00
module.cc Use more ARRAY_SIZE. 2022-05-16 10:38:46 +02:00
name-lookup.cc Use more ARRAY_SIZE. 2022-05-16 10:38:46 +02:00
name-lookup.h [c++] Add module attachment 2022-05-11 06:38:19 -07:00
operators.def Update copyright years. 2022-01-03 10:42:10 +01:00
optimize.cc c++: fix arm-eabi crash building libstdc++ [PR105529] 2022-05-10 01:05:51 -04:00
parser.cc openmp: Add support for inoutset depend-kind 2022-05-17 15:40:27 +02:00
parser.h Change references of .c files to .cc files 2022-01-17 22:12:07 +01:00
pt.cc OpenMP, C++: Add template support for the has_device_addr clause. 2022-05-16 01:02:50 -07:00
ptree.cc [c++] Add module attachment 2022-05-11 06:38:19 -07:00
rtti.cc c++: typeid and instantiation [PR102651] 2022-04-28 22:59:10 -04:00
search.cc c++: hidden friend access [DR1699] 2022-05-15 12:43:30 -04:00
semantics.cc OpenMP, C++: Add template support for the has_device_addr clause. 2022-05-16 01:02:50 -07:00
tree.cc tree: introduce range adaptor for TREE_VEC 2022-05-11 16:14:59 -04:00
type-utils.h Update copyright years. 2022-01-03 10:42:10 +01:00
typeck.cc c++: fix arm-eabi bootstrap [PR105567] 2022-05-11 13:50:39 -04:00
typeck2.cc c++: constexpr init of union sub-aggr w/ base [PR105491] 2022-05-09 09:53:27 -04:00
vtable-class-hierarchy.cc Change references of .c files to .cc files 2022-01-17 22:12:07 +01:00