* [PATCH] Initialize counters in autoFDO to zero, not to uninitialized.
@ 2017-07-11 10:36 Martin Liška
2017-07-26 17:43 ` Jeff Law
0 siblings, 1 reply; 3+ messages in thread
From: Martin Liška @ 2017-07-11 10:36 UTC (permalink / raw)
To: gcc-patches; +Cc: Jan Hubicka
[-- Attachment #1: Type: text/plain, Size: 375 bytes --]
Hello.
This fixes majority of autoFDO test-cases.
Patch can boostrap and survives regression tests.
Ready for trunk?
Thanks,
Martin
gcc/ChangeLog:
2017-07-11 Martin Liska <mliska@suse.cz>
* auto-profile.c (afdo_annotate_cfg): Assign zero counts to
BBs and edges seen by autoFDO.
---
gcc/auto-profile.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[-- Attachment #2: 0001-Initialize-counters-in-autoFDO-to-zero-not-to-uninit.patch --]
[-- Type: text/x-patch, Size: 587 bytes --]
diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c
index 71c06f30449..334f38be109 100644
--- a/gcc/auto-profile.c
+++ b/gcc/auto-profile.c
@@ -1547,9 +1547,9 @@ afdo_annotate_cfg (const stmt_set &promoted_stmts)
edge e;
edge_iterator ei;
- bb->count = profile_count::uninitialized ();
+ bb->count = profile_count::zero ().afdo ();
FOR_EACH_EDGE (e, ei, bb->succs)
- e->count = profile_count::uninitialized ();
+ e->count = profile_count::zero ().afdo ();
if (afdo_set_bb_count (bb, promoted_stmts))
set_bb_annotated (bb, &annotated_bb);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Initialize counters in autoFDO to zero, not to uninitialized.
2017-07-11 10:36 [PATCH] Initialize counters in autoFDO to zero, not to uninitialized Martin Liška
@ 2017-07-26 17:43 ` Jeff Law
2017-07-27 12:53 ` Martin Liška
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2017-07-26 17:43 UTC (permalink / raw)
To: Martin Liška, gcc-patches; +Cc: Jan Hubicka
On 07/11/2017 04:35 AM, Martin Liška wrote:
> Hello.
>
> This fixes majority of autoFDO test-cases.
>
> Patch can boostrap and survives regression tests.
>
> Ready for trunk?
> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> 2017-07-11 Martin Liska <mliska@suse.cz>
>
> * auto-profile.c (afdo_annotate_cfg): Assign zero counts to
> BBs and edges seen by autoFDO.
I went back and forth on this a couple times. I could argue that if we
don't have data for the edge from auto-fdo, then the proper value is
uninitialized(). But I think the response to that argument is that if
the edge didn't show up in the afdo run, then it's counters should be
zero'd as they weren't triggered during the afdo run.
I think a comment immediately prior to the initialization seems wise. OK
with that change.
jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Initialize counters in autoFDO to zero, not to uninitialized.
2017-07-26 17:43 ` Jeff Law
@ 2017-07-27 12:53 ` Martin Liška
0 siblings, 0 replies; 3+ messages in thread
From: Martin Liška @ 2017-07-27 12:53 UTC (permalink / raw)
To: Jeff Law, gcc-patches; +Cc: Jan Hubicka
On 07/26/2017 07:43 PM, Jeff Law wrote:
> On 07/11/2017 04:35 AM, Martin Liška wrote:
>> Hello.
>>
>> This fixes majority of autoFDO test-cases.
>>
>> Patch can boostrap and survives regression tests.
>>
>> Ready for trunk?
>> Thanks,
>> Martin
>>
>> gcc/ChangeLog:
>>
>> 2017-07-11 Martin Liska <mliska@suse.cz>
>>
>> * auto-profile.c (afdo_annotate_cfg): Assign zero counts to
>> BBs and edges seen by autoFDO.
> I went back and forth on this a couple times. I could argue that if we
> don't have data for the edge from auto-fdo, then the proper value is
> uninitialized(). But I think the response to that argument is that if
> the edge didn't show up in the afdo run, then it's counters should be
> zero'd as they weren't triggered during the afdo run.
>
> I think a comment immediately prior to the initialization seems wise. OK
> with that change.
Yes, I've just added comment and installed the patch as r250621.
Thanks for the review.
Martin
>
> jeff
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-27 12:53 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:36 [PATCH] Initialize counters in autoFDO to zero, not to uninitialized Martin Liška
2017-07-26 17:43 ` Jeff Law
2017-07-27 12:53 ` 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).