* Fix profile updating on loop-doloop
@ 2017-07-03 12:17 Jan Hubicka
0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2017-07-03 12:17 UTC (permalink / raw)
To: gcc-patches
Hi,
this patch fixes powerPC bootstrap ICE caused by doloop incorrectly updating profile.
Comitted.
PR bootstrap/81285
* loop-doloop.c (add_test): Update profile.
Index: loop-doloop.c
===================================================================
--- loop-doloop.c (revision 249885)
+++ loop-doloop.c (working copy)
@@ -347,6 +347,8 @@ add_test (rtx cond, edge *e, basic_block
rtx op0 = XEXP (cond, 0), op1 = XEXP (cond, 1);
enum rtx_code code = GET_CODE (cond);
basic_block bb;
+ /* The jump is supposed to handle an unlikely special case. */
+ profile_probability prob = profile_probability::guessed_never ();
mode = GET_MODE (XEXP (cond, 0));
if (mode == VOIDmode)
@@ -357,7 +359,7 @@ add_test (rtx cond, edge *e, basic_block
op1 = force_operand (op1, NULL_RTX);
label = block_label (dest);
do_compare_rtx_and_jump (op0, op1, code, 0, mode, NULL_RTX, NULL, label,
- profile_probability::uninitialized ());
+ prob);
jump = get_last_insn ();
if (!jump || !JUMP_P (jump))
@@ -387,12 +389,14 @@ add_test (rtx cond, edge *e, basic_block
JUMP_LABEL (jump) = label;
- /* The jump is supposed to handle an unlikely special case. */
- add_int_reg_note (jump, REG_BR_PROB, 0);
-
LABEL_NUSES (label)++;
- make_edge (bb, dest, (*e)->flags & ~EDGE_FALLTHRU);
+ edge e2 = make_edge (bb, dest, (*e)->flags & ~EDGE_FALLTHRU);
+ e2->probability = prob;
+ e2->count = e2->src->count.apply_probability (prob);
+ (*e)->probability = prob.invert ();
+ (*e)->count = (*e)->count.apply_probability (prob);
+ update_br_prob_note (e2->src);
return true;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-07-03 12:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-03 12:17 Fix profile updating on loop-doloop Jan Hubicka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).