This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, 6/8] Add pass_copy_prop in pass_oacc_kernels


Hi!

On Tue, 25 Nov 2014 12:38:55 +0100, Tom de Vries <Tom_deVries@mentor.com> wrote:
> On 15-11-14 18:22, Tom de Vries wrote:
> > On 15-11-14 13:14, Tom de Vries wrote:
> >> I'm submitting a patch series with initial support for the oacc kernels
> >> directive.
> >>
> >> The patch series uses pass_parallelize_loops to implement parallelization of
> >> loops in the oacc kernels region.
> >>
> >> The patch series consists of these 8 patches:
> >> ...
> >>      1  Expand oacc kernels after pass_build_ealias
> >>      2  Add pass_oacc_kernels
> >>      3  Add pass_ch_oacc_kernels to pass_oacc_kernels
> >>      4  Add pass_tree_loop_{init,done} to pass_oacc_kernels
> >>      5  Add pass_loop_im to pass_oacc_kernels
> >>      6  Add pass_ccp to pass_oacc_kernels
> >>      7  Add pass_parloops_oacc_kernels to pass_oacc_kernels
> >>      8  Do simple omp lowering for no address taken var
> >> ...
> >
> > This patch adds pass_loop_ccp to pass group pass_oacc_kernels.
> >
> > We need this pass to simplify the loop body, and allow pass_parloops to detect
> > that loop iterations are independent.
> >
> 
> As suggested here ( https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02993.html ) 
> I've replaced the pass_ccp with pass_copyprop, which performs trivial constant 
> propagation in addition to copy propagation.
> 
> Bootstrapped and reg-tested as before.
> 
> OK for trunk?

Committed to gomp-4_0-branch in r222284:

commit 1c2529b64620811cbff4a50374af797ee52ef5f8
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Tue Apr 21 19:58:54 2015 +0000

    Add pass_copy_prop in pass_oacc_kernels
    
    	gcc/
    	* passes.def: Add pass_copy_prop to pass group pass_oacc_kernels.
    	* tree-ssa-copy.c (stmt_may_generate_copy): Handle .omp_data_i init
    	conservatively.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@222284 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.gomp  |    4 ++++
 gcc/passes.def      |    1 +
 gcc/tree-ssa-copy.c |    4 ++++
 3 files changed, 9 insertions(+)

diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp
index 98e33ad..0be9191 100644
--- gcc/ChangeLog.gomp
+++ gcc/ChangeLog.gomp
@@ -1,5 +1,9 @@
 2015-04-21  Tom de Vries  <tom@codesourcery.com>
 
+	* passes.def: Add pass_copy_prop to pass group pass_oacc_kernels.
+	* tree-ssa-copy.c (stmt_may_generate_copy): Handle .omp_data_i init
+	conservatively.
+
 	* passes.def: Add pass_lim in pass group pass_ch_oacc_kernels.
 
 	* passes.def: Run pass_tree_loop_init and pass_tree_loop_done in pass
diff --git gcc/passes.def gcc/passes.def
index e6c9287..e6f1c33 100644
--- gcc/passes.def
+++ gcc/passes.def
@@ -93,6 +93,7 @@ along with GCC; see the file COPYING3.  If not see
 	      NEXT_PASS (pass_ch_oacc_kernels);
 	      NEXT_PASS (pass_tree_loop_init);
 	      NEXT_PASS (pass_lim);
+	      NEXT_PASS (pass_copy_prop);
 	      NEXT_PASS (pass_expand_omp_ssa);
 	      NEXT_PASS (pass_tree_loop_done);
 	  POP_INSERT_PASSES ()
diff --git gcc/tree-ssa-copy.c gcc/tree-ssa-copy.c
index 5ae8e6c..6f35f99 100644
--- gcc/tree-ssa-copy.c
+++ gcc/tree-ssa-copy.c
@@ -61,6 +61,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-scalar-evolution.h"
 #include "tree-ssa-dom.h"
 #include "tree-ssa-loop-niter.h"
+#include "omp-low.h"
 
 
 /* This file implements the copy propagation pass and provides a
@@ -116,6 +117,9 @@ stmt_may_generate_copy (gimple stmt)
   if (gimple_has_volatile_ops (stmt))
     return false;
 
+  if (gimple_stmt_omp_data_i_init_p (stmt))
+    return false;
+
   /* Statements with loads and/or stores will never generate a useful copy.  */
   if (gimple_vuse (stmt))
     return false;


GrÃÃe,
 Thomas

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]