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: OpenACC GIMPLE_OACC_* -- or not?


Hi!

On Wed, 10 Dec 2014 11:10:47 +0100, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Dec 10, 2014 at 11:07:37AM +0100, Thomas Schwinge wrote:
> > ..., I noticed that GIMPLE_OMP_TARGET doesn't walk the child_fn and
> > data_arg.  Is that intentional, or should that be done?  If the latter
> > (but this doesn't seem to cause any ill effects -- why?), OK to commit
> > the following to trunk?
> 
> Ok with proper ChangeLog.
> 
> >  gcc/gimple-walk.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git gcc/gimple-walk.c gcc/gimple-walk.c
> > index bfa3532..1330c04 100644
> > --- gcc/gimple-walk.c
> > +++ gcc/gimple-walk.c
> > @@ -416,6 +416,14 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op,
> >  		       pset);
> >        if (ret)
> >  	return ret;
> > +      ret = walk_tree (gimple_omp_target_child_fn_ptr (stmt), callback_op, wi,
> > +		       pset);
> > +      if (ret)
> > +	return ret;
> > +      ret = walk_tree (gimple_omp_target_data_arg_ptr (stmt), callback_op, wi,
> > +		       pset);
> > +      if (ret)
> > +	return ret;
> >        break;
> >  
> >      case GIMPLE_OMP_TEAMS:

Committed to trunk in r218686:

commit c1277edd4b50623bae89bea8cba84def9b308e77
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Fri Dec 12 20:01:18 2014 +0000

    A bit of walk_gimple_op maintenance.
    
    	* gimple-walk.c (walk_gimple_op) <GIMPLE_OMP_FOR>: Also check
    	intermediate walk_tree results for for_incr.
    	<GIMPLE_OMP_TARGET>: Walk child_fn and data_arg, too.
    	<GIMPLE_OMP_CRITICAL, GIMPLE_OMP_ATOMIC_STORE>: Pretty printing.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218686 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog     |  7 +++++++
 gcc/gimple-walk.c | 49 +++++++++++++++++++++++++++++++------------------
 2 files changed, 38 insertions(+), 18 deletions(-)

diff --git gcc/ChangeLog gcc/ChangeLog
index bf9571b..3a20032 100644
--- gcc/ChangeLog
+++ gcc/ChangeLog
@@ -1,3 +1,10 @@
+2014-12-12  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* gimple-walk.c (walk_gimple_op) <GIMPLE_OMP_FOR>: Also check
+	intermediate walk_tree results for for_incr.
+	<GIMPLE_OMP_TARGET>: Walk child_fn and data_arg, too.
+	<GIMPLE_OMP_CRITICAL, GIMPLE_OMP_ATOMIC_STORE>: Pretty printing.
+
 2014-12-12  Richard Sandiford  <richard.sandiford@arm.com>
 
 	PR middle-end/64182
diff --git gcc/gimple-walk.c gcc/gimple-walk.c
index 48fa05d..959d68e 100644
--- gcc/gimple-walk.c
+++ gcc/gimple-walk.c
@@ -321,11 +321,13 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op,
       break;
 
     case GIMPLE_OMP_CRITICAL:
-      ret = walk_tree (gimple_omp_critical_name_ptr (
-			 as_a <gomp_critical *> (stmt)),
-		       callback_op, wi, pset);
-      if (ret)
-	return ret;
+      {
+	gomp_critical *omp_stmt = as_a <gomp_critical *> (stmt);
+	ret = walk_tree (gimple_omp_critical_name_ptr (omp_stmt),
+			 callback_op, wi, pset);
+	if (ret)
+	  return ret;
+      }
       break;
 
     case GIMPLE_OMP_FOR:
@@ -349,9 +351,9 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op,
 	    return ret;
 	  ret = walk_tree (gimple_omp_for_incr_ptr (stmt, i), callback_op,
 			   wi, pset);
+	  if (ret)
+	    return ret;
 	}
-      if (ret)
-	return ret;
       break;
 
     case GIMPLE_OMP_PARALLEL:
@@ -404,7 +406,6 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op,
 		       wi, pset);
       if (ret)
 	return ret;
-
       ret = walk_tree (gimple_omp_sections_control_ptr (stmt), callback_op,
 		       wi, pset);
       if (ret)
@@ -420,10 +421,21 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op,
       break;
 
     case GIMPLE_OMP_TARGET:
-      ret = walk_tree (gimple_omp_target_clauses_ptr (stmt), callback_op, wi,
-		       pset);
-      if (ret)
-	return ret;
+      {
+	gomp_target *omp_stmt = as_a <gomp_target *> (stmt);
+	ret = walk_tree (gimple_omp_target_clauses_ptr (omp_stmt),
+			 callback_op, wi, pset);
+	if (ret)
+	  return ret;
+	ret = walk_tree (gimple_omp_target_child_fn_ptr (omp_stmt),
+			 callback_op, wi, pset);
+	if (ret)
+	  return ret;
+	ret = walk_tree (gimple_omp_target_data_arg_ptr (omp_stmt),
+			 callback_op, wi, pset);
+	if (ret)
+	  return ret;
+      }
       break;
 
     case GIMPLE_OMP_TEAMS:
@@ -440,7 +452,6 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op,
 			 callback_op, wi, pset);
 	if (ret)
 	  return ret;
-
 	ret = walk_tree (gimple_omp_atomic_load_rhs_ptr (omp_stmt),
 			 callback_op, wi, pset);
 	if (ret)
@@ -449,11 +460,13 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op,
       break;
 
     case GIMPLE_OMP_ATOMIC_STORE:
-      ret = walk_tree (gimple_omp_atomic_store_val_ptr (
-		         as_a <gomp_atomic_store *> (stmt)),
-		       callback_op, wi, pset);
-      if (ret)
-	return ret;
+      {
+	gomp_atomic_store *omp_stmt = as_a <gomp_atomic_store *> (stmt);
+	ret = walk_tree (gimple_omp_atomic_store_val_ptr (omp_stmt),
+			 callback_op, wi, pset);
+	if (ret)
+	  return ret;
+      }
       break;
 
     case GIMPLE_TRANSACTION:


GrÃÃe,
 Thomas

Attachment: pgpBGfADYyRM4.pgp
Description: PGP signature


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