]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/tree-vect-slp.c
tree-optimization/103544 - SLP reduction chain as SLP reduction issue
[gcc.git] / gcc / tree-vect-slp.c
index bc22ffeed82e6f2f34ae80398847b7bb685f0f73..b912c3577df61a694d5bb9e22c5303fe6a48ab6e 100644 (file)
@@ -2537,7 +2537,8 @@ dot_slp_tree (FILE *f, slp_tree node, hash_set<slp_tree> &visited)
     fprintf (f, "\"%p\" -> \"%p\";", (void *)node, (void *)child);
 
   for (slp_tree child : SLP_TREE_CHILDREN (node))
-    dot_slp_tree (f, child, visited);
+    if (child)
+      dot_slp_tree (f, child, visited);
 }
 
 DEBUG_FUNCTION void
@@ -3418,8 +3419,13 @@ vect_analyze_slp (vec_info *vinfo, unsigned max_tree_size)
                vinfo = next;
              }
            STMT_VINFO_DEF_TYPE (first_element) = vect_internal_def;
-           /* It can be still vectorized as part of an SLP reduction.  */
-           loop_vinfo->reductions.safe_push (last);
+           /* It can be still vectorized as part of an SLP reduction.
+              ???  But only if we didn't skip a conversion around the group.
+              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.  */
+           if (STMT_VINFO_DEF_TYPE (last) == vect_reduction_def)
+             loop_vinfo->reductions.safe_push (last);
          }
 
       /* Find SLP sequences starting from groups of reductions.  */
This page took 0.02918 seconds and 5 git commands to generate.