summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-21 08:52:41 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-21 08:52:41 +0000
commit4dc22c929be4640e9d4f7dd7e71423cae3ad86f9 (patch)
tree87d4e4f174ced25b3efddbb90746e7bc78982e4a
parent59332088102e402faf7a76165bc828ffa5db8a18 (diff)
downloadgcc-4dc22c929be4640e9d4f7dd7e71423cae3ad86f9.tar.gz
* tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Use also
max_loop_iterations_int. (tree_unswitch_outer_loop): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235315 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-loop-unswitch.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 55d9708336b..d24599f7dcc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-04-18 Jan Hubicka <jh@suse.cz>
+
+ * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Use also
+ max_loop_iterations_int.
+ (tree_unswitch_outer_loop): Likewise.
+
2016-04-20 Bin Cheng <bin.cheng@arm.com>
PR tree-optimization/69489
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))