re PR tree-optimization/81303 (410.bwaves regression caused by r249919)
authorRichard Biener <rguenther@suse.de>
Fri, 21 Jul 2017 07:13:57 +0000 (07:13 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 21 Jul 2017 07:13:57 +0000 (07:13 +0000)
2016-07-21  Richard Biener  <rguenther@suse.de>

PR tree-optimization/81303
* tree-vect-loop.c (vect_estimate_min_profitable_iters): Take
into account prologue and epilogue iterations when raising
min_profitable_iters to sth at least covering one vector iteration.

From-SVN: r250416

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

index 2e29894a92044efaee70c66e5c437828caabaf78..e5bd2bf58bc8e69622fa9b0feabd24238d9fe801 100644 (file)
@@ -1,3 +1,10 @@
+2016-07-21  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/81303
+       * tree-vect-loop.c (vect_estimate_min_profitable_iters): Take
+       into account prologue and epilogue iterations when raising
+       min_profitable_iters to sth at least covering one vector iteration.
+
 2017-07-21  Tamar Christina  <tamar.christina@arm.com>
 
        * config/arm/arm.c (arm_test_cpu_arch_dat):
index 7bae41680afc3562d855876cb8fcb48d54ead163..64d86995c84ea9a8875e5bdfd0a662fba85e2edd 100644 (file)
@@ -3702,8 +3702,9 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo,
               "  Calculated minimum iters for profitability: %d\n",
               min_profitable_iters);
 
-  min_profitable_iters =
-       min_profitable_iters < vf ? vf : min_profitable_iters;
+  /* We want the vectorized loop to execute at least once.  */
+  if (min_profitable_iters < (vf + peel_iters_prologue + peel_iters_epilogue))
+    min_profitable_iters = vf + peel_iters_prologue + peel_iters_epilogue;
 
   if (dump_enabled_p ())
     dump_printf_loc (MSG_NOTE, vect_location,