Hi Bernd! On Mon, 1 Jun 2015 17:58:51 +0200, Bernd Schmidt wrote: > This extends the previous vector-single support to also handle > worker-level predication. Thanks! > --- gcc/omp-low.c (revision 223974) > +++ gcc/omp-low.c (working copy) > +/* Allocate storage for OpenACC worker threads in CTX to broadcast > + condition results. CLAUSES are the clauses of the parallel construct. */ > + > +static void > +oacc_alloc_broadcast_storage (omp_context *ctx, tree clauses) > +{ > + tree vull_type_node = build_qualified_type (long_long_unsigned_type_node, > + TYPE_QUAL_VOLATILE); > + tree uptr_node = build_pointer_type (vull_type_node); > + > + tree clause = find_omp_clause (clauses, OMP_CLAUSE_NUM_WORKERS); > + tree host_count = integer_one_node; > + if (clause) > + host_count = OMP_CLAUSE_NUM_WORKERS_EXPR (clause); > + > + ctx->worker_sync_elt > + = alloc_var_ganglocal (NULL_TREE, long_long_unsigned_type_node, > + ctx, TYPE_SIZE_UNIT (long_long_unsigned_type_node)); > +} > @@ -12503,7 +12673,10 @@ lower_omp_target (gimple_stmt_iterator * > orlist = NULL; > > if (is_gimple_omp_oacc (stmt)) > - oacc_init_count_vars (ctx, clauses); > + { > + oacc_init_count_vars (ctx, clauses); > + oacc_alloc_broadcast_storage (ctx, clauses); > + } > > if (has_reduction) > { A few warnings/errors resulting in bootstrap failures. Not yet committed -- probably you meant to do something with host_count? commit f0a9e05f8b16436767e4f899580b8f3e753d228f Author: Thomas Schwinge Date: Tue Jun 2 12:07:35 2015 +0200 Resolve bootstrap failures ... introduced in r223989. [...]/source-gcc/gcc/omp-low.c: In function 'void oacc_alloc_broadcast_storage(omp_context*, tree)': [...]/source-gcc/gcc/omp-low.c:9412:8: error: unused variable 'uptr_node' [-Werror=unused-variable] tree uptr_node = build_pointer_type (vull_type_node); ^ [...]/source-gcc/gcc/omp-low.c:9415:8: error: variable 'host_count' set but not used [-Werror=unused-but-set-variable] tree host_count = integer_one_node; ^ [...]/source-gcc/gcc/omp-low.c: In function 'void predicate_bb(basic_block, omp_region*, int)': [...]/source-gcc/gcc/omp-low.c:10462:16: error: unused variable 'adjust_bb_ptr' [-Werror=unused-variable] basic_block *adjust_bb_ptr = NULL; ^ --- gcc/omp-low.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git gcc/omp-low.c gcc/omp-low.c index 01e5d4b..ace9e24 100644 --- gcc/omp-low.c +++ gcc/omp-low.c @@ -9405,17 +9405,8 @@ expand_omp_atomic (struct omp_region *region) condition results. CLAUSES are the clauses of the parallel construct. */ static void -oacc_alloc_broadcast_storage (omp_context *ctx, tree clauses) +oacc_alloc_broadcast_storage (omp_context *ctx) { - tree vull_type_node = build_qualified_type (long_long_unsigned_type_node, - TYPE_QUAL_VOLATILE); - tree uptr_node = build_pointer_type (vull_type_node); - - tree clause = find_omp_clause (clauses, OMP_CLAUSE_NUM_WORKERS); - tree host_count = integer_one_node; - if (clause) - host_count = OMP_CLAUSE_NUM_WORKERS_EXPR (clause); - ctx->worker_sync_elt = alloc_var_ganglocal (NULL_TREE, long_long_unsigned_type_node, ctx, TYPE_SIZE_UNIT (long_long_unsigned_type_node)); @@ -10459,7 +10450,6 @@ predicate_bb (basic_block bb, struct omp_region *parent, int mask) return; basic_block skip_dest_bb = NULL; - basic_block *adjust_bb_ptr = NULL; if (gimple_code (stmt) == GIMPLE_OMP_ENTRY_END) return; @@ -12675,7 +12665,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) if (is_gimple_omp_oacc (stmt)) { oacc_init_count_vars (ctx, clauses); - oacc_alloc_broadcast_storage (ctx, clauses); + oacc_alloc_broadcast_storage (ctx); } if (has_reduction) Grüße, Thomas