From patchwork Fri Aug 31 14:41:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 180984 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]) by ozlabs.org (Postfix) with SMTP id 565D62C011F for ; Sat, 1 Sep 2012 00:42:01 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1347028922; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Subject:Message-ID:Mail-Followup-To:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To: User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=cQ4wLO1 wT4IkBDoAyJn2zt7S2k8=; b=eNF/ORL51/Rh51e9nnvwIHc643PLLWVkn5vRBv6 JqRxpW+LU1FZ2We9DUmL5b0hNgb7WH6tf6q5kDphdgYV3Qd+O0+B458vOEt7qU9z /uNFqmY4VL1opg3dCsBBQ3COqOE5STW1WTPMxDuu8i70gcDR88typyEYAaHfyySz bMjw= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=IJcTw4nZoa8B5gG4tTVMV7MwHhf1o1GPEK/FSbsIxakKb7h5EdBn3T0IZrRNHI 4W76Kpn5pn6XSmVMSdoJp/3egj0ZhdlxS4TiNQRIMMw/ECQ82/NlUAe2cwjSVpJn GjdYWRFPaOuEZBxocL1FZKw5JzLzmeykpHDWEaffY9/5E=; Received: (qmail 14418 invoked by alias); 31 Aug 2012 14:41:57 -0000 Received: (qmail 14406 invoked by uid 22791); 31 Aug 2012 14:41:55 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 31 Aug 2012 14:41:36 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 4FB8AA3DE0 for ; Fri, 31 Aug 2012 16:41:35 +0200 (CEST) Date: Fri, 31 Aug 2012 16:41:34 +0200 From: Martin Jambor To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH, PR 54394] Compute loops when generating inline summaries Message-ID: <20120831144134.GB6468@virgil.arch.suse.de> Mail-Followup-To: gcc-patches@gcc.gnu.org References: <20120829182400.GC3395@virgil.arch.suse.de> <20120831085332.GD7104@kam.mff.cuni.cz> <20120831095616.GA6468@virgil.arch.suse.de> <20120831100633.GA12083@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120831100633.GA12083@kam.mff.cuni.cz> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 Hi, On Fri, Aug 31, 2012 at 12:06:33PM +0200, Jan Hubicka wrote: > > > > This is not required to make hints working, it is necessary because of > > the following line a in estimate_function_body_sizes: > > > > es->loop_depth = bb_loop_depth (bb); > > > > which always yields zero if we don't have loops computed. So I can > > skip the computation only if we don't care about loop depths in early > > inlining either. Should I skip it? > > Only place we care is the badness computation and only if profile guessing is off, > so just initialize it to 0 for early inliner. > Thanks. For the record, this is what I have committed. Martin 2012-08-31 Martin Jambor PR middle-end/54394 * ipa-inline-analysis.c (estimate_function_body_sizes): Compute dominance info and loops whenever optimizing. Index: src/gcc/ipa-inline-analysis.c =================================================================== --- src.orig/gcc/ipa-inline-analysis.c +++ src/gcc/ipa-inline-analysis.c @@ -2102,6 +2102,11 @@ estimate_function_body_sizes (struct cgr info->conds = 0; info->entry = 0; + if (optimize && !early) + { + calculate_dominance_info (CDI_DOMINATORS); + loop_optimizer_init (LOOPS_NORMAL | LOOPS_HAVE_RECORDED_EXITS); + } if (dump_file) fprintf (dump_file, "\nAnalyzing function body size: %s\n", @@ -2270,9 +2275,6 @@ estimate_function_body_sizes (struct cgr loop_iterator li; predicate loop_iterations = true_predicate (); - calculate_dominance_info (CDI_DOMINATORS); - loop_optimizer_init (LOOPS_NORMAL - | LOOPS_HAVE_RECORDED_EXITS); if (dump_file && (dump_flags & TDF_DETAILS)) flow_loops_dump (dump_file, NULL, 0); scev_initialize (); @@ -2305,12 +2307,15 @@ estimate_function_body_sizes (struct cgr *inline_summary (node)->loop_iterations = loop_iterations; } scev_finalize (); - loop_optimizer_finalize (); - free_dominance_info (CDI_DOMINATORS); } inline_summary (node)->self_time = time; inline_summary (node)->self_size = size; VEC_free (predicate_t, heap, nonconstant_names); + if (optimize && !early) + { + loop_optimizer_finalize (); + free_dominance_info (CDI_DOMINATORS); + } if (dump_file) { fprintf (dump_file, "\n");