OpenACC 'kernels' decomposition: Mark variables used in synthesized data clauses as addressable [PR100280]

Jakub Jelinek jakub@redhat.com
Wed Mar 2 13:30:40 GMT 2022


On Tue, Mar 01, 2022 at 05:46:20PM +0100, Thomas Schwinge wrote:
> OK to proceed in this way?

With a suitable ChangeLog entry and one nit fixed yes.

> --- gcc/omp-low.cc
> +++ gcc/omp-low.cc
> @@ -188,7 +188,7 @@ struct omp_context
>  static splay_tree all_contexts;
>  static int taskreg_nesting_level;
>  static int target_nesting_level;
> -static bitmap task_shared_vars;
> +static bitmap make_addressable_vars;
>  static bitmap global_nonaddressable_vars;
>  static vec<omp_context *> taskreg_contexts;
>  static vec<gomp_task *> task_cpyfns;
> @@ -572,9 +572,9 @@ use_pointer_for_field (tree decl, omp_context *shared_ctx)
>               /* Taking address of OUTER in lower_send_shared_vars
>                  might need regimplification of everything that uses the
>                  variable.  */
> -             if (!task_shared_vars)
> -               task_shared_vars = BITMAP_ALLOC (NULL);
> -             bitmap_set_bit (task_shared_vars, DECL_UID (outer));
> +             if (!make_addressable_vars)
> +               make_addressable_vars = BITMAP_ALLOC (NULL);
> +             bitmap_set_bit (make_addressable_vars, DECL_UID (outer));

Has the MUA replaced tabs with spaces?

> --- gcc/omp-oacc-kernels-decompose.cc
> +++ gcc/omp-oacc-kernels-decompose.cc
> @@ -845,7 +845,11 @@ maybe_build_inner_data_region (location_t loc, gimple *body,
>           prev_mapped_var = v;
> 
>           /* See <https://gcc.gnu.org/PR100280>.  */
> -         TREE_ADDRESSABLE (v) = 1;
> +         if (!TREE_ADDRESSABLE (v))
> +           {
> +             /* Request that OMP lowering make 'v' addressable.  */
> +             OMP_CLAUSE_MAP_DECL_MAKE_ADDRESSABLE (new_clause) = 1;
> +           }

That is a single statement body, so shouldn't have {}s around it.

	Jakub



More information about the Gcc-patches mailing list