Skip to content

Commit bb3b9c1

Browse files
author
Jan Hubicka
committed
Simplify force_edge_cold.
gcc/ChangeLog: * predict.cc (force_edge_cold): Use set_edge_probability_and_rescale_others; improve dumps.
1 parent 768f00e commit bb3b9c1

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

gcc/predict.cc

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4421,21 +4421,16 @@ force_edge_cold (edge e, bool impossible)
44214421
there. */
44224422
else if (prob_sum > profile_probability::never ())
44234423
{
4424-
if (!(e->probability < goal))
4425-
e->probability = goal;
4426-
4427-
profile_probability prob_comp = prob_sum / e->probability.invert ();
4428-
44294424
if (dump_file && (dump_flags & TDF_DETAILS))
4430-
fprintf (dump_file, "Making edge %i->%i %s by redistributing "
4431-
"probability to other edges.\n",
4432-
e->src->index, e->dest->index,
4433-
impossible ? "impossible" : "cold");
4434-
FOR_EACH_EDGE (e2, ei, e->src->succs)
4435-
if (e2 != e)
4436-
{
4437-
e2->probability /= prob_comp;
4438-
}
4425+
{
4426+
fprintf (dump_file, "Making edge %i->%i %s by redistributing "
4427+
"probability to other edges. Original probability: ",
4428+
e->src->index, e->dest->index,
4429+
impossible ? "impossible" : "cold");
4430+
e->probability.dump (dump_file);
4431+
fprintf (dump_file, "\n");
4432+
}
4433+
set_edge_probability_and_rescale_others (e, goal);
44394434
if (current_ir_type () != IR_GIMPLE
44404435
&& e->src != ENTRY_BLOCK_PTR_FOR_FN (cfun))
44414436
update_br_prob_note (e->src);

0 commit comments

Comments
 (0)