summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-analysis.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r--gcc/ipa-inline-analysis.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 0a319710fe8..c2abe91a482 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -2096,8 +2096,7 @@ param_change_prob (gimple stmt, int i)
if (!init_freq)
init_freq = 1;
if (init_freq < bb->frequency)
- return MAX ((init_freq * REG_BR_PROB_BASE +
- bb->frequency / 2) / bb->frequency, 1);
+ return MAX (GCOV_COMPUTE_SCALE (init_freq, bb->frequency), 1);
else
return REG_BR_PROB_BASE;
}
@@ -2139,8 +2138,7 @@ param_change_prob (gimple stmt, int i)
BITMAP_FREE (info.bb_set);
if (max < bb->frequency)
- return MAX ((max * REG_BR_PROB_BASE +
- bb->frequency / 2) / bb->frequency, 1);
+ return MAX (GCOV_COMPUTE_SCALE (max, bb->frequency), 1);
else
return REG_BR_PROB_BASE;
}
@@ -2795,6 +2793,7 @@ estimate_edge_size_and_time (struct cgraph_edge *e, int *size, int *time,
&& hints && cgraph_maybe_hot_edge_p (e))
*hints |= INLINE_HINT_indirect_call;
*size += call_size * INLINE_SIZE_SCALE;
+ /* Update to use apply_probability(). */
*time += call_time * prob / REG_BR_PROB_BASE
* e->frequency * (INLINE_TIME_SCALE / CGRAPH_FREQ_BASE);
if (*time > MAX_TIME * INLINE_TIME_SCALE)
@@ -2905,6 +2904,7 @@ estimate_node_size_and_time (struct cgraph_node *node,
inline_param_summary);
gcc_checking_assert (prob >= 0);
gcc_checking_assert (prob <= REG_BR_PROB_BASE);
+ /* Update to use apply_probability(). */
time += ((gcov_type) e->time * prob) / REG_BR_PROB_BASE;
}
if (time > MAX_TIME * INLINE_TIME_SCALE)
@@ -3123,8 +3123,7 @@ remap_edge_change_prob (struct cgraph_edge *inlined_edge,
int jf_formal_id = ipa_get_jf_pass_through_formal_id (jfunc);
int prob1 = es->param[i].change_prob;
int prob2 = inlined_es->param[jf_formal_id].change_prob;
- int prob = ((prob1 * prob2 + REG_BR_PROB_BASE / 2)
- / REG_BR_PROB_BASE);
+ int prob = combine_probabilities (prob1, prob2);
if (prob1 && prob2 && !prob)
prob = 1;
@@ -3315,6 +3314,7 @@ inline_merge_summary (struct cgraph_edge *edge)
int prob = predicate_probability (callee_info->conds,
&e->predicate,
clause, es->param);
+ /* Update to use apply_probability(). */
add_time = ((gcov_type) add_time * prob) / REG_BR_PROB_BASE;
if (add_time > MAX_TIME * INLINE_TIME_SCALE)
add_time = MAX_TIME * INLINE_TIME_SCALE;