summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-ch.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2008-08-29 10:58:52 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2008-08-29 08:58:52 +0000
commitcc870036bd76fccec8aeb19a3f8c4fda081e5c3d (patch)
tree92d8dcba01165e9199c912b448b73d517d093087 /gcc/tree-ssa-loop-ch.c
parent7299cb994088a68a4fec5e479a03fc8a71e50646 (diff)
downloadgcc-cc870036bd76fccec8aeb19a3f8c4fda081e5c3d.tar.gz
tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Check that loop is not cold.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Check that loop is not cold. * predict.c (optimize_bb_for_size_p, optimize_bb_for_speed_p): Constify arguments. (optimize_loop_for_size_p, optimize_loop_for_speed_p): New functions. * basic-block.h (optimize_bb_for_size_p, optimize_bb_for_speed_p): Constify. (optimize_loop_for_size_p, optimize_loop_for_speed_p): Declare. From-SVN: r139756
Diffstat (limited to 'gcc/tree-ssa-loop-ch.c')
-rw-r--r--gcc/tree-ssa-loop-ch.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c
index 9a0dca7265e..33e85c839dc 100644
--- a/gcc/tree-ssa-loop-ch.c
+++ b/gcc/tree-ssa-loop-ch.c
@@ -58,6 +58,13 @@ should_duplicate_loop_header_p (basic_block header, struct loop *loop,
if (header->aux)
return false;
+ /* Loop header copying usually increases size of the code. This used not to
+ be true, since quite often it is possible to verify that the condition is
+ satisfied in the first iteration and therefore to eliminate it. Jump
+ threading handles these cases now. */
+ if (optimize_loop_for_size_p (loop))
+ return false;
+
gcc_assert (EDGE_COUNT (header->succs) > 0);
if (single_succ_p (header))
return false;