Hi,

this patch adds missing edge probability in expand_oacc_for for the chunk loop.

Committed.

Thanks,
- Tom
Add missing edge probability in expand_oacc_for

 ;;   basic block 10, loop depth 1, freq 0, maybe hot
 ;;    prev block 9, next block 19, flags: (NEW, REACHABLE)
 ;;    pred:       18 (FALSE_VALUE)
 ;;                9 (FALSE_VALUE)
   GIMPLE_NOP
   .chunk_no.7D.1948 = .chunk_no.7D.1948 + 1;
   if (.chunk_no.7D.1948 < .chunk_max.6D.1949)
-    goto <bb 18>; [INV] [count: INV]
+    goto <bb 18>; [80.01%] [count: INV]
   else
-    goto <bb 19>; [100.00%] [count: INV]
+    goto <bb 19>; [19.99%] [count: INV]

2017-08-06  Tom de Vries  <t...@codesourcery.com>

	* omp-expand.c (expand_oacc_for): Add missing edge probability for chunk
	loop.

---
 gcc/omp-expand.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c
index 970e04f..5772bd9 100644
--- a/gcc/omp-expand.c
+++ b/gcc/omp-expand.c
@@ -5718,7 +5718,9 @@ expand_oacc_for (struct omp_region *region, struct omp_for_data *fd)
 
 	  /* Fixup edges from bottom_bb.  */
 	  split->flags ^= EDGE_FALLTHRU | EDGE_FALSE_VALUE;
-	  make_edge (bottom_bb, head_bb, EDGE_TRUE_VALUE);
+	  split->probability = profile_probability::unlikely ().guessed ();
+	  edge latch_edge = make_edge (bottom_bb, head_bb, EDGE_TRUE_VALUE);
+	  latch_edge->probability = profile_probability::likely ().guessed ();
 	}
     }
 

Reply via email to