summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-06-19 07:26:50 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-06-19 07:26:50 +0000
commitadb7eaa2bac31047b37cc8b9cb7b4121ca0a8fea (patch)
tree45140d490b96fcec2f3b954c5e0f7d1496ea0b05 /gcc/tree-ssa-loop-niter.c
parentdb9bbdeca441e21f50b12cbfc2ff34992242b4f3 (diff)
tree-ssa-loop-niter.h (estimate_numbers_of_iterations): Take struct function as arg.
2017-06-19 Richard Biener <rguenther@suse.de> * tree-ssa-loop-niter.h (estimate_numbers_of_iterations): Take struct function as arg. (estimate_numbers_of_iterations): Export overload with loop arg. (free_numbers_of_iterations_estimates_loop): Use an overload of free_numbers_of_iterations_estimates instead. * tree-cfg.c (remove_bb): Adjust. * tree-cfgcleanup.c (remove_forwarder_block_with_phi): Likewise. * tree-parloops.c (gen_parallel_loop): Likewise. * tree-ssa-loop-ivcanon.c (canonicalize_induction_variables): Likewise. (tree_unroll_loops_completely): Likewise. * tree-ssa-loop-niter.c (estimate_numbers_of_iterations_loop): Use an overload instead and export. (estimated_loop_iterations): Adjust. (max_loop_iterations): Likewise. (likely_max_loop_iterations): Likewise. (estimate_numbers_of_iterations): Take struct function as arg and adjust. (loop_exits_before_overflow): Adjust. (free_numbers_of_iterations_estimates_loop): Use an overload. * tree-vect-loop.c (vect_analyze_loop_form): Adjust. * tree-vectorizer.c (vect_free_loop_info_assumptions): Likewise. From-SVN: r249358
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r--gcc/tree-ssa-loop-niter.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index b1f14078b4f..848e812cb96 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -3786,8 +3786,8 @@ maybe_lower_iteration_bound (struct loop *loop)
/* Records estimates on numbers of iterations of LOOP. If USE_UNDEFINED_P
is true also use estimates derived from undefined behavior. */
-static void
-estimate_numbers_of_iterations_loop (struct loop *loop)
+void
+estimate_numbers_of_iterations (struct loop *loop)
{
vec<edge> exits;
tree niter, type;
@@ -3876,7 +3876,7 @@ estimated_loop_iterations (struct loop *loop, widest_int *nit)
/* When SCEV information is available, try to update loop iterations
estimate. Otherwise just return whatever we recorded earlier. */
if (scev_initialized_p ())
- estimate_numbers_of_iterations_loop (loop);
+ estimate_numbers_of_iterations (loop);
return (get_estimated_loop_iterations (loop, nit));
}
@@ -3912,7 +3912,7 @@ max_loop_iterations (struct loop *loop, widest_int *nit)
/* When SCEV information is available, try to update loop iterations
estimate. Otherwise just return whatever we recorded earlier. */
if (scev_initialized_p ())
- estimate_numbers_of_iterations_loop (loop);
+ estimate_numbers_of_iterations (loop);
return get_max_loop_iterations (loop, nit);
}
@@ -3947,7 +3947,7 @@ likely_max_loop_iterations (struct loop *loop, widest_int *nit)
/* When SCEV information is available, try to update loop iterations
estimate. Otherwise just return whatever we recorded earlier. */
if (scev_initialized_p ())
- estimate_numbers_of_iterations_loop (loop);
+ estimate_numbers_of_iterations (loop);
return get_likely_max_loop_iterations (loop, nit);
}
@@ -4051,7 +4051,7 @@ estimated_stmt_executions (struct loop *loop, widest_int *nit)
/* Records estimates on numbers of iterations of loops. */
void
-estimate_numbers_of_iterations (void)
+estimate_numbers_of_iterations (function *fn)
{
struct loop *loop;
@@ -4059,10 +4059,8 @@ estimate_numbers_of_iterations (void)
loop iteration estimates. */
fold_defer_overflow_warnings ();
- FOR_EACH_LOOP (loop, 0)
- {
- estimate_numbers_of_iterations_loop (loop);
- }
+ FOR_EACH_LOOP_FN (fn, loop, 0)
+ estimate_numbers_of_iterations (loop);
fold_undefer_and_ignore_overflow_warnings ();
}
@@ -4235,7 +4233,7 @@ loop_exits_before_overflow (tree base, tree step,
valid_niter = fold_build2 (FLOOR_DIV_EXPR, unsigned_type, delta, step_abs);
- estimate_numbers_of_iterations_loop (loop);
+ estimate_numbers_of_iterations (loop);
if (max_loop_iterations (loop, &niter)
&& wi::fits_to_tree_p (niter, TREE_TYPE (valid_niter))
@@ -4502,7 +4500,7 @@ scev_probably_wraps_p (tree var, tree base, tree step,
/* Frees the information on upper bounds on numbers of iterations of LOOP. */
void
-free_numbers_of_iterations_estimates_loop (struct loop *loop)
+free_numbers_of_iterations_estimates (struct loop *loop)
{
struct control_iv *civ;
struct nb_iter_bound *bound;
@@ -4534,9 +4532,7 @@ free_numbers_of_iterations_estimates (function *fn)
struct loop *loop;
FOR_EACH_LOOP_FN (fn, loop, 0)
- {
- free_numbers_of_iterations_estimates_loop (loop);
- }
+ free_numbers_of_iterations_estimates (loop);
}
/* Substitute value VAL for ssa name NAME inside expressions held