]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
openacc: Add "can_be_parallel" flag info to "graph" dumps
authorFrederik Harwath <frederik@codesourcery.com>
Tue, 16 Nov 2021 15:16:47 +0000 (16:16 +0100)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 21 Jun 2022 13:11:48 +0000 (14:11 +0100)
gcc/ChangeLog:

* graph.cc (oacc_get_fn_attrib): New declaration.
(find_loop_location): New declaration.
(draw_cfg_nodes_for_loop): Print value of the
can_be_parallel flag at the top of loops in OpenACC
functions.

gcc/ChangeLog.omp
gcc/graph.cc

index 97f2f523265de20018d4bff58fe2a361f846cb1e..8669e9e07e90aca03a5ce84a72780f6f89b31dc0 100644 (file)
@@ -1,3 +1,11 @@
+2021-11-16  Frederik Harwath <frederik@codesourcery.com>
+
+       * graph.cc (oacc_get_fn_attrib): New declaration.
+       (find_loop_location): New declaration.
+       (draw_cfg_nodes_for_loop): Print value of the
+       can_be_parallel flag at the top of loops in OpenACC
+       functions.
+
 2021-11-16  Frederik Harwath <frederik@codesourcery.com>
            Thomas Schwinge <thomas@codesourcery.com>
 
index bc29862fcad231d5162d3af84d9ffe2227b02dee..ff5ef02e811be3823078a60f918566e106a045fe 100644 (file)
@@ -192,6 +192,10 @@ draw_cfg_nodes_no_loops (pretty_printer *pp, struct function *fun)
     }
 }
 
+
+extern tree oacc_get_fn_attrib (tree);
+extern dump_user_location_t find_loop_location (class loop *);
+
 /* Draw all the basic blocks in LOOP.  Print the blocks in breath-first
    order to get a good ranking of the nodes.  This function is recursive:
    It first prints inner loops, then the body of LOOP itself.  */
@@ -206,17 +210,26 @@ draw_cfg_nodes_for_loop (pretty_printer *pp, int funcdef_no,
 
   if (loop->header != NULL
       && loop->latch != EXIT_BLOCK_PTR_FOR_FN (cfun))
-    pp_printf (pp,
-              "\tsubgraph cluster_%d_%d {\n"
-              "\tstyle=\"filled\";\n"
-              "\tcolor=\"darkgreen\";\n"
-              "\tfillcolor=\"%s\";\n"
-              "\tlabel=\"loop %d\";\n"
-              "\tlabeljust=l;\n"
-              "\tpenwidth=2;\n",
-              funcdef_no, loop->num,
-              fillcolors[(loop_depth (loop) - 1) % 3],
-              loop->num);
+    {
+      pp_printf (pp,
+                 "\tsubgraph cluster_%d_%d {\n"
+                 "\tstyle=\"filled\";\n"
+                 "\tcolor=\"darkgreen\";\n"
+                 "\tfillcolor=\"%s\";\n"
+                 "\tlabel=\"loop %d %s\";\n"
+                 "\tlabeljust=l;\n"
+                 "\tpenwidth=2;\n",
+                 funcdef_no, loop->num,
+                 fillcolors[(loop_depth (loop) - 1) % 3], loop->num,
+                 /* This is only meaningful for loops that have been processed
+                    by Graphite.
+
+                    TODO Use can_be_parallel_valid_p? */
+                 !oacc_get_fn_attrib (cfun->decl)
+                     ? ""
+                     : loop->can_be_parallel ? "(can_be_parallel = true)"
+                                             : "(can_be_parallel = false)");
+    }
 
   for (class loop *inner = loop->inner; inner; inner = inner->next)
     draw_cfg_nodes_for_loop (pp, funcdef_no, inner);