From patchwork Fri Jul 11 18:42:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 369219 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 5F12C1400D6 for ; Sat, 12 Jul 2014 04:42:27 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=UTJiJecMnrGtsemVX 32tww29cd6TsnsWVykArguYJdO3OyRqHMJgBrXLOH3gES5l1+QXdW+8iUMeZHaEd 7c81VOCD4zXFPTGRrfhwO0k7/a+oVQddyWLIkt81hD/P7HkpQNoJPZLBfSGI2Yzs vzf1U4ZS4h6mQ8J4F+WOJ7vVcw= 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:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=OKhiNzojKZ+SCs7zGTPka+D /Qqg=; b=IvDyo5xCHsLmOPjMSgRAMG9yHWtTiracNmC+v5YcW1k0BkZ9NLEM0lp fA2YTs0S0nMzqbFJNlzfMGlM1fue7fKBbCjRi8gJxwsYC6ALeapQFyIFRq3RRNIp 4Kvu0vwMEnh1iv1Zugd/SVmEK4vEhZ/VYXsvyfM2+0ABxGfil5/U= Received: (qmail 1029 invoked by alias); 11 Jul 2014 18:42:19 -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 960 invoked by uid 89); 11 Jul 2014 18:42:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_50, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 11 Jul 2014 18:42:09 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 79569543DD2; Fri, 11 Jul 2014 20:42:05 +0200 (CEST) Date: Fri, 11 Jul 2014 20:42:05 +0200 From: Jan Hubicka To: Jan Hubicka Cc: Richard Biener , gcc-patches@gcc.gnu.org Subject: Re: Use separate sections to stream non-trivial constructors Message-ID: <20140711184205.GB27781@kam.mff.cuni.cz> References: <20140711091810.GC30037@kam.mff.cuni.cz> <20140711115320.GA27809@atrey.karlin.mff.cuni.cz> <20140711120855.GD11760@kam.mff.cuni.cz> <20140711174741.GA27781@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140711174741.GA27781@kam.mff.cuni.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Hi this is patch i am going to commit after testing. It removes DECL_INIT_IO timevar that guards only one variable set (so hardly measure anything) and moves GIMPLE_IN to proper place. It also adds CTORS_IN and CTORS_OUT. I get: ipa lto gimple out : 0.37 ( 0%) usr 0.21 ( 3%) sys 0.64 ( 1%) wall 0 kB ( 0%) ggc ipa lto decl in : 23.56 (26%) usr 1.24 (15%) sys 24.81 (23%) wall 2429174 kB (60%) ggc ipa lto decl out : 5.58 ( 6%) usr 0.34 ( 4%) sys 5.94 ( 5%) wall 0 kB ( 0%) ggc ipa lto constructors in : 0.34 ( 0%) usr 0.10 ( 1%) sys 0.47 ( 0%) wall 14864 kB ( 0%) ggc ipa lto constructors out: 0.06 ( 0%) usr 0.01 ( 0%) sys 0.01 ( 0%) wall 0 kB ( 0%) ggc ipa lto cgraph I/O : 1.20 ( 1%) usr 0.25 ( 3%) sys 1.45 ( 1%) wall 437317 kB (11%) ggc for Firefox WPA that is surprisingly good. We traded about 400MB for 14MB. So perhaps I do not need to care about not bringing in all vtables needed for devirt machinery. honza * lto.c (read_cgraph_and_symbols): Do not push DECL_INIT_IO timevar (materialize_cgraph): Do not push GIMPLE_IN timevar. * timevar.def (TV_IPA_LTO_DECL_INIT_IO): Remove. (TV_IPA_LTO_CTORS_IN, TV_IPA_LTO_CTORS_OUT): New timevar. * cgraph.c (cgraph_get_body): Push GIMPLE_IN timevar. (varpool_get_constructor): Push CTORS_IN timevar. * lto-streamer-out.c (lto_output): Push TV_IPA_LTO_CTORS_OUT timevar. Index: lto/lto.c =================================================================== --- lto/lto.c (revision 212467) +++ lto/lto.c (working copy) @@ -3094,12 +3094,9 @@ read_cgraph_and_symbols (unsigned nfiles timevar_pop (TV_IPA_LTO_CGRAPH_MERGE); - timevar_push (TV_IPA_LTO_DECL_INIT_IO); - /* Indicate that the cgraph is built and ready. */ cgraph_function_flags_ready = true; - timevar_pop (TV_IPA_LTO_DECL_INIT_IO); ggc_free (all_file_decl_data); all_file_decl_data = NULL; } @@ -3117,9 +3114,6 @@ materialize_cgraph (void) fprintf (stderr, flag_wpa ? "Materializing decls:" : "Reading function bodies:"); - /* Now that we have input the cgraph, we need to clear all of the aux - nodes and read the functions if we are not running in WPA mode. */ - timevar_push (TV_IPA_LTO_GIMPLE_IN); FOR_EACH_FUNCTION (node) { @@ -3130,7 +3124,6 @@ materialize_cgraph (void) } } - timevar_pop (TV_IPA_LTO_GIMPLE_IN); /* Start the appropriate timer depending on the mode that we are operating in. */ Index: timevar.def =================================================================== --- timevar.def (revision 212457) +++ timevar.def (working copy) @@ -77,7 +77,8 @@ DEFTIMEVAR (TV_IPA_LTO_GIMPLE_IN , " DEFTIMEVAR (TV_IPA_LTO_GIMPLE_OUT , "ipa lto gimple out") DEFTIMEVAR (TV_IPA_LTO_DECL_IN , "ipa lto decl in") DEFTIMEVAR (TV_IPA_LTO_DECL_OUT , "ipa lto decl out") -DEFTIMEVAR (TV_IPA_LTO_DECL_INIT_IO , "ipa lto decl init I/O") +DEFTIMEVAR (TV_IPA_LTO_CTORS_IN , "ipa lto constructors in") +DEFTIMEVAR (TV_IPA_LTO_CTORS_OUT , "ipa lto constructors out") DEFTIMEVAR (TV_IPA_LTO_CGRAPH_IO , "ipa lto cgraph I/O") DEFTIMEVAR (TV_IPA_LTO_DECL_MERGE , "ipa lto decl merge") DEFTIMEVAR (TV_IPA_LTO_CGRAPH_MERGE , "ipa lto cgraph merge") Index: cgraph.c =================================================================== --- cgraph.c (revision 212457) +++ cgraph.c (working copy) @@ -3053,6 +3053,8 @@ cgraph_get_body (struct cgraph_node *nod gcc_assert (in_lto_p); + timevar_push (TV_IPA_LTO_GIMPLE_IN); + file_data = node->lto_file_data; name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); @@ -3076,6 +3078,9 @@ cgraph_get_body (struct cgraph_node *nod lto_free_section_data (file_data, LTO_section_function_body, name, data, len); lto_free_function_in_decl_state_for_node (node); + + timevar_pop (TV_IPA_LTO_GIMPLE_IN); + return true; } Index: varpool.c =================================================================== --- varpool.c (revision 212467) +++ varpool.c (working copy) @@ -268,6 +268,8 @@ varpool_get_constructor (struct varpool_ || !in_lto_p) return DECL_INITIAL (node->decl); + timevar_push (TV_IPA_LTO_CTORS_IN); + file_data = node->lto_file_data; name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); @@ -286,6 +288,7 @@ varpool_get_constructor (struct varpool_ lto_free_section_data (file_data, LTO_section_function_body, name, data, len); lto_free_function_in_decl_state_for_node (node); + timevar_pop (TV_IPA_LTO_CTORS_IN); return DECL_INITIAL (node->decl); } Index: lto-streamer-out.c =================================================================== --- lto-streamer-out.c (revision 212467) +++ lto-streamer-out.c (working copy) @@ -2115,6 +2115,7 @@ lto_output (void) && lto_symtab_encoder_encode_initializer_p (encoder, node) && !node->alias) { + timevar_push (TV_IPA_LTO_CTORS_OUT); #ifdef ENABLE_CHECKING gcc_assert (!bitmap_bit_p (output, DECL_UID (node->decl))); bitmap_set_bit (output, DECL_UID (node->decl)); @@ -2129,6 +2130,7 @@ lto_output (void) gcc_assert (lto_get_out_decl_state () == decl_state); lto_pop_out_decl_state (); lto_record_function_out_decl_state (node->decl, decl_state); + timevar_pop (TV_IPA_LTO_CTORS_OUT); } } }