tree-vect-data-refs.c (vect_slp_analyze_node_dependences): Handle memory using/clobbe...
authorRichard Biener <rguenther@suse.de>
Tue, 10 Nov 2015 10:12:13 +0000 (10:12 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 10 Nov 2015 10:12:13 +0000 (10:12 +0000)
2015-11-10  Richard Biener  <rguenther@suse.de>

* tree-vect-data-refs.c (vect_slp_analyze_node_dependences):
Handle memory using/clobbering stmts without a STMT_VINFO_DATA_REF
conservatively.

From-SVN: r230094

gcc/ChangeLog
gcc/tree-vect-data-refs.c

index 68163747ca153ab74850a260206ead2d17523112..9db12db3a75edeca989cfd6edba3cffa19dca5cd 100644 (file)
@@ -1,3 +1,9 @@
+2015-11-10  Richard Biener  <rguenther@suse.de>
+
+       * tree-vect-data-refs.c (vect_slp_analyze_node_dependences):
+       Handle memory using/clobbering stmts without a STMT_VINFO_DATA_REF
+       conservatively.
+
 2015-11-10  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/56118
index 6e323911d932cae123ce24cdff2f6238fa2229c0..77313ec4e1a0cc97adba9873ae243b531d717ff2 100644 (file)
@@ -573,21 +573,22 @@ vect_slp_analyze_node_dependences (slp_instance instance, slp_tree node)
       gimple *access = SLP_TREE_SCALAR_STMTS (node)[k];
       if (access == last_access)
        continue;
-      stmt_vec_info access_stmt_info = vinfo_for_stmt (access);
-      gimple_stmt_iterator gsi = gsi_for_stmt (access);
-      gsi_next (&gsi);
-      for (; gsi_stmt (gsi) != last_access; gsi_next (&gsi))
+      data_reference *dr_a = STMT_VINFO_DATA_REF (vinfo_for_stmt (access));
+      for (gimple_stmt_iterator gsi = gsi_for_stmt (access);
+          gsi_stmt (gsi) != last_access; gsi_next (&gsi))
        {
          gimple *stmt = gsi_stmt (gsi);
-         stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
-         if (!STMT_VINFO_DATA_REF (stmt_info)
-             || (DR_IS_READ (STMT_VINFO_DATA_REF (stmt_info))
-                 && DR_IS_READ (STMT_VINFO_DATA_REF (access_stmt_info))))
+         if (! gimple_vuse (stmt)
+             || (DR_IS_READ (dr_a) && ! gimple_vdef (stmt)))
            continue;
 
-         ddr_p ddr = initialize_data_dependence_relation
-             (STMT_VINFO_DATA_REF (access_stmt_info),
-              STMT_VINFO_DATA_REF (stmt_info), vNULL);
+         /* If we couldn't record a (single) data reference for this
+            stmt we have to give up.  */
+         data_reference *dr_b = STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt));
+         if (!dr_b)
+           return false;
+
+         ddr_p ddr = initialize_data_dependence_relation (dr_a, dr_b, vNULL);
          if (vect_slp_analyze_data_ref_dependence (ddr))
            {
              /* ???  If the dependence analysis failed we can resort to the