This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Avoid nondeterminism in tree-ssanames
- From: Geoff Keating <geoffk at geoffk dot org>
- To: law at redhat dot com
- Cc: jh at suse dot cz, gcc-patches at gcc dot gnu dot org
- Date: Mon, 1 Dec 2003 11:00:59 -0800
- Subject: Re: [tree-ssa] Avoid nondeterminism in tree-ssanames
- References: <200312011728.hB1HSDO3029939@speedy.slc.redhat.com>
> 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>