diff options
author | Richard Biener <rguenther@suse.de> | 2013-11-21 09:15:38 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2013-11-21 09:15:38 +0000 |
commit | 7276921760f1b9a8ec3e6f34644c1399dff1b9b1 (patch) | |
tree | a18f595d229483f0389d11db182f5bc51f0b308d /gcc/tree-ssa-loop-ch.c | |
parent | d995e887cb937a630aaf1fc9a78d4bd166f12a83 (diff) | |
download | gcc-7276921760f1b9a8ec3e6f34644c1399dff1b9b1.zip gcc-7276921760f1b9a8ec3e6f34644c1399dff1b9b1.tar.gz gcc-7276921760f1b9a8ec3e6f34644c1399dff1b9b1.tar.bz2 |
tree-ssa-loop-ch.c (copy_loop_headers): Decrement nb_iterations_upper_bound by one.
2013-11-21 Richard Biener <rguenther@suse.de>
* tree-ssa-loop-ch.c (copy_loop_headers): Decrement
nb_iterations_upper_bound by one.
From-SVN: r205198
Diffstat (limited to 'gcc/tree-ssa-loop-ch.c')
-rw-r--r-- | gcc/tree-ssa-loop-ch.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c index df45c28..ccaa9c89 100644 --- a/gcc/tree-ssa-loop-ch.c +++ b/gcc/tree-ssa-loop-ch.c @@ -243,6 +243,16 @@ copy_loop_headers (void) are not now, since there was the loop exit condition. */ split_edge (loop_preheader_edge (loop)); split_edge (loop_latch_edge (loop)); + + /* We peeled off one iteration of the loop thus we can lower + the maximum number of iterations if we have a previously + recorded value for that. */ + double_int max; + if (get_max_loop_iterations (loop, &max)) + { + max -= double_int_one; + loop->nb_iterations_upper_bound = max; + } } update_ssa (TODO_update_ssa); |