On 19-03-15 12:11, Jakub Jelinek wrote:
On Thu, Mar 19, 2015 at 12:02:01PM +0100, Tom de Vries wrote:
+void
+mark_parallelized_function (tree fndecl)
+{
+  cgraph_node *node = cgraph_node::get (fndecl);
+  gcc_assert (node != NULL);
+  node->parallelized_function = 1;
  }

I'm not convinced we need this wrapper, I'd just use
   cgraph_node::get (fndecl)->parallelized_function = 1;
wherever you need to set it.  It wouldn't be the first or last
flag handled this way.


Sure, I can update that, I'll retest and repost.

@@ -1459,10 +1465,6 @@ create_loop_fn (location_t loc)
    type = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);

    decl = build_decl (loc, FUNCTION_DECL, name, type);
-  if (!parallelized_functions)
-    parallelized_functions = BITMAP_GGC_ALLOC ();
-  bitmap_set_bit (parallelized_functions, DECL_UID (decl));
-

More importantly, you aren't marking the function as parallelized here.
That most likely defeats the original purpose of the bitmap.
Perhaps it is too early to create cgraph node here, but you should ensure
that it is done perhaps later in create_loop_fn.


Indeed, it's not done here, but it is still done, only later.

The function we create in parloops is split off using omp_expand, and that's where we mark the function as parallelized, just like other omp functions, in expand_omp_taskreg.

Thanks,
- Tom

Reply via email to