This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR opt/12322: Speed-up trim_ld_motion_mems
- From: Roger Sayle <roger at eyesopen dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 2 Dec 2003 08:10:10 -0700 (MST)
- Subject: Re: [PATCH] PR opt/12322: Speed-up trim_ld_motion_mems
On Mon, 1 Dec 2003, Richard Henderson wrote:
> On Mon, Dec 01, 2003 at 01:37:56PM -0700, Roger Sayle wrote:
> > PR optimization/12322
> > * gcse.c (struct ls_expr): Change type of hash_index from int to
> > unsigned int.
> > (hash_expr): Document hash_table_size parameter and wrap long line.
> > (ldst_entry): Calculate expression's hash_index and record in ptr.
> > (trim_ld_motion_mems): Use hash_index to search a single bucket
> > instead of scanning the entire hash_table. Remove the "del" local
> > variable and use the equivalent "expr == 0" instead. Change last
> > to be a pointer to the pointer to the current element, to simplify
> > and speed-up deleting from a linked list.
>
> Looks ok.
Many thanks. Committed.
I've also bootstrapped and regression tested on powerpc-apple-darwin7.0.0,
to get some timings that aren't biased by the exponential behaviour in
regstack.
Before: GCSE Total
Run #1 44.67 (49%) 91.04
Run #2 45.79 (48%) 95.73
Run #3 49.29 (49%) 100.33
After: GCSE Total
Run #1 27.41 (35%) 78.31
Run #2 27.07 (35%) 77.59
Run #3 27.14 (35%) 77.34
So the patch knocks 19s off of both GCSE (41% reduction) and total
compilation time (20% reduction) when compiling core_ops_cg.i (from
perl 6) at -O2.
Many thanks again,
Roger
--