From 34705fdc3b33df1e354c907e526761296333e103 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 17 Nov 2017 13:36:37 +0000 Subject: [PATCH] re PR fortran/83017 (DO CONCURRENT not parallelizing) 2017-11-17 Richard Biener PR fortran/83017 * tree-core.h (enum annot_expr_kind): Add annot_expr_parallel_kind. * tree-pretty-print.c (dump_generic_node): Handle annot_expr_parallel_kind. * tree-cfg.c (replace_loop_annotate_in_block): Likewise. * gimplify.c (gimple_boolify): Likewise. fortran/ * trans-stmt.c (gfc_trans_forall_loop): Annotate DO CONCURRENT loops with annot_expr_parallel_kind instead of just annot_expr_ivdep_kind. From-SVN: r254869 --- gcc/ChangeLog | 9 +++++++++ gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/trans-stmt.c | 2 +- gcc/gimplify.c | 1 + gcc/tree-cfg.c | 4 ++++ gcc/tree-core.h | 1 + gcc/tree-pretty-print.c | 3 +++ 7 files changed, 26 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a08574d7aaf..993ac9bba24 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2017-11-17 Richard Biener + + PR fortran/83017 + * tree-core.h (enum annot_expr_kind): Add annot_expr_parallel_kind. + * tree-pretty-print.c (dump_generic_node): Handle + annot_expr_parallel_kind. + * tree-cfg.c (replace_loop_annotate_in_block): Likewise. + * gimplify.c (gimple_boolify): Likewise. + 2017-11-17 Igor Tsimbalist * config.gcc (extra_headers): Add cet.h for x86 targets. diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index d3170c7370a..cd72b1cf0c3 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2017-11-17 Richard Biener + + PR fortran/83017 + * trans-stmt.c (gfc_trans_forall_loop): Annotate DO CONCURRENT + loops with annot_expr_parallel_kind instead of just + annot_expr_ivdep_kind. + 2017-11-15 Martin Liska * options.c (gfc_post_options): diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index ea0f9529f1c..a89751bfd79 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -3455,7 +3455,7 @@ gfc_trans_forall_loop (forall_info *forall_tmp, tree body, if (forall_tmp->do_concurrent) cond = build2 (ANNOTATE_EXPR, TREE_TYPE (cond), cond, build_int_cst (integer_type_node, - annot_expr_ivdep_kind)); + annot_expr_parallel_kind)); tmp = build1_v (GOTO_EXPR, exit_label); tmp = fold_build3_loc (input_location, COND_EXPR, void_type_node, diff --git a/gcc/gimplify.c b/gcc/gimplify.c index e9168785fc0..d71bd2ab01e 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -3749,6 +3749,7 @@ gimple_boolify (tree expr) case annot_expr_ivdep_kind: case annot_expr_no_vector_kind: case annot_expr_vector_kind: + case annot_expr_parallel_kind: TREE_OPERAND (expr, 0) = gimple_boolify (TREE_OPERAND (expr, 0)); if (TREE_CODE (type) != BOOLEAN_TYPE) TREE_TYPE (expr) = boolean_type_node; diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 1772185f033..f44855024a3 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -287,6 +287,10 @@ replace_loop_annotate_in_block (basic_block bb, struct loop *loop) loop->force_vectorize = true; cfun->has_force_vectorize_loops = true; break; + case annot_expr_parallel_kind: + loop->can_be_parallel = true; + loop->safelen = INT_MAX; + break; default: gcc_unreachable (); } diff --git a/gcc/tree-core.h b/gcc/tree-core.h index f74f1453de6..aa54221253c 100644 --- a/gcc/tree-core.h +++ b/gcc/tree-core.h @@ -853,6 +853,7 @@ enum annot_expr_kind { annot_expr_ivdep_kind, annot_expr_no_vector_kind, annot_expr_vector_kind, + annot_expr_parallel_kind, annot_expr_kind_last }; diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index 80d45f96d67..169f9724eb1 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -2638,6 +2638,9 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags, case annot_expr_vector_kind: pp_string (pp, ", vector"); break; + case annot_expr_parallel_kind: + pp_string (pp, ", parallel"); + break; default: gcc_unreachable (); } -- 2.30.2