On Tue, 10 Mar 2015, Jan Hubicka wrote: > > > > This reduces the time spent in cgraph call-site hash by providing > > inline version of htab_hash_pointer. > > > > Bootstrap / regtest on x86_64-unknown-linux-gnu in progress. > > > > Ok? > > > > Thanks, > > Richard. > > > > 2015-03-09 Richard Biener <rguent...@suse.de> > > > > PR middle-end/44563 > > * cgraph.h (struct cgraph_edge_hasher): Add hash overload > > for compare_type. > > * cgraph.c (cgraph_edge_hasher::hash): Inline htab_hash_pointer. > > (cgraph_update_edge_in_call_site_hash): Use cgraph_edge_hasher::hash. > > (cgraph_add_edge_to_call_site_hash): Likewise. > > (cgraph_node::get_edge): Likewise. > > (cgraph_edge::set_call_stmt): Likewise. > > (cgraph_edge::remove_caller): Likewise. > > Seems reosnable to me and patch is OK. Since hash-map is now GGC safe, won't > it be faster to use it instead? The hash is really mapping stmts to edges, so > hash-map seems most fitting datastructure in our grand new C++ world.
hash-map is just a wrapper around hash-table, so it would be a code cleanup at most. Not sure if it gets any nicer with using that. I have applied the patch with adjusted comments on the hash functions as requested by Steven. Richard.