aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-manip.cc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-01-25 19:16:06 +0100
committerMartin Liska <mliska@suse.cz>2022-06-20 11:11:38 +0200
commit9f55aee9dca759da84afd4563ff72d3ca8ab8a1c (patch)
tree7414224cafb6e6aed06e7664cfaa3528017aa8d3 /gcc/tree-ssa-loop-manip.cc
parent970b03c0037549a571ecea9afa41de78eb859b3a (diff)
downloadgcc-9f55aee9dca759da84afd4563ff72d3ca8ab8a1c.zip
gcc-9f55aee9dca759da84afd4563ff72d3ca8ab8a1c.tar.gz
gcc-9f55aee9dca759da84afd4563ff72d3ca8ab8a1c.tar.bz2
Add operators / and * for profile_{count,probability}.
gcc/ChangeLog: * bb-reorder.cc (find_traces_1_round): Add operators / and * and use them. (better_edge_p): Likewise. * cfgloop.cc (find_subloop_latch_edge_by_profile): Likewise. * cfgloopmanip.cc (scale_loop_profile): Likewise. * cfgrtl.cc (force_nonfallthru_and_redirect): Likewise. * cgraph.cc (cgraph_edge::maybe_hot_p): Likewise. * config/sh/sh.cc (expand_cbranchdi4): Likewise. * dojump.cc (do_compare_rtx_and_jump): Likewise. * final.cc (compute_alignments): Likewise. * ipa-cp.cc (update_counts_for_self_gen_clones): Likewise. (decide_about_value): Likewise. * ipa-inline-analysis.cc (do_estimate_edge_time): Likewise. * loop-unroll.cc (unroll_loop_runtime_iterations): Likewise. * modulo-sched.cc (sms_schedule): Likewise. * omp-expand.cc (extract_omp_for_update_vars): Likewise. (expand_omp_ordered_sink): Likewise. (expand_omp_for_ordered_loops): Likewise. (expand_omp_for_static_nochunk): Likewise. * predict.cc (maybe_hot_count_p): Likewise. (probably_never_executed): Likewise. (set_even_probabilities): Likewise. (handle_missing_profiles): Likewise. (expensive_function_p): Likewise. * profile-count.h: Likewise. * profile.cc (compute_branch_probabilities): Likewise. * stmt.cc (emit_case_dispatch_table): Likewise. * symtab-thunks.cc (expand_thunk): Likewise. * tree-ssa-loop-manip.cc (tree_transform_and_unroll_loop): Likewise. * tree-ssa-sink.cc (select_best_block): Likewise. * tree-switch-conversion.cc (switch_decision_tree::analyze_switch_statement): Likewise. (switch_decision_tree::balance_case_nodes): Likewise. (switch_decision_tree::emit_case_nodes): Likewise. * tree-vect-loop.cc (scale_profile_for_vect_loop): Likewise.
Diffstat (limited to 'gcc/tree-ssa-loop-manip.cc')
-rw-r--r--gcc/tree-ssa-loop-manip.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/tree-ssa-loop-manip.cc b/gcc/tree-ssa-loop-manip.cc
index 6696425..5d43563 100644
--- a/gcc/tree-ssa-loop-manip.cc
+++ b/gcc/tree-ssa-loop-manip.cc
@@ -1421,8 +1421,8 @@ tree_transform_and_unroll_loop (class loop *loop, unsigned factor,
}
basic_block rest = new_exit->dest;
- new_exit->probability = profile_probability::always ()
- .apply_scale (1, new_est_niter + 1);
+ new_exit->probability
+ = (profile_probability::always () / (new_est_niter + 1));
rest->count += new_exit->count ();
@@ -1463,8 +1463,7 @@ tree_transform_and_unroll_loop (class loop *loop, unsigned factor,
&& TREE_CODE (desc->niter) == INTEGER_CST)
{
/* The + 1 converts latch counts to iteration counts. */
- profile_count new_header_count
- = (in_count.apply_scale (new_est_niter + 1, 1));
+ profile_count new_header_count = in_count * (new_est_niter + 1);
basic_block *body = get_loop_body (loop);
scale_bbs_frequencies_profile_count (body, loop->num_nodes,
new_header_count,
@@ -1502,8 +1501,8 @@ tree_transform_and_unroll_loop (class loop *loop, unsigned factor,
e->dest->count / e->src->count ~= new e->probability
for every outgoing edge e of NEW_EXIT->src. */
- profile_probability new_exit_prob = profile_probability::always ()
- .apply_scale (1, new_est_niter + 1);
+ profile_probability new_exit_prob
+ = profile_probability::always () / (new_est_niter + 1);
change_edge_frequency (new_exit, new_exit_prob);
}