I messed up and checked the vector type instead of the reduction
number of lanes.
Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.
PR tree-optimization/126417
* tree-vect-slp.cc (vectorizable_bb_reduc_epilogue): Check
the total number of lanes instead of the vector type against
the two-lane special case that doesn't need fold-left reduction
handling.
---
gcc/tree-vect-slp.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index b1b92e06324..8c8961e319d 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -9346,7 +9346,7 @@ vectorizable_bb_reduc_epilogue (slp_instance instance,
be included here. */
|| (needs_fold_left_reduction_p (TREE_TYPE (vectype), reduc_code)
&& (!instance->remain_defs.is_empty ()
- || maybe_ne (TYPE_VECTOR_SUBPARTS (vectype), 2u))))
+ || SLP_TREE_LANES (SLP_INSTANCE_TREE (instance)) != 2)))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
--
2.51.0