[gcc r17-2683] Remove shift vectorization check from vect_build_slp_tree_1

Richard Biener via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:a3a3e4fa672a5d925f303440345a62925fb5f5e8

commit r17-2683-ga3a3e4fa672a5d925f303440345a62925fb5f5e8
Author: Richard Biener <[email protected]>
Date:   Fri Jul 24 09:21:50 2026 +0200

    Remove shift vectorization check from vect_build_slp_tree_1
    
    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.
    
            * tree-vect-slp.cc (vect_build_slp_tree_1): Remove failure
            on unvectorizable shifts.

Diff:
---
 gcc/tree-vect-slp.cc | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index dcd35da43a29..cc802f4f4cd9 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -1327,26 +1327,16 @@ vect_build_slp_tree_1 (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;
-		      /* Fatal mismatch.  */
-		      matches[0] = false;
-		      return false;
-		    }
+		  /* No vector/vector shift, arrange for a vector/scalar
+		     SLP layout.  */
 		  need_same_oprnds = true;
 		  first_op1 = gimple_assign_rhs2 (stmt);
 		}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.