This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Turn streamer cache to pointer_map
- From: Michael Matz <matz at suse dot de>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 2 May 2011 16:35:17 +0200 (CEST)
- Subject: Re: Turn streamer cache to pointer_map
- References: <20110502141629.GA5173@kam.mff.cuni.cz>
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 (tree, cache->nodes);
> else
> ix = *ix_p;
> !
> ! entry = (struct tree_int_map *)pool_alloc (cache->node_map_entries);
> ! entry->base.from = t;
> ! entry->to = ix;
> ! *slot = entry;
>
> lto_streamer_cache_add_to_node_array (cache, ix, t);
>
> --- 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);
> ! if (!*slot)
ix might legitimately be zero. Hence this transformation is not
equivalent. You might want to enter ix+1 into the cache with the
appropriate adjustment at read-out. Same for the other places.
Ciao,
Michael.