aboutsummaryrefslogtreecommitdiff
path: root/gcc/profile.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2016-06-10 14:46:30 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2016-06-10 12:46:30 +0000
commitaade5c72c6adb395d2bddb0d08c6626d537a1714 (patch)
tree51e6e0da3d401e02cfe021ad40bcd7b0cf5e8df6 /gcc/profile.c
parent1f24fd3e734381f5e268d3a9897a2268b6d0485b (diff)
downloadgcc-aade5c72c6adb395d2bddb0d08c6626d537a1714.zip
gcc-aade5c72c6adb395d2bddb0d08c6626d537a1714.tar.gz
gcc-aade5c72c6adb395d2bddb0d08c6626d537a1714.tar.bz2
profile.c: Include cfgloop.h.
* 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. From-SVN: r237305
Diffstat (limited to 'gcc/profile.c')
-rw-r--r--gcc/profile.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/profile.c b/gcc/profile.c
index 9925bb5..4519e7d 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 ();
}
}