https://gcc.gnu.org/g:ea9d4bf45ef906b990abdb101297e34366059f1c

commit r15-3514-gea9d4bf45ef906b990abdb101297e34366059f1c
Author: Richard Biener <rguent...@suse.de>
Date:   Fri Sep 6 13:24:38 2024 +0200

    Fix SLP double-reduction support
    
    When doing SLP discovery I forgot to handle double reductions even
    though they are already queued in LOOP_VINFO_REDUCTIONS.
    
            * tree-vect-slp.cc (vect_analyze_slp): Also handle discovery
            for double reductions.

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

diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 3d2973698e2..0fb17340bd3 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -4652,7 +4652,9 @@ vect_analyze_slp (vec_info *vinfo, unsigned max_tree_size)
                     reduction path.  In that case we'd have to reverse
                     engineer that conversion stmt following the chain using
                     reduc_idx and from the PHI using reduc_def.  */
-                 && STMT_VINFO_DEF_TYPE (next_info) == vect_reduction_def)
+                 && (STMT_VINFO_DEF_TYPE (next_info) == vect_reduction_def
+                     || (STMT_VINFO_DEF_TYPE (next_info)
+                         == vect_double_reduction_def)))
                {
                  /* Do not discover SLP reductions combining lane-reducing
                     ops, that will fail later.  */

Reply via email to