This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] rebuild frequency after vrp
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Dehao Chen <dehao at google dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Biener <richard dot guenther at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 2 Jun 2014 20:13:16 +0200
- Subject: Re: [PATCH] rebuild frequency after vrp
- Authentication-results: sourceware.org; auth=none
- References: <CAO2gOZWFOuG2O0RLkkT5+tZOpDg+-=pBQk--88X+A-qObgDayw at mail dot gmail dot com> <20140602161326 dot GC16816 at kam dot mff dot cuni dot cz> <CAO2gOZV8WH5_u4_pxCApahgB2F9f=g=6PYb9u0Ppcw1GMLU82Q at mail dot gmail dot com>
> We need to rebuild frequency after vrp, otherwise the following code
> in tree-ssa-threadupdate.c will make the frequency larger than
> upper-bound.
>
> /* Excessive jump threading may make frequencies large enough so
> the computation overflows. */
> if (rd->dup_blocks[0]->frequency < BB_FREQ_MAX * 2)
> rd->dup_blocks[0]->frequency += EDGE_FREQUENCY (e);
>
> This is referring to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61384
I see, I still think C++ conversion gives us chance to turn both counts and
frequencies to types that are safe WRT such calculations. Counts can be either
software floats as discussed or fixed point 64bit type (I think we only need
something like 8-10 bits to get problems Teresa is running into resolved - the
cases where expanding statements gets sub 1 counts that needs to be diferent
from 0) that does caps instead of overflow. Frequencies can be either the same
or 32bit fixed point with capping as we do, sort of, now.
I would really welcome if someone worked on this rather than papering around the
bugs in current hand written fixed point arithmetics. (I am currently occupied
by other projects, so I am not sure I can do it myself really soon)
Honza