diff options
author | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2007-03-14 00:38:34 +0000 |
---|---|---|
committer | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2007-03-14 00:38:34 +0000 |
commit | b3ce5b6ed7924967c74d161950038d5eb044273e (patch) | |
tree | bf5bf3bffd54164948533f0f4a35ee7c79aaffd7 /gcc/tree-flow.h | |
parent | ec34c4e4c0e8227b1b741028248228354eccfdba (diff) | |
download | gcc-b3ce5b6ed7924967c74d161950038d5eb044273e.zip gcc-b3ce5b6ed7924967c74d161950038d5eb044273e.tar.gz gcc-b3ce5b6ed7924967c74d161950038d5eb044273e.tar.bz2 |
re PR tree-optimization/30730 (-Wunsafe-loop-optimizations gives too many warnings)
PR tree-optimization/30730
PR tree-optimization/26900
* tree-ssa-loop-niter.c: Include gmp.h.
(bounds): New type.
(mpz_set_double_int, get_type_bounds, mpz_to_double_int,
split_to_var_and_offset, determine_value_range,
bound_difference_of_offsetted_base, refine_bounds_using_guard,
bound_difference, bounds_add, bounds_negate,
number_of_iterations_ne_max, dump_affine_iv): New functions.
(number_of_iterations_ne, number_of_iterations_lt_to_ne,
assert_loop_rolls_lt, assert_loop_rolls_le): Use bounds on the
difference of initial and final value of control iv to validate
results.
(number_of_iterations_cond): Add loop parameter. Determine bounds
on the difference of the extremes of the control iv. Add dumps.
(expand_simple_operations): Handle phi nodes.
(simplify_using_initial_conditions): Do not record used conditions.
(number_of_iterations_exit): Pass loop to number_of_iterations_cond.
Do not set additional_info.
(implies_nonnegative_p, implies_ge_p): Removed.
(derive_constant_upper_bound): Do not use parameter `additional'.
(record_estimate): Parameter `additional' removed. Parameter
`i_bound' added. Do not call derive_constant_upper_bound.
(record_nonwrapping_iv): Use derive_constant_upper_bound to
bound the number of iterations estimate.
(estimate_numbers_of_iterations_loop): Pass the estimate from
the number of iterations analysis to record_estimate.
* tree.h (multiple_of_p): Declare.
* tree-scalar-evolution.c (expression_expensive_p): Removed.
(scev_const_prop): Do not check expression_expensive_p.
* fold-const.c (multiple_of_p): Exported.
* double-int.c (double_int_mask): Exported.
* double-int.h (double_int_mask): Declare.
* tree-flow.h (struct tree_niter_desc): Removed additional_info
field. Added max field.
* gcc.dg/tree-ssa/loop-26.c: New test.
From-SVN: r122896
Diffstat (limited to 'gcc/tree-flow.h')
-rw-r--r-- | gcc/tree-flow.h | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index 99db89d..ea2d677 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -822,18 +822,8 @@ struct tree_niter_desc a loop (provided that assumptions == true and may_be_zero == false), more precisely the number of executions of the latch of the loop. */ - tree additional_info; /* The boolean expression. Sometimes we use additional - knowledge to simplify the other expressions - contained in this structure (for example the - knowledge about value ranges of operands on entry to - the loop). If this is a case, conjunction of such - condition is stored in this field, so that we do not - lose the information: for example if may_be_zero - is (n <= 0) and niter is (unsigned) n, we know - that the number of iterations is at most - MAX_SIGNED_INT. However if the (n <= 0) assumption - is eliminated (by looking at the guard on entry of - the loop), then the information would be lost. */ + double_int max; /* The upper bound on the number of iterations of + the loop. */ /* The simplified shape of the exit condition. The loop exits if CONTROL CMP BOUND is false, where CMP is one of NE_EXPR, |