openacc reference reductions

2016-02-09 Thread Cesar Philippidis
This patch teaches omp-lower how handle reference-typed reductions, which are common in fortran subroutines. Unlike the implementation in gomp4 branch, this patch doesn't rewrite the reference reduction variables as local variables. Instead, a local copy is created for reduction variable. There ar

Re: openacc reference reductions

2016-02-22 Thread Cesar Philippidis
Ping. This patch still needs a review. Cesar On 02/09/2016 08:17 AM, Cesar Philippidis wrote: > On 02/09/2016 07:33 AM, Nathan Sidwell wrote: >> While I've not looked at the rest of the patch, this bit stood out: >> >>> +static bool >>> +is_oacc_parallel_reduction (tree var, omp_context *ctx) >>>

Re: openacc reference reductions

2016-02-22 Thread Nathan Sidwell
On 02/22/16 10:34, Cesar Philippidis wrote: Ping. This patch still needs a review. I'm not sure who has the approval ball. Jakub? nathan

Re: openacc reference reductions

2016-04-05 Thread Cesar Philippidis
On 02/22/2016 07:34 AM, Cesar Philippidis wrote: > Ping. This patch still needs a review. Ping. I've attached a rebased version of this patch. The omp-low.c bits haven't changed, but the test cases have since Thomas has been merging some of them from trunk. I separated the omp-low.c changes becaus

Re: openacc reference reductions

2016-04-06 Thread Jakub Jelinek
On Tue, Apr 05, 2016 at 06:53:47PM -0700, Cesar Philippidis wrote: > --- a/gcc/omp-low.c > +++ b/gcc/omp-low.c > @@ -309,6 +309,25 @@ is_oacc_kernels (omp_context *ctx) > == GF_OMP_TARGET_KIND_OACC_KERNELS)); > } > > +/* Return true if CTX corresponds to an oacc parallel region and i

Re: openacc reference reductions

2016-04-06 Thread Cesar Philippidis
On 04/06/2016 07:23 AM, Jakub Jelinek wrote: > On Tue, Apr 05, 2016 at 06:53:47PM -0700, Cesar Philippidis wrote: >> --- a/gcc/omp-low.c >> +++ b/gcc/omp-low.c >> @@ -309,6 +309,25 @@ is_oacc_kernels (omp_context *ctx) >>== GF_OMP_TARGET_KIND_OACC_KERNELS)); >> } >> >> +/* Return tru

Re: openacc reference reductions

2016-04-07 Thread Jakub Jelinek
On Wed, Apr 06, 2016 at 01:21:30PM -0700, Cesar Philippidis wrote: > That's a good idea. I went ahead and combined this patch with the data > map reduction fix for PR70289 that I posted on Monday, > , because I'm > already scanning for paral

Re: openacc reference reductions

2016-04-07 Thread Cesar Philippidis
On 04/07/2016 02:56 AM, Jakub Jelinek wrote: > But more importantly, do you really have to do this separately? > I admit I haven't stepped through your testcases in the debugger, so > correct me if I'm missing something: > I mean, gimplify_scan_omp_clauses should omp_add_variable for the > OMP_CLA

Re: openacc reference reductions

2016-04-08 Thread Jakub Jelinek
On Thu, Apr 07, 2016 at 09:34:43PM -0700, Cesar Philippidis wrote: > --- a/gcc/gimplify.c > +++ b/gcc/gimplify.c > @@ -5802,7 +5802,8 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree > decl, unsigned int flags) > flags |= GOVD_SEEN; > >n = splay_tree_lookup (ctx->variables, (spla

Re: openacc reference reductions

2016-04-08 Thread Jakub Jelinek
On Fri, Apr 08, 2016 at 09:40:54AM +0200, Jakub Jelinek wrote: > So, you can do all the checking there. Say on OMP_CLAUSE_REDUCTION > for the ORT_ACC_PARALLEL check the flags if they include GOVD_PRIVATE > or GOVD_FIRSTPRIVATE, if yes, complain. Also check if GOVD_MAP is included, Though, void f

Re: openacc reference reductions

2016-04-08 Thread Nathan Sidwell
On 04/08/16 00:40, Jakub Jelinek wrote: +/* OpenACC parallel reductions need a present_or_copy clause to ensure + that the original variable used in the reduction gets updated on + the host. Scan the list of clauses for reduction so that any existing + data clause can be adjusted if neces

Re: openacc reference reductions

2016-04-08 Thread Jakub Jelinek
On Fri, Apr 08, 2016 at 07:14:13AM -0700, Nathan Sidwell wrote: > On 04/08/16 00:40, Jakub Jelinek wrote: > > >>+/* OpenACC parallel reductions need a present_or_copy clause to ensure > >>+ that the original variable used in the reduction gets updated on > >>+ the host. Scan the list of claus

Re: openacc reference reductions

2016-04-08 Thread Cesar Philippidis
On 04/08/2016 12:40 AM, Jakub Jelinek wrote: > On Thu, Apr 07, 2016 at 09:34:43PM -0700, Cesar Philippidis wrote: >> --- a/gcc/gimplify.c >> +++ b/gcc/gimplify.c >> @@ -5802,7 +5802,8 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree >> decl, unsigned int flags) >> flags |= GOVD_SEEN; >

Re: openacc reference reductions

2016-04-08 Thread Cesar Philippidis
On 04/08/2016 07:14 AM, Nathan Sidwell wrote: > On 04/08/16 00:40, Jakub Jelinek wrote: > >>> +/* OpenACC parallel reductions need a present_or_copy clause to ensure >>> + that the original variable used in the reduction gets updated on >>> + the host. Scan the list of clauses for reduction s

Re: openacc reference reductions

2016-04-08 Thread Nathan Sidwell
On 04/08/16 07:46, Cesar Philippidis wrote: I'm not sure what the purpose of a firstprivate parallel reduction is anyway. I'm not sure either. Tom and I were pushing to make parallel reductions imply copy (or present_or_copy in openacc 2.0). Did that fall through? It doesn't seem to have

Re: openacc reference reductions

2016-04-08 Thread Jakub Jelinek
On Fri, Apr 08, 2016 at 07:35:35AM -0700, Cesar Philippidis wrote: > The FEs a little inconsistent, and I didn't want to make this patch that > invasive. Can the FE changes wait to gcc7? Sure. > 2016-04-08 Cesar Philippidis > > PR lto/70289 > PR ipa/70348 > PR tree-optimizat

Re: openacc reference reductions

2016-02-09 Thread Nathan Sidwell
While I've not looked at the rest of the patch, this bit stood out: +static bool +is_oacc_parallel_reduction (tree var, omp_context *ctx) +{ + if (!is_oacc_parallel (ctx)) +return false; + + tree clauses = gimple_omp_target_clauses (ctx->stmt); + + /* Don't install a local copy of the dec

Re: openacc reference reductions

2016-02-09 Thread Cesar Philippidis
On 02/09/2016 07:33 AM, Nathan Sidwell wrote: > While I've not looked at the rest of the patch, this bit stood out: > >> +static bool >> +is_oacc_parallel_reduction (tree var, omp_context *ctx) >> +{ >> + if (!is_oacc_parallel (ctx)) >> +return false; >> + >> + tree clauses = gimple_omp_targ

[OpenACC] Don't compile libgomp testcases with '-w' (was: openacc reference reductions)

2021-04-26 Thread Thomas Schwinge
Hi! On 2016-02-09T07:14:31-0800, Cesar Philippidis wrote: > This patch [...] ... as eventually commited in r234840 (commit c42cfb5ca3b02756705485e013fa9107aaf28acd "re PR lto/70289 ([openacc] ICE in input_varpool_node)") added 'dg-additional-options "-w"' for a bunch of testcases. We'd like to