From patchwork Wed Sep 30 06:17:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 524159 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 10E89140789 for ; Wed, 30 Sep 2015 16:17:51 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=PTmMa/CJ; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=ihi03AzrlbDWVVcIZ o5jBerjYjtVSQ0fdCy/ebpPvLeN5T/0et1B6E2b9cubO7x4VI/4yeqdganLdwSq9 eaVwrr7CkNFKGURf+68GIXt5hImCUq42XnrgCvtP2PJYICmN+fyjGeugkMUoFPVC iWyJDUF8KlTrkplwu4jlGmH/1g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=4dO/29wWWUJvxqSYyQNxyy0 13ZY=; b=PTmMa/CJ500aYul4qnYayxi8vRW4rXrd6hB+NH2422zNITJ0ume4Hz2 bVpHX4ppooE3/dxoFDfsAnV0nBEYF8AVyi+8H4Kuv2yOw+yxyjpCUw4Ul18YBsJY qBA17OWHSszjhnhNBB5P+nbf1CJZJ5+7W2hk7hd+XRCe0N3X4Urc= Received: (qmail 2109 invoked by alias); 30 Sep 2015 06:17:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 2087 invoked by uid 89); 30 Sep 2015 06:17:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 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, 30 Sep 2015 06:17:36 +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 1ZhAho-0004U0-MJ from Tom_deVries@mentor.com ; Tue, 29 Sep 2015 23:17:33 -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; Wed, 30 Sep 2015 07:17:31 +0100 Subject: [gomp4,committed] Remove release_dangling_ssa_names To: Thomas Schwinge References: <546743BC.5070804@mentor.com> <54678B3D.8020009@mentor.com> <54730EE7.40000@mentor.com> <5474665A.4070101@mentor.com> <87iocp1d8o.fsf@kepler.schwinge.homeip.net> <557076A5.7050207@mentor.com> <55C1BA11.70008@mentor.com> <55C1CDAF.8050402@mentor.com> <55C1EA05.5070904@mentor.com> <55CA44B3.2000409@mentor.com> <87twqkwd1u.fsf@kepler.schwinge.homeip.net> <560399EB.3010208@mentor.com> <87fv24fav1.fsf@schwinge.name> CC: GCC Patches , Jakub Jelinek , Richard Biener From: Tom de Vries Message-ID: <560B7E60.2040806@mentor.com> Date: Wed, 30 Sep 2015 08:17:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <87fv24fav1.fsf@schwinge.name> [ was: Re: [PATCH] Don't create superfluous parm in expand_omp_taskreg ] On 24/09/15 11:02, Thomas Schwinge wrote: > Hi Tom! > > On Thu, 24 Sep 2015 08:36:27 +0200, Tom de Vries wrote: >> >On 24/09/15 08:23, Thomas Schwinge wrote: >>> > >On Tue, 11 Aug 2015 20:53:39 +0200, Tom de Vries wrote: >>>> > >>Don't create superfluous parm in expand_omp_taskreg >>>> > >> >>>> > >>2015-08-11 Tom de Vries >>>> > >> >>>> > >> * omp-low.c (expand_omp_taskreg): If in ssa, set rhs of parcopy stmt to >>>> > >> parm_decl, rather than generating a dummy default def in cfun. >>>> > >> * tree-cfg.c (replace_ssa_name): Assume no default defs. Make sure >>>> > >> ssa_name from cfun and child_fn do not share a stmt as def stmt. >>>> > >> (move_stmt_op): Handle PARM_DECl. >>>> > >> (gather_ssa_name_hash_map_from): New function. >>>> > >> (move_sese_region_to_fn): Add default defs for function params, and add >>>> > >> them to vars_map. Release copied ssa names. >>>> > >> * tree-cfg.h (gather_ssa_name_hash_map_from): Declare. >>> > > >>> > >Do I understand correct that with this change present on trunk (which I'm >>> > >currently merging into gomp-4_0-branch), the changes you've earlier done >>> > >on gomp-4_0-branch to gcc/omp-low.c:release_dangling_ssa_names, >>> > >gcc/tree-cfg.c:replace_ssa_name, should now be reverted? That is, how >>> > >much of the following patches can be reverted now (listed backwards in >>> > >time)? >> > >> >indeed, in the above commit we release the dangling ssa names in >> >move_sese_region_to_fn. So after committing this patch to the >> >gomp-4_0-branch, the call to release_dangling_ssa_names is no longer >> >necessary, and the function release_dangling_ssa_names can be removed. > Well, I'm asking because in my merge tree, I'm running > into an assertion that you added there -- not sure yet whether I've > done something wrong, though. The source of the problem was in expand_omp_target, which needed similar changes as expand_omp_taskreg got in the "Don't create superfluous parm in expand_omp_taskreg" patch. Now that the merge ( https://gcc.gnu.org/viewcvs/gcc/branches/gomp-4_0-branch/gcc/omp-low.c?limit_changes=0&r1=228091&r2=228090&pathrev=228091 ) contains that change, I've committed these two patches to gomp-4_0-branch: - Revert "Fix release_dangling_ssa_names" (Reverting an earlier attempt to handle the release_dangling_ssa_names TODO, which was committed to the gomp-4_0-branch) - Remove release_dangling_ssa_names Thanks, - Tom Remove release_dangling_ssa_names 2015-09-24 Tom de Vries * omp-low.c (release_dangling_ssa_names): Remove. (pass_omp_expand_ssa::execute): Remove call to release_dangling_ssa_names. --- gcc/omp-low.c | 46 +--------------------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 04a60ab..6bdfaa2 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -10541,48 +10541,6 @@ make_pass_expand_omp (gcc::context *ctxt) return new pass_expand_omp (ctxt); } -/* After running pass_expand_omp_ssa to expand the oacc kernels - directive, we are left in the original function with anonymous - SSA_NAMEs, with a defining statement that has been deleted. This - pass finds those SSA_NAMEs and releases them. - TODO: Either fix this elsewhere, or make the fix unnecessary. */ - -static void -release_dangling_ssa_names (void) -{ - unsigned int i; - for (i = 1; i < num_ssa_names; ++i) - { - tree name = ssa_name (i); - if (name == NULL_TREE) - continue; - - gimple *stmt = SSA_NAME_DEF_STMT (name); - if (stmt != NULL) - continue; - bool found = false; - - ssa_op_iter op_iter; - def_operand_p def_p; - FOR_EACH_PHI_OR_STMT_DEF (def_p, stmt, op_iter, SSA_OP_ALL_DEFS) - { - tree def = DEF_FROM_PTR (def_p); - if (def == name) - { - found = true; - break; - } - } - - if (!found) - { - if (dump_file) - fprintf (dump_file, "Released dangling ssa name %u\n", i); - release_ssa_name (name); - } - } -} - namespace { const pass_data pass_data_expand_omp_ssa = @@ -10613,9 +10571,7 @@ public: } virtual unsigned int execute (function *) { - unsigned res = execute_expand_omp (); - release_dangling_ssa_names (); - return res; + return execute_expand_omp (); } opt_pass * clone () { return new pass_expand_omp_ssa (m_ctxt); } -- 1.9.1