Speedup aliasing (on tramp3d -O1)
Jan Hubicka
jh@suse.cz
Sun Aug 20 23:58:00 GMT 2006
> Jan Hubicka wrote:
> > Hi,
> > on tramp3d (and my favorite testcase too), aliasing spends about 6-10%
> > of -O1 compilation time by checking bitmaps for equivalency.
>
> How much faster does this change make the compiler?
For the two testcases at -O1 the 6-10% I mentioned above (stated not
really clearly, but the time comes to basically 0). For "common"
function bodies it probably matters less as only large bodies create
many different memory tags.
>
> As a general rule, if you're providing a patch to speed up either the
> compiler or the generated code on a particular benchmark, you should say
> what you measured and what improvement your patch provides.
>
> > +/* Compute checksum of bitmap (for purposes of hashing). */
> > +unsigned long
> > +bitmap_checksum (bitmap head)
>
> As Dan Berlin said, this should be bitmap_hash. (Checksums are used to
> check that something (often a stream of data) is likely to be the thing
> you expected. Hashes are used to store things in hash tables, and
> should ideally be randomly distributed over the key space.)
>
> This function should be declared to return a hashval_t since that's how
> you're using it. Besides being confusing, this is potentially
> suboptimal: you're truncating from unsigned long to hashval_t (which is
> actually an unsigned int) which does not in general preserve the
> desirable properties of a hash function. Finally, since you're
> returning a hashval_t, you should insert a cast somewhere in the
> function -- either at the point of return, or as you read the various
> chunks out of the bitmap, so that it is clear that you understand that
> the conversion is taking place.
>
> OK with those changes.
Thanks.
Honza
>
> --
> Mark Mitchell
> CodeSourcery
> mark@codesourcery.com
> (650) 331-3385 x713
More information about the Gcc-patches
mailing list