[Bug tree-optimization/65511] transform_to_exit_first_loop looses edge probabilities
vries at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Mar 22 10:44:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65511
--- Comment #1 from vries at gcc dot gnu.org ---
tentative patch:
...
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 0f5e428..837dbbd 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -6175,6 +6175,7 @@ gimple_duplicate_sese_tail (edge entry ATTRIBUTE_UNUSED,
edge exit ATTRIBUTE_UNU
gphi *phi;
tree def;
struct loop *target, *aloop, *cloop;
+ int exit_prob = exit->probability;
gcc_assert (EDGE_COUNT (exit->src->succs) == 2);
exits[0] = exit;
@@ -6266,6 +6267,8 @@ gimple_duplicate_sese_tail (edge entry ATTRIBUTE_UNUSED,
edge exit ATTRIBUTE_UNU
sorig = single_succ_edge (switch_bb);
sorig->flags = exits[1]->flags;
snew = make_edge (switch_bb, nentry_bb, exits[0]->flags);
+ snew->probability = exit_prob;
+ sorig->probability = REG_BR_PROB_BASE - exit_prob;
/* Register the new edge from SWITCH_BB in loop exit lists. */
rescan_loop_exit (snew, true, false);
...
More information about the Gcc-bugs
mailing list