OpenACC: Basic support for #pragma acc parallel.
commit790a3f92963afe0ceff99fac6f8fac7b987f57df
authortschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Nov 2013 16:50:04 +0000 (7 16:50 +0000)
committertschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Nov 2013 16:50:04 +0000 (7 16:50 +0000)
tree70d55c953dc7727e28276943e6c22b49d1e6690c
parent901292719008d9fdc60ee537a6b6357929503185
OpenACC: Basic support for #pragma acc parallel.

gcc/c-family/
* c-pragma.h (pragma_kind): Add PRAGMA_OACC_PARALLEL.
* c-pragma.c (oacc_pragmas): Add "parallel".
gcc/c/
* c-parser.c (c_parser_omp_structured_block): Update comment.
(c_parser_oacc_parallel): New function.
(c_parser_omp_construct): Handle PRAGMA_OACC_PARALLEL.

gcc/
* tree.def (OACC_PARALLEL): New code.
* doc/generic.texi (OpenMP): Document it.
* tree.h (OMP_BODY, OMP_CLAUSES): Include it.
(OACC_PARALLEL_BODY, OACC_PARALLEL_CLAUSES): New macros.
* tree-pretty-print.c (dump_generic_node): Handle OACC_PARALLEL.
gcc/c/
* c-tree.h (c_finish_oacc_parallel): New declaration.
* c-typeck.c (c_finish_oacc_parallel): New function.
gcc/c-family/
* c-omp.c (c_omp_split_clauses): Catch OACC_PARALLEL.

gcc/
* gimple.def (GIMPLE_OACC_PARALLEL): New code.
* doc/gimple.texi: Document it.
* gimple.h (gimple_build_oacc_parallel): New declaration.
(gimple_oacc_parallel_clauses, gimple_oacc_parallel_clauses_ptr)
(gimple_oacc_parallel_set_clauses, gimple_oacc_parallel_child_fn)
(gimple_oacc_parallel_child_fn_ptr)
(gimple_oacc_parallel_set_child_fn, gimple_oacc_parallel_data_arg)
(gimple_oacc_parallel_data_arg_ptr)
(gimple_oacc_parallel_set_data_arg): New inline functions.
(CASE_GIMPLE_OMP): Add GIMPLE_OACC_PARALLEL.
* gimple.c (gimple_build_oacc_parallel): New function.
(walk_gimple_op, walk_gimple_stmt, gimple_copy): Handle
GIMPLE_OACC_PARALLEL.
* gimplify.c (is_gimple_stmt): Handle GIMPLE_OACC_PARALLEL.
(gimplify_oacc_parallel): New function.
(gimplify_expr): Handle OACC_PARALLEL.
* cgraphbuild.c (build_cgraph_edges): Handle GIMPLE_OACC_PARALLEL.
* gimple-low.c (lower_stmt): Likewise.
* gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
(dump_gimple_oacc_parallel): New function.
* oacc-builtins.def (BUILT_IN_GOACC_PARALLEL): New macro.
* omp-low.c (scan_oacc_parallel, expand_oacc_parallel)
(lower_oacc_parallel): New functions.
(use_pointer_for_field, build_outer_var_ref, scan_sharing_clauses)
(create_omp_child_function, check_omp_nesting_restrictions)
(scan_omp_1_stmt, lower_rec_simd_input_clauses)
(lower_lastprivate_clauses, lower_reduction_clauses)
(lower_copyprivate_clauses, lower_send_clauses)
(lower_send_shared_vars, expand_omp)
(maybe_add_implicit_barrier_cancel, create_task_copyfn)
(lower_omp_1, make_gimple_omp_edges): Handle GIMPLE_OACC_PARALLEL,
or catch it.
* tree-inline.c (remap_gimple_stmt): Likewise.
* tree-nested.c (convert_nonlocal_reference_stmt)
(convert_local_reference_stmt, convert_tramp_reference_stmt)
(convert_gimple_call): Likewise.
gcc/testsuite/
* c-c++-common/goacc-gomp/nesting-fail-1.c: New file.
* c-c++-common/goacc/nesting-fail-1.c: Likewise.
* c-c++-common/goacc/parallel-1.c: Likewise.
* c-c++-common/goacc/parallel-fail-1.c: Likewise.

libgomp/
* oacc-parallel.c: New file.
* Makefile.am (libgomp_la_SOURCES): Add it.
* Makefile.in: Regenerate.
* libgomp.map (GOACC_2.0): Add GOACC_parallel.
* libgomp_g.h (GOACC_parallel): New declaration.
* testsuite/libgomp.oacc-c/goacc_parallel.c: New file.
* testsuite/libgomp.oacc-c/parallel-1.c: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@204532 138bc75d-0d04-0410-961f-82ee72b054a4
38 files changed:
gcc/ChangeLog.gomp
gcc/c-family/ChangeLog.gomp
gcc/c-family/c-omp.c
gcc/c-family/c-pragma.c
gcc/c-family/c-pragma.h
gcc/c/ChangeLog.gomp
gcc/c/c-parser.c
gcc/c/c-tree.h
gcc/c/c-typeck.c
gcc/cgraphbuild.c
gcc/doc/generic.texi
gcc/doc/gimple.texi
gcc/gimple-low.c
gcc/gimple-pretty-print.c
gcc/gimple.c
gcc/gimple.def
gcc/gimple.h
gcc/gimplify.c
gcc/oacc-builtins.def
gcc/omp-low.c
gcc/testsuite/ChangeLog.gomp
gcc/testsuite/c-c++-common/goacc-gomp/nesting-fail-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/goacc/parallel-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/goacc/parallel-fail-1.c [new file with mode: 0644]
gcc/tree-inline.c
gcc/tree-nested.c
gcc/tree-pretty-print.c
gcc/tree.def
gcc/tree.h
libgomp/ChangeLog.gomp
libgomp/Makefile.am
libgomp/Makefile.in
libgomp/libgomp.map
libgomp/libgomp_g.h
libgomp/oacc-parallel.c [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-c/goacc_parallel.c [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-c/parallel-1.c [new file with mode: 0644]