Re: Turn streamer cache to pointer_map

2011-05-02 Thread Richard Guenther
2011/5/2 Jan Hubicka : >> Hi, >> >> On Mon, 2 May 2011, Richard Guenther wrote: >> >> > >> --- 348,367 >> > >>                            bool insert_at_next_slot_p) >> > >>   { >> > >>     void **slot; >> > >>     unsigned ix; >> > >>     bool existed_p; >> > >> >> > >>     gcc_assert (t); >>

Re: Turn streamer cache to pointer_map

2011-05-02 Thread Jan Hubicka
> Hi, > > On Mon, 2 May 2011, Richard Guenther wrote: > > > >> --- 348,367 > > >>                            bool insert_at_next_slot_p) > > >>   { > > >>     void **slot; > > >>     unsigned ix; > > >>     bool existed_p; > > >> > > >>     gcc_assert (t); > > >> > > >> !   slot = pointer_ma

Re: Turn streamer cache to pointer_map

2011-05-02 Thread Richard Guenther
On Mon, May 2, 2011 at 5:15 PM, Michael Matz wrote: > Hi, > > On Mon, 2 May 2011, Richard Guenther wrote: > >> >> --- 348,367 >> >>                            bool insert_at_next_slot_p) >> >>   { >> >>     void **slot; >> >>     unsigned ix; >> >>     bool existed_p; >> >> >> >>     gcc_asse

Re: Turn streamer cache to pointer_map

2011-05-02 Thread Michael Matz
Hi, On Mon, 2 May 2011, Richard Guenther wrote: > >> --- 348,367 > >>                            bool insert_at_next_slot_p) > >>   { > >>     void **slot; > >>     unsigned ix; > >>     bool existed_p; > >> > >>     gcc_assert (t); > >> > >> !   slot = pointer_map_insert (cache->node_map, t

Re: Turn streamer cache to pointer_map

2011-05-02 Thread Richard Guenther
On Mon, May 2, 2011 at 4:35 PM, Michael Matz wrote: > Hi, > > On Mon, 2 May 2011, Jan Hubicka wrote: > >> !   d_entry.base.from = t; >> !   slot = htab_find_slot (cache->node_map, &d_entry, INSERT); >> !   if (*slot == NULL) >>       { >>         /* Determine the next slot to use in the cache.  */

Re: Turn streamer cache to pointer_map

2011-05-02 Thread Jan Hubicka
> > If you skip node_map you can end up with false entries for re-used > trees. So I don't think that's a good idea. The GTY marker is bogus there. I believed that the cache is GTY annotated and then the skip would be safe, since whether is in the map is also in the following array. But it is no

Re: Turn streamer cache to pointer_map

2011-05-02 Thread Michael Matz
Hi, On Mon, 2 May 2011, Richard Guenther wrote: > >>    /* The mapping between tree nodes and slots into the nodes array.  */ > >> !   struct pointer_map_t GTY((skip)) *node_map; > > > > If you skip node_map you can end up with false entries for re-used > > trees.  So I don't think that's a good

Re: Turn streamer cache to pointer_map

2011-05-02 Thread Nathan Froyd
On Mon, May 02, 2011 at 04:46:23PM +0200, Richard Guenther wrote: > >> *** typedef void (lto_free_section_data_f) ( > >> *** 346,355 > >>  struct lto_streamer_cache_d > >>  { > >>    /* The mapping between tree nodes and slots into the nodes array.  */ > >> !   htab_t node_map; > >

Re: Turn streamer cache to pointer_map

2011-05-02 Thread Richard Guenther
On Mon, May 2, 2011 at 4:38 PM, Richard Guenther wrote: > On Mon, May 2, 2011 at 4:16 PM, Jan Hubicka wrote: >> Hi, >> according to oprofile, libiberty hashing takes about 30% of streaming in time >> and according to callgrind, the most busy cache is node_map cache in the >> streamer. >> >> This

Re: Turn streamer cache to pointer_map

2011-05-02 Thread Richard Guenther
On Mon, May 2, 2011 at 4:16 PM, Jan Hubicka wrote: > Hi, > according to oprofile, libiberty hashing takes about 30% of streaming in time > and according to callgrind, the most busy cache is node_map cache in the > streamer. > > This patch turns it into pointer-map that also saves about 400MB of me

Re: Turn streamer cache to pointer_map

2011-05-02 Thread Michael Matz
Hi, On Mon, 2 May 2011, Jan Hubicka wrote: > ! d_entry.base.from = t; > ! slot = htab_find_slot (cache->node_map, &d_entry, INSERT); > ! if (*slot == NULL) > { > /* Determine the next slot to use in the cache. */ > if (insert_at_next_slot_p) > ix = VEC_length (t

Turn streamer cache to pointer_map

2011-05-02 Thread Jan Hubicka
Hi, according to oprofile, libiberty hashing takes about 30% of streaming in time and according to callgrind, the most busy cache is node_map cache in the streamer. This patch turns it into pointer-map that also saves about 400MB of memory and is bit prettier. I get about 8-10% speedup on Mozilla