---
 gcc/tree-vect-stmts.cc | 115 ++++++++++-------------------------------
 1 file changed, 26 insertions(+), 89 deletions(-)

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index fa86aecd9bc..3f9edb79479 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -3954,7 +3954,7 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
 {
   tree vec_dest;
   tree scalar_dest;
-  tree op, type;
+  tree op;
   tree vec_oprnd0 = NULL_TREE;
   tree vectype;
   poly_uint64 nunits;
@@ -3966,7 +3966,7 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
   auto_vec<simd_call_arg_info> arginfo;
   vec<tree> vargs = vNULL;
   size_t i, nargs;
-  tree lhs, rtype, ratype;
+  tree rtype, ratype;
   vec<constructor_elt, va_gc> *ret_ctor_elts = NULL;
   int masked_call_offset = 0;
 
@@ -4017,8 +4017,7 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
   if (nargs == 0)
     return false;
 
-  vec<tree>& simd_clone_info = (1 ? SLP_TREE_SIMD_CLONE_INFO (slp_node)
-                               : STMT_VINFO_SIMD_CLONE_INFO (stmt_info));
+  vec<tree>& simd_clone_info = SLP_TREE_SIMD_CLONE_INFO (slp_node);
   if (!vec_stmt)
     simd_clone_info.truncate (0);
   arginfo.reserve (nargs, true);
@@ -4035,9 +4034,9 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
       thisarginfo.op = NULL_TREE;
       thisarginfo.simd_lane_linear = false;
 
-      int op_no = i + masked_call_offset;
-      if (1)
-       op_no = vect_slp_child_index_for_operand (stmt, op_no, false);
+      int op_no = vect_slp_child_index_for_operand (stmt,
+                                                   i + masked_call_offset,
+                                                   false);
       if (!vect_is_simple_use (vinfo, stmt_info, slp_node,
                               op_no, &op, &slp_op[i],
                               &thisarginfo.dt, &thisarginfo.vectype)
@@ -4057,7 +4056,6 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
             vect_maybe_update_slp_op_vectype.  At transform time
             we have a vector type recorded for SLP.  */
          gcc_assert (!vec_stmt
-                     || !1
                      || thisarginfo.vectype != NULL_TREE);
          if (!vec_stmt)
            thisarginfo.vectype = get_vectype_for_scalar_type (vinfo,
@@ -4124,7 +4122,7 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
     }
 
   poly_uint64 vf = loop_vinfo ? LOOP_VINFO_VECT_FACTOR (loop_vinfo) : 1;
-  unsigned group_size = 1 ? SLP_TREE_LANES (slp_node) : 1;
+  unsigned group_size = SLP_TREE_LANES (slp_node);
   unsigned int badness = 0;
   struct cgraph_node *bestn = NULL;
   if (vec_stmt)
@@ -4339,10 +4337,7 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
 
   fndecl = bestn->decl;
   nunits = bestn->simdclone->simdlen;
-  if (1)
-    ncopies = vector_unroll_factor (vf * group_size, nunits);
-  else
-    ncopies = vector_unroll_factor (vf, nunits);
+  ncopies = vector_unroll_factor (vf * group_size, nunits);
 
   /* If the function isn't const, only allow it in simd loops where user
      has asserted that at least nunits consecutive iterations can be
@@ -4357,15 +4352,14 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
 
   if (!vec_stmt) /* transformation not required.  */
     {
-      if (1)
-       for (unsigned i = 0; i < nargs; ++i)
-         if (!vect_maybe_update_slp_op_vectype (slp_op[i], arginfo[i].vectype))
-           {
-             if (dump_enabled_p ())
-               dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
-                                "incompatible vector types for invariants\n");
-             return false;
-           }
+      for (unsigned i = 0; i < nargs; ++i)
+       if (!vect_maybe_update_slp_op_vectype (slp_op[i], arginfo[i].vectype))
+         {
+           if (dump_enabled_p ())
+             dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+                              "incompatible vector types for invariants\n");
+           return false;
+         }
       /* When the original call is pure or const but the SIMD ABI dictates
         an aggregate return we will have to use a virtual definition and
         in a loop eventually even need to add a virtual PHI.  That's
@@ -4377,7 +4371,7 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
       /* ???  For SLP code-gen we end up inserting after the last
         vector argument def rather than at the original call position
         so automagic virtual operand updating doesn't work.  */
-      if (gimple_vuse (stmt) && 1)
+      if (gimple_vuse (stmt))
        vinfo->any_known_not_updated_vssa = true;
       simd_clone_info.safe_push (bestn->decl);
       for (i = 0; i < bestn->simdclone->nargs; i++)
@@ -4451,13 +4445,8 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
   auto_vec<vec<tree> > vec_oprnds;
   auto_vec<unsigned> vec_oprnds_i;
   vec_oprnds_i.safe_grow_cleared (nargs, true);
-  if (1)
-    {
-      vec_oprnds.reserve_exact (nargs);
-      vect_get_slp_defs (vinfo, slp_node, &vec_oprnds);
-    }
-  else
-    vec_oprnds.safe_grow_cleared (nargs, true);
+  vec_oprnds.reserve_exact (nargs);
+  vect_get_slp_defs (vinfo, slp_node, &vec_oprnds);
   for (j = 0; j < ncopies; ++j)
     {
       poly_uint64 callee_nelements;
@@ -4492,10 +4481,6 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
                      gcc_assert ((k & (k - 1)) == 0);
                      if (m == 0)
                        {
-                         if (!1)
-                           vect_get_vec_defs_for_operand (vinfo, stmt_info,
-                                                          ncopies * o / k, op,
-                                                          &vec_oprnds[i]);
                          vec_oprnds_i[i] = 0;
                          vec_oprnd0 = vec_oprnds[i][vec_oprnds_i[i]++];
                        }
@@ -4532,11 +4517,6 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
                        {
                          if (m == 0 && l == 0)
                            {
-                             if (!1)
-                               vect_get_vec_defs_for_operand (vinfo, stmt_info,
-                                                              k * o * ncopies,
-                                                              op,
-                                                              &vec_oprnds[i]);
                              vec_oprnds_i[i] = 0;
                              vec_oprnd0 = vec_oprnds[i][vec_oprnds_i[i]++];
                            }
@@ -4600,14 +4580,7 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
                          /* The SIMD clone function has the same number of
                             elements as the current function.  */
                          if (m == 0)
-                           {
-                             if (!1)
-                               vect_get_vec_defs_for_operand (vinfo, stmt_info,
-                                                              o * ncopies,
-                                                              op,
-                                                              &vec_oprnds[i]);
-                             vec_oprnds_i[i] = 0;
-                           }
+                           vec_oprnds_i[i] = 0;
                          vec_oprnd0 = vec_oprnds[i][vec_oprnds_i[i]++];
                          if (loop_vinfo
                              && LOOP_VINFO_FULLY_MASKED_P (loop_vinfo))
@@ -4658,14 +4631,7 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
                  for (m = j * o; m < (j + 1) * o; m++)
                    {
                      if (m == 0)
-                       {
-                         if (!1)
-                           vect_get_vec_defs_for_operand (vinfo, stmt_info,
-                                                          o * ncopies,
-                                                          op,
-                                                          &vec_oprnds[i]);
-                         vec_oprnds_i[i] = 0;
-                       }
+                       vec_oprnds_i[i] = 0;
                      if (maybe_lt (atype_subparts,
                                    TYPE_VECTOR_SUBPARTS (arginfo[i].vectype)))
                        {
@@ -4902,11 +4868,8 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
 
                  if (j == 0 && l == 0)
                    *vec_stmt = new_stmt;
-                 if (1)
-                   SLP_TREE_VEC_DEFS (slp_node)
-                     .quick_push (gimple_assign_lhs (new_stmt));
-                 else
-                   STMT_VINFO_VEC_STMTS (stmt_info).safe_push (new_stmt);
+                 SLP_TREE_VEC_DEFS (slp_node)
+                   .quick_push (gimple_assign_lhs (new_stmt));
                }
 
              if (ratype)
@@ -4951,11 +4914,8 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
 
              if ((unsigned) j == k - 1)
                *vec_stmt = new_stmt;
-             if (1)
-               SLP_TREE_VEC_DEFS (slp_node)
-                 .quick_push (gimple_assign_lhs (new_stmt));
-             else
-               STMT_VINFO_VEC_STMTS (stmt_info).safe_push (new_stmt);
+             SLP_TREE_VEC_DEFS (slp_node)
+               .quick_push (gimple_assign_lhs (new_stmt));
              continue;
            }
          else if (ratype)
@@ -4978,10 +4938,7 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
 
       if (j == 0)
        *vec_stmt = new_stmt;
-      if (1)
-       SLP_TREE_VEC_DEFS (slp_node).quick_push (gimple_get_lhs (new_stmt));
-      else
-       STMT_VINFO_VEC_STMTS (stmt_info).safe_push (new_stmt);
+      SLP_TREE_VEC_DEFS (slp_node).quick_push (gimple_get_lhs (new_stmt));
     }
 
   for (i = 0; i < nargs; ++i)
@@ -4994,26 +4951,6 @@ vectorizable_simd_clone_call (vec_info *vinfo, 
stmt_vec_info stmt_info,
   /* Mark the clone as no longer being a candidate for GC.  */
   bestn->gc_candidate = false;
 
-  /* The call in STMT might prevent it from being removed in dce.
-     We however cannot remove it here, due to the way the ssa name
-     it defines is mapped to the new definition.  So just replace
-     rhs of the statement with something harmless.  */
-
-  if (1)
-    return true;
-
-  gimple *new_stmt;
-  if (scalar_dest)
-    {
-      type = TREE_TYPE (scalar_dest);
-      lhs = gimple_call_lhs (vect_orig_stmt (stmt_info)->stmt);
-      new_stmt = gimple_build_assign (lhs, build_zero_cst (type));
-    }
-  else
-    new_stmt = gimple_build_nop ();
-  vinfo->replace_stmt (gsi, vect_orig_stmt (stmt_info), new_stmt);
-  unlink_stmt_vdef (stmt);
-
   return true;
 }
 
-- 
2.43.0

Reply via email to