From patchwork Sat Dec 31 08:45:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dehao Chen X-Patchwork-Id: 133733 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 5EC92B6FA4 for ; Sat, 31 Dec 2011 19:46:08 +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=1325925968; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type: Content-Transfer-Encoding:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=oKrUj7ivJkI6cgrWKqAiBVRgWk4=; b=Wl3UFsMpOsD2Pvd GoVs+LajNfeu7UXMbU5hZ/3d6z//ifDmDmRzPLZUOBpESkJG8XEKM7krSHacg5+7 yxSH3EU4Z8BPq11iq9OhUitHYskQkuCLasq50O7qRO7OB3TVsqQfI+mgyeZK4Ax5 FVnGIAsktgaqkj1osOzNg/8C6aE8= 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:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:X-System-Of-Record:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=tfK5UlP3CKrnj7bMaQHEegBx1kbAbFtnQaRd4depogrcaywmOgrxB1IMVe+IBl KWlUuWNPNQV3NFHgYcTmvE4tdSTypTuy9swpnZhY3pugMzZuzWB+aygd4sTRySH4 LCPdS+MwRO5tCAVBBTX0Y7wiZYjogVIlG8E/+1TsPZfFg=; Received: (qmail 16122 invoked by alias); 31 Dec 2011 08:46:00 -0000 Received: (qmail 16105 invoked by uid 22791); 31 Dec 2011 08:45:58 -0000 X-SWARE-Spam-Status: No, hits=-3.5 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; Sat, 31 Dec 2011 08:45:45 +0000 Received: by iakh37 with SMTP id h37so24078633iak.20 for ; Sat, 31 Dec 2011 00:45:45 -0800 (PST) Received: by 10.50.108.140 with SMTP id hk12mr50012585igb.18.1325321144904; Sat, 31 Dec 2011 00:45:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.108.140 with SMTP id hk12mr50012574igb.18.1325321144717; Sat, 31 Dec 2011 00:45:44 -0800 (PST) Received: by 10.50.23.70 with HTTP; Sat, 31 Dec 2011 00:45:44 -0800 (PST) In-Reply-To: References: Date: Sat, 31 Dec 2011 16:45:44 +0800 Message-ID: Subject: Re: [google] change dump_inline_decisions to make it print more useful and better looking info From: Dehao Chen To: Xinliang David Li Cc: gcc-patches@gcc.gnu.org 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 I see. The patch is updated: Thanks, Dehao On Fri, Dec 30, 2011 at 4:59 PM, Xinliang David Li wrote: > the early inline decisions are still good to dump out. However the > opt-info should check 'if (profile_info)' to decide if count and max > count info need to be dumped. > > David > > On Fri, Dec 30, 2011 at 12:31 AM, Dehao Chen wrote: >> 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); Index: ipa-inline.c =================================================================== --- ipa-inline.c (revision 182739) +++ 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); + if (flag_opt_info >= OPT_INFO_MED && profile_info) + 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); + if (flag_opt_info >= OPT_INFO_MED && profile_info) + sprintf (buf, "("HOST_WIDEST_INT_PRINT_DEC", "HOST_WIDEST_INT_PRINT_DEC")", + node->count, node->max_bb_count); return buf; }