tree-vect-data-refs.c (vect_slp_analyze_node_dependences): Skip unnecessary data...
authorBin Cheng <bin.cheng@arm.com>
Mon, 31 Oct 2016 09:27:31 +0000 (09:27 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Mon, 31 Oct 2016 09:27:31 +0000 (09:27 +0000)
* tree-vect-data-refs.c (vect_slp_analyze_node_dependences): Skip
unnecessary data dependence check after visited store stmt.

From-SVN: r241696

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

index f29b9b507fcf03de522685095e65e94ee1eed7c1..49698e6af485bf7a0ab7d9a01662d9bad48b335e 100644 (file)
@@ -1,3 +1,8 @@
+2016-10-31  Bin Cheng  <bin.cheng@arm.com>
+
+       * tree-vect-data-refs.c (vect_slp_analyze_node_dependences): Skip
+       unnecessary data dependence check after visited store stmt.
+
 2016-10-30  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        PR tree-optimization/71915
index c99fa4069beb398d0744e8bdd5a25a93d0639a5f..9346cfeafd25cc068080ecd4768ba7ad7a7e80ac 100644 (file)
@@ -583,6 +583,7 @@ vect_slp_analyze_node_dependences (slp_instance instance, slp_tree node,
          if (!dr_b)
            return false;
 
+         bool dependent = false;
          /* If we run into a store of this same instance (we've just
             marked those) then delay dependence checking until we run
             into the last store because this is where it will have
@@ -599,22 +600,21 @@ vect_slp_analyze_node_dependences (slp_instance instance, slp_tree node,
                    = STMT_VINFO_DATA_REF (vinfo_for_stmt (store));
                  ddr_p ddr = initialize_data_dependence_relation
                                (dr_a, store_dr, vNULL);
-                 if (vect_slp_analyze_data_ref_dependence (ddr))
-                   {
-                     free_dependence_relation (ddr);
-                     return false;
-                   }
+                 dependent = vect_slp_analyze_data_ref_dependence (ddr);
                  free_dependence_relation (ddr);
+                 if (dependent)
+                   break;
                }
            }
-
-         ddr_p ddr = initialize_data_dependence_relation (dr_a, dr_b, vNULL);
-         if (vect_slp_analyze_data_ref_dependence (ddr))
+         else
            {
+             ddr_p ddr = initialize_data_dependence_relation (dr_a,
+                                                              dr_b, vNULL);
+             dependent = vect_slp_analyze_data_ref_dependence (ddr);
              free_dependence_relation (ddr);
-             return false;
            }
-         free_dependence_relation (ddr);
+         if (dependent)
+           return false;
        }
     }
   return true;