From patchwork Fri Dec 30 08:31:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dehao Chen X-Patchwork-Id: 133621 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 26F76B6FC2 for ; Fri, 30 Dec 2011 19:32:14 +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=1325838735; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=Y82FEBS Awu0Po0tvppZn3RTRH0E=; b=uSDq6w+OvFptR5AnByIGsuMLnX2RrqSDfHvS2nY kuLG1WPBsg+BUAEtK94pHM3iBUooezbttsyg0lq6+l7eM7C1CJFJbTgWUoL91ej6 kTjBkP2rRitQkPQu7bP0UjkZKMJXKJQVlqNBCLxNxHIdH2j2gAJvDjGGXj5ntYFD YeDI= 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:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Cc:X-System-Of-Record:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Qoy15fzQPLfo9r2C6WnkMmfUvOa6VN4jgPg8nqbHcg5Zlgw47R1JRpoTnOTKuC 9Mc2+hLKs/MtQXF9iN03QmMjwCWYlGgaFblPe5GBDqt+Flx6Bh+szRDOdu0ujbJ5 /fDCxbrY5UsP3xQqu/TUKmvDhzIt91McbKq4IFVG9hBew=; Received: (qmail 15510 invoked by alias); 30 Dec 2011 08:32:11 -0000 Received: (qmail 15501 invoked by uid 22791); 30 Dec 2011 08:32:10 -0000 X-SWARE-Spam-Status: No, hits=-3.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, TW_CP X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Dec 2011 08:31:57 +0000 Received: by iakh37 with SMTP id h37so22555379iak.20 for ; Fri, 30 Dec 2011 00:31:56 -0800 (PST) Received: by 10.42.131.136 with SMTP id z8mr21709607ics.5.1325233916767; Fri, 30 Dec 2011 00:31:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.131.136 with SMTP id z8mr21709596ics.5.1325233916657; Fri, 30 Dec 2011 00:31:56 -0800 (PST) Received: by 10.50.23.70 with HTTP; Fri, 30 Dec 2011 00:31:56 -0800 (PST) Date: Fri, 30 Dec 2011 16:31:56 +0800 Message-ID: Subject: [google] change dump_inline_decisions to make it print more useful and better looking info From: Dehao Chen To: gcc-patches@gcc.gnu.org Cc: Xinliang David Li X-System-Of-Record: true 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, This patch makes the -fopt-info print more concise info: 1. only inline decisions after einline are printed 2. print in a more compact format Bootstrapped with no problem. Is it okay for google-4_6 and google-main branch? Thanks, Dehao gcc/ChangeLog.google-4_6 2011-12-30 Dehao Chen * ipa-inline.c (dump_inline_decision): Print more concise info when dumping inline decisions. Index: gcc/ipa-inline.c =================================================================== --- gcc/ipa-inline.c (revision 182739) +++ gcc/ipa-inline.c (working copy) @@ -303,26 +303,19 @@ char *buf; size_t buf_size; const char *bfd_name = lang_hooks.dwarf_name (node->decl, 0); - const char *count_text = "count="; - const char *max_count_text = "max_count="; if (!bfd_name) bfd_name = "unknown"; buf_size = strlen (bfd_name) + 1; if (flag_opt_info >= OPT_INFO_MED) - buf_size += (strlen (count_text) + MAX_INT_LENGTH + 1); - if (flag_opt_info >= OPT_INFO_MAX) - buf_size += (strlen (max_count_text) + MAX_INT_LENGTH + 1); + buf_size += (2 * MAX_INT_LENGTH + 5); buf = (char *) xmalloc (buf_size); strcpy (buf, bfd_name); if (flag_opt_info >= OPT_INFO_MED) - sprintf (buf, "%s,%s"HOST_WIDEST_INT_PRINT_DEC, - buf, count_text, node->count); - if (flag_opt_info >= OPT_INFO_MAX) - sprintf (buf, "%s,%s"HOST_WIDEST_INT_PRINT_DEC, - buf, max_count_text, node->max_bb_count); + sprintf (buf, "("HOST_WIDEST_INT_PRINT_DEC", "HOST_WIDEST_INT_PRINT_DEC")", + node->count, node->max_bb_count); return buf; } @@ -369,6 +362,14 @@ const char *inline_chain_text; const char *call_count_text; struct cgraph_node *final_caller = edge->caller; + tree decl = edge->caller->decl; + + if (decl) + { + struct function *fn = DECL_STRUCT_FUNCTION (decl); + if (!fn || !fn->always_inline_functions_inlined) + return; + } if (final_caller->global.inlined_to != NULL) inline_chain_text = cgraph_node_call_chain (final_caller, &final_caller);