This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch,openacc] Propagate independent clause for OpenACC kernels pass
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Cesar Philippidis <cesar at codesourcery dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Chung-Lin Tang <cltang at codesourcery dot com>
- Date: Tue, 4 Dec 2018 14:48:34 +0100
- Subject: Re: [patch,openacc] Propagate independent clause for OpenACC kernels pass
- References: <f432a0c0-63c2-044f-846b-f049d1214882@codesourcery.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Sep 20, 2018 at 11:06:40AM -0700, Cesar Philippidis wrote:
> 2018-XX-YY Chung-Lin Tang <cltang@codesourcery.com>
> Cesar Philippidis <cesar@codesourcery.com>
>
> gcc/
> * cfgloop.h (struct loop): Add 'bool marked_independent' field.
> * omp-expand.c (struct omp_region): Add 'int kind' and
> 'bool independent' fields.
> (expand_omp_for): Set 'marked_independent' field for loop
> corresponding to region.
> (find_omp_for_region_data): New function.
> (build_omp_regions_1): Set kind field. Call
> find_omp_for_region_data for GIMPLE_OMP_FOR statements.
In addition to what I've just mentioned in another mail:
> --- a/gcc/omp-expand.c
> +++ b/gcc/omp-expand.c
> @@ -107,6 +107,12 @@ struct omp_region
>
> /* True if this is nested inside an OpenACC kernels construct. */
> bool inside_kernels_p;
> +
> + /* Records a generic kind field. */
> + int kind;
> +
> + /* For an OpenACC loop directive, true if has the 'independent' clause. */
> + bool independent;
> };
I'm not sure why you need kind cached, you can get from the region at the
stmt and from there at the kind easily. And even if it would be a good idea
to cache it, you don't want to mix bool and non-bool members in the
structure to avoid padding gaps.
Jakub