This is the mail archive of the
mailing list for the GCC project.
guessed profile counts leading to incorrect static branch hints on ppc64
- From: Aaron Sawdey <acsawdey at linux dot vnet dot ibm dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 09 Dec 2015 13:59:21 -0600
- Subject: guessed profile counts leading to incorrect static branch hints on ppc64
- Authentication-results: sourceware.org; auth=none
So, I'm wondering if anyone can help with where the ultimate problem may
lie here. I've seen some cases where gcc generates branches with the
static branch hints bit set. It is happening because the branch
probability gets set to "always". This happens in
recompute_probabilities (basic_block bb)
FOR_EACH_EDGE (esucc, ei, bb->succs)
/* Prevent overflow computation due to insane profiles. */
if (esucc->count < bb->count)
esucc->probability = GCOV_COMPUTE_SCALE (esucc->count,
/* Can happen with missing/guessed probabilities, since we
may determine that more is flowing along duplicated
path than joiner succ probabilities allowed.
Counts and freqs will be insane after jump threading,
at least make sure probability is sane or we will
get a flow verification error.
Not much we can do to make counts/freqs sane without
redoing the profile estimation. */
esucc->probability = REG_BR_PROB_BASE;
It would appear that the guessed counts are getting changed
inconsistently before this during the tree-ssa-dom pass.
Any trail of breadcrumbs to follow through the forest would be helpful
Aaron Sawdey, Ph.D. firstname.lastname@example.org
050-2/C113 (507) 253-7520 home: 507/263-0782
IBM Linux Technology Center - PPC Toolchain