Commit 641762ae by Jan Hubicka Committed by Jan Hubicka

tree-ssa-loop-niter.c (estimate_numbers_of_iterations_loop): Avoid use of…

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
parent 0d2f700f
2016-06-03 Jan Hubicka <hubicka@ucw.cz>
* 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.
2016-06-03 Joseph Myers <joseph@codesourcery.com> 2016-06-03 Joseph Myers <joseph@codesourcery.com>
PR target/71276 PR target/71276
......
...@@ -826,8 +826,6 @@ compute_branch_probabilities (unsigned cfg_checksum, unsigned lineno_checksum) ...@@ -826,8 +826,6 @@ compute_branch_probabilities (unsigned cfg_checksum, unsigned lineno_checksum)
} }
} }
counts_to_freqs (); counts_to_freqs ();
profile_status_for_fn (cfun) = PROFILE_READ;
compute_function_frequency ();
if (dump_file) if (dump_file)
{ {
...@@ -1329,8 +1327,13 @@ branch_prob (void) ...@@ -1329,8 +1327,13 @@ branch_prob (void)
values.release (); values.release ();
free_edge_list (el); free_edge_list (el);
coverage_end_function (lineno_checksum, cfg_checksum); coverage_end_function (lineno_checksum, cfg_checksum);
if (dump_file && (dump_flags & TDF_DETAILS)) if (flag_branch_probabilities && profile_info)
report_predictor_hitrates (); {
if (dump_file && (dump_flags & TDF_DETAILS))
report_predictor_hitrates ();
profile_status_for_fn (cfun) = PROFILE_READ;
compute_function_frequency ();
}
} }
/* Union find algorithm implementation for the basic blocks using /* Union find algorithm implementation for the basic blocks using
......
...@@ -3757,10 +3757,12 @@ estimate_numbers_of_iterations_loop (struct loop *loop) ...@@ -3757,10 +3757,12 @@ estimate_numbers_of_iterations_loop (struct loop *loop)
maybe_lower_iteration_bound (loop); maybe_lower_iteration_bound (loop);
/* If we have a measured profile, use it to estimate the number of /* If we have a measured profile, use it to estimate the number of
iterations. */ iterations. Explicitly check for profile status so we do not report
if (loop->header->count != 0) 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); bound = gcov_type_to_wide_int (nit);
record_niter_bound (loop, bound, true, false); record_niter_bound (loop, bound, true, false);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment