]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix SLP double-reduction support
authorRichard Biener <rguenther@suse.de>
Fri, 6 Sep 2024 11:24:38 +0000 (13:24 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 6 Sep 2024 12:15:04 +0000 (14:15 +0200)
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.

gcc/tree-vect-slp.cc

index 3d2973698e27dd78253ebe071de8b0291b64a6ec..0fb17340bd3c0e79dad06951853fed1cce66bbc6 100644 (file)
@@ -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.  */