On Tue, Apr 12, 2011 at 5:09 PM, Nathan Froyd <froy...@codesourcery.com> wrote: > On Tue, Apr 12, 2011 at 04:54:43PM +0200, Richard Guenther wrote: >> On Tue, Apr 12, 2011 at 4:51 PM, Nathan Froyd <froy...@codesourcery.com> >> wrote: >> > True, but maybe those testcases should be adjusted--per-pass flags, >> > rather than blindly assuming -O2 includes them. And it's not clear to >> >> It's easier to add things to GCC than to argue removing things ... > > And sometimes not even easy to argue for adding things. :) > >> > me that the statistics_counter_event infrastructure really helps >> > catching do-nothing passes, since it doesn't record stats that increment >> > by zero... >> >> Well, if the overall count is zero then nothing was done. > > 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). Richard. > -Nathan >