From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14375 invoked by alias); 16 Apr 2011 22:42:50 -0000 Received: (qmail 14364 invoked by uid 22791); 16 Apr 2011 22:42:49 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_TM X-Spam-Check-By: sourceware.org Received: from mail-qy0-f182.google.com (HELO mail-qy0-f182.google.com) (209.85.216.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 16 Apr 2011 22:42:33 +0000 Received: by qyk27 with SMTP id 27so2601506qyk.20 for ; Sat, 16 Apr 2011 15:42:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.43.142 with SMTP id w14mr2507529qce.27.1302993752692; Sat, 16 Apr 2011 15:42:32 -0700 (PDT) Received: by 10.229.190.140 with HTTP; Sat, 16 Apr 2011 15:42:32 -0700 (PDT) In-Reply-To: <20110413222034.GA12767@kam.mff.cuni.cz> References: <20110413222034.GA12767@kam.mff.cuni.cz> Date: Sun, 17 Apr 2011 01:18:00 -0000 Message-ID: Subject: Re: More of ipa-inline housekeeping From: "H.J. Lu" To: Jan Hubicka Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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 X-SW-Source: 2011-04/txt/msg01290.txt.bz2 On Wed, Apr 13, 2011 at 3:20 PM, Jan Hubicka wrote: > Hi, > this patch moves inline_summary from field in cgraph_node into its own on= side > datastructure. This moves it from arcane decision of mine to split all IP= A data > into global/local datas stored in common datastructure into the scheme we > developed for new IPA passes some time ago. > > The advantage is that the code is more contained and less spread across t= he > compiler. We also make cgraph_node smaller and dumps more compact that ne= ver > hurts. > > While working on it I noticed that Richi's patch to introduce cgraph_edge > times/sizes is bit iffy in computing data when they are missing in the > datastructure. Also it computes incomming edge costs instead of outgoing = that > leads to fact that not all edges gets their info computed for IPA inliner > (think of newly discovered direct calls or IPA merging). > > I fixed this on the and added sanity check that the fields are initialize= d. > This has shown problem with early inliner iteration fixed thusly and fact= that > early inliner is attempting to compute overall growth at a time the inline > parameters are not computed for functions not visited by early optimizati= ons > yet. We previously agreed that early inliner should not try to do that (a= s this > leads to early inliner inlining functions called once that should be defe= rred > for later consieration). =A0I just hope it won't cause benchmarks to > regress too much ;) > > Having place to pile inline analysis info in, there is more to cleanup. T= he > cgraph_local/cgraph_global fields probably should go and the stuff from g= lobal > info should go into inline_summary datastructure, too (the lifetimes are > essentially the same so there is no need for the split). =A0I will handle= this > incrementally. > > Bootstrapped/regtested x86_64-linux with slightly modified version of the= patch. > Re-testing with final version and intend to commit the patch tomorrow. > > Honza > > =A0 =A0 =A0 =A0* cgraph.c (dump_cgraph_node): Do not dump inline summarie= s. > =A0 =A0 =A0 =A0* cgraph.h (struct inline_summary): Move to ipa-inline.h > =A0 =A0 =A0 =A0(cgraph_local_info): Remove inline_summary. > =A0 =A0 =A0 =A0* ipa-cp.c: Include ipa-inline.h. > =A0 =A0 =A0 =A0(ipcp_cloning_candidate_p, ipcp_estimate_growth, > =A0 =A0 =A0 =A0ipcp_estimate_cloning_cost, ipcp_insert_stage): Use inline= _summary > =A0 =A0 =A0 =A0accesor. > =A0 =A0 =A0 =A0* lto-cgraph.c (lto_output_node): Do not stream inline sum= mary. > =A0 =A0 =A0 =A0(input_overwrite_node): Do not set inline summary. > =A0 =A0 =A0 =A0(input_node): Do not stream inline summary. > =A0 =A0 =A0 =A0* ipa-inline.c (cgraph_decide_inlining): Dump inline summa= ries. > =A0 =A0 =A0 =A0(cgraph_decide_inlining_incrementally): Do not try to esti= mate overall > =A0 =A0 =A0 =A0growth; we do not have inline parameters computed for that= anyway. > =A0 =A0 =A0 =A0(cgraph_early_inlining): After inlining compute call_stmt_= sizes. > =A0 =A0 =A0 =A0* ipa-inline.h (struct inline_summary): Move here from ipa= -inline.h > =A0 =A0 =A0 =A0(inline_summary_t): New type and VECtor. > =A0 =A0 =A0 =A0(debug_inline_summary, dump_inline_summaries): Declare. > =A0 =A0 =A0 =A0(inline_summary): Use VOCtor. > =A0 =A0 =A0 =A0(estimate_edge_growth): Kill hack computing call stmt size= directly. > =A0 =A0 =A0 =A0* lto-section-in.c (lto_section_name): Add inline section. > =A0 =A0 =A0 =A0* ipa-inline-analysis.c: Include lto-streamer.h > =A0 =A0 =A0 =A0(node_removal_hook_holder, node_duplication_hook_holder): = New holders > =A0 =A0 =A0 =A0(inline_node_removal_hook, inline_node_duplication_hook): = New functions. > =A0 =A0 =A0 =A0(inline_summary_vec): Define. > =A0 =A0 =A0 =A0(inline_summary_alloc, dump_inline_summary, debug_inline_s= ummary, > =A0 =A0 =A0 =A0dump_inline_summaries): New functions. > =A0 =A0 =A0 =A0(estimate_function_body_sizes): Properly compute size/time= of outgoing calls. > =A0 =A0 =A0 =A0(compute_inline_parameters): Alloc inline_summary; do not = compute size/time > =A0 =A0 =A0 =A0of incomming calls. > =A0 =A0 =A0 =A0(estimate_edge_time): Avoid missing time summary hack. > =A0 =A0 =A0 =A0(inline_read_summary): Read inline summary info. > =A0 =A0 =A0 =A0(inline_write_summary): Write inline summary info. > =A0 =A0 =A0 =A0(inline_free_summary): Free all hooks and inline summary v= ector. > =A0 =A0 =A0 =A0* lto-streamer.h: Add LTO_section_inline_summary section. > =A0 =A0 =A0 =A0* Makefile.in (ipa-cp.o, ipa-inline-analysis.o): Update de= pendencies. > =A0 =A0 =A0 =A0* ipa.c (cgraph_remove_unreachable_nodes): Fix dump file f= ormating. > > =A0 =A0 =A0 =A0* lto.c: Include ipa-inline.h > =A0 =A0 =A0 =A0(add_cgraph_node_to_partition, undo_partition): Use inline= _summary accessor. > =A0 =A0 =A0 =A0(ipa_node_duplication_hook): Fix declaration. > =A0 =A0 =A0 =A0* Make-lang.in (lto.o): Update dependencies. This may have caused: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D48645 --=20 H.J.