From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3861 invoked by alias); 9 Jun 2015 14:12:32 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 3847 invoked by uid 89); 9 Jun 2015 14:12:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 09 Jun 2015 14:12:30 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Z2KGP-0000UM-T3 from Tom_deVries@mentor.com ; Tue, 09 Jun 2015 07:12:26 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Tue, 9 Jun 2015 15:12:24 +0100 Message-ID: <5576F43C.3010201@mentor.com> Date: Tue, 09 Jun 2015 14:12:00 -0000 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Richard Biener CC: GCC Patches Subject: Re: [PING^2][PATCH][3/3][PR65460] Mark offloaded functions as parallelized References: <5509B43E.802@mentor.com> <550AAD8B.9080900@mentor.com> <550C06BB.1050500@mentor.com> <5530DBA0.2000703@mentor.com> <557588BA.6060409@mentor.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------060906040606010604030307" X-SW-Source: 2015-06/txt/msg00680.txt.bz2 --------------060906040606010604030307 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1414 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 --------------060906040606010604030307 Content-Type: text/x-patch; name="0001-Mark-function-parallelized_function-before-add_new_f.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0001-Mark-function-parallelized_function-before-add_new_f.pa"; filename*1="tch" Content-length: 1400 Mark function parallelized_function before add_new_function 2015-06-09 Tom de Vries * 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 --------------060906040606010604030307 Content-Type: text/x-patch; name="0002-Mark-offloaded-functions-as-parallelized.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="0002-Mark-offloaded-functions-as-parallelized.patch" Content-length: 791 Mark offloaded functions as parallelized 2015-06-09 Tom de Vries 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 --------------060906040606010604030307--