aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2016-05-30 16:12:46 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2016-05-30 14:12:46 +0000
commite5b1fae41b02c97227598559e6d3601a109d9e49 (patch)
tree8c2690338bdd403e7419cb52d2597ee324b18353
parenteb897cfcf5b0777f1e1d25e0b3c64d233dd56ec0 (diff)
downloadgcc-e5b1fae41b02c97227598559e6d3601a109d9e49.zip
gcc-e5b1fae41b02c97227598559e6d3601a109d9e49.tar.gz
gcc-e5b1fae41b02c97227598559e6d3601a109d9e49.tar.bz2
* tree-vect-loop.c (vect_transform_loop): Update likely bounds.
From-SVN: r236880
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/tree-vect-loop.c14
2 files changed, 15 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 82d3683..df40818 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
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
for peeled copies; avoid underflow when updating estimates; correctly
scale loop profile.
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index cada096..6463a81 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)
{