* 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
2004-11-21 Jeff Law <law@redhat.com>
+ * 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.
+
* tree-ssa-threadupdate.c (redirection_data_hash): Use the
index of the destination block for the hash value rather than
hashing a pointer.
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 ();