From patchwork Wed Nov 7 09:25:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 197639 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 40F062C00FE for ; Wed, 7 Nov 2012 20:25:48 +1100 (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=1352885149; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=CdWUui96TwOgnLSyucKoDdR7onM=; b=fJ4GgQYROK9hZFL UPYXtpLD308BE231T3YddX9ivdCNxari+Rbkl9kHqfgJqJUvdsyxLeu2y2xa/P8u PaomRqsjv74bf+BTK+BfsJmxArxfvP27mzmQfPzuPBOAMaUG96sAwWgH4YUiIPdU QNWo/0c4611IMMjDAHkP3/N+yDxc= 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:MIME-Version:Content-Type:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=RvkB/FSE8u3I9HAvdWK55zCybFBd7LIRXJpWTTmNZJqgbc54CB5tPtZjgAupCA Ff2xpPLNS79RoJy6Xw2k3gK7+qs9aEFbI0B50MHqytA9zfjgq8Gpy2SyvhiKLf7d 9nphH30Lx8MH7/5CXnsxuexy0pY3EqVg7hULyNecRmf/Q=; Received: (qmail 30846 invoked by alias); 7 Nov 2012 09:25:44 -0000 Received: (qmail 30821 invoked by uid 22791); 7 Nov 2012 09:25:43 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Nov 2012 09:25:37 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id C5273543D55; Wed, 7 Nov 2012 10:25:32 +0100 (CET) Date: Wed, 7 Nov 2012 10:25:32 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Minor fixes to ipa-inline-analysis.c Message-ID: <20121107092532.GA29254@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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, while analyzing c-ray I noticed two issues. First is that I originally set number of size/time entries to 32. Once we reach this limit we conservatively account everything as unconditional. This limit is not met on relatively simple testcases, like ray-sphere. The reason is that aggregate tracking now adds a lot of new conditionals on individual fields. While number of arguments hardly exceeds 5, the number of fields passed and used easilly. So there is need to increase the bound. While propagating info about non-constant parameters, we should also work in reverse postorder rather than in random order, since we can propagate things down across SSA graph. Bootstrapped/regtested & comitted. Honza Index: ChangeLog =================================================================== --- ChangeLog (revision 193284) +++ ChangeLog (working copy) @@ -1,3 +1,12 @@ +2012-11-07 Jan Hubicka + + * ipa-inline-analysis.c (true_predicate, single_cond_predicate, + reset_inline_edge_summary): Fix + formatting. + (account_size_time): Bump up the limit on number of size/time entries to + 256. + (estimate_function_body_sizes): Work in reverse postorder. + 2012-11-07 David S. Miller PR bootstrap/55211 Index: ipa-inline-analysis.c =================================================================== --- ipa-inline-analysis.c (revision 193284) +++ ipa-inline-analysis.c (working copy) @@ -149,7 +149,7 @@ static inline struct predicate true_predicate (void) { struct predicate p; - p.clause[0]=0; + p.clause[0] = 0; return p; } @@ -160,8 +160,8 @@ static inline struct predicate single_cond_predicate (int cond) { struct predicate p; - p.clause[0]=1 << cond; - p.clause[1]=0; + p.clause[0] = 1 << cond; + p.clause[1] = 0; return p; } @@ -692,12 +692,14 @@ account_size_time (struct inline_summary found = true; break; } - if (i == 32) + if (i == 256) { i = 0; found = true; e = &VEC_index (size_time_entry, summary->entry, 0); gcc_assert (!e->predicate.clause[0]); + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, "\t\tReached limit on number of entries, ignoring the predicate."); } if (dump_file && (dump_flags & TDF_DETAILS) && (time || size)) { @@ -970,7 +972,7 @@ reset_inline_edge_summary (struct cgraph { struct inline_edge_summary *es = inline_edge_summary (e); - es->call_stmt_size = es->call_stmt_time =0; + es->call_stmt_size = es->call_stmt_time = 0; if (es->predicate) pool_free (edge_predicate_pool, es->predicate); es->predicate = NULL; @@ -2280,6 +2282,8 @@ estimate_function_body_sizes (struct cgr struct predicate bb_predicate; struct ipa_node_params *parms_info = NULL; VEC (predicate_t, heap) *nonconstant_names = NULL; + int nblocks, n; + int *order; info->conds = 0; info->entry = 0; @@ -2312,8 +2316,12 @@ estimate_function_body_sizes (struct cgr gcc_assert (my_function && my_function->cfg); if (parms_info) compute_bb_predicates (node, parms_info, info); - FOR_EACH_BB_FN (bb, my_function) + gcc_assert (cfun == my_function); + order = XNEWVEC (int, n_basic_blocks); + nblocks = pre_and_rev_post_order_compute (NULL, order, false); + for (n = 0; n < nblocks; n++) { + bb = BASIC_BLOCK (order[n]); freq = compute_call_stmt_bb_frequency (node->symbol.decl, bb); /* TODO: Obviously predicates can be propagated down across CFG. */ @@ -2486,6 +2494,7 @@ estimate_function_body_sizes (struct cgr time = (time + CGRAPH_FREQ_BASE / 2) / CGRAPH_FREQ_BASE; if (time > MAX_TIME) time = MAX_TIME; + free (order); if (!early && nonconstant_names) {