re PR fortran/83017 (DO CONCURRENT not parallelizing)
authorRichard Biener <rguenther@suse.de>
Fri, 17 Nov 2017 13:36:37 +0000 (13:36 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 17 Nov 2017 13:36:37 +0000 (13:36 +0000)
2017-11-17  Richard Biener  <rguenther@suse.de>

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
gcc/fortran/ChangeLog
gcc/fortran/trans-stmt.c
gcc/gimplify.c
gcc/tree-cfg.c
gcc/tree-core.h
gcc/tree-pretty-print.c

index a08574d..993ac9b 100644 (file)
@@ -1,3 +1,12 @@
+2017-11-17  Richard Biener  <rguenther@suse.de>
+
+       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  <igor.v.tsimbalist@intel.com>
 
        * config.gcc (extra_headers): Add cet.h for x86 targets.
index d3170c7..cd72b1c 100644 (file)
@@ -1,3 +1,10 @@
+2017-11-17  Richard Biener  <rguenther@suse.de>
+
+       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  <mliska@suse.cz>
 
        * options.c (gfc_post_options):
index ea0f952..a89751b 100644 (file)
@@ -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,
index e916878..d71bd2a 100644 (file)
@@ -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;
index 1772185..f448550 100644 (file)
@@ -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 ();
        }
index f74f145..aa54221 100644 (file)
@@ -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
 };
 
index 80d45f9..169f972 100644 (file)
@@ -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 ();
        }