Speedup aliasing (on tramp3d -O1)

Jan Hubicka jh@suse.cz
Mon Aug 21 06:04: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?
> 
> 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

One problem here is that I drag hashtable.h depencency into bitmap.h.
Would be fine with you to add the #include?  (this was original reason
for me to not use hashval_t.  One alternative would be to make the
function to return BITMAP_WORD to make clear the range of the hash
value).

Honza
> 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.
> 
> -- 
> Mark Mitchell
> CodeSourcery
> mark@codesourcery.com
> (650) 331-3385 x713



More information about the Gcc-patches mailing list