/* Return expected execution frequency of the edge E. */
#define EDGE_FREQUENCY(e) e->count ().to_frequency (cfun)
-/* Compute a scale factor (or probability) suitable for scaling of
- gcov_type values via apply_probability() and apply_scale(). */
-#define GCOV_COMPUTE_SCALE(num,den) \
- ((den) ? RDIV ((num) * REG_BR_PROB_BASE, (den)) : REG_BR_PROB_BASE)
-
/* Return nonzero if edge is critical. */
#define EDGE_CRITICAL_P(e) (EDGE_COUNT ((e)->src->succs) >= 2 \
&& EDGE_COUNT ((e)->dest->preds) >= 2)
count = all;
}
speculative_call_target item (
- val, GCOV_COMPUTE_SCALE (count, all));
+ val,
+ profile_count::from_gcov_type (count)
+ .probability_in
+ (profile_count::from_gcov_type (all))
+ .to_reg_br_prob_base ());
csum->speculative_call_targets.safe_push (item);
}
int tf = prob[trg], cf = prob[i];
/* In CFGs with low probability edges TF can possibly be zero. */
- sp->src_prob = (tf ? GCOV_COMPUTE_SCALE (cf, tf) : 0);
+ sp->src_prob = (tf ?
+ profile_count::from_gcov_type (cf)
+ .probability_in
+ (profile_count::from_gcov_type (tf))
+ .to_reg_br_prob_base ()
+ : 0);
sp->is_valid = (sp->src_prob >= min_spec_prob);
}