From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54664 invoked by alias); 10 Jun 2015 08:26:35 -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 53594 invoked by uid 89); 10 Jun 2015 08:26:34 -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; Wed, 10 Jun 2015 08:26:32 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Z2bLA-0003TV-5n from Tom_deVries@mentor.com ; Wed, 10 Jun 2015 01:26:28 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.224.2; Wed, 10 Jun 2015 09:26:26 +0100 Message-ID: <5577F4A4.20301@mentor.com> Date: Wed, 10 Jun 2015 08:26: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: Thomas Schwinge CC: GCC Patches , Richard Biener 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> <5576F43C.3010201@mentor.com> <87a8w8h6kl.fsf@kepler.schwinge.homeip.net> In-Reply-To: <87a8w8h6kl.fsf@kepler.schwinge.homeip.net> Content-Type: multipart/mixed; boundary="------------020800080501000507000805" X-SW-Source: 2015-06/txt/msg00736.txt.bz2 --------------020800080501000507000805 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 2956 On 10/06/15 00:15, Thomas Schwinge wrote: > Hi Tom! > > On Tue, 9 Jun 2015 16:12:12 +0200, Tom de Vries wrote: >> 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: >>>>>>>> this patch fixes PR65460. >>>>>>>> >>>>>>>> The patch marks offloaded functions as parallelized, which means the >>>>>>>> parloops >>>>>>>> pass no longer attempts to modify that function. > >>> 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 took note of this small change of the trunk patch vs. the version > present on gomp-4_0-branch, and will adapt the latter as required as part > of the next merge.) > >> I'll bootstrap and reg-test attached two patches on x86_64, and commit >> unless objections. > >> 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. > > (Committed to trunk in r224303.) > >> --- 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); > > Would you please committ a fix: in offloading configurations > (ENABLE_OFFLOADING), this new node variable will clash with an existing > definition a little later: > >> + node->parallelized_function = 1; >> cgraph_node::add_new_function (child_fn, true); >> >> #ifdef ENABLE_OFFLOADING > | /* Add the new function to the offload table. */ > | vec_safe_push (offload_funcs, child_fn); > | #endif > | > | /* Fix the callgraph edges for child_cfun. Those for cfun will be > | fixed in a following pass. */ > | push_cfun (child_cfun); > | cgraph_edge::rebuild_edges (); > | > | #ifdef ENABLE_OFFLOADING > | /* Prevent IPA from removing child_fn as unreachable, since there are no > | refs from the parent function to child_fn in offload LTO mode. */ > | struct cgraph_node *node = cgraph_node::get (child_fn); > | node->mark_force_output (); > | #endif > Committed attached patch to trunk as obvious. Build and tested in ENABLE_OFFLOADING configuration on top of gomp-4_0-branch. Thanks, - Tom --------------020800080501000507000805 Content-Type: text/x-patch; name="0001-Fix-build-for-ENABLE_OFFLOADING-in-expand_omp_target.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0001-Fix-build-for-ENABLE_OFFLOADING-in-expand_omp_target.pa"; filename*1="tch" Content-length: 849 Fix build for ENABLE_OFFLOADING in expand_omp_target 2015-06-10 Tom de Vries * omp-low.c (expand_omp_target): Remove duplicate declaration of node. --- gcc/omp-low.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 77716bf6..72c431e 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -8976,8 +8976,7 @@ expand_omp_target (struct omp_region *region) #ifdef ENABLE_OFFLOADING /* Prevent IPA from removing child_fn as unreachable, since there are no refs from the parent function to child_fn in offload LTO mode. */ - struct cgraph_node *node = cgraph_node::get (child_fn); - node->mark_force_output (); + cgraph_node::get (child_fn)->mark_force_output (); #endif /* Some EH regions might become dead, see PR34608. If -- 1.9.1 --------------020800080501000507000805--