public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew MacLeod <amacleod@redhat.com>
To: Chris Lattner <sabre@nondot.org>
Cc: Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>,
	Jeff Law <law@redhat.com>, gcc mailing list <gcc@gcc.gnu.org>
Subject: Re: [tree-ssa] Maintaining/representing def-use/use-def information
Date: Mon, 15 Dec 2003 19:43:00 -0000	[thread overview]
Message-ID: <1071516477.3353.1693.camel@p4> (raw)
In-Reply-To: <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:
> > > It seems to me that the problem is that SSA is a second class citizen in
> > > your representation, something that is hacked onto the side.  Maybe if it
> > > were better integrated, some of the problems would go away.  There is no
> > > reason for the SSA_NAME's to be distinct memory objects from the
> > > expressions.
> >
> > 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.
> 

An SSA_NAME is a decl, just like a variable declaration.
so in non ssa LAND, we have 
 a = 10

thats a tree:
  MODIFY_EXPR
  /      \
VAR_DECL  CONST
   A        10

in ssa land we have

a_2 = 10

    MODIFY_EXPR
    /         \
  SSA_NAME    CONST
  /       \      10
VAR_DECL   2
   A

so the expression does implicitly define the computed value. Its really
no different than  variable except we can associate the version number
with a var_decl.

Its not much different than duplicating the var_decl for A and adding an
integer field for the version number.  We chose this way because there
is a ton of variable specific information like type, etc etc that we
dont need to duplicate, and it doesnt impact any non-ssa parts of the
compiler. It also makes it trivial to look at a cariable and tell if its
in SSA form or not.


> > As far as def->use chain go, the architecture is modular enough that it
> > is quite trivial to add them, and maintain them if need be. I haven't
> > seen a need to keep them around all the time yet, and since we haven't
> > gotten to the tree memory issue yet, I dont see why would try to keep
> > them around and up to date all the time when there are very few
> > consumers of it so far.
> 
> Ok, I guess its a reasonable approach just to make them available and then
> see how often it gets used, as long as the current implementation is
> efficient enough that people will not avoid using it when it makes
> sense...
> 

Well, when it does become a problem, thats when we tackle the efficiency
of the implementation :-)

> > > Adding capabilities like this at a late date will mean that a lot of code
> > > will need to be rewritten.
> 
> > I think virtually nothing will have to be rewritten to add this
> > capability. I have to make a minor change to the way immediate uses is
> > currently calculated/stored, but its pretty minor. And we'll have the
> > capability to calculate/maintain def->use links without a lot of
> > trouble.
> 
> Ok, that makes sense.  :)

We just cant do everything up front. We implement additional
features/requirements things as we need them, and attempt to keep the
architecture well enough designed to let us add these things, hopefully,
without much trouble. Its just not worth spending time on something that
someone might need in the future.

Thats all :-)

Andrew


  reply	other threads:[~2003-12-15 19:28 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-11 22:31 [tree-ssa] Lazy updating of stmt operands Chris Lattner
2003-12-12  3:14 ` law
2003-12-12  3:58   ` Chris Lattner
2003-12-12 19:25     ` Andrew MacLeod
2003-12-12 19:42       ` Zdenek Dvorak
2003-12-12 19:45         ` Andrew MacLeod
2003-12-12 19:54           ` Chris Lattner
2003-12-12 19:55             ` Andrew MacLeod
2003-12-12 20:39               ` [tree-ssa] Maintaining/representing def-use/use-def information Chris Lattner
2003-12-13 13:46                 ` Andrew MacLeod
2003-12-14  3:59                   ` Chris Lattner
2003-12-15 17:17                     ` Andrew MacLeod
2003-12-15 19:18                       ` Chris Lattner
2003-12-15 19:43                         ` Andrew MacLeod [this message]
2003-12-15 20:26                           ` Chris Lattner
2003-12-15 20:29                             ` Diego Novillo
2003-12-15 20:52                             ` Andrew MacLeod
2003-12-15 21:01                               ` Zdenek Dvorak
2003-12-15 21:09                                 ` Andrew MacLeod
2003-12-15 21:11                                   ` Zdenek Dvorak
2003-12-15 21:20                                     ` Diego Novillo
2003-12-15 21:23                                       ` Zdenek Dvorak
2003-12-15 21:31                                     ` Andrew MacLeod
2003-12-17  8:47                                 ` law
2003-12-15 21:03                               ` Diego Novillo
2003-12-15 21:11                                 ` Andrew MacLeod
2003-12-15 21:11                               ` Chris Lattner
2003-12-15 21:16                                 ` Zdenek Dvorak
2003-12-15 21:19                                   ` Chris Lattner
2003-12-15 21:38                                     ` Daniel Berlin
2003-12-15 22:08                                       ` Chris Lattner
2003-12-15 23:09                                         ` Daniel Berlin
2003-12-15 23:31                                           ` Chris Lattner
2003-12-15 23:46                                             ` Daniel Berlin
2003-12-15 21:32                                   ` Daniel Berlin
2003-12-15 21:31                                 ` Andrew MacLeod
2003-12-17  7:51                                 ` law
2003-12-15 20:04                         ` Diego Novillo
2003-12-15 23:26                 ` law
2003-12-15 23:32                   ` Chris Lattner
2003-12-12 21:26               ` [tree-ssa] Lazy updating of stmt operands Diego Novillo
2003-12-12 19:57       ` Chris Lattner
2003-12-13 16:02         ` Andrew MacLeod
2003-12-14  3:39           ` Chris Lattner
2003-12-15 23:41           ` law
2003-12-16  6:02             ` Andrew MacLeod

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1071516477.3353.1693.camel@p4 \
    --to=amacleod@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=rakdver@atrey.karlin.mff.cuni.cz \
    --cc=sabre@nondot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).