Commit 421e6082 by Richard Guenther Committed by Richard Biener

cfgloop.h (estimate_numbers_of_iterations_loop): Remove use_undefined_p parameter.

2012-04-18  Richard Guenther  <rguenther@suse.de>

	* cfgloop.h (estimate_numbers_of_iterations_loop): Remove
	use_undefined_p parameter.
	* tree-flow.h (estimate_numbers_of_iterations): Likewise.
	* tree-ssa-loop-niter.c (estimate_numbers_of_iterations_loop):
	Likewise.
	(estimate_numbers_of_iterations): Likewise.
	(estimated_loop_iterations): Adjust.
	(max_loop_iterations): Likewise.
	(scev_probably_wraps_p): Likewise.
	* tree-ssa-loop.c (tree_ssa_loop_bounds): Likewise.
	* tree-vrp.c (adjust_range_with_scev): Use max_stmt_executions,
	not max_loop_iterations.
	(execute_vrp): Remove explicit number of iterations estimation.

From-SVN: r186562
parent dcc186d6
2012-04-18 Richard Guenther <rguenther@suse.de>
* cfgloop.h (estimate_numbers_of_iterations_loop): Remove
use_undefined_p parameter.
* tree-flow.h (estimate_numbers_of_iterations): Likewise.
* tree-ssa-loop-niter.c (estimate_numbers_of_iterations_loop):
Likewise.
(estimate_numbers_of_iterations): Likewise.
(estimated_loop_iterations): Adjust.
(max_loop_iterations): Likewise.
(scev_probably_wraps_p): Likewise.
* tree-ssa-loop.c (tree_ssa_loop_bounds): Likewise.
* tree-vrp.c (adjust_range_with_scev): Use max_stmt_executions,
not max_loop_iterations.
(execute_vrp): Remove explicit number of iterations estimation.
2012-04-18 Enkovich Ilya <ilya.enkovich@intel.com> 2012-04-18 Enkovich Ilya <ilya.enkovich@intel.com>
* config/i386/linux-common.h: New. * config/i386/linux-common.h: New.
......
...@@ -278,7 +278,7 @@ gcov_type expected_loop_iterations_unbounded (const struct loop *); ...@@ -278,7 +278,7 @@ gcov_type expected_loop_iterations_unbounded (const struct loop *);
extern unsigned expected_loop_iterations (const struct loop *); extern unsigned expected_loop_iterations (const struct loop *);
extern rtx doloop_condition_get (rtx); extern rtx doloop_condition_get (rtx);
void estimate_numbers_of_iterations_loop (struct loop *, bool); void estimate_numbers_of_iterations_loop (struct loop *);
bool estimated_loop_iterations (struct loop *, double_int *); bool estimated_loop_iterations (struct loop *, double_int *);
bool max_loop_iterations (struct loop *, double_int *); bool max_loop_iterations (struct loop *, double_int *);
HOST_WIDE_INT estimated_loop_iterations_int (struct loop *); HOST_WIDE_INT estimated_loop_iterations_int (struct loop *);
......
...@@ -685,7 +685,7 @@ bool number_of_iterations_exit (struct loop *, edge, ...@@ -685,7 +685,7 @@ bool number_of_iterations_exit (struct loop *, edge,
tree find_loop_niter (struct loop *, edge *); tree find_loop_niter (struct loop *, edge *);
tree loop_niter_by_eval (struct loop *, edge); tree loop_niter_by_eval (struct loop *, edge);
tree find_loop_niter_by_eval (struct loop *, edge *); tree find_loop_niter_by_eval (struct loop *, edge *);
void estimate_numbers_of_iterations (bool); void estimate_numbers_of_iterations (void);
bool scev_probably_wraps_p (tree, tree, gimple, struct loop *, bool); bool scev_probably_wraps_p (tree, tree, gimple, struct loop *, bool);
bool convert_affine_scev (struct loop *, tree, tree *, tree *, gimple, bool); bool convert_affine_scev (struct loop *, tree, tree *, tree *, gimple, bool);
......
...@@ -2950,7 +2950,7 @@ gcov_type_to_double_int (gcov_type val) ...@@ -2950,7 +2950,7 @@ gcov_type_to_double_int (gcov_type val)
is true also use estimates derived from undefined behavior. */ is true also use estimates derived from undefined behavior. */
void void
estimate_numbers_of_iterations_loop (struct loop *loop, bool use_undefined_p) estimate_numbers_of_iterations_loop (struct loop *loop)
{ {
VEC (edge, heap) *exits; VEC (edge, heap) *exits;
tree niter, type; tree niter, type;
...@@ -2984,8 +2984,7 @@ estimate_numbers_of_iterations_loop (struct loop *loop, bool use_undefined_p) ...@@ -2984,8 +2984,7 @@ estimate_numbers_of_iterations_loop (struct loop *loop, bool use_undefined_p)
} }
VEC_free (edge, heap, exits); VEC_free (edge, heap, exits);
if (use_undefined_p) infer_loop_bounds_from_undefined (loop);
infer_loop_bounds_from_undefined (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. */
...@@ -3013,7 +3012,7 @@ estimate_numbers_of_iterations_loop (struct loop *loop, bool use_undefined_p) ...@@ -3013,7 +3012,7 @@ estimate_numbers_of_iterations_loop (struct loop *loop, bool use_undefined_p)
bool bool
estimated_loop_iterations (struct loop *loop, double_int *nit) estimated_loop_iterations (struct loop *loop, double_int *nit)
{ {
estimate_numbers_of_iterations_loop (loop, true); estimate_numbers_of_iterations_loop (loop);
if (!loop->any_estimate) if (!loop->any_estimate)
return false; return false;
...@@ -3028,7 +3027,7 @@ estimated_loop_iterations (struct loop *loop, double_int *nit) ...@@ -3028,7 +3027,7 @@ estimated_loop_iterations (struct loop *loop, double_int *nit)
bool bool
max_loop_iterations (struct loop *loop, double_int *nit) max_loop_iterations (struct loop *loop, double_int *nit)
{ {
estimate_numbers_of_iterations_loop (loop, true); estimate_numbers_of_iterations_loop (loop);
if (!loop->any_upper_bound) if (!loop->any_upper_bound)
return false; return false;
...@@ -3155,7 +3154,7 @@ estimated_stmt_executions (struct loop *loop, double_int *nit) ...@@ -3155,7 +3154,7 @@ estimated_stmt_executions (struct loop *loop, double_int *nit)
/* Records estimates on numbers of iterations of loops. */ /* Records estimates on numbers of iterations of loops. */
void void
estimate_numbers_of_iterations (bool use_undefined_p) estimate_numbers_of_iterations (void)
{ {
loop_iterator li; loop_iterator li;
struct loop *loop; struct loop *loop;
...@@ -3166,7 +3165,7 @@ estimate_numbers_of_iterations (bool use_undefined_p) ...@@ -3166,7 +3165,7 @@ estimate_numbers_of_iterations (bool use_undefined_p)
FOR_EACH_LOOP (li, loop, 0) FOR_EACH_LOOP (li, loop, 0)
{ {
estimate_numbers_of_iterations_loop (loop, use_undefined_p); estimate_numbers_of_iterations_loop (loop);
} }
fold_undefer_and_ignore_overflow_warnings (); fold_undefer_and_ignore_overflow_warnings ();
...@@ -3362,7 +3361,7 @@ scev_probably_wraps_p (tree base, tree step, ...@@ -3362,7 +3361,7 @@ scev_probably_wraps_p (tree base, tree step,
valid_niter = fold_build2 (FLOOR_DIV_EXPR, unsigned_type, delta, step_abs); valid_niter = fold_build2 (FLOOR_DIV_EXPR, unsigned_type, delta, step_abs);
estimate_numbers_of_iterations_loop (loop, true); estimate_numbers_of_iterations_loop (loop);
for (bound = loop->bounds; bound; bound = bound->next) for (bound = loop->bounds; bound; bound = bound->next)
{ {
if (n_of_executions_at_most (at_stmt, bound, valid_niter)) if (n_of_executions_at_most (at_stmt, bound, valid_niter))
......
...@@ -420,7 +420,7 @@ tree_ssa_loop_bounds (void) ...@@ -420,7 +420,7 @@ tree_ssa_loop_bounds (void)
if (number_of_loops () <= 1) if (number_of_loops () <= 1)
return 0; return 0;
estimate_numbers_of_iterations (true); estimate_numbers_of_iterations ();
scev_reset (); scev_reset ();
return 0; return 0;
} }
......
...@@ -3420,7 +3420,7 @@ adjust_range_with_scev (value_range_t *vr, struct loop *loop, ...@@ -3420,7 +3420,7 @@ adjust_range_with_scev (value_range_t *vr, struct loop *loop,
{ {
double_int nit; double_int nit;
if (max_loop_iterations (loop, &nit)) if (max_stmt_executions (loop, &nit))
{ {
value_range_t maxvr = { VR_UNDEFINED, NULL_TREE, NULL_TREE, NULL }; value_range_t maxvr = { VR_UNDEFINED, NULL_TREE, NULL_TREE, NULL };
double_int dtmp; double_int dtmp;
...@@ -8272,12 +8272,6 @@ execute_vrp (void) ...@@ -8272,12 +8272,6 @@ execute_vrp (void)
insert_range_assertions (); insert_range_assertions ();
/* Estimate number of iterations - but do not use undefined behavior
for this. We can't do this lazily as other functions may compute
this using undefined behavior. */
free_numbers_of_iterations_estimates ();
estimate_numbers_of_iterations (false);
to_remove_edges = VEC_alloc (edge, heap, 10); to_remove_edges = VEC_alloc (edge, heap, 10);
to_update_switch_stmts = VEC_alloc (switch_update, heap, 5); to_update_switch_stmts = VEC_alloc (switch_update, heap, 5);
threadedge_initialize_values (); threadedge_initialize_values ();
......
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