diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-02 16:34:52 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-02 16:34:52 +0000 |
commit | 72276d01ede840f437b084eb0f89495f0d69f49f (patch) | |
tree | f422408bb685a50d53e449a1a6c13e851119cfe9 /gcc/tree-ssa-loop-niter.c | |
parent | b73e53043ae7c29b715538961c8af71e22727585 (diff) | |
download | ppe42-gcc-72276d01ede840f437b084eb0f89495f0d69f49f.tar.gz ppe42-gcc-72276d01ede840f437b084eb0f89495f0d69f49f.zip |
PR middle-end/55079
* tree-ssa-loop-niter.c (number_of_iterations_exit): Update
MAX field if NITER was folded to contant.
(record_estimate): Sanity check.
* tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts): New
function.
(remove_redundant_iv_test): New function.
(loops_to_unloop, loops_to_unloop_nunroll): New static vars.
(unloop_loops): Break out from ...
(try_unroll_loop_completely): ... here; Pass in MAXITER; use
remove_exits_and_undefined_stmts; do not unloop.
(canonicalize_loop_induction_variables): Compute MAXITER;
use remove_redundant_iv_test; remove loop_close_ssa_invalidated
and irred_invalidated arguments.
(canonicalize_induction_variables): Compute fresh bound estimates;
unloop; walk from innermost.
(tree_unroll_loops_completely): Likewise.
* gcc.dg/tree-ssa/cunroll-10.c: New testcase.
* gcc.dg/tree-ssa/cunroll-9.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193098 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r-- | gcc/tree-ssa-loop-niter.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 20681a9140a..b77bcbbe5ba 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -1880,6 +1880,10 @@ number_of_iterations_exit (struct loop *loop, edge exit, fold_undefer_and_ignore_overflow_warnings (); + /* If NITER has simplified into a constant, update MAX. */ + if (TREE_CODE (niter->niter) == INTEGER_CST) + niter->max = tree_to_double_int (niter->niter); + if (integer_onep (niter->assumptions)) return true; @@ -2556,6 +2560,8 @@ record_estimate (struct loop *loop, tree bound, double_int i_bound, real number of iterations. */ if (TREE_CODE (bound) != INTEGER_CST) realistic = false; + else + gcc_checking_assert (i_bound == tree_to_double_int (bound)); if (!upper && !realistic) return; |