This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] add statistics counting to postreload, copy-rename, and math-opts


On Wed, Apr 13, 2011 at 11:07:15AM +0200, Richard Guenther wrote:
> On Tue, Apr 12, 2011 at 5:09 PM, Nathan Froyd <froydnj@codesourcery.com> wrote:
> > Granted, but that fact should still be recorded. ?The situation we have
> > today, for something like:
> >
> > func1: statistic for "statx" was 0
> > ?- nothing is recorded in the statistics table
> > func2: statistic for "statx" was 0
> > ?- nothing is recorded in the statistics table
> > func3: statistic for "statx" was 0
> > ?- nothing is recorded in the statistics table
> > ...
> >
> > and so forth, is that at the end of the day, the dump file won't even
> > include any information about "statx". ?If you had some func7387 where
> > "statx" was non-zero, you could infer that nothing else happened in the
> > previous 7386 functions. ?For the case where a pass is truly useless on
> > a TU, it's hard to figure out from the statistics dump alone. ?And I'd
> > argue that it's useful to see explicitly that the pass only helped in 1
> > out of 7387 functions, rather than trying to infer it from missing data.
> 
> I always use statistics-stats (thus, overall stats, not per function).  The
> per function ones omit zero counts during dumping on purpose
> (to make the dump smaller).

I didn't know about statistics-stats (or didn't realize that's what the
code was trying to do), that's useful.  And it looks like all the
statistics dumping things omit zero counts on purpose, not just the
per-function ones.

But that has no bearing on the point above: zero counts are not even
*recorded* today.  E.g. if you apply the patch upthread, grab a random C
file, compile it with -O2/3 -fdump-statistics/-stats, and examine the
dump file, you might not even know that new statistics counters have
been added.  Taking out the checks to avoid printing zero counts doesn't
help either, because the data simply doesn't get recorded.  This
infrastructure makes it somewhat difficult to figure out, in an
automated way from the dump file alone, whether passes are actually
doing anything.

Enough grousing.  I'm assuming turning on accumulation and dumping of
zero counts always would be frowned upon; would it be acceptable to turn
accumulation and dumping of zero counts if -details is given?

-Nathan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]