Hi Casar!

Can you please help me trying to understand the following change, that
you've done a long time ago:

On Tue, 8 Jul 2014 07:28:24 -0700, Cesar Philippidis 
<cesar_philippi...@mentor.com> wrote:
> On 07/07/2014 02:55 AM, Thomas Schwinge wrote:
> 
> > On Sun, 6 Jul 2014 16:10:56 -0700, Cesar Philippidis 
> > <cesar_philippi...@mentor.com> wrote:
> >> This patch is the first step to enabling parallel reductions in openacc.

> --- a/gcc/omp-low.c
> +++ b/gcc/omp-low.c

> @@ -1750,7 +1808,16 @@ scan_sharing_clauses (tree clauses, omp_context *ctx)
>                     && TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
>                   install_var_field (decl, true, 7, ctx);
>                 else
> -                 install_var_field (decl, true, 3, ctx);
> +                 {
> +                   if (!is_gimple_omp_oacc_specifically (ctx->stmt))
> +                     install_var_field (decl, true, 3, ctx);
> +                   else
> +                 {
> +                   /* decl goes heres.  */
> +                   omp_context *c = (ctx->field_map ? ctx : ctx->outer);
> +                   install_var_field (decl, true, 3, c);
> +                 }
> +                 }
>                 if (is_gimple_omp_offloaded (ctx->stmt))
>                   install_var_local (decl, ctx);
>               }

Writing your change differently, easier to read:

                      if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
                          && OMP_CLAUSE_MAP_KIND (c) == OMP_CLAUSE_MAP_POINTER
                          && !OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION (c)
                          && TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
                        install_var_field (decl, true, 7, ctx);
    +                 else if (is_gimple_omp_oacc_specifically (ctx->stmt))
    +                   {
    +                     /* decl goes heres.  */
    +                     omp_context *c = (ctx->field_map ? ctx : ctx->outer);
    +                     install_var_field (decl, true, 3, c);
    +                   }
                      else
                        install_var_field (decl, true, 3, ctx);

It is a generic OpenACC (that is, not only OpenACC reductions) code path
that you're changing here.  Can you still come up with a rationale for
that change, or should this possibly be restricted to OpenACC reductions
processing only?


Grüße,
 Thomas

Attachment: pgp62ujqtblKo.pgp
Description: PGP signature

Reply via email to