aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2023-07-07 19:21:02 +0200
committerJan Hubicka <jh@suse.cz>2023-07-07 19:21:02 +0200
commitbb3b9c1c3ba8228387ea8a94f3638190d1696324 (patch)
tree433ee85c0f518706e50ab1094589cc89ec952cc0 /gcc
parent768f00e3e84123e8d0f1bf28a3b2e0b7995402f1 (diff)
downloadgcc-bb3b9c1c3ba8228387ea8a94f3638190d1696324.zip
gcc-bb3b9c1c3ba8228387ea8a94f3638190d1696324.tar.gz
gcc-bb3b9c1c3ba8228387ea8a94f3638190d1696324.tar.bz2
Simplify force_edge_cold.
gcc/ChangeLog: * predict.cc (force_edge_cold): Use set_edge_probability_and_rescale_others; improve dumps.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/predict.cc23
1 files changed, 9 insertions, 14 deletions
diff --git a/gcc/predict.cc b/gcc/predict.cc
index d65c26f..1aa4c25 100644
--- a/gcc/predict.cc
+++ b/gcc/predict.cc
@@ -4421,21 +4421,16 @@ force_edge_cold (edge e, bool impossible)
there. */
else if (prob_sum > profile_probability::never ())
{
- if (!(e->probability < goal))
- e->probability = goal;
-
- profile_probability prob_comp = prob_sum / e->probability.invert ();
-
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "Making edge %i->%i %s by redistributing "
- "probability to other edges.\n",
- e->src->index, e->dest->index,
- impossible ? "impossible" : "cold");
- FOR_EACH_EDGE (e2, ei, e->src->succs)
- if (e2 != e)
- {
- e2->probability /= prob_comp;
- }
+ {
+ fprintf (dump_file, "Making edge %i->%i %s by redistributing "
+ "probability to other edges. Original probability: ",
+ e->src->index, e->dest->index,
+ impossible ? "impossible" : "cold");
+ e->probability.dump (dump_file);
+ fprintf (dump_file, "\n");
+ }
+ set_edge_probability_and_rescale_others (e, goal);
if (current_ir_type () != IR_GIMPLE
&& e->src != ENTRY_BLOCK_PTR_FOR_FN (cfun))
update_br_prob_note (e->src);