diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-06-10 12:46:30 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-06-10 12:46:30 +0000 |
commit | f5de8018493046bb9369608312f93fac4a97080c (patch) | |
tree | 51e6e0da3d401e02cfe021ad40bcd7b0cf5e8df6 /gcc/profile.c | |
parent | 61724718d52a90fa62ed0e13375054ac793bcd82 (diff) |
* profile.c: Include cfgloop.h.
(branch_prob): Compute estimated number of iterations.
* tree-ssa-loop-niter.c (estimate_numbers_of_iterations_loop): Do not
recompute estimate number of iterations from profile.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237305 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/profile.c')
-rw-r--r-- | gcc/profile.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/profile.c b/gcc/profile.c index 9925bb568c6..4519e7d8558 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -63,6 +63,7 @@ along with GCC; see the file COPYING3. If not see #include "gimple-iterator.h" #include "tree-cfg.h" #include "dumpfile.h" +#include "cfgloop.h" #include "profile.h" @@ -1329,9 +1330,21 @@ branch_prob (void) coverage_end_function (lineno_checksum, cfg_checksum); if (flag_branch_probabilities && profile_info) { + struct loop *loop; if (dump_file && (dump_flags & TDF_DETAILS)) report_predictor_hitrates (); profile_status_for_fn (cfun) = PROFILE_READ; + + /* At this moment we have precise loop iteration count estimates. + Record them to loop structure before the profile gets out of date. */ + FOR_EACH_LOOP (loop, 0) + if (loop->header->count) + { + gcov_type nit = expected_loop_iterations_unbounded (loop); + widest_int bound = gcov_type_to_wide_int (nit); + loop->any_estimate = false; + record_niter_bound (loop, bound, true, false); + } compute_function_frequency (); } } |