tree-vect-loop-manip.c (vect_do_peeling_for_loop_bound): If the epilogue loop is...
authorRichard Guenther <rguenther@suse.de>
Tue, 24 Apr 2012 11:25:21 +0000 (11:25 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 24 Apr 2012 11:25:21 +0000 (11:25 +0000)
2012-04-24  Richard Guenther  <rguenther@suse.de>

* tree-vect-loop-manip.c (vect_do_peeling_for_loop_bound): If
the epilogue loop is not re-used as unvectorized version
record the its maximum number of iterations.

From-SVN: r186760

gcc/ChangeLog
gcc/tree-vect-loop-manip.c

index 8e57d2843cc3d4b54e1f2d09d020fb32e00530be..f02bf710fb179b9cd38793b5c21ccbc7fec8bc45 100644 (file)
@@ -1,3 +1,9 @@
+2012-04-24  Richard Guenther  <rguenther@suse.de>
+
+       * tree-vect-loop-manip.c (vect_do_peeling_for_loop_bound): If
+       the epilogue loop is not re-used as unvectorized version
+       record the its maximum number of iterations.
+
 2012-04-24  Andrew Pinski  <apinski@cavium.com>
 
        * tree-ssa-forwprop.c (simplify_bitwise_binary):
index 32f57fe993af74f0b1f694f3e9d4db247d1a8803..5e5d6ef3121f04ec8508bda4b92549bac01f7d3e 100644 (file)
@@ -1966,6 +1966,16 @@ vect_do_peeling_for_loop_bound (loop_vec_info loop_vinfo, tree *ratio,
      by ratio_mult_vf_name steps.  */
   vect_update_ivs_after_vectorizer (loop_vinfo, ratio_mult_vf_name, update_e);
 
+  if (!LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT (loop_vinfo)
+      && !LOOP_REQUIRES_VERSIONING_FOR_ALIAS (loop_vinfo))
+    {
+      int max_iter = MAX (LOOP_VINFO_VECT_FACTOR (loop_vinfo) - 1, (int) th);
+      record_niter_bound (new_loop, shwi_to_double_int (max_iter), false, true);
+      if (dump_file && (dump_flags & TDF_DETAILS))
+       fprintf (dump_file, "Setting upper bound of nb iterations for epilogue "
+                "loop to %d\n", max_iter);
+    }
+
   /* After peeling we have to reset scalar evolution analyzer.  */
   scev_reset ();