This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Maintaining/representing def-use/use-def information
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Chris Lattner <sabre at nondot dot org>
- Cc: Andrew Macleod <amacleod at redhat dot com>, Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>, Jeff Law <law at redhat dot com>, gcc mailing list <gcc at gcc dot gnu dot org>
- Date: Mon, 15 Dec 2003 14:43:18 -0500
- Subject: Re: [tree-ssa] Maintaining/representing def-use/use-def information
- Organization: Red Hat Canada
- References: <Pine.LNX.4.44.0312151306220.25881-100000@nondot.org>
On Mon, 2003-12-15 at 14:12, Chris Lattner wrote:
> On 15 Dec 2003, Andrew MacLeod wrote:
>
> > Actually, SSA is very well integrated. The addition of SSA requires not
> > much more than PHI nodes and SSA_NAME tree nodes, which are
> > fundamentally the same as a variable, except they add a version number.
> > I wouldn't call SSA a second class citizen at all.
>
> That is my point. There is no reason to have an extra SSA_NAME memory
> allocation at all. If SSA is properly integrated into the representation
> (ie, not something tacked onto an existing representation designed for
> something else), then the expression implicitly defines the computed
> value.
>
This was done un purpose when I switched the SSA representation from FUD
chains to a rewriting form. In GCC, variables are represented by struct
tree_decl, which on a 64 bit host takes up 28 words.
Since each expression must compute a unique variable, I obviously didn't
want to create a new VAR_DECL for every new SSA version we created. So,
I introduced SSA_NAMEs (6 words) which are the variables that the SSA
passes operate on.
Could the tree_decls be smaller? Probably. Do the optimizers care?
Not in the least. To them it's just an object that says 'true' when you
call SSA_VAR_P(), they can be added to expression operands, etc.
The guiding principle we have is try not to get distracted with
syntactic sugar or changes that we know are mechanical or can be hidden
behind some API. That not always works, of course. And we've had a
fair number of changes that have overhauled large chunks of the
implementation.
Diego.