public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tom de Vries <Tom_deVries@mentor.com>
To: Richard Biener <rguenther@suse.de>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PING^2][PATCH][3/3][PR65460] Mark offloaded functions as parallelized
Date: Tue, 09 Jun 2015 14:12:00 -0000	[thread overview]
Message-ID: <5576F43C.3010201@mentor.com> (raw)
In-Reply-To: <alpine.LSU.2.11.1506091304470.30088@zhemvz.fhfr.qr>

[-- Attachment #1: Type: text/plain, Size: 1414 bytes --]

On 09/06/15 13:07, Richard Biener wrote:
> On Mon, 8 Jun 2015, Tom de Vries wrote:
>
>> On 17/04/15 12:08, Tom de Vries wrote:
>>> On 20-03-15 12:38, Tom de Vries wrote:
>>>> On 19-03-15 12:05, Tom de Vries wrote:
>>>>> On 18-03-15 18:22, Tom de Vries wrote:
>>>>>> Hi,
>>>>>>
>>>>>> this patch fixes PR65460.
>>>>>>
>>>>>> The patch marks offloaded functions as parallelized, which means the
>>>>>> parloops
>>>>>> pass no longer attempts to modify that function.
>>>>>
>>>>> Updated patch to postpone mark_parallelized_function until the
>>>>> corresponding
>>>>> cgraph_node is available, to ensure it works with the updated
>>>>> mark_parallelized_function from patch 2/3.
>>>>>
>>>>
>>>> Updated to eliminate mark_parallelized_function.
>>>>
>>>> Bootstrapped and reg-tested on x86_64.
>>>>
>>>> OK for stage4?
>>>>
>>>
>>> ping.
>>
>> ping^2. Original post at
>> https://gcc.gnu.org/ml/gcc-patches/2015-03/msg01063.html .
>
> Ok, but shouldn't it be set before calling add_new_function as
> add_new_function might run passes that wouldn't identify the
> function as parallelized?
>

Hm, indeed sometimes add_new_function executes some passes itself, 
besides queueing the function for further processing. I suppose the 
existing settings of parallelized_function should be modified in a 
similar way.

I'll bootstrap and reg-test attached two patches on x86_64, and commit 
unless objections.

Thanks,
- Tom

[-- Attachment #2: 0001-Mark-function-parallelized_function-before-add_new_f.patch --]
[-- Type: text/x-patch, Size: 1400 bytes --]

Mark function parallelized_function before add_new_function

2015-06-09  Tom de Vries  <tom@codesourcery.com>

	* omp-low.c (finalize_task_copyfn, expand_omp_taskreg): Mark function
	parallelized_function before add_new_function.
---
 gcc/omp-low.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index f322416..2045e48 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -1552,8 +1552,9 @@ finalize_task_copyfn (gomp_task *task_stmt)
   pop_cfun ();
 
   /* Inform the callgraph about the new function.  */
+  cgraph_node *node = cgraph_node::get_create (child_fn);
+  node->parallelized_function = 1;
   cgraph_node::add_new_function (child_fn, false);
-  cgraph_node::get (child_fn)->parallelized_function = 1;
 }
 
 /* Destroy a omp_context data structures.  Called through the splay tree
@@ -5589,8 +5590,9 @@ expand_omp_taskreg (struct omp_region *region)
 
       /* Inform the callgraph about the new function.  */
       DECL_STRUCT_FUNCTION (child_fn)->curr_properties = cfun->curr_properties;
+      cgraph_node *node = cgraph_node::get_create (child_fn);
+      node->parallelized_function = 1;
       cgraph_node::add_new_function (child_fn, true);
-      cgraph_node::get (child_fn)->parallelized_function = 1;
 
       /* Fix the callgraph edges for child_cfun.  Those for cfun will be
 	 fixed in a following pass.  */
-- 
1.9.1


[-- Attachment #3: 0002-Mark-offloaded-functions-as-parallelized.patch --]
[-- Type: text/x-patch, Size: 791 bytes --]

Mark offloaded functions as parallelized

2015-06-09  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/65460
	* omp-low.c (expand_omp_target): Set parallelized_function on
	cgraph_node for child_fn.
---
 gcc/omp-low.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 2045e48..77716bf6 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -8959,6 +8959,8 @@ expand_omp_target (struct omp_region *region)
 
       /* Inform the callgraph about the new function.  */
       DECL_STRUCT_FUNCTION (child_fn)->curr_properties = cfun->curr_properties;
+      cgraph_node *node = cgraph_node::get_create (child_fn);
+      node->parallelized_function = 1;
       cgraph_node::add_new_function (child_fn, true);
 
 #ifdef ENABLE_OFFLOADING
-- 
1.9.1


  reply	other threads:[~2015-06-09 14:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18 17:22 [PATCH][3/3][PR65460] " Tom de Vries
2015-03-19 11:05 ` Tom de Vries
2015-03-20 11:38   ` Tom de Vries
2015-03-21 22:31     ` Tom de Vries
2015-03-25  8:30       ` Thomas Schwinge
2015-04-17 10:08     ` [PING][PATCH][3/3][PR65460] " Tom de Vries
2015-06-08 12:33       ` [PING^2][PATCH][3/3][PR65460] " Tom de Vries
2015-06-09 11:12         ` Richard Biener
2015-06-09 14:12           ` Tom de Vries [this message]
2015-06-09 23:46             ` Thomas Schwinge
2015-06-10  8:26               ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5576F43C.3010201@mentor.com \
    --to=tom_devries@mentor.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).