This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] Maintaining/representing def-use/use-def information


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]