On Mon, 9 May 2011, Jan Hubicka wrote: > > On Fri, May 6, 2011 at 10:24 PM, Jan Hubicka <hubi...@ucw.cz> wrote: > > > Hi, > > > while looking at type merging code I noticed that type pairs can be > > > managed > > > to be ordered by their UIDs. This save some of hashing overhead in one of > > > most intensively querried hashes. > > > > > > Also gimple_lookup_type_leader is hot function that is better to be > > > inlined. > > > > > > I also wonder, why unionfind algorithm is not used here to maintain the > > > positive answers? > > > > Can you elaborate? > > Well, just use unionfind to record the equivalences found and then > prior checking the hashtable ask it for equivalence class representative. > Either you will already find that the pairs are equivalent (in faster > way than by querying the hash) or you at least save the memory by caching > the negative andwers only across the equivalence classes. > > I hacked quick unionfind two days ago, but the stopper is that the cache > is temporarily caching equilvaences in SCC regions. You mentioned it is no > longer neccesary, so perhaps if you send me patch to remove this, I can give > a try to this idea.
I think we already do exactly this. Richard.