From e5b1fae41b02c97227598559e6d3601a109d9e49 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Mon, 30 May 2016 16:12:46 +0200 Subject: [PATCH] * tree-vect-loop.c (vect_transform_loop): Update likely bounds. From-SVN: r236880 --- gcc/ChangeLog | 4 ++++ gcc/tree-vect-loop.c | 14 +++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 82d3683c73d..df408182398 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2016-05-30 Jan Hubicka + + * tree-vect-loop.c (vect_transform_loop): Update likely bounds. + 2016-05-30 Jan Hubicka * tree-ssa-loop-ivcanon.c (try_peel_loop): Correctly set wont_exit diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index cada09692fb..6463a819e5e 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -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) { -- 2.30.2