The following removes the SLP discovery failure caused by not
vectorizable shifts.  This does not belong here.  I have kept
the heuristic that forces uniform shift operands when vector-vector
shifts are not supported.

Bootstrap and regtest running on x86_64-unknown-linux-gnu.

I'll probably push before all the rest if that succeeds.

        * tree-vect-slp.cc (vect_build_slp_tree_1): Remove failure
        on unvectorizable shifts.
---
 gcc/tree-vect-slp.cc | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 3b4468cd6e3..8162df180c6 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -1305,24 +1305,16 @@ vect_build_slp_tree_12 (vec_info *vinfo, unsigned char 
*swap,
 
          /* Shift arguments should be equal in all the packed stmts for a
             vector shift with scalar shift operand.  */
-         if (rhs_code == LSHIFT_EXPR || rhs_code == RSHIFT_EXPR
+         if (rhs_code == LSHIFT_EXPR
+             || rhs_code == RSHIFT_EXPR
              || rhs_code == LROTATE_EXPR
              || rhs_code == RROTATE_EXPR)
            {
              /* First see if we have a vector/vector shift.  */
              if (!directly_supported_p (rhs_code, vectype, optab_vector))
                {
-                 /* No vector/vector shift, try for a vector/scalar shift.  */
-                 if (!directly_supported_p (rhs_code, vectype, optab_scalar))
-                   {
-                     if (dump_enabled_p ())
-                       dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
-                                        "Build SLP failed: "
-                                        "op not supported by target.\n");
-                     if (is_a <bb_vec_info> (vinfo) && i != 0)
-                       continue;
-                     return false;
-                   }
+                 /* No vector/vector shift, arrange for a vector/scalar
+                    SLP layout.  */
                  need_same_oprnds = true;
                  first_op1 = gimple_assign_rhs2 (stmt);
                }
-- 
2.51.0

Reply via email to