This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch,openacc] Generate sequential loop for OpenACC loop directive inside kernels
- 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>, Thomas Schwinge <thomas at codesourcery dot com>, Chung-Lin Tang <cltang at codesourcery dot com>
- Date: Tue, 4 Dec 2018 14:37:09 +0100
- Subject: Re: [patch,openacc] Generate sequential loop for OpenACC loop directive inside kernels
- References: <d18eb129-6416-1c6b-3368-bc6eb8519170@codesourcery.com> <3557f957-245f-f9fe-16b6-bb925806c1ac@codesourcery.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Sep 20, 2018 at 11:57:50AM -0700, Cesar Philippidis wrote:
> 2018-XX-YY Cesar Philippidis <cesar@codesourcery.com>
>
> * omp-low.c (install_var_field): New base_pointer_restrict
> argument.
> (scan_sharing_clauses): Update call to install_var_field.
> (omp_target_base_pointers_restrict_p): New function.
> (scan_omp_target): Update call to install_var_field.
> ---
> gcc/omp-low.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 83 insertions(+), 6 deletions(-)
>
> diff --git a/gcc/omp-low.c b/gcc/omp-low.c
> index 24685fd012c..a59c15ae5fd 100644
> --- a/gcc/omp-low.c
> +++ b/gcc/omp-low.c
> @@ -642,7 +642,8 @@ build_sender_ref (tree var, omp_context *ctx)
> BASE_POINTERS_RESTRICT, declare the field with restrict. */
>
> static void
> -install_var_field (tree var, bool by_ref, int mask, omp_context *ctx)
> +install_var_field (tree var, bool by_ref, int mask, omp_context *ctx,
> + bool base_pointers_restrict = false)
Can this be a bool in omp_context that you just initialize early, so that it
isn't passed all around?
> @@ -987,10 +992,12 @@ fixup_child_record_type (omp_context *ctx)
> }
>
> /* Instantiate decls as necessary in CTX to satisfy the data sharing
> - specified by CLAUSES. */
> + specified by CLAUSES. If BASE_POINTERS_RESTRICT, install var field with
> + restrict. */
>
> static void
> -scan_sharing_clauses (tree clauses, omp_context *ctx)
> +scan_sharing_clauses (tree clauses, omp_context *ctx,
> + bool base_pointers_restrict = false)
And here etc.
Jakub