summaryrefslogtreecommitdiff
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-19 16:04:03 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-19 16:04:03 +0000
commit615dd397c37bcd1d50f3b13227eb2fb4f2edb237 (patch)
tree2864608d6a5ce3c527756be3a276cd609e29f91f /gcc/cfgcleanup.c
parentc9cbb533d375a6102745288983e820ff3a52f66e (diff)
downloadgcc-615dd397c37bcd1d50f3b13227eb2fb4f2edb237.tar.gz
* basic-block.h (update_bb_profile_after_threading): Declare.
* cfg.c (update_bb_profile_after_threading): Break out from ... * cfgcleanup.c (try_forward_edges): ... here; use it. * tree-ssa-dom.c (thread_across_edge): Use it. * tree-ssa-threadupdate.c (create_block_for_threading): Zero out profile of the new BB. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87730 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r--gcc/cfgcleanup.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 08714f6d652..f9d06075caa 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -614,41 +614,23 @@ try_forward_edges (int mode, basic_block b)
{
edge t;
- first->count -= edge_count;
- if (first->count < 0)
- first->count = 0;
- first->frequency -= edge_frequency;
- if (first->frequency < 0)
- first->frequency = 0;
if (first->succ->succ_next)
{
- edge e;
- int prob;
-
gcc_assert (n < nthreaded_edges);
t = threaded_edges [n++];
gcc_assert (t->src == first);
- if (first->frequency)
- prob = edge_frequency * REG_BR_PROB_BASE / first->frequency;
- else
- prob = 0;
- if (prob > t->probability)
- prob = t->probability;
- t->probability -= prob;
- prob = REG_BR_PROB_BASE - prob;
- if (prob <= 0)
- {
- first->succ->probability = REG_BR_PROB_BASE;
- first->succ->succ_next->probability = 0;
- }
- else
- for (e = first->succ; e; e = e->succ_next)
- e->probability = ((e->probability * REG_BR_PROB_BASE)
- / (double) prob);
+ update_bb_profile_for_threading (first, edge_frequency,
+ edge_count, t);
update_br_prob_note (first);
}
else
{
+ first->count -= edge_count;
+ if (first->count < 0)
+ first->count = 0;
+ first->frequency -= edge_frequency;
+ if (first->frequency < 0)
+ first->frequency = 0;
/* It is possible that as the result of
threading we've removed edge as it is
threaded to the fallthru edge. Avoid