tree-vect-slp.c (vect_detect_hybrid_slp_2): Match up what we consider a relevant...
authorRichard Biener <rguenther@suse.de>
Fri, 2 Jun 2017 13:11:11 +0000 (13:11 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 2 Jun 2017 13:11:11 +0000 (13:11 +0000)
2017-06-02  Richard Biener  <rguenther@suse.de>

* tree-vect-slp.c (vect_detect_hybrid_slp_2): Match up
what we consider a relevant use stmt with vect_detect_hybrid_slp_stmts.

From-SVN: r248825

gcc/ChangeLog
gcc/tree-vect-slp.c

index 499e6bb63851dd209188b4677991273d78f59775..4f861e16ade94221d14cb8f7c9c63d5c26c8a7b1 100644 (file)
@@ -1,3 +1,8 @@
+2017-06-02  Richard Biener  <rguenther@suse.de>
+
+       * tree-vect-slp.c (vect_detect_hybrid_slp_2): Match up
+       what we consider a relevant use stmt with vect_detect_hybrid_slp_stmts.
+
 2017-06-02  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/80948
index d221fc63873c10edbf65d35009a1522e8cad44bf..31194b823d022e01cda5dc0c07167b7f4e152aae 100644 (file)
@@ -2245,9 +2245,16 @@ static tree
 vect_detect_hybrid_slp_2 (gimple_stmt_iterator *gsi, bool *handled,
                          walk_stmt_info *)
 {
+  stmt_vec_info use_vinfo = vinfo_for_stmt (gsi_stmt (*gsi));
   /* If the stmt is in a SLP instance then this isn't a reason
      to mark use definitions in other SLP instances as hybrid.  */
-  if (STMT_SLP_TYPE (vinfo_for_stmt (gsi_stmt (*gsi))) != loop_vect)
+  if (! STMT_SLP_TYPE (use_vinfo)
+      && (STMT_VINFO_RELEVANT (use_vinfo)
+         || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (use_vinfo)))
+      && ! (gimple_code (gsi_stmt (*gsi)) == GIMPLE_PHI
+           && STMT_VINFO_DEF_TYPE (use_vinfo) == vect_reduction_def))
+    ;
+  else
     *handled = true;
   return NULL_TREE;
 }