From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19211 invoked by alias); 25 Aug 2014 09:56:03 -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 19185 invoked by uid 89); 25 Aug 2014 09:55:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=AWL,BAYES_50 autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 25 Aug 2014 09:55:54 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 63D57AB12; Mon, 25 Aug 2014 09:55:51 +0000 (UTC) Message-ID: <53FB0826.6080105@suse.cz> Date: Mon, 25 Aug 2014 09:56:00 -0000 From: =?windows-1252?Q?Martin_Li=9Aka?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org CC: Jan Hubicka Subject: Re: [PATCH 2/5] Existing call graph infrastructure enhancement References: <47303faf697c5f537d471e88d3c946c5a1d04f6e.1402913001.git.mliska@suse.cz> <53A09E46.5080507@redhat.com> <53B14EC0.1080509@suse.cz> <53B1B258.9040607@redhat.com> <53C7E284.7050303@suse.cz> In-Reply-To: <53C7E284.7050303@suse.cz> Content-Type: multipart/mixed; boundary="------------000501050301090107050700" X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg02310.txt.bz2 This is a multi-part message in MIME format. --------------000501050301090107050700 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-length: 2661 Hello, after fixing an issue with callgraph thunk creation, I would like to enhance callgraph API a bit. My problem was that I was trying to expand_thunk after a body of the original function was removed. As a result, I created a call without arguments. The change was suggested by Honza. Thank you, Martin On 07/17/2014 03:49 PM, Martin Liška wrote: > > On 06/30/2014 08:54 PM, Jeff Law wrote: >> On 06/30/14 05:49, Martin Liška wrote: >>> >>> On 06/17/2014 10:00 PM, Jeff Law wrote: >>>> On 06/13/14 04:26, mliska wrote: >>>>> Hi, >>>>> this small patch prepares remaining needed infrastructure for >>>>> the new pass. >>>>> >>>>> Changelog: >>>>> >>>>> 2014-06-13 Martin Liska >>>>> Honza Hubicka >>>>> >>>>> * ipa-utils.h (polymorphic_type_binfo_p): Function marked external >>>>> instead of static. >>>>> * ipa-devirt.c (polymorphic_type_binfo_p): Likewise. >>>>> * ipa-prop.h (count_formal_params): Likewise. >>>>> * ipa-prop.c (count_formal_params): Likewise. >>>>> * ipa-utils.c (ipa_merge_profiles): Be more tolerant if we merge >>>>> profiles for semantically equivalent functions. >>>>> * passes.c (do_per_function): If we load body of a function >>>>> during WPA, >>>>> this condition should behave same. >>>>> * varpool.c (ctor_for_folding): More tolerant assert for variable >>>>> aliases created during WPA. >>>> Presumably we don't have any useful way to merge the cases where we >>>> have provides for SRC & DST in ipa_merge_profiles or even to guess >>>> which is more useful when presented with both? Does it make sense to >>>> log this into a debugging file when we drop one? >>> Hello, >>> this merge function was written by Honza, what do you think Honza >>> about this note? >>> >>>> I think this patch is fine. If adding logging makes sense, then feel >>>> free to do so and consider that trivial change pre-approved. >>> I made a small change to this patch, where I moved >>> 'gsi_next_nonvirtual_phi' from the pass to gimple-iterator.h. >>> >>> Ready for trunk with this change? >> Yes. I think with the exception of patch #3/5 everything looks good. I'll try to get another pass over #3 this week. What I looked at last week was pretty good; I'm pretty confident this will be wrapped up shortly. >> >> If #1/#2 make sense to install independent of #3, go ahead. #4/#5 are obviously dependent on #3. >> >> Jeff > > Hello, > thank you for approval, this final version removes few hunks that are not needed any more. Changes are just cosmetic and I will commit the patch at the beginning of next week. > > Thanks, > Martin > --------------000501050301090107050700 Content-Type: text/plain; charset=UTF-8; name="ipa-icf-release-body.changelog" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ipa-icf-release-body.changelog" Content-length: 146 2014-08-25 Martin Liska * cgraph.h (release_body): new argument keep_arguments added. * cgraph.c (release_body): Likewise. --------------000501050301090107050700 Content-Type: text/x-patch; name="ipa-icf-release-body.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ipa-icf-release-body.patch" Content-length: 1266 diff --git a/gcc/cgraph.c b/gcc/cgraph.c index cb49cdc..ad32fb8 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -1716,13 +1716,15 @@ release_function_body (tree decl) are free'd in final.c via free_after_compilation(). */ void -cgraph_node::release_body (void) +cgraph_node::release_body (bool keep_arguments) { ipa_transforms_to_apply.release (); if (!used_as_abstract_origin && cgraph_state != CGRAPH_STATE_PARSING) { DECL_RESULT (decl) = NULL; - DECL_ARGUMENTS (decl) = NULL; + + if (!keep_arguments) + DECL_ARGUMENTS (decl) = NULL; } /* If the node is abstract and needed, then do not clear DECL_INITIAL of its associated function function declaration because it's diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 2594ae5..5edcf74 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -890,7 +890,7 @@ public: Use this only for functions that are released before being translated to target code (i.e. RTL). Functions that are compiled to RTL and beyond are free'd in final.c via free_after_compilation(). */ - void release_body (void); + void release_body (bool keep_arguments = false); /* cgraph_node is no longer nested function; update cgraph accordingly. */ void unnest (void); --------------000501050301090107050700--