From: Tom de Vries Date: Sun, 6 Aug 2017 09:56:38 +0000 (+0000) Subject: Add missing edge probabilities in expand_oacc_for, tile case X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9fba2943f1e76245fda610fdb295b7077a5e799d;p=gcc.git Add missing edge probabilities in expand_oacc_for, tile case ;; basic block 11, loop depth 2, freq 0, maybe hot ;; prev block 22, next block 23, flags: (NEW, REACHABLE) ;; pred: 22 (TRUE_VALUE) ;; 24 (TRUE_VALUE) ... if (.e_offset.15D.1971 < .e_bound.14D.1972) - goto ; [100.00%] [count: INV] + goto ; [80.01%] [count: INV] else - goto ; [INV] [count: INV] + goto ; [19.99%] [count: INV] ;; basic block 23, loop depth 3, freq 0, maybe hot ;; prev block 11, next block 24, flags: (NEW) ;; pred: 11 [always] (TRUE_VALUE) ;; 23 (TRUE_VALUE) ixD.1974 = .outer.4D.1967 + .e_offset.15D.1971; .e_offset.15D.1971 = .e_offset.15D.1971 + .e_step.16D.1973; if (.e_offset.15D.1971 < .e_bound.14D.1972) - goto ; [INV] [count: INV] + goto ; [80.01%] [count: INV] else - goto ; [100.00%] [count: INV] + goto ; [19.99%] [count: INV] 2017-08-06 Tom de Vries * omp-expand.c (expand_oacc_for): Add missing edge probability for tile and element loops. From-SVN: r250900 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c06ef3f3633..51ed7c99162 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-08-06 Tom de Vries + + * omp-expand.c (expand_oacc_for): Add missing edge probability for tile + and element loops. + 2017-08-06 Tom de Vries * omp-expand.c (expand_oacc_for): Add missing edge probability for chunk diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c index 5772bd9e4a3..0a0098af669 100644 --- a/gcc/omp-expand.c +++ b/gcc/omp-expand.c @@ -5663,9 +5663,16 @@ expand_oacc_for (struct omp_region *region, struct omp_for_data *fd) cont_bb = split->dest; split->flags ^= EDGE_FALLTHRU | EDGE_FALSE_VALUE; - make_edge (elem_cont_bb, elem_body_bb, EDGE_TRUE_VALUE); + split->probability = profile_probability::unlikely ().guessed (); + edge latch_edge + = make_edge (elem_cont_bb, elem_body_bb, EDGE_TRUE_VALUE); + latch_edge->probability = profile_probability::likely ().guessed (); - make_edge (body_bb, cont_bb, EDGE_FALSE_VALUE); + edge skip_edge = make_edge (body_bb, cont_bb, EDGE_FALSE_VALUE); + skip_edge->probability = profile_probability::unlikely ().guessed (); + edge loop_entry_edge = EDGE_SUCC (body_bb, 1 - skip_edge->dest_idx); + loop_entry_edge->probability + = profile_probability::likely ().guessed (); gsi = gsi_for_stmt (cont_stmt); }