[tree-ssa] Avoid nondeterminism in tree-ssanames
Geoff Keating
geoffk@geoffk.org
Mon Dec 1 19:01:00 GMT 2003
> From: law@redhat.com
> Date: Mon, 01 Dec 2003 10:28:13 -0700
> 1. Re-using SSA_NAMES across different functions is a bad idea. Please let's
> not do that. The whole point of the SSA_NAME cache is to avoid silly
> GC allocations within the SSA path for a single function.
So, maybe the best thing to do is to reintroduce a freelist, but do it
right?
A 'deletable' freelist is supposed to look like:
if (freelist_head)
{
<type> tmp;
tmp = freelist_head;
freelist_head = tmp->next;
memset (tmp, 0, sizeof (*tmp));
return tmp;
}
else
return ggc_alloc_cleared (sizeof (<type>));
That is, the new object should be treated as uninitialised data.
> 2. Long term SSA_NAME management needs to go away.
>
> 2a. First we need to be able to GC between the SSA passes.
>
> 2b. We need to be able to tell the GC system that a particular object
> is no longer being used and that the GC system should re-use that
> memory if it is convenient to do so.
A well-implemented freelist would help with both these goals. It will
also be more efficient than a general-purpose allocator, and safer
than free() or equivalent.
--
- Geoffrey Keating <geoffk@geoffk.org>
More information about the Gcc-patches
mailing list