aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfg.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2004-11-21 13:41:37 -0700
committerJeff Law <law@gcc.gnu.org>2004-11-21 13:41:37 -0700
commit763ea904933bd0449b68beac077415ff38d8b832 (patch)
treeea5455585b4267b0b44eac78823f2fec25c902da /gcc/cfg.c
parent926253eecabc64f87a0c8601e7a3949dc56979c4 (diff)
downloadgcc-763ea904933bd0449b68beac077415ff38d8b832.zip
gcc-763ea904933bd0449b68beac077415ff38d8b832.tar.gz
gcc-763ea904933bd0449b68beac077415ff38d8b832.tar.bz2
cfg.c (update_bb_profile_for_threading): Do not rescale the successor probabilities if they are not going to change.
* cfg.c (update_bb_profile_for_threading): Do not rescale the successor probabilities if they are not going to change. Pull division out of loop if we do need to rescale successor probabilities. From-SVN: r90987
Diffstat (limited to 'gcc/cfg.c')
-rw-r--r--gcc/cfg.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cfg.c b/gcc/cfg.c
index 67b0598..b008bad 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -941,9 +941,13 @@ update_bb_profile_for_threading (basic_block bb, int edge_frequency,
for (; (c = ei_safe_edge (ei)); ei_next (&ei))
c->probability = 0;
}
- else
- FOR_EACH_EDGE (c, ei, bb->succs)
- c->probability = ((c->probability * REG_BR_PROB_BASE) / (double) prob);
+ else if (prob != REG_BR_PROB_BASE)
+ {
+ int scale = REG_BR_PROB_BASE / prob;
+
+ FOR_EACH_EDGE (c, ei, bb->succs)
+ c->probability *= scale;
+ }
if (bb != taken_edge->src)
abort ();