summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-unswitch.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2016-04-21 10:52:41 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2016-04-21 08:52:41 +0000
commitf0305f3a5b2d64cc8143ad3a1aa8a704c10f91c7 (patch)
tree87d4e4f174ced25b3efddbb90746e7bc78982e4a /gcc/tree-ssa-loop-unswitch.c
parent0ef5cd0ad8b4f382dca65bbd47154ee6777f4446 (diff)
downloadgcc-f0305f3a5b2d64cc8143ad3a1aa8a704c10f91c7.tar.gz
tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Use also max_loop_iterations_int.
* tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Use also max_loop_iterations_int. (tree_unswitch_outer_loop): Likewise. From-SVN: r235315
Diffstat (limited to 'gcc/tree-ssa-loop-unswitch.c')
-rw-r--r--gcc/tree-ssa-loop-unswitch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index dd6fd01256a..77acd66e997 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -223,6 +223,8 @@ tree_unswitch_single_loop (struct loop *loop, int num)
/* If the loop is not expected to iterate, there is no need
for unswitching. */
iterations = estimated_loop_iterations_int (loop);
+ if (iterations < 0)
+ iterations = max_loop_iterations_int (loop);
if (iterations >= 0 && iterations <= 1)
{
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -439,6 +441,8 @@ tree_unswitch_outer_loop (struct loop *loop)
/* If the loop is not expected to iterate, there is no need
for unswitching. */
iterations = estimated_loop_iterations_int (loop);
+ if (iterations < 0)
+ iterations = max_loop_iterations_int (loop);
if (iterations >= 0 && iterations <= 1)
{
if (dump_file && (dump_flags & TDF_DETAILS))