This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][2/3][PR65458] Mark omp thread functions as parallelized


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.

> @@ -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.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]