diff options
Diffstat (limited to 'gcc/tree-parloops.c')
-rw-r--r-- | gcc/tree-parloops.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 6ce9d84..f826154 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -2040,19 +2040,20 @@ create_parallel_loop (struct loop *loop, tree loop_fn, tree data, tree cvar, cvar_init, initvar, cvar_next, cvar_base, type; edge exit, nexit, guard, end, e; - /* Prepare the GIMPLE_OMP_PARALLEL statement. */ if (oacc_kernels_p) { gcc_checking_assert (lookup_attribute ("oacc kernels", DECL_ATTRIBUTES (cfun->decl))); - - tree clause = build_omp_clause (loc, OMP_CLAUSE_NUM_GANGS); - OMP_CLAUSE_NUM_GANGS_EXPR (clause) - = build_int_cst (integer_type_node, n_threads); - oacc_set_fn_attrib (cfun->decl, clause, NULL); + /* Indicate to later processing that this is a parallelized OpenACC + kernels construct. */ + DECL_ATTRIBUTES (cfun->decl) + = tree_cons (get_identifier ("oacc kernels parallelized"), + NULL_TREE, DECL_ATTRIBUTES (cfun->decl)); } else { + /* Prepare the GIMPLE_OMP_PARALLEL statement. */ + basic_block bb = loop_preheader_edge (loop)->src; basic_block paral_bb = single_pred (bb); gsi = gsi_last_bb (paral_bb); @@ -2154,7 +2155,8 @@ create_parallel_loop (struct loop *loop, tree loop_fn, tree data, /* Emit GIMPLE_OMP_FOR. */ if (oacc_kernels_p) - /* In combination with the NUM_GANGS on the parallel. */ + /* Parallelized OpenACC kernels constructs use gang parallelism. See also + omp-offload.c:execute_oacc_device_lower. */ t = build_omp_clause (loc, OMP_CLAUSE_GANG); else { |