Hi! On Sun, 12 Jul 2015 14:46:02 +0200, Tom de Vries wrote: > This patch allows parallelization of an outer loop in an openacc kernels > region. \o/ > We rely on pass_lim to move the *.omp_data_i loads out of the loop nest. > For the test-case, pass_lim was managing to move the load out of the > inner loop, but not the outer loop, because the load was classified as > 'MOVE_PRESERVE_EXECUTION'. By marking the *.omp_data_i load > non-trapping, it's now classified as 'MOVE_POSSIBLE', and moved out of > the loop nest. Should this go into trunk already? (Jakub?) Do we need to audit the code for constructs that need similar treatment? * omp-low.c (build_receiver_ref): Mark *.omp_data_i as non-trapping. --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -1147,6 +1147,7 @@ build_receiver_ref (tree var, bool by_ref, omp_context *ctx) field = x; x = build_simple_mem_ref (ctx->receiver_decl); + TREE_THIS_NOTRAP (x) = 1; x = omp_build_component_ref (x, field); if (by_ref) x = build_simple_mem_ref (x); > I've committed this patch to gomp-4_0-branch. Are you planning to also add a Fortran test case? > --- /dev/null > +++ b/gcc/testsuite/c-c++-common/goacc/kernels-loop-nest.c > @@ -0,0 +1,42 @@ > +/* { dg-additional-options "-O2" } */ > +/* { dg-additional-options "-ftree-parallelize-loops=32" } */ > +/* { dg-additional-options "-fdump-tree-parloops_oacc_kernels-all" } */ > +/* { dg-additional-options "-fdump-tree-optimized" } */ > +[...] > +/* { dg-final { cleanup-tree-dump "parloops_oacc_kernels" } } */ > +/* { dg-final { cleanup-tree-dump "optimized" } } */ Committed in r225728: commit c2da6458c51cc71dccec2e49481560b91d57aa1c Author: tschwinge Date: Mon Jul 13 08:14:05 2015 +0000 cleanup-tree-dump is no more ERROR: (DejaGnu) proc "cleanup-tree-dump parloops_oacc_kernels" does not exist. gcc/testsuite/ * c-c++-common/goacc/kernels-loop-nest.c: Remove cleanup-tree-dump directives. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@225728 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog.gomp | 5 +++++ gcc/testsuite/c-c++-common/goacc/kernels-loop-nest.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git gcc/testsuite/ChangeLog.gomp gcc/testsuite/ChangeLog.gomp index 636a087..4694a60 100644 --- gcc/testsuite/ChangeLog.gomp +++ gcc/testsuite/ChangeLog.gomp @@ -1,3 +1,8 @@ +2015-07-13 Thomas Schwinge + + * c-c++-common/goacc/kernels-loop-nest.c: Remove cleanup-tree-dump + directives. + 2015-07-12 Tom de Vries * c-c++-common/goacc/kernels-loop-nest.c: New test. diff --git gcc/testsuite/c-c++-common/goacc/kernels-loop-nest.c gcc/testsuite/c-c++-common/goacc/kernels-loop-nest.c index 3e06c9f..e8eebaa 100644 --- gcc/testsuite/c-c++-common/goacc/kernels-loop-nest.c +++ gcc/testsuite/c-c++-common/goacc/kernels-loop-nest.c @@ -37,6 +37,3 @@ main (void) /* { dg-final { scan-tree-dump-times "(?n);; Function .*main._omp_fn.0" 1 "optimized" } } */ /* { dg-final { scan-tree-dump-times "(?n)pragma omp target oacc_parallel.*num_gangs\\(32\\)" 1 "parloops_oacc_kernels" } } */ - -/* { dg-final { cleanup-tree-dump "parloops_oacc_kernels" } } */ -/* { dg-final { cleanup-tree-dump "optimized" } } */ Grüße, Thomas