Make GCSE statistics more detailed

Roger Sayle roger@eyesopen.com
Mon Aug 9 15:09:00 GMT 2004


On Mon, 9 Aug 2004, Steven Bosscher wrote:
>
>         * timevar.def (TV_CPROP1, TV_CPROP2, TV_PRE, TV_HOIST, TV_LSM):
>         New timers.
>         * gcse.c: Include timevar.h.
> (const_prop_count, copy_prop_count): Rename to global_const_prop_count
>         and global_copy_prop_count.
> (local_const_prop_count, local_copy_prop_count): New static globals.
>         (gcse_main): Set the right timevar for each pass.
> (cprop_jump): Increment global_const_prop_count when a constant is
>         propagated.  Add "GLOBAL" to dump output.
> (cprop_insn): Increment global_const_prop_count when a constant is
>         propagated, or global_copy_prop_count when a copy is propagated.
>         (do_local_cprop): Likewise for local_const_prop_count and
>         local_copy_prop_count.
>         (one_cprop_pass): Initialize const/cprop counters to zero.
>         Print out results of local and global const/cprop separately.
>         (bypass_block): Break over-length line.


You're missing the change to Makefile.in reflecting the dependency of
gcse.o on $(TIMEVAR_H).  Ok for mainline with that change.


If you have access to SPEC it might be useful to use your patch to update
the statistics in the comment at the top of gcse.c:

>>   A study of spec92 using an unlimited number of passes:
>>   [1 pass] = 1208 substitutions, [2] = 577, [3] = 202, [4] = 192,
>>   [5] = 83, [6] = 34, [7] = 17, [8] = 9, [9] = 4, [10] = 4, [11] = 2,
>>   [12] = 2, [13] = 1, [15] = 1, [16] = 2, [41] = 1

I suspect that tree-ssa completely invalidates these statistics.


Roger
--



More information about the Gcc-patches mailing list