aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-im.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-loop-im.c')
-rw-r--r--gcc/tree-ssa-loop-im.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index a1b8a00..46be944 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -1803,7 +1803,7 @@ execute_sm_if_changed (edge ex, tree mem, tree tmp_var, tree flag,
for (hash_set<basic_block>::iterator it = flag_bbs->begin ();
it != flag_bbs->end (); ++it)
{
- freq_sum += (*it)->frequency;
+ freq_sum += (*it)->count.to_frequency (cfun);
if ((*it)->count.initialized_p ())
count_sum += (*it)->count, ncount ++;
if (dominated_by_p (CDI_DOMINATORS, ex->src, *it))
@@ -1815,20 +1815,15 @@ execute_sm_if_changed (edge ex, tree mem, tree tmp_var, tree flag,
if (flag_probability.initialized_p ())
;
- else if (ncount == nbbs && count_sum > 0 && preheader->count () >= count_sum)
+ else if (ncount == nbbs
+ && preheader->count () >= count_sum && preheader->count ().nonzero_p ())
{
flag_probability = count_sum.probability_in (preheader->count ());
if (flag_probability > cap)
flag_probability = cap;
}
- else if (freq_sum > 0 && EDGE_FREQUENCY (preheader) >= freq_sum)
- {
- flag_probability = profile_probability::from_reg_br_prob_base
- (GCOV_COMPUTE_SCALE (freq_sum, EDGE_FREQUENCY (preheader)));
- if (flag_probability > cap)
- flag_probability = cap;
- }
- else
+
+ if (!flag_probability.initialized_p ())
flag_probability = cap;
/* ?? Insert store after previous store if applicable. See note
@@ -1861,7 +1856,6 @@ execute_sm_if_changed (edge ex, tree mem, tree tmp_var, tree flag,
old_dest = ex->dest;
new_bb = split_edge (ex);
then_bb = create_empty_bb (new_bb);
- then_bb->frequency = flag_probability.apply (new_bb->frequency);
then_bb->count = new_bb->count.apply_probability (flag_probability);
if (irr)
then_bb->flags = BB_IRREDUCIBLE_LOOP;