summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-ivcanon.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2016-05-27 14:10:34 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2016-05-27 12:10:34 +0000
commit105e29c5cf8729021614b152328bcfe054bed64d (patch)
tree9c8ce8178d2d6e5fb92b3271a8afae4b5b62e6c0 /gcc/tree-ssa-loop-ivcanon.c
parent3cee7e4e2badde2374fc77bb8f3a072e1698d1fe (diff)
cfgloop.c (record_niter_bound): Record likely upper bounds.
* cfgloop.c (record_niter_bound): Record likely upper bounds. (likely_max_stmt_executions_int, get_likely_max_loop_iterations, get_likely_max_loop_iterations_int): New. * cfgloop.h (struct loop): Add nb_iterations_likely_upper_bound, any_likely_upper_bound. (get_likely_max_loop_iterations_int, get_likely_max_loop_iterations): Declare. * cfgloopmanip.c (copy_loop_info): Copy likely upper bounds. * loop-unroll.c (unroll_loop_constant_iterations): Update likely upper bound. (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. * lto-streamer-in.c (input_cfg): Stream likely upper bounds. * lto-streamer-out.c (output_cfg): Likewise. * tree-ssa-loop-ivcanon.c (try_peel_loop): Update likely upper bounds. (canonicalize_loop_induction_variables): Dump likely upper bounds. * tree-ssa-loop-niter.c (record_estimate): Record likely upper bounds. (likely_max_loop_iterations): New. (likely_max_loop_iterations_int): New. (likely_max_stmt_executions): New. * tree-ssa-loop-niter.h (likely_max_loop_iterations, likely_max_loop_iterations_int, likely_max_stmt_executions_int, likely_max_stmt_executions): Declare. From-SVN: r236816
Diffstat (limited to 'gcc/tree-ssa-loop-ivcanon.c')
-rw-r--r--gcc/tree-ssa-loop-ivcanon.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index e8f67953231..de447f40e78 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -1036,6 +1036,8 @@ try_peel_loop (struct loop *loop,
}
if (loop->any_upper_bound)
loop->nb_iterations_upper_bound -= npeel;
+ if (loop->any_likely_upper_bound)
+ loop->nb_iterations_likely_upper_bound -= npeel;
loop->nb_iterations_estimate = 0;
/* Make sure to mark loop cold so we do not try to peel it more. */
scale_loop_profile (loop, 1, 0);
@@ -1107,6 +1109,12 @@ canonicalize_loop_induction_variables (struct loop *loop,
fprintf (dump_file, "Loop %d iterates at most %i times.\n", loop->num,
(int)maxiter);
}
+ if (dump_file && (dump_flags & TDF_DETAILS)
+ && likely_max_loop_iterations_int (loop) >= 0)
+ {
+ fprintf (dump_file, "Loop likely %d iterates at most %i times.\n", loop->num,
+ (int)likely_max_loop_iterations_int (loop));
+ }
/* Remove exits that are known to be never taken based on loop bound.
Needs to be called after compilation of max_loop_iterations_int that