diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-04 12:12:00 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-04 12:12:00 +0000 |
commit | f889f544905a8dca86957570ed772df69ad54195 (patch) | |
tree | 13d32354865b2db700fa6e4a168efb3e44ba9d0e /gcc/tracer.c | |
parent | 8e1c8dbc64e1b6910728cbdb4290d987ffb09979 (diff) | |
download | gcc-f889f544905a8dca86957570ed772df69ad54195.tar.gz |
2012-04-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52808
* tracer.c (tail_duplicate): Do not tail-duplicate loop header
blocks.
* Makefile.in (tracer.o): Depend on $(CFGLOOP_H).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186135 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tracer.c')
-rw-r--r-- | gcc/tracer.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tracer.c b/gcc/tracer.c index 8fb9817dbe9..ce95f56bbbe 100644 --- a/gcc/tracer.c +++ b/gcc/tracer.c @@ -52,6 +52,7 @@ #include "tree-pass.h" #include "tree-flow.h" #include "tree-inline.h" +#include "cfgloop.h" static int count_insns (basic_block); static bool ignore_bb_p (const_basic_block); @@ -307,7 +308,13 @@ tail_duplicate (void) } traced_insns += bb2->frequency * counts [bb2->index]; if (EDGE_COUNT (bb2->preds) > 1 - && can_duplicate_block_p (bb2)) + && can_duplicate_block_p (bb2) + /* We have the tendency to duplicate the loop header + of all do { } while loops. Do not do that - it is + not profitable and it might create a loop with multiple + entries or at least rotate the loop. */ + && (!current_loops + || bb2->loop_father->header != bb2)) { edge e; basic_block copy; |