From b8163af7d91c2f5a4158a5cb6e6555b375e61ea4 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 27 Jul 2017 14:53:34 +0200 Subject: [PATCH] Initialize counters in autoFDO to zero, not to uninitialized. 2017-07-27 Martin Liska * auto-profile.c (afdo_annotate_cfg): Assign zero counts to BBs and edges seen by autoFDO. From-SVN: r250621 --- gcc/ChangeLog | 5 +++++ gcc/auto-profile.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5fcaae2eba6..cf39fdaec7c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-07-27 Martin Liska + + * auto-profile.c (afdo_annotate_cfg): Assign zero counts to + BBs and edges seen by autoFDO. + 2017-07-27 Richard Biener PR tree-optimization/81502 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); -- 2.30.2