diff mbox series

vect: Fix shift-by-induction for single-lane slp

Message ID LV2PR01MB7839215FF76EBD5677AA8D1CF7D62@LV2PR01MB7839.prod.exchangelabs.com
State New
Headers show
Series vect: Fix shift-by-induction for single-lane slp | expand

Commit Message

Feng Xue OS June 26, 2024, 2:57 p.m. UTC
Allow shift-by-induction for slp node, when it is single lane, which is
aligned with the original loop-based handling. 

Thanks,
Feng

---
 gcc/tree-vect-stmts.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index ca6052662a3..840e162c7f0 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -6247,7 +6247,7 @@  vectorizable_shift (vec_info *vinfo,
   if ((dt[1] == vect_internal_def
        || dt[1] == vect_induction_def
        || dt[1] == vect_nested_cycle)
-      && !slp_node)
+      && (!slp_node || SLP_TREE_LANES (slp_node) == 1))
     scalar_shift_arg = false;
   else if (dt[1] == vect_constant_def
 	   || dt[1] == vect_external_def