diff options
author | Cesar Philippidis <cesar@codesourcery.com> | 2015-11-05 18:03:48 -0800 |
---|---|---|
committer | Cesar Philippidis <cesar@gcc.gnu.org> | 2015-11-05 18:03:48 -0800 |
commit | 7a5e4956cc026cba54159d5c764486ac4151db85 (patch) | |
tree | 2f50525608c6a6a2a595620ad902d2efc85ab031 /gcc/c-family | |
parent | 906f9ad995368b4891186c07ed3c5c2fd5f53bea (diff) | |
download | gcc-7a5e4956cc026cba54159d5c764486ac4151db85.zip gcc-7a5e4956cc026cba54159d5c764486ac4151db85.tar.gz gcc-7a5e4956cc026cba54159d5c764486ac4151db85.tar.bz2 |
gimplify.c (gimplify_scan_omp_clauses): Add support for OMP_CLAUSE_TILE.
gcc/
* gimplify.c (gimplify_scan_omp_clauses): Add support for
OMP_CLAUSE_TILE. Update handling of OMP_CLAUSE_INDEPENDENT.
(gimplify_adjust_omp_clauses): Likewise.
* omp-low.c (scan_sharing_clauses): Add support for OMP_CLAUSE_TILE.
* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_TILE.
* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_TILE.
* tree.c (omp_clause_num_ops): Add an entry for OMP_CLAUSE_TILE.
(omp_clause_code_name): Likewise.
(walk_tree_1): Handle OMP_CLAUSE_TILE.
* tree.h (OMP_TILE_LIST): New macro.
gcc/c-family/
* c-omp.c (c_oacc_split_loop_clauses): Make TILE, GANG, WORKER, VECTOR,
AUTO, SEQ, INDEPENDENT and PRIVATE loop clauses. Associate REDUCTION
clauses with parallel and kernels and loops.
* c-pragma.h (enum pragma_omp_clause): Add entries for
PRAGMA_OACC_CLAUSE_{INDEPENDENT,TILE,DEFAULT}.
* pt.c (tsubst_omp_clauses): Add support for OMP_CLAUSE_{NUM_GANGS,
NUM_WORKERS,VECTOR_LENGTH,GANG,WORKER,VECTOR,ASYNC,WAIT,TILE,AUTO,
INDEPENDENT,SEQ}.
(tsubst_expr): Add support for OMP_CLAUSE_{KERNELS,PARALLEL,LOOP}.
gcc/c/
* c-parser.c (c_parser_omp_clause_name): Add support for
PRAGMA_OACC_CLAUSE_INDEPENDENT and PRAGMA_OACC_CLAUSE_TILE.
(c_parser_omp_clause_default): Add is_oacc argument. Handle
default(none) in OpenACC.
(c_parser_oacc_shape_clause): Allow pointer variables as gang static
arguments.
(c_parser_oacc_clause_tile): New function.
(c_parser_oacc_all_clauses): Add support for OMP_CLAUSE_DEFAULT,
OMP_CLAUSE_INDEPENDENT and OMP_CLAUSE_TILE.
(OACC_LOOP_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_{PRIVATE,INDEPENDENT,
TILE}.
(OACC_KERNELS_MASK): Add PRAGMA_OACC_CLAUSE_DEFAULT.
(OACC_PARALLEL_MASK): Add PRAGMA_OACC_CLAUSE_{DEFAULT,PRIVATE,
FIRSTPRIVATE}.
(c_parser_omp_all_clauses): Update call to c_parser_omp_clause_default.
(c_parser_oacc_update): Update the error message for missing clauses.
* c-typeck.c (c_finish_omp_clauses): Add support for OMP_CLAUSE_TILE
and OMP_CLAUSE_INDEPENDENT.
gcc/cp/
* parser.c (cp_parser_omp_clause_name): Add support for
PRAGMA_OACC_CLAUSE_INDEPENDENT and PRAGMA_OACC_CLAUSE_TILE.
(cp_parser_oacc_shape_clause): Allow pointer variables as gang static
arguments.
(cp_parser_oacc_clause_tile): New function.
(cp_parser_omp_clause_default): Add is_oacc argument. Handle
default(none) in OpenACC.
(cp_parser_oacc_all_clauses): Add support for
(cp_parser_omp_all_clauses): Update call to
cp_parser_omp_clause_default.
PRAGMA_OACC_CLAUSE_{DEFAULT,INDEPENDENT,TILE,PRIVATE,FIRSTPRIVATE}.
(OACC_LOOP_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_{PRIVATE,INDEPENDENT,
TILE}.
(OACC_KERNELS_MASK): Add PRAGMA_OACC_CLAUSE_DEFAULT.
(OACC_PARALLEL_MASK): Add PRAGMA_OACC_CLAUSE_{DEFAULT,PRIVATE,
FIRSTPRIVATE}.
(cp_parser_oacc_update): Update the error message for missing clauses.
* semantics.c (finish_omp_clauses): Add support for
OMP_CLAUSE_INDEPENDENT and OMP_CLAUSE_TILE.
gcc/fortran/
* openmp.c (gfc_match_omp_clauses): Update support for the tile
and default clauses in OpenACC.
(gfc_match_oacc_update): Error when data clauses are supplied.
(oacc_compatible_clauses): Delete.
(resolve_omp_clauses): Give special care for OpenACC reductions.
Also update error reporting for the tile clause.
(resolve_oacc_loop_blocks): Update error reporting for the tile clause.
* trans-openmp.c (gfc_trans_omp_clauses): Update OMP_CLAUSE_SEQ. Add
OMP_CLAUSE_{AUTO,TILE} and add support the the gang static argument.
(gfc_trans_oacc_combined_directive): Update the list of clauses which
are split to acc loops.
gcc/testsuite/
* c-c++-common/goacc/combined-directives.c: New test.
* c-c++-common/goacc/loop-clauses.c: New test.
* c-c++-common/goacc/tile.c: New test.
* c-c++-common/goacc/loop-shape.c: Add test for pointer variable
as gang static arguments.
* c-c++-common/goacc/update-1.c: Adjust expected error message.
* g++.dg/goacc/template.C: New test.
* gfortran.dg/goacc/combined-directives.f90: New test.
* gfortran.dg/goacc/default.f95: New test.
* gfortran.dg/goacc/default_none.f95: New test.
* gfortran.dg/goacc/firstprivate-1.f95: New test.
* gfortran.dg/goacc/gang-static.f95: New test.
* gfortran.dg/goacc/kernels-loop-inner.f95: New test.
* gfortran.dg/goacc/kernels-loops-adjacent.f95: New test.
* gfortran.dg/goacc/list.f95: Update test.
* gfortran.dg/goacc/loop-2.f95: Likewise.
* gfortran.dg/goacc/loop-4.f95: New test.
* gfortran.dg/goacc/loop-5.f95: New test.
* gfortran.dg/goacc/loop-6.f95: New test.
* gfortran.dg/goacc/loop-tree-1.f90: Update test.
* gfortran.dg/goacc/multi-clause.f90: New test.
* gfortran.dg/goacc/parallel-tree.f95: Update test.
* gfortran.dg/goacc/update.f95: New test.
Co-Authored-By: James Norris <jnorris@codesourcery.com>
Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com>
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
Co-Authored-By: Tom de Vries <tom@codesourcery.com>
From-SVN: r229832
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/c-family/c-omp.c | 19 | ||||
-rw-r--r-- | gcc/c-family/c-pragma.h | 3 |
3 files changed, 34 insertions, 2 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index c21f504..cc9a642 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,17 @@ +2015-11-05 Cesar Philippidis <cesar@codesourcery.com> + Thomas Schwinge <thomas@codesourcery.com> + James Norris <jnorris@codesourcery.com> + + * c-omp.c (c_oacc_split_loop_clauses): Make TILE, GANG, WORKER, VECTOR, + AUTO, SEQ, INDEPENDENT and PRIVATE loop clauses. Associate REDUCTION + clauses with parallel and kernels and loops. + * c-pragma.h (enum pragma_omp_clause): Add entries for + PRAGMA_OACC_CLAUSE_{INDEPENDENT,TILE,DEFAULT}. + * pt.c (tsubst_omp_clauses): Add support for OMP_CLAUSE_{NUM_GANGS, + NUM_WORKERS,VECTOR_LENGTH,GANG,WORKER,VECTOR,ASYNC,WAIT,TILE,AUTO, + INDEPENDENT,SEQ}. + (tsubst_expr): Add support for OMP_CLAUSE_{KERNELS,PARALLEL,LOOP}. + 2015-11-05 Martin Sebor <msebor@redhat.com> PR c++/67942 diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c index a51611c..3e93b59 100644 --- a/gcc/c-family/c-omp.c +++ b/gcc/c-family/c-omp.c @@ -867,7 +867,7 @@ c_omp_check_loop_iv_exprs (location_t stmt_loc, tree declv, tree decl, tree c_oacc_split_loop_clauses (tree clauses, tree *not_loop_clauses) { - tree next, loop_clauses; + tree next, loop_clauses, t; loop_clauses = *not_loop_clauses = NULL_TREE; for (; clauses ; clauses = next) @@ -876,12 +876,27 @@ c_oacc_split_loop_clauses (tree clauses, tree *not_loop_clauses) switch (OMP_CLAUSE_CODE (clauses)) { + /* Loop clauses. */ case OMP_CLAUSE_COLLAPSE: - case OMP_CLAUSE_REDUCTION: + case OMP_CLAUSE_TILE: + case OMP_CLAUSE_GANG: + case OMP_CLAUSE_WORKER: + case OMP_CLAUSE_VECTOR: + case OMP_CLAUSE_AUTO: + case OMP_CLAUSE_SEQ: + case OMP_CLAUSE_INDEPENDENT: + case OMP_CLAUSE_PRIVATE: OMP_CLAUSE_CHAIN (clauses) = loop_clauses; loop_clauses = clauses; break; + /* Reductions belong in both constructs. */ + case OMP_CLAUSE_REDUCTION: + t = copy_node (clauses); + OMP_CLAUSE_CHAIN (t) = loop_clauses; + loop_clauses = t; + + /* Parallel/kernels clauses. */ default: OMP_CLAUSE_CHAIN (clauses) = *not_loop_clauses; *not_loop_clauses = clauses; diff --git a/gcc/c-family/c-pragma.h b/gcc/c-family/c-pragma.h index 69e7392..953c4e3 100644 --- a/gcc/c-family/c-pragma.h +++ b/gcc/c-family/c-pragma.h @@ -153,6 +153,7 @@ enum pragma_omp_clause { PRAGMA_OACC_CLAUSE_DEVICEPTR, PRAGMA_OACC_CLAUSE_GANG, PRAGMA_OACC_CLAUSE_HOST, + PRAGMA_OACC_CLAUSE_INDEPENDENT, PRAGMA_OACC_CLAUSE_NUM_GANGS, PRAGMA_OACC_CLAUSE_NUM_WORKERS, PRAGMA_OACC_CLAUSE_PRESENT, @@ -162,6 +163,7 @@ enum pragma_omp_clause { PRAGMA_OACC_CLAUSE_PRESENT_OR_CREATE, PRAGMA_OACC_CLAUSE_SELF, PRAGMA_OACC_CLAUSE_SEQ, + PRAGMA_OACC_CLAUSE_TILE, PRAGMA_OACC_CLAUSE_VECTOR, PRAGMA_OACC_CLAUSE_VECTOR_LENGTH, PRAGMA_OACC_CLAUSE_WAIT, @@ -169,6 +171,7 @@ enum pragma_omp_clause { PRAGMA_OACC_CLAUSE_COLLAPSE = PRAGMA_OMP_CLAUSE_COLLAPSE, PRAGMA_OACC_CLAUSE_COPYIN = PRAGMA_OMP_CLAUSE_COPYIN, PRAGMA_OACC_CLAUSE_DEVICE = PRAGMA_OMP_CLAUSE_DEVICE, + PRAGMA_OACC_CLAUSE_DEFAULT = PRAGMA_OMP_CLAUSE_DEFAULT, PRAGMA_OACC_CLAUSE_FIRSTPRIVATE = PRAGMA_OMP_CLAUSE_FIRSTPRIVATE, PRAGMA_OACC_CLAUSE_IF = PRAGMA_OMP_CLAUSE_IF, PRAGMA_OACC_CLAUSE_PRIVATE = PRAGMA_OMP_CLAUSE_PRIVATE, |