This removes the non-SLP path from vectorizable_induction.

Bootstrapped and tested on x86_64-unknown-linux-gnu, squashed and
pushed.

        * tree-vect-loop.cc (vectorizable_nonlinear_induction):
        Remove non-SLP path, use SLP_TREE_VECTYPE.
        (vectorizable_induction): Likewise.  Drop ncopies variable
        which is always 1.
---
 gcc/tree-vect-loop.cc | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index 3ab2f4d52c7..2d1a6883e6b 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -9698,7 +9698,7 @@ vectorizable_nonlinear_induction (loop_vec_info 
loop_vinfo,
 
   gphi *phi = dyn_cast <gphi *> (stmt_info->stmt);
 
-  tree vectype = STMT_VINFO_VECTYPE (stmt_info);
+  tree vectype = SLP_TREE_VECTYPE (slp_node);
   poly_uint64 nunits = TYPE_VECTOR_SUBPARTS (vectype);
   enum vect_induction_op_type induction_type
     = STMT_VINFO_LOOP_PHI_EVOLUTION_TYPE (stmt_info);
@@ -9990,7 +9990,6 @@ vectorizable_induction (loop_vec_info loop_vinfo,
                        stmt_vector_for_cost *cost_vec)
 {
   class loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
-  unsigned ncopies;
   bool nested_in_vect_loop = false;
   class loop *iv_loop;
   tree vec_def;
@@ -10024,11 +10023,9 @@ vectorizable_induction (loop_vec_info loop_vinfo,
     return vectorizable_nonlinear_induction (loop_vinfo, stmt_info,
                                             vec_stmt, slp_node, cost_vec);
 
-  tree vectype = STMT_VINFO_VECTYPE (stmt_info);
+  tree vectype = SLP_TREE_VECTYPE (slp_node);
   poly_uint64 nunits = TYPE_VECTOR_SUBPARTS (vectype);
 
-  ncopies = 1;
-
   /* FORNOW. These restrictions should be relaxed.  */
   if (nested_in_vect_loop_p (loop, stmt_info))
     {
@@ -10038,14 +10035,6 @@ vectorizable_induction (loop_vec_info loop_vinfo,
       edge latch_e;
       tree loop_arg;
 
-      if (ncopies > 1)
-       {
-         if (dump_enabled_p ())
-           dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
-                            "multiple types in nested loop.\n");
-         return false;
-       }
-
       exit_phi = NULL;
       latch_e = loop_latch_edge (loop->inner);
       loop_arg = PHI_ARG_DEF_FROM_EDGE (phi, latch_e);
-- 
2.43.0

Reply via email to