diff options
author | Martin Liska <mliska@suse.cz> | 2017-07-27 14:53:34 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2017-07-27 12:53:34 +0000 |
commit | b8163af7d91c2f5a4158a5cb6e6555b375e61ea4 (patch) | |
tree | 724a0bec6f6a0ece835bec475ddeebeaf8a9b858 /gcc/auto-profile.c | |
parent | 9811e84c99df6269baa406c7f42d479b342087c4 (diff) |
Initialize counters in autoFDO to zero, not to uninitialized.
2017-07-27 Martin Liska <mliska@suse.cz>
* auto-profile.c (afdo_annotate_cfg): Assign zero counts to
BBs and edges seen by autoFDO.
From-SVN: r250621
Diffstat (limited to 'gcc/auto-profile.c')
-rw-r--r-- | gcc/auto-profile.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c index 71c06f30449..552e3331b15 100644 --- a/gcc/auto-profile.c +++ b/gcc/auto-profile.c @@ -1547,9 +1547,11 @@ afdo_annotate_cfg (const stmt_set &promoted_stmts) edge e; edge_iterator ei; - bb->count = profile_count::uninitialized (); + /* As autoFDO uses sampling approach, we have to assume that all + counters are zero when not seen by autoFDO. */ + 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); |