This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][2/3][PR65458] Mark omp thread functions as parallelized
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Tom de Vries <Tom_deVries at mentor dot com>
- Cc: Richard Biener <rguenther at suse dot de>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 19 Mar 2015 12:11:27 +0100
- Subject: Re: [PATCH][2/3][PR65458] Mark omp thread functions as parallelized
- Authentication-results: sourceware.org; auth=none
- References: <5509B42F dot 1040707 at mentor dot com> <20150318172540 dot GO1746 at tucnak dot redhat dot com> <550AACA9 dot 60207 at mentor dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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