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]

Make GCSE statistics more detailed


Hi,

While looking at some compile time slowness issues, I found out that
the second const/copy propagation pass in gcse is very slow and not
very effective on AMD64, and that the cprop pass for jump bypassing
did not even find a single constant to propagate.

Especially cprop is extremely expensive for some tests (most notably
insn-attrtab where DOM and gcse cprop together make up for more than
one third of the total compile time).  Getting rid of some (parts of)
this pass would be helpful.

On other platforms these passes might be equally ineffective, but it
is kind of hard to analyze unless the following patch is applied.  The
patch adds timers for each pass in gcse.c, and splits out the number
of constant and copy props in local and global results.  I'd like to
see if we can get away with a few local and just one global const/copy
propagation pass, and having the effects of the global and local pass
split up like this makes evaluating the effectiveness of these passes
a lot easier.
Also, good per-pass statistics gathering is generally useful IMHO.

I think the patch is quite obvious.
Bootstrapped on AMD64.  Testing doesn't exercise the patch but I've
done some compiles with -dG.  OK for mainline?

Gr.
Steven

        * 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.

Attachment: gcse_timers.diff
Description: Binary data


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