aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2008-08-31 17:54:54 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2008-08-31 15:54:54 +0000
commit079990a2bffd576c7f8a3f375e8f02be2bc00306 (patch)
treec38c8aeaed04648e997fe6aa19893da9484d71c2
parentf885a45b90b1a06a12aed90273d5f16c9baabccf (diff)
downloadgcc-079990a2bffd576c7f8a3f375e8f02be2bc00306.zip
gcc-079990a2bffd576c7f8a3f375e8f02be2bc00306.tar.gz
gcc-079990a2bffd576c7f8a3f375e8f02be2bc00306.tar.bz2
tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Check that loop is optimized for speed.
* tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Check that loop is optimized for speed. From-SVN: r139834
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-ssa-loop-unswitch.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 72a46cf..e046003 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-31 Jan Hubicka <jh@suse.cz>
+
+ * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Check that
+ loop is optimized for speed.
+
2008-08-31 Richard Guenther <rguenther@suse.de>
PR middle-end/37289
diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index 850270f..26abed2 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -198,6 +198,14 @@ tree_unswitch_single_loop (struct loop *loop, int num)
return false;
}
+ /* Do not unswitch in cold regions. */
+ if (optimize_loop_for_size_p (loop))
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, ";; Not unswitching cold loops\n");
+ return false;
+ }
+
/* The loop should not be too large, to limit code growth. */
if (tree_num_loop_insns (loop, &eni_size_weights)
> (unsigned) PARAM_VALUE (PARAM_MAX_UNSWITCH_INSNS))