tree-vect-data-refs.c (vect_analyze_data_ref_dependences): Assert compute_all_depende...
authorRichard Biener <rguenther@suse.de>
Fri, 29 Jun 2018 09:49:14 +0000 (09:49 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 29 Jun 2018 09:49:14 +0000 (09:49 +0000)
2018-06-29  Richard Biener  <rguenther@suse.de>

* tree-vect-data-refs.c (vect_analyze_data_ref_dependences): Assert
compute_all_dependences succeeds.
* tree-vect-loop.c (vect_get_datarefs_in_loop): Fail early if we
exceed --param loop-max-datarefs-for-datadeps.

From-SVN: r262244

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

index 67f562cb073e28ba36e467d2c46f88bdc0b292e4..bc333f2dae67b230d7c3726a99d43b7d3eec77ba 100644 (file)
@@ -1,3 +1,10 @@
+2018-06-29  Richard Biener  <rguenther@suse.de>
+
+       * tree-vect-data-refs.c (vect_analyze_data_ref_dependences): Assert
+       compute_all_dependences succeeds.
+       * tree-vect-loop.c (vect_get_datarefs_in_loop): Fail early if we
+       exceed --param loop-max-datarefs-for-datadeps.
+
 2018-06-29  Jakub Jelinek  <jakub@redhat.com>
 
        * config/rs6000/t-rs6000: Append rs6000-modes.h to TM_H.
index 9f848fefd1e7f89d491f47e72881f4d3f23978a8..63429a34bf2e16e99f9c5253e3ee66284b2d9fe0 100644 (file)
@@ -575,10 +575,11 @@ vect_analyze_data_ref_dependences (loop_vec_info loop_vinfo,
                 * LOOP_VINFO_DATAREFS (loop_vinfo).length ());
       /* We need read-read dependences to compute
         STMT_VINFO_SAME_ALIGN_REFS.  */
-      if (!compute_all_dependences (LOOP_VINFO_DATAREFS (loop_vinfo),
-                                   &LOOP_VINFO_DDRS (loop_vinfo),
-                                   LOOP_VINFO_LOOP_NEST (loop_vinfo), true))
-       return false;
+      bool res = compute_all_dependences (LOOP_VINFO_DATAREFS (loop_vinfo),
+                                         &LOOP_VINFO_DDRS (loop_vinfo),
+                                         LOOP_VINFO_LOOP_NEST (loop_vinfo),
+                                         true);
+      gcc_assert (res);
     }
 
   LOOP_VINFO_NO_DATA_DEPENDENCIES (loop_vinfo) = true;
index ab76be0bdac2de0f4ceacc853faa0246528d35f1..8741e0bc02a9d4771b423292df01ca8c0dd7c845 100644 (file)
@@ -1812,6 +1812,11 @@ vect_get_datarefs_in_loop (loop_p loop, basic_block *bbs,
              }
            return false;
          }
+       /* If dependence analysis will give up due to the limit on the
+          number of datarefs stop here and fail fatally.  */
+       if (datarefs->length ()
+           > (unsigned)PARAM_VALUE (PARAM_LOOP_MAX_DATAREFS_FOR_DATADEPS))
+         return false;
       }
   return true;
 }