diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2016-06-03 19:00:19 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2016-06-03 17:00:19 +0000 |
commit | 641762ae264c86492d869d55559644e87ed36d46 (patch) | |
tree | 77e01c3bfeb741c9d3244647bd9b356c05368d43 /gcc/tree-ssa-loop-niter.c | |
parent | 0d2f700f7be6780985b2cfd6bfca44523e058cbc (diff) | |
download | gcc-641762ae264c86492d869d55559644e87ed36d46.zip gcc-641762ae264c86492d869d55559644e87ed36d46.tar.gz gcc-641762ae264c86492d869d55559644e87ed36d46.tar.bz2 |
tree-ssa-loop-niter.c (estimate_numbers_of_iterations_loop): Avoid use of profile unless profile status is PROFILE_READ.
* tree-ssa-loop-niter.c (estimate_numbers_of_iterations_loop): Avoid
use of profile unless profile status is PROFILE_READ.
* profile.c (compute_branch_probabilities): Set profile status
only after reporting predictor hitrates.
From-SVN: r237076
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r-- | gcc/tree-ssa-loop-niter.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index e70e0a7..7804036 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -3757,10 +3757,12 @@ estimate_numbers_of_iterations_loop (struct loop *loop) maybe_lower_iteration_bound (loop); /* If we have a measured profile, use it to estimate the number of - iterations. */ - if (loop->header->count != 0) + iterations. Explicitly check for profile status so we do not report + wrong prediction hitrates for guessed loop iterations heuristics. */ + if (loop->header->count != 0 + && profile_status_for_fn (cfun) >= PROFILE_READ) { - gcov_type nit = expected_loop_iterations_unbounded (loop) + 1; + gcov_type nit = expected_loop_iterations_unbounded (loop); bound = gcov_type_to_wide_int (nit); record_niter_bound (loop, bound, true, false); } |