[02/11] Remove vect_schedule_slp return value

Message ID 87va8xdkek.fsf@arm.com
State New
Headers show
Series
  • Add a vec_basic_block of scalar statements
Related show

Commit Message

Richard Sandiford July 30, 2018, 11:37 a.m.
Nothing now uses the vect_schedule_slp return value, so it's not worth
propagating the value through vect_schedule_slp_instance.


2018-07-30  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vectorizer.h (vect_schedule_slp): Return void.
	* tree-vect-slp.c (vect_schedule_slp_instance): Likewise.
	(vect_schedule_slp): Likewise.

Comments

Richard Biener Aug. 1, 2018, 12:49 p.m. | #1
On Mon, Jul 30, 2018 at 1:37 PM Richard Sandiford
<richard.sandiford@arm.com> wrote:
>

> Nothing now uses the vect_schedule_slp return value, so it's not worth

> propagating the value through vect_schedule_slp_instance.


OK.

>

> 2018-07-30  Richard Sandiford  <richard.sandiford@arm.com>

>

> gcc/

>         * tree-vectorizer.h (vect_schedule_slp): Return void.

>         * tree-vect-slp.c (vect_schedule_slp_instance): Likewise.

>         (vect_schedule_slp): Likewise.

>

> Index: gcc/tree-vectorizer.h

> ===================================================================

> --- gcc/tree-vectorizer.h       2018-07-30 12:32:09.114687014 +0100

> +++ gcc/tree-vectorizer.h       2018-07-30 12:32:19.366596715 +0100

> @@ -1575,7 +1575,7 @@ extern bool vect_transform_slp_perm_load

>                                           gimple_stmt_iterator *, poly_uint64,

>                                           slp_instance, bool, unsigned *);

>  extern bool vect_slp_analyze_operations (vec_info *);

> -extern bool vect_schedule_slp (vec_info *);

> +extern void vect_schedule_slp (vec_info *);

>  extern bool vect_analyze_slp (vec_info *, unsigned);

>  extern bool vect_make_slp_decision (loop_vec_info);

>  extern void vect_detect_hybrid_slp (loop_vec_info);

> Index: gcc/tree-vect-slp.c

> ===================================================================

> --- gcc/tree-vect-slp.c 2018-07-30 12:32:09.026687790 +0100

> +++ gcc/tree-vect-slp.c 2018-07-30 12:32:19.366596715 +0100

> @@ -3849,11 +3849,11 @@ vect_transform_slp_perm_load (slp_tree n

>

>  /* Vectorize SLP instance tree in postorder.  */

>

> -static bool

> +static void

>  vect_schedule_slp_instance (slp_tree node, slp_instance instance,

>                             scalar_stmts_to_slp_tree_map_t *bst_map)

>  {

> -  bool grouped_store, is_store;

> +  bool grouped_store;

>    gimple_stmt_iterator si;

>    stmt_vec_info stmt_info;

>    unsigned int group_size;

> @@ -3862,14 +3862,14 @@ vect_schedule_slp_instance (slp_tree nod

>    slp_tree child;

>

>    if (SLP_TREE_DEF_TYPE (node) != vect_internal_def)

> -    return false;

> +    return;

>

>    /* See if we have already vectorized the same set of stmts and reuse their

>       vectorized stmts.  */

>    if (slp_tree *leader = bst_map->get (SLP_TREE_SCALAR_STMTS (node)))

>      {

>        SLP_TREE_VEC_STMTS (node).safe_splice (SLP_TREE_VEC_STMTS (*leader));

> -      return false;

> +      return;

>      }

>

>    bst_map->put (SLP_TREE_SCALAR_STMTS (node).copy (), node);

> @@ -3991,11 +3991,10 @@ vect_schedule_slp_instance (slp_tree nod

>             }

>           v0.release ();

>           v1.release ();

> -         return false;

> +         return;

>         }

>      }

> -  is_store = vect_transform_stmt (stmt_info, &si, &grouped_store, node,

> -                                 instance);

> +  vect_transform_stmt (stmt_info, &si, &grouped_store, node, instance);

>

>    /* Restore stmt def-types.  */

>    FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)

> @@ -4005,8 +4004,6 @@ vect_schedule_slp_instance (slp_tree nod

>         FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (child), j, child_stmt_info)

>           STMT_VINFO_DEF_TYPE (child_stmt_info) = vect_internal_def;

>        }

> -

> -  return is_store;

>  }

>

>  /* Replace scalar calls from SLP node NODE with setting of their lhs to zero.

> @@ -4048,14 +4045,12 @@ vect_remove_slp_scalar_calls (slp_tree n

>

>  /* Generate vector code for all SLP instances in the loop/basic block.  */

>

> -bool

> +void

>  vect_schedule_slp (vec_info *vinfo)

>  {

>    vec<slp_instance> slp_instances;

>    slp_instance instance;

>    unsigned int i;

> -  bool is_store = false;

> -

>

>    scalar_stmts_to_slp_tree_map_t *bst_map

>      = new scalar_stmts_to_slp_tree_map_t ();

> @@ -4063,8 +4058,8 @@ vect_schedule_slp (vec_info *vinfo)

>    FOR_EACH_VEC_ELT (slp_instances, i, instance)

>      {

>        /* Schedule the tree of INSTANCE.  */

> -      is_store = vect_schedule_slp_instance (SLP_INSTANCE_TREE (instance),

> -                                             instance, bst_map);

> +      vect_schedule_slp_instance (SLP_INSTANCE_TREE (instance),

> +                                 instance, bst_map);

>        if (dump_enabled_p ())

>         dump_printf_loc (MSG_NOTE, vect_location,

>                           "vectorizing stmts using SLP.\n");

> @@ -4099,6 +4094,4 @@ vect_schedule_slp (vec_info *vinfo)

>           vinfo->remove_stmt (store_info);

>          }

>      }

> -

> -  return is_store;

>  }

Patch

Index: gcc/tree-vectorizer.h
===================================================================
--- gcc/tree-vectorizer.h	2018-07-30 12:32:09.114687014 +0100
+++ gcc/tree-vectorizer.h	2018-07-30 12:32:19.366596715 +0100
@@ -1575,7 +1575,7 @@  extern bool vect_transform_slp_perm_load
 					  gimple_stmt_iterator *, poly_uint64,
 					  slp_instance, bool, unsigned *);
 extern bool vect_slp_analyze_operations (vec_info *);
-extern bool vect_schedule_slp (vec_info *);
+extern void vect_schedule_slp (vec_info *);
 extern bool vect_analyze_slp (vec_info *, unsigned);
 extern bool vect_make_slp_decision (loop_vec_info);
 extern void vect_detect_hybrid_slp (loop_vec_info);
Index: gcc/tree-vect-slp.c
===================================================================
--- gcc/tree-vect-slp.c	2018-07-30 12:32:09.026687790 +0100
+++ gcc/tree-vect-slp.c	2018-07-30 12:32:19.366596715 +0100
@@ -3849,11 +3849,11 @@  vect_transform_slp_perm_load (slp_tree n
 
 /* Vectorize SLP instance tree in postorder.  */
 
-static bool
+static void
 vect_schedule_slp_instance (slp_tree node, slp_instance instance,
 			    scalar_stmts_to_slp_tree_map_t *bst_map)
 {
-  bool grouped_store, is_store;
+  bool grouped_store;
   gimple_stmt_iterator si;
   stmt_vec_info stmt_info;
   unsigned int group_size;
@@ -3862,14 +3862,14 @@  vect_schedule_slp_instance (slp_tree nod
   slp_tree child;
 
   if (SLP_TREE_DEF_TYPE (node) != vect_internal_def)
-    return false;
+    return;
 
   /* See if we have already vectorized the same set of stmts and reuse their
      vectorized stmts.  */
   if (slp_tree *leader = bst_map->get (SLP_TREE_SCALAR_STMTS (node)))
     {
       SLP_TREE_VEC_STMTS (node).safe_splice (SLP_TREE_VEC_STMTS (*leader));
-      return false;
+      return;
     }
 
   bst_map->put (SLP_TREE_SCALAR_STMTS (node).copy (), node);
@@ -3991,11 +3991,10 @@  vect_schedule_slp_instance (slp_tree nod
 	    }
 	  v0.release ();
 	  v1.release ();
-	  return false;
+	  return;
 	}
     }
-  is_store = vect_transform_stmt (stmt_info, &si, &grouped_store, node,
-				  instance);
+  vect_transform_stmt (stmt_info, &si, &grouped_store, node, instance);
 
   /* Restore stmt def-types.  */
   FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
@@ -4005,8 +4004,6 @@  vect_schedule_slp_instance (slp_tree nod
 	FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (child), j, child_stmt_info)
 	  STMT_VINFO_DEF_TYPE (child_stmt_info) = vect_internal_def;
       }
-
-  return is_store;
 }
 
 /* Replace scalar calls from SLP node NODE with setting of their lhs to zero.
@@ -4048,14 +4045,12 @@  vect_remove_slp_scalar_calls (slp_tree n
 
 /* Generate vector code for all SLP instances in the loop/basic block.  */
 
-bool
+void
 vect_schedule_slp (vec_info *vinfo)
 {
   vec<slp_instance> slp_instances;
   slp_instance instance;
   unsigned int i;
-  bool is_store = false;
-
 
   scalar_stmts_to_slp_tree_map_t *bst_map
     = new scalar_stmts_to_slp_tree_map_t ();
@@ -4063,8 +4058,8 @@  vect_schedule_slp (vec_info *vinfo)
   FOR_EACH_VEC_ELT (slp_instances, i, instance)
     {
       /* Schedule the tree of INSTANCE.  */
-      is_store = vect_schedule_slp_instance (SLP_INSTANCE_TREE (instance),
-                                             instance, bst_map);
+      vect_schedule_slp_instance (SLP_INSTANCE_TREE (instance),
+				  instance, bst_map);
       if (dump_enabled_p ())
 	dump_printf_loc (MSG_NOTE, vect_location,
                          "vectorizing stmts using SLP.\n");
@@ -4099,6 +4094,4 @@  vect_schedule_slp (vec_info *vinfo)
 	  vinfo->remove_stmt (store_info);
         }
     }
-
-  return is_store;
 }