diff mbox

Fix incorrect setting of edge probability in loop unroller

Message ID c485acfa-b917-df64-77fa-8c7393332ff0@linux.vnet.ibm.com
State New
Headers show

Commit Message

Pat Haugen Sept. 14, 2016, 5:04 p.m. UTC
The following patch corrects a problem with setting the probability on the pred edge instead of the newly created fallthru succ edge.

Bootstrap/regtest on powerpc64le with no new regressions. Committed as obvious.

-Pat


2016-09-14  Pat Haugen  <pthaugen@us.ibm.com>

	* loop-unroll.c (unroll_loop_runtime_iterations): Set probability of succ edge.
diff mbox

Patch

Index: gcc/loop-unroll.c
===================================================================
--- gcc/loop-unroll.c	(revision 240092)
+++ gcc/loop-unroll.c	(working copy)
@@ -979,7 +979,7 @@  unroll_loop_runtime_iterations (struct l
 
       swtch = split_edge_and_insert (single_pred_edge (swtch), branch_code);
       set_immediate_dominator (CDI_DOMINATORS, preheader, swtch);
-      single_pred_edge (swtch)->probability = REG_BR_PROB_BASE - p;
+      single_succ_edge (swtch)->probability = REG_BR_PROB_BASE - p;
       e = make_edge (swtch, preheader,
 		     single_succ_edge (swtch)->flags & EDGE_IRREDUCIBLE_LOOP);
       e->count = RDIV (preheader->count * REG_BR_PROB_BASE, p);