diff mbox

[gimple-classes,committed,45/92] omp-low.c: Use more concrete types of gimple statement for various locals

Message ID 1414442490-14841-46-git-send-email-dmalcolm@redhat.com
State New
Headers show

Commit Message

David Malcolm Oct. 27, 2014, 8:40 p.m. UTC
This corresponds to:
  [PATCH 47/89] omp-low.c: Use more concrete types of gimple statement for various locals
  https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01203.html
from the original 89-patch kit

That earlier patch was approved by Jeff:
> OK once prerequisites have gone in.
in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00810.html

gcc/
	* omp-low.c (finalize_task_copyfn): Strengthen local "bind" from
	plain gimple to gimple_bind.
	(lower_rec_input_clauses): Strengthen local "g" from
	plain gimple to gimple_assign.
	(lower_lastprivate_clauses): Likewise for "stmt" to gimple_cond
	and "g" to gimple_call.
	(expand_omp_for_init_vars): Likewise, for two decls of "stmt" to
	gimple_assign.
	(expand_omp_atomic_pipeline): Likewise for one decl of "stmt".
	(expand_omp_atomic_mutex): Likewise.
	(lower_omp_master): Likewise for "x" to gimple_call.
	(lower_omp_ordered): Likewise.
---
 gcc/ChangeLog.gimple-classes | 17 +++++++++++++++++
 gcc/omp-low.c                | 22 ++++++++++++----------
 2 files changed, 29 insertions(+), 10 deletions(-)
diff mbox

Patch

diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index b8d2f38..b0391f3 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,22 @@ 
 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
 
+	omp-low.c: Use more concrete types of gimple statement for various locals
+
+	* omp-low.c (finalize_task_copyfn): Strengthen local "bind" from
+	plain gimple to gimple_bind.
+	(lower_rec_input_clauses): Strengthen local "g" from
+	plain gimple to gimple_assign.
+	(lower_lastprivate_clauses): Likewise for "stmt" to gimple_cond
+	and "g" to gimple_call.
+	(expand_omp_for_init_vars): Likewise, for two decls of "stmt" to
+	gimple_assign.
+	(expand_omp_atomic_pipeline): Likewise for one decl of "stmt".
+	(expand_omp_atomic_mutex): Likewise.
+	(lower_omp_master): Likewise for "x" to gimple_call.
+	(lower_omp_ordered): Likewise.
+
+2014-10-24  David Malcolm  <dmalcolm@redhat.com>
+
 	tree-parloops.c: Use gimple_phi in various places
 
 	* tree-parloops.c (reduction_info::keep_res): Strengthen field
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 1edc943..9946f3f 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -1377,7 +1377,7 @@  finalize_task_copyfn (gimple_omp_task task_stmt)
   struct function *child_cfun;
   tree child_fn;
   gimple_seq seq = NULL, new_seq;
-  gimple bind;
+  gimple_bind bind;
 
   child_fn = gimple_omp_task_copy_fn (task_stmt);
   if (child_fn == NULL_TREE)
@@ -3603,7 +3603,7 @@  lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
 			  gimplify_and_add (x, ilist);
 			  gimple_stmt_iterator gsi
 			    = gsi_start_1 (gimple_omp_body_ptr (ctx->stmt));
-			  gimple g
+			  gimple_assign g
 			    = gimple_build_assign (unshare_expr (lvar), iv);
 			  gsi_insert_before_without_update (&gsi, g,
 							    GSI_SAME_STMT);
@@ -3940,7 +3940,7 @@  lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *stmt_list,
 
   if (predicate)
     {
-      gimple stmt;
+      gimple_cond stmt;
       tree label_true, arm1, arm2;
 
       label = create_artificial_label (UNKNOWN_LOCATION);
@@ -3987,7 +3987,7 @@  lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *stmt_list,
 		  if (lastlane == NULL)
 		    {
 		      lastlane = create_tmp_var (unsigned_type_node, NULL);
-		      gimple g
+		      gimple_call g
 			= gimple_build_call_internal (IFN_GOMP_SIMD_LAST_LANE,
 						      2, simduid,
 						      TREE_OPERAND (val, 1));
@@ -5360,7 +5360,7 @@  expand_omp_for_init_vars (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 	      tree t = fold_convert (TREE_TYPE (tem), counts[i]);
 	      t = force_gimple_operand_gsi (gsi, t, false, NULL_TREE,
 					    false, GSI_CONTINUE_LINKING);
-	      gimple stmt = gimple_build_assign (tem, t);
+	      gimple_assign stmt = gimple_build_assign (tem, t);
 	      gsi_insert_after (gsi, stmt, GSI_CONTINUE_LINKING);
 	    }
 	}
@@ -5369,7 +5369,7 @@  expand_omp_for_init_vars (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 
   tree type = TREE_TYPE (fd->loop.v);
   tree tem = create_tmp_reg (type, ".tem");
-  gimple stmt = gimple_build_assign (tem, startvar);
+  gimple_assign stmt = gimple_build_assign (tem, startvar);
   gsi_insert_after (gsi, stmt, GSI_CONTINUE_LINKING);
 
   for (i = fd->collapse - 1; i >= 0; i--)
@@ -8044,7 +8044,7 @@  expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb,
       gsi2 = gsi_start_bb (loop_header);
       if (gimple_in_ssa_p (cfun))
 	{
-	  gimple stmt;
+	  gimple_assign stmt;
 	  x = force_gimple_operand_gsi (&gsi2, x, true, NULL_TREE,
 					true, GSI_SAME_STMT);
 	  stmt = gimple_build_assign (loaded_val, x);
@@ -8157,7 +8157,7 @@  expand_omp_atomic_mutex (basic_block load_bb, basic_block store_bb,
 			 tree addr, tree loaded_val, tree stored_val)
 {
   gimple_stmt_iterator si;
-  gimple stmt;
+  gimple_assign stmt;
   tree t;
 
   si = gsi_last_bb (load_bb);
@@ -9190,7 +9190,8 @@  lower_omp_master (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 static void
 lower_omp_taskgroup (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 {
-  gimple stmt = gsi_stmt (*gsi_p), x;
+  gimple stmt = gsi_stmt (*gsi_p);
+  gimple_call x;
   gimple_bind bind;
   tree block = make_node (BLOCK);
 
@@ -9219,7 +9220,8 @@  static void
 lower_omp_ordered (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 {
   tree block;
-  gimple stmt = gsi_stmt (*gsi_p), x;
+  gimple stmt = gsi_stmt (*gsi_p);
+  gimple_call x;
   gimple_bind bind;
 
   push_gimplify_context ();