On Wed, 3 Jun 2015, Tom de Vries wrote:

> On 22/04/15 09:39, Richard Biener wrote:
> > > Committed to gomp-4_0-branch in r222281:
> > > >
> > > >commit 58c33a7965c379b55b549d50e3b79b2252bcc876
> > > >Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
> > > >Date:   Tue Apr 21 19:48:16 2015 +0000
> > > >
> > > >     Add pass_ch_oacc_kernels to pass_oacc_kernels
> > > >
> > > >         gcc/
> > > >         * omp-low.c (loop_in_oacc_kernels_region_p): New function.
> > > >         * omp-low.h (loop_in_oacc_kernels_region_p): Declare.
> > > >         * passes.def: Add pass_ch_oacc_kernels to pass group
> > > pass_oacc_kernels.
> > > >         * tree-pass.h (make_pass_ch_oacc_kernels): Declare
> > > >         * tree-ssa-loop-ch.c: Include omp-low.h.
> > > >         (pass_ch_execute): Declare.
> > > >         (pass_ch::execute): Factor out ...
> > > >         (pass_ch_execute): ... this new function.  If handling oacc
> > > kernels,
> > > >         skip loops that are not in oacc kernels region.
> > > >         (pass_ch_oacc_kernels::execute):
> > > >         (pass_data_ch_oacc_kernels): New pass_data.
> > > >         (class pass_ch_oacc_kernels): New pass.
> > > >         (pass_ch_oacc_kernels::execute, make_pass_ch_oacc_kernels):
> > > New
> > > >         function.
> > > >
> > > >     git-svn-id:
> > > svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@222281
> > > 138bc75d-0d04-0410-961f-82ee72b054a4
> > > >---
> > > >  gcc/ChangeLog.gomp     |   15 ++++++++
> > > >  gcc/omp-low.c          |   91
> > > ++++++++++++++++++++++++++++++++++++++++++++++++
> > > >  gcc/omp-low.h          |    2 ++
> > > >  gcc/passes.def         |    1 +
> > > >  gcc/tree-pass.h        |    1 +
> > > >  gcc/tree-ssa-loop-ch.c |   59 +++++++++++++++++++++++++++++--
> > > >  6 files changed, 167 insertions(+), 2 deletions(-)
> > > >
> > > >diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp
> > > >index 8a53ad8..d00c5e0 100644
> > > >--- gcc/ChangeLog.gomp
> > > >+++ gcc/ChangeLog.gomp
> > > >@@ -1,5 +1,20 @@
> > > >  2015-04-21  Tom de Vries<t...@codesourcery.com>
> > > >
> > > >+        * omp-low.c (loop_in_oacc_kernels_region_p): New function.
> > > >+        * omp-low.h (loop_in_oacc_kernels_region_p): Declare.
> > > >+        * passes.def: Add pass_ch_oacc_kernels to pass group
> > > pass_oacc_kernels.
> > > >+        * tree-pass.h (make_pass_ch_oacc_kernels): Declare
> > > >+        * tree-ssa-loop-ch.c: Include omp-low.h.
> > > >+        (pass_ch_execute): Declare.
> > > >+        (pass_ch::execute): Factor out ...
> > > >+        (pass_ch_execute): ... this new function.  If handling oacc 
> > > >kernels,
> > > >+        skip loops that are not in oacc kernels region.
> > > >+        (pass_ch_oacc_kernels::execute):
> > > >+        (pass_data_ch_oacc_kernels): New pass_data.
> > > >+        (class pass_ch_oacc_kernels): New pass.
> > > >+        (pass_ch_oacc_kernels::execute, make_pass_ch_oacc_kernels): New
> > > >+        function.
> > > >+
> > > >         * passes.def: Add pass group pass_oacc_kernels.
> > > >         * tree-pass.h (make_pass_oacc_kernels): Declare.
> > > >         * tree-ssa-loop.c (gate_oacc_kernels): New static function.
> > > >diff --git gcc/omp-low.c gcc/omp-low.c
> > > >index 16d9a5e..1b03ae6 100644
> > > >--- gcc/omp-low.c
> > > >+++ gcc/omp-low.c
> > > >@@ -13920,4 +13920,95 @@ gimple_stmt_omp_data_i_init_p (gimple stmt)
> > > >                                                    SSA_OP_DEF);
> > > >  }
> > > >
> > > >+/* Return true if LOOP is inside a kernels region.  */
> > > >+
> > > >+bool
> > > >+loop_in_oacc_kernels_region_p (struct loop *loop, basic_block
> > > *region_entry,
> > > >+                               basic_block *region_exit)
> 
> <SNIP>
> 
> > It's also very odd that you disable transforms on OMP regions but at
> > the same time do all the OMP processing_after_  those transforms.
> > Something feels backward here.
> 
> I'm not sure if I understand your remark in the context of this patch. All we
> do here, is to disable transforming loops in pass_ch_oacc_kernels that are not
> part of a kernels region.

Ah, I probably failed to realize this.

Richard.

> Thanks,
> - Tom
> 
> 

-- 
Richard Biener <rguent...@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Dilip Upmanyu, Graham 
Norton, HRB 21284 (AG Nuernberg)

Reply via email to