From 3893cc47fa491fae852c0a8c87cb997de866c3e4 Mon Sep 17 00:00:00 2001 From: hubicka Date: Sun, 31 Aug 2008 15:54:54 +0000 Subject: [PATCH] * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Check that loop is optimized for speed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139834 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/tree-ssa-loop-unswitch.c | 8 ++++++++ 2 files changed, 13 insertions(+) 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 + + * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Check that + loop is optimized for speed. + 2008-08-31 Richard Guenther 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)) -- 2.7.4