public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix indirect call optimization done by autoFDO.
@ 2017-07-11 10:37 Martin Liška
  2017-07-26 17:22 ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Liška @ 2017-07-11 10:37 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jan Hubicka

[-- 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;
     }
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix indirect call optimization done by autoFDO.
  2017-07-11 10:37 [PATCH] Fix indirect call optimization done by autoFDO Martin Liška
@ 2017-07-26 17:22 ` Jeff Law
  2017-07-27 12:54   ` Martin Liška
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2017-07-26 17:22 UTC (permalink / raw)
  To: Martin Liška, gcc-patches; +Cc: Jan Hubicka

On 07/11/2017 04:37 AM, Martin Liška wrote:
> 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.
The preceeding comment says

"If it is no less than half of the callsite count (stored in INFO), the
original promoted target is considered not hot anymore."

"it" presumably refers to TOTAL  and INFO->count holds the callsite count.

A direct translation would result in

! (total < info->count / 2)

Which is equivalent to

(total >= info->count / 2)

Which seems to match the code.

So is the comment wrong?  Or is my interpretation wrong?

jeff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix indirect call optimization done by autoFDO.
  2017-07-26 17:22 ` Jeff Law
@ 2017-07-27 12:54   ` Martin Liška
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liška @ 2017-07-27 12:54 UTC (permalink / raw)
  To: Jeff Law, gcc-patches; +Cc: Jan Hubicka

On 07/26/2017 07:22 PM, Jeff Law wrote:
> So is the comment wrong?  Or is my interpretation wrong?
> 
> jeff

Yes, comment needs adjustment, done that in r250622.

Thanks for review,
Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-27 12:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-11 10:37 [PATCH] Fix indirect call optimization done by autoFDO Martin Liška
2017-07-26 17:22 ` Jeff Law
2017-07-27 12:54   ` Martin Liška

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).