public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: gcc-patches@gcc.gnu.org, Martin Jambor <mjambor@suse.cz>
Subject: Re: [PATCH] IPA: reduce what we dump in normal mode
Date: Wed, 3 Aug 2022 10:56:32 +0200	[thread overview]
Message-ID: <818b219a-1717-9372-612e-1bcd9862c5fc@suse.cz> (raw)
In-Reply-To: <YulQVa2DAdEm0Wo1@kam.mff.cuni.cz>

[-- Attachment #1: Type: text/plain, Size: 249 bytes --]

On 8/2/22 18:27, Jan Hubicka wrote:
> If you disable dumping, you can also disable the collection of stats
> which is guarded by if (dump_file) as well.  Otherwise the patch is OK.

Sure, good point!

I'm going to push the following.

Thanks,
Martin

[-- Attachment #2: 0001-profile-do-not-collect-stats-unless-TDF_DETAILS.patch --]
[-- Type: text/x-patch, Size: 1486 bytes --]

From 7585e5ecb47761516b8f397002819f2c95b8c32e Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Wed, 3 Aug 2022 10:53:22 +0200
Subject: [PATCH] profile: do not collect stats unless TDF_DETAILS

gcc/ChangeLog:

	* profile.cc (compute_branch_probabilities): Do not collect
	stats unless TDF_DETAILS.
---
 gcc/profile.cc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gcc/profile.cc b/gcc/profile.cc
index 92de821b8bb..96121d60711 100644
--- a/gcc/profile.cc
+++ b/gcc/profile.cc
@@ -753,7 +753,8 @@ compute_branch_probabilities (unsigned cfg_checksum, unsigned lineno_checksum)
 	    bb->count = profile_count::from_gcov_type (bb_gcov_count (bb));
 	  else
 	    bb->count = profile_count::guessed_zero ();
-	  if (dump_file && bb->index >= 0)
+
+	  if (dump_file && (dump_flags & TDF_DETAILS) && bb->index >= 0)
 	    {
 	      double freq1 = cnt.to_sreal_scale (old_entry_cnt).to_double ();
 	      double freq2 = bb->count.to_sreal_scale
@@ -776,8 +777,8 @@ compute_branch_probabilities (unsigned cfg_checksum, unsigned lineno_checksum)
 	      nsum2 += stat.feedback;
 	      fprintf (dump_file,
 		       " Basic block %4i guessed freq: %12.3f"
-		       " cummulative:%6.2f%% "
-		       " feedback freq: %12.3f cummulative:%7.2f%%"
+		       " cumulative:%6.2f%% "
+		       " feedback freq: %12.3f cumulative:%7.2f%%"
 		       " cnt: 10%" PRId64 "\n", stat.bb->index,
 		       stat.guessed,
 		       nsum1 * 100 / sum1,
-- 
2.37.1


      reply	other threads:[~2022-08-03  8:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02  8:46 Martin Liška
2022-08-02  9:52 ` Richard Biener
2022-08-02 16:27 ` Jan Hubicka
2022-08-03  8:56   ` Martin Liška [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=818b219a-1717-9372-612e-1bcd9862c5fc@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=mjambor@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).