public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: gcc-patches@gcc.gnu.org
Cc: Jan Hubicka <hubicka@ucw.cz>
Subject: [PATCH] Fix indirect call optimization done by autoFDO.
Date: Tue, 11 Jul 2017 10:37:00 -0000	[thread overview]
Message-ID: <dc01fe0c-9101-9c57-3401-bbff63d742a3@suse.cz> (raw)

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

Hello.

Following is a typo fix which nobody has noticed during testing of
e.g. gcc/testsuite/gcc.dg/tree-prof/indir-call-prof.c.


Patch can bootstrap and survives regression tests.

Ready for trunk?
Thanks,
Martin


gcc/ChangeLog:

2017-07-11  Martin Liska  <mliska@suse.cz>

	* auto-profile.c (autofdo_source_profile::update_inlined_ind_target):
	Fix wrong condition.
---
  gcc/auto-profile.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)



[-- Attachment #2: 0001-Fix-indirect-call-optimization-done-by-autoFDO.patch --]
[-- Type: text/x-patch, Size: 749 bytes --]

diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c
index 334f38be109..d8b0d04bf15 100644
--- a/gcc/auto-profile.c
+++ b/gcc/auto-profile.c
@@ -777,12 +777,12 @@ autofdo_source_profile::update_inlined_ind_target (gcall *stmt,
      count of the unpromoted targets (stored in old_info). If it is no less
      than half of the callsite count (stored in INFO), the original promoted
      target is considered not hot any more.  */
-  if (total >= info->count / 2)
+  if (info->count < total / 2)
     {
       if (dump_file)
-	fprintf (dump_file, " not hot anymore %ld >= %ld",
-		 (long)total,
-		 (long)info->count /2);
+	fprintf (dump_file, " not hot anymore %ld < %ld",
+		 (long)info->count,
+		 (long)total /2);
       return false;
     }
 


             reply	other threads:[~2017-07-11 10:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-11 10:37 Martin Liška [this message]
2017-07-26 17:22 ` Jeff Law
2017-07-27 12:54   ` Martin Liška

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=dc01fe0c-9101-9c57-3401-bbff63d742a3@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.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).