This removes the non-SLP paths from vectorizable_assignment

        * tree-vect-stmts.cc (vectorizable_assignment): Remove
        non-SLP paths.
---
 gcc/tree-vect-stmts.cc | 28 +++++-----------------------
 1 file changed, 5 insertions(+), 23 deletions(-)

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 8f9aad9d7f1..dcee631fd82 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -5814,11 +5814,9 @@ vectorizable_assignment (vec_info *vinfo,
   tree vec_dest;
   tree scalar_dest;
   tree op;
-  loop_vec_info loop_vinfo = dyn_cast <loop_vec_info> (vinfo);
   tree new_temp;
   enum vect_def_type dt[1] = {vect_unknown_def_type};
   int ndts = 1;
-  int ncopies;
   int i;
   vec<tree> vec_oprnds = vNULL;
   tree vop;
@@ -5851,19 +5849,9 @@ vectorizable_assignment (vec_info *vinfo,
        || CONVERT_EXPR_CODE_P (code)))
     return false;
 
-  tree vectype = STMT_VINFO_VECTYPE (stmt_info);
+  tree vectype = SLP_TREE_VECTYPE (slp_node);
   poly_uint64 nunits = TYPE_VECTOR_SUBPARTS (vectype);
 
-  /* Multiple types in SLP are handled by creating the appropriate number of
-     vectorized stmts for each SLP node.  Hence, NCOPIES is always 1 in
-     case of SLP.  */
-  if (1)
-    ncopies = 1;
-  else
-    ncopies = vect_get_num_copies (loop_vinfo, vectype);
-
-  gcc_assert (ncopies >= 1);
-
   slp_tree slp_op;
   if (!vect_is_simple_use (vinfo, stmt_info, slp_node, 0, &op, &slp_op,
                           &dt[0], &vectype_in))
@@ -5924,8 +5912,7 @@ vectorizable_assignment (vec_info *vinfo,
 
   if (!vec_stmt) /* transformation not required.  */
     {
-      if (1
-         && !vect_maybe_update_slp_op_vectype (slp_op, vectype_in))
+      if (!vect_maybe_update_slp_op_vectype (slp_op, vectype_in))
        {
          if (dump_enabled_p ())
            dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
@@ -5935,7 +5922,7 @@ vectorizable_assignment (vec_info *vinfo,
       STMT_VINFO_TYPE (stmt_info) = assignment_vec_info_type;
       DUMP_VECT_SCOPE ("vectorizable_assignment");
       if (!vect_nop_conversion_p (stmt_info))
-       vect_model_simple_cost (vinfo, ncopies, dt, ndts, slp_node, cost_vec);
+       vect_model_simple_cost (vinfo, 1, dt, ndts, slp_node, cost_vec);
       return true;
     }
 
@@ -5947,7 +5934,7 @@ vectorizable_assignment (vec_info *vinfo,
   vec_dest = vect_create_destination_var (scalar_dest, vectype);
 
   /* Handle use.  */
-  vect_get_vec_defs (vinfo, stmt_info, slp_node, ncopies, op, &vec_oprnds);
+  vect_get_vec_defs (vinfo, stmt_info, slp_node, 1, op, &vec_oprnds);
 
   /* Arguments are ready. create the new vector stmt.  */
   FOR_EACH_VEC_ELT (vec_oprnds, i, vop)
@@ -5959,13 +5946,8 @@ vectorizable_assignment (vec_info *vinfo,
       new_temp = make_ssa_name (vec_dest, new_stmt);
       gimple_assign_set_lhs (new_stmt, new_temp);
       vect_finish_stmt_generation (vinfo, stmt_info, new_stmt, gsi);
-      if (1)
-       slp_node->push_vec_def (new_stmt);
-      else
-       STMT_VINFO_VEC_STMTS (stmt_info).safe_push (new_stmt);
+      slp_node->push_vec_def (new_stmt);
     }
-  if (!1)
-    *vec_stmt = STMT_VINFO_VEC_STMTS (stmt_info)[0];
 
   vec_oprnds.release ();
   return true;
-- 
2.43.0

Reply via email to