* tree-vect-loop.c (vect_transform_loop): Update likely bounds.
authorJan Hubicka <hubicka@ucw.cz>
Mon, 30 May 2016 14:12:46 +0000 (16:12 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 30 May 2016 14:12:46 +0000 (14:12 +0000)
From-SVN: r236880

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

index 82d3683c73dd98d1ee3b4bb505e82539a7063c5b..df40818239866ddae0aeaff298c82fc1493b6a0b 100644 (file)
@@ -1,3 +1,7 @@
+2016-05-30  Jan Hubicka  <hubicka@ucw.cz>
+
+       * tree-vect-loop.c (vect_transform_loop): Update likely bounds.
+
 2016-05-30  Jan Hubicka  <hubicka@ucw.cz>
 
        * tree-ssa-loop-ivcanon.c (try_peel_loop): Correctly set wont_exit
index cada09692fb8ec8160b3949d6e4bc4d5a4b7965c..6463a819e5e0448259bb0bd808be20dd55ee3d1e 100644 (file)
@@ -6918,12 +6918,20 @@ vect_transform_loop (loop_vec_info loop_vinfo)
   /* Reduce loop iterations by the vectorization factor.  */
   scale_loop_profile (loop, GCOV_COMPUTE_SCALE (1, vectorization_factor),
                      expected_iterations / vectorization_factor);
-  if (LOOP_VINFO_PEELING_FOR_GAPS (loop_vinfo)
-      && loop->nb_iterations_upper_bound != 0)
-    loop->nb_iterations_upper_bound = loop->nb_iterations_upper_bound - 1;
+  if (LOOP_VINFO_PEELING_FOR_GAPS (loop_vinfo))
+    {
+      if (loop->nb_iterations_upper_bound != 0)
+        loop->nb_iterations_upper_bound = loop->nb_iterations_upper_bound - 1;
+      if (loop->nb_iterations_likely_upper_bound != 0)
+        loop->nb_iterations_likely_upper_bound
+          = loop->nb_iterations_likely_upper_bound - 1;
+    }
   loop->nb_iterations_upper_bound
     = wi::udiv_floor (loop->nb_iterations_upper_bound + 1,
                      vectorization_factor) - 1;
+  loop->nb_iterations_likely_upper_bound
+    = wi::udiv_floor (loop->nb_iterations_likely_upper_bound + 1,
+                     vectorization_factor) - 1;
 
   if (loop->any_estimate)
     {