diff options
Diffstat (limited to 'gcc/omp-expand.c')
-rw-r--r-- | gcc/omp-expand.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c index d6755cd71ee..ac83ba168d2 100644 --- a/gcc/omp-expand.c +++ b/gcc/omp-expand.c @@ -58,7 +58,8 @@ along with GCC; see the file COPYING3. If not see #include "gimple-pretty-print.h" #include "hsa-common.h" #include "debug.h" - +#include "stringpool.h" +#include "attribs.h" /* OMP region information. Every parallel and workshare directive is enclosed between two markers, the OMP_* directive @@ -4851,8 +4852,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd) /* If not -fno-tree-loop-vectorize, hint that we want to vectorize the loop. */ if ((flag_tree_loop_vectorize - || (!global_options_set.x_flag_tree_loop_vectorize - && !global_options_set.x_flag_tree_vectorize)) + || !global_options_set.x_flag_tree_loop_vectorize) && flag_tree_loop_optimize && loop->safelen > 1) { @@ -5329,6 +5329,8 @@ expand_oacc_for (struct omp_region *region, struct omp_for_data *fd) } if (POINTER_TYPE_P (diff_type) || TYPE_UNSIGNED (diff_type)) diff_type = signed_type_for (diff_type); + if (TYPE_PRECISION (diff_type) < TYPE_PRECISION (integer_type_node)) + diff_type = integer_type_node; basic_block entry_bb = region->entry; /* BB ending in OMP_FOR */ basic_block exit_bb = region->exit; /* BB ending in OMP_RETURN */ @@ -5664,9 +5666,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); } @@ -5719,7 +5728,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 (); } } |