This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Make cgraph frequencies more precise
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, GCC Patches <gcc-patches at gcc dot gnu dot org>, David Edelsohn <dje dot gcc at gmail dot com>
- Date: Mon, 12 Oct 2015 20:53:00 +0200
- Subject: Re: Make cgraph frequencies more precise
- Authentication-results: sourceware.org; auth=none
- References: <20151012060727 dot GB53108 at kam dot mff dot cuni dot cz> <CAMe9rOrixioyW6CG8WJhGpdv3pPoUVTS7FnU1Rtjk7U7yOUh+Q at mail dot gmail dot com>
> On Sun, Oct 11, 2015 at 11:07 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
> > Hi,
> > this patch fixes a case of extreme imprecision I noticed while looking into
> > profiles of PHP interpretter. There is a function that is called 22 times
> > and contains the main loop. Now since the frequency of entry block is dropped
> > to 0, we do not have any information of relative frequencies in the colder
> > areas of the function.
> >
> > Hope all this uglyness with go away with conversion to sreals soonish.
> >
> > Profiledbootstrapped/regtested ppc64le-linux, comitted.
> > * cgraphbuild.c (compute_call_stmt_bb_frequency): Use
> > counts when these are more informative.
>
> This caused:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67931
Hmm, interesting it does not show on ppcle. The problem is however obvious,
while we scale counts we get into roundoff errors that affects the new definition
of bb frequencies. I have reverted the patch as the actual effect on generated
code should be minimal - we use counts instead of frequences when available
on all relevant places.
Honza
>
> --
> H.J.