]> git.ipfire.org Git - thirdparty/gcc.git/commit
builtin-types.def (BT_FN_VOID_BOOL, [...]): New.
authorJakub Jelinek <jakub@redhat.com>
Wed, 7 Nov 2018 19:21:43 +0000 (20:21 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 7 Nov 2018 19:21:43 +0000 (20:21 +0100)
commit0bb1abc55ad30f708911b66727140754424f9af3
tree508ae42ab40c2ff0e4460163797ccf08adce066a
parent5fab271291a0deba6f098116748b4fe1a3c2788f
builtin-types.def (BT_FN_VOID_BOOL, [...]): New.

* builtin-types.def (BT_FN_VOID_BOOL, BT_FN_UINT_UINT_PTR_PTR,
BT_FN_BOOL_UINT_LONGPTR_LONG_LONG_LONGPTR_LONGPTR_PTR_PTR,
BT_FN_BOOL_UINT_ULLPTR_LONG_ULL_ULLPTR_ULLPTR_PTR_PTR,
BT_FN_BOOL_LONG_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR_PTR_PTR,
BT_FN_BOOL_BOOL_ULL_ULL_ULL_LONG_ULL_ULLPTR_ULLPTR_PTR_PTR): New.
* omp-builtins.def (BUILT_IN_GOMP_LOOP_START,
BUILT_IN_GOMP_LOOP_ORDERED_START, BUILT_IN_GOMP_LOOP_DOACROSS_START,
BUILT_IN_GOMP_LOOP_ULL_START, BUILT_IN_GOMP_LOOP_ULL_ORDERED_START,
BUILT_IN_GOMP_LOOP_ULL_DOACROSS_START, BUILT_IN_GOMP_SECTIONS2_START,
BUILT_IN_GOMP_WORKSHARE_TASK_REDUCTION_UNREGISTER): New.
* omp-general.h (struct omp_for_data): Add have_reductemp member.
* omp-general.c (omp_extract_for_data): Initialize it.
* omp-low.c (build_outer_var_ref): Ignore taskgroup outer contexts.
Fix up the condition when lookup_decl should be used.
(scan_sharing_clauses): Call install_var_local for reductions with
task modifier even in worksharing contexts.
(lower_rec_input_clauses): Don't lookup_decl reductemp in worksharing
contexts.  Handle reductions with task modifier in worksharing
contexts.  Ignore _reductemp_ clause in worksharing contexts.
(lower_reduction_clauses): Ignore reduction clause with task modifiers
even in worksharing contexts.
(lower_send_clauses): Likewise.
(maybe_add_implicit_barrier_cancel): Add OMP_RETURN argument, don't
rely that it is the last stmt in body so far.  Ignore outer taskgroup
contexts.
(omp_task_reductions_find_first): Move earlier.
(lower_omp_task_reductions): Add forward declaration.  Handle
OMP_FOR and OMP_SECTIONS, add support for parallel cancellation.
(lower_omp_sections): Handle reduction clauses with taskgroup
modifiers.  Adjust maybe_add_implicit_barrier_cancel caller.
(lower_omp_single): Adjust maybe_add_implicit_barrier_cancel caller.
(lower_omp_for): Likewise.  Handle reduction clauses with taskgroup
modifiers.
* omp-expand.c (omp_adjust_chunk_size): Don't adjust anything if
chunk_size is zero.
(determine_parallel_type): Don't combine parallel with worksharing
which has _reductemp_ clause.
(expand_omp_for_generic): Add SCHED_ARG argument.  Handle expansion
of worksharing loops with task reductions.
(expand_omp_for_static_nochunk): Handle expansion of worksharing
loops with task reductions.
(expand_omp_for_static_chunk): Likewise.
(expand_omp_for): Adjust expand_omp_for_generic caller, use
GOMP_loop{,_ull}{,_ordered,_doacross}_start builtins if there are
task reductions.
(expand_omp_sections): Handle expansion of sections with task
reductions.
gcc/fortran/
* types.def (BT_FN_VOID_BOOL, BT_FN_UINT_UINT_PTR_PTR,
BT_FN_BOOL_UINT_LONGPTR_LONG_LONG_LONGPTR_LONGPTR_PTR_PTR,
BT_FN_BOOL_UINT_ULLPTR_LONG_ULL_ULLPTR_ULLPTR_PTR_PTR,
BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR,
BT_FN_BOOL_LONG_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR_PTR_PTR,
BT_FN_BOOL_BOOL_ULL_ULL_ULL_LONG_ULL_ULLPTR_ULLPTR_PTR_PTR): New.
libgomp/
* libgomp_g.h (GOMP_loop_start, GOMP_loop_ordered_start,
GOMP_loop_doacross_start, GOMP_loop_ull_start,
GOMP_loop_ull_ordered_start, GOMP_loop_ull_doacross_start,
GOMP_workshare_task_reduction_unregister, GOMP_sections2_start): New
prototypes.
* libgomp.h (struct gomp_doacross_work_share): Add extra field.
(struct gomp_work_share): Add task_reductions field.
(struct gomp_taskgroup): Add workshare flag.
(gomp_doacross_init, gomp_doacross_ull_init): Add size_t argument.
(gomp_workshare_taskgroup_start,
gomp_workshare_task_reduction_register): New prototypes.
(gomp_init_work_share, gomp_work_share_start): Change bool argument
to size_t.
* libgomp.map (GOMP_5.0): Export GOMP_loop_start,
GOMP_loop_ordered_start, GOMP_loop_doacross_start,
GOMP_loop_ull_start, GOMP_loop_ull_ordered_start,
GOMP_loop_ull_doacross_start,
GOMP_workshare_task_reduction_unregister and GOMP_sections2_start.
* loop.c: Include string.h.
(GOMP_loop_runtime_next): Add ialias.
(GOMP_taskgroup_reduction_register): Add ialias_redirect.
(gomp_loop_static_start, gomp_loop_dynamic_start,
gomp_loop_guided_start, gomp_loop_ordered_static_start,
gomp_loop_ordered_dynamic_start, gomp_loop_ordered_guided_start,
gomp_loop_doacross_static_start, gomp_loop_doacross_dynamic_start,
gomp_loop_doacross_guided_start): Adjust gomp_work_share_start
or gomp_doacross_init callers.
(gomp_adjust_sched, GOMP_loop_start, GOMP_loop_ordered_start,
GOMP_loop_doacross_start): New functions.
* loop_ull.c: Include string.h.
(GOMP_loop_ull_runtime_next): Add ialias.
(GOMP_taskgroup_reduction_register): Add ialias_redirect.
(gomp_loop_ull_static_start, gomp_loop_ull_dynamic_start,
gomp_loop_ull_guided_start, gomp_loop_ull_ordered_static_start,
gomp_loop_ull_ordered_dynamic_start,
gomp_loop_ull_ordered_guided_start,
gomp_loop_ull_doacross_static_start,
gomp_loop_ull_doacross_dynamic_start,
gomp_loop_ull_doacross_guided_start): Adjust gomp_work_share_start
and gomp_doacross_ull_init callers.
(gomp_adjust_sched, GOMP_loop_ull_start, GOMP_loop_ull_ordered_start,
GOMP_loop_ull_doacross_start): New functions.
* sections.c: Include string.h.
(GOMP_taskgroup_reduction_register): Add ialias_redirect.
(GOMP_sections_start): Adjust gomp_work_share_start caller.
(GOMP_sections2_start): New function.
* ordered.c (gomp_doacross_init, gomp_doacross_ull_init): Add
EXTRA argument.  If not needed to prepare array, if extra is 0,
clear ws->doacross, otherwise allocate just doacross structure and
extra payload.  If array is needed, allocate also extra payload.
(GOMP_doacross_post, GOMP_doacross_wait, GOMP_doacross_ull_post,
GOMP_doacross_ull_wait): Handle doacross->array == NULL like
doacross == NULL.
* parallel.c (GOMP_cancellation_point): If taskgroup has workshare
flag set, check cancelled of prev taskgroup if any.
(GOMP_cancel): If taskgroup has workshare flag set, set cancelled
on prev taskgroup if any.
* single.c (GOMP_single_start, GOMP_single_copy_start): Adjust
gomp_work_share_start callers.
* target.c (GOMP_target_update_ext, GOMP_target_enter_exit_data):
If taskgroup has workshare flag set, check cancelled on prev
taskgroup if any.  Guard all cancellation tests with
gomp_cancel_var test.
* taskloop.c (GOMP_taskloop): Likewise.
* task.c (GOMP_task, gomp_create_target_task, gomp_task_run_pre,
GOMP_taskwait_depend): Likewise.
(gomp_taskgroup_init): Clear workshare flag, reorder initialization.
(gomp_reduction_register): Add always_inline attribute.  Add
ORIG argument, if non-NULL, don't allocate memory, but copy it
from there.
(gomp_create_artificial_team): New function.
(GOMP_taskgroup_reduction_register): Extend function comment.
Use gomp_create_artificial_team.  Adjust gomp_reduction_register
caller.
(gomp_parallel_reduction_register): Adjust gomp_reduction_register
caller.
(gomp_workshare_task_reduction_register,
gomp_workshare_taskgroup_start,
GOMP_workshare_task_reduction_unregister): New functions.
* team.c (gomp_new_team): Adjust gomp_init_work_share caller.
* work.c (gomp_init_work_share): Change ORDERED argument from
bool to size_t, if more than 1 allocate also extra payload at the
end of array.  Never keep ordered_team_ids NULL, set it
to inline_ordered_team_ids instead.
(gomp_work_share_start): Change ORDERED argument from bool to size_t,
return true instead of ws.
* testsuite/libgomp.c-c++-common/cancel-parallel-1.c: New test.
* testsuite/libgomp.c-c++-common/cancel-taskgroup-3.c: New test.
* testsuite/libgomp.c-c++-common/task-reduction-6.c (struct S):
Use unsigned long long int instead of unsigned long int.
(main): Verify r == t.
* testsuite/libgomp.c-c++-common/task-reduction-8.c: New test.
* testsuite/libgomp.c-c++-common/task-reduction-9.c: New test.
* testsuite/libgomp.c-c++-common/task-reduction-11.c: New test.
* testsuite/libgomp.c-c++-common/task-reduction-12.c: New test.
* testsuite/libgomp.c++/task-reduction-14.C: New test.
* testsuite/libgomp.c++/task-reduction-15.C: New test.
* testsuite/libgomp.c++/task-reduction-16.C: New test.
* testsuite/libgomp.c++/task-reduction-17.C: New test.
* testsuite/libgomp.c++/task-reduction-18.C: New test.
* testsuite/libgomp.c++/task-reduction-19.C: New test.

From-SVN: r265885
37 files changed:
gcc/ChangeLog.gomp
gcc/builtin-types.def
gcc/fortran/ChangeLog.gomp
gcc/fortran/types.def
gcc/omp-builtins.def
gcc/omp-expand.c
gcc/omp-general.c
gcc/omp-general.h
gcc/omp-low.c
libgomp/ChangeLog.gomp
libgomp/libgomp.h
libgomp/libgomp.map
libgomp/libgomp_g.h
libgomp/loop.c
libgomp/loop_ull.c
libgomp/ordered.c
libgomp/parallel.c
libgomp/sections.c
libgomp/single.c
libgomp/target.c
libgomp/task.c
libgomp/taskloop.c
libgomp/team.c
libgomp/testsuite/libgomp.c++/task-reduction-14.C [new file with mode: 0644]
libgomp/testsuite/libgomp.c++/task-reduction-15.C [new file with mode: 0644]
libgomp/testsuite/libgomp.c++/task-reduction-16.C [new file with mode: 0644]
libgomp/testsuite/libgomp.c++/task-reduction-17.C [new file with mode: 0644]
libgomp/testsuite/libgomp.c++/task-reduction-18.C [new file with mode: 0644]
libgomp/testsuite/libgomp.c++/task-reduction-19.C [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/cancel-parallel-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/cancel-taskgroup-3.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/task-reduction-11.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/task-reduction-12.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/task-reduction-6.c
libgomp/testsuite/libgomp.c-c++-common/task-reduction-8.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/task-reduction-9.c [new file with mode: 0644]
libgomp/work.c