public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Chris Lattner <sabre@nondot.org>
To: Andrew MacLeod <amacleod@redhat.com>
Cc: Jeff Law <law@redhat.com>,
	Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>,
	gcc mailing list <gcc@gcc.gnu.org>
Subject: Re: [tree-ssa] Lazy updating of stmt operands
Date: Sun, 14 Dec 2003 03:39:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.44.0312132121220.23347-100000@nondot.org> (raw)
In-Reply-To: <1071323157.3257.138.camel@p4>

> Its not the SSA space thats the memory consumption problem. gcc is now
> unit at a time, so the entire program is read into memory as trees and
> held there. the tree-ssa branch also uses GIMPLE, which creates more
> trees. Then you add even a lightweight SSA and this simply magnifies any
> additional memory that is used. Once the machine starts swapping, its
> another order of magnitude on timing.

Why exactly do you need all of these representations?  In LLVM, we
routinely optimize _entire_ reasonably large C++ programs (like LLVM
itself), without even coming _near_ swap.  Can't you get rid of some of
the duplicate information you are holding?

> So we are trying to watch memory very carefully.  That plus we are still
> working within the existing tree data structures. I beleive our
> representation of SSA is quite lightweight. It only becomes less so when
> you try to add a bunch of stuff that isnt needed everywhere.

It seems to me that you are trying to save memory in the wrong places, but
my knowledge of tree-ssa is pretty limited, so I could certainly be wrong.
I think that you should be looking for the fundamental gains, especially
at this stage of the project.  If you try to make any big changes when you
have lots of transformations written, it will only be harder.  If you
build on a non-sustainable foundation, and never change it, ultimately the
project will become unwieldy.  Perhaps trees are not the right approach.

Saving memory by not having basic things like use-def or def-use chains is
not the right approach either in my mind.

> > If you're trying to work around the problem with caches and recomputation
> > of information, I suspect that you are barking up the wrong tree.  That
> > said, I don't know exactly what's going on in the tree-ssa world, so there
> > may be complicating factors.
>
> The Cache isnt something we're trying to work around. Thats there to
> prevent us from having to muck around in trees looking for things which
> are operands. The stmt is in the form of trees, our "cache" is the
> equivilent of your instruction. It consists of the operands plus looking
> at the tree code(s) of the stmt.

I'm not saying that you are trying to work around the cache: I'm saying
the cache is a workaround.  If "mucking around in the trees looking for
things" is that expensive, you have other problems which the cache is only
disguising.

> So we have 1 word for each operand. It points to the SSA_NAME in the
> stmt tree which represents that ssa version.

How big is each "SSA_NAME"?  What is the _total allocated size_?  Has
anyone looked into what the aggregate footprint is of a simple plus node
with two SSA operands?

> As far as Im concerned, we're not working around anything. Everything
> works just fine. IF someone wants/needs the def->use inforation, it can
> be built today. What we dont have is the ability to keep it up to date
> for some period of time, simply because we've never needed it. If the
> time comes that we do need it, it is not hard to add.

You have to remember that my opinion is not worth very much, and that my
knowledge of tree-ssa is quite limited.  That said, I am qualified to say
that def-use information can be put to good use by _almost every
transformation_, and that the information should be _automatically kept
up-to-date_ by the infrastructure.

Doing it any other way will cause tremendous problems down the road.

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/

  reply	other threads:[~2003-12-14  3:29 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-11 22:31 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
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 [this message]
2003-12-15 23:41           ` law
2003-12-16  6:02             ` Andrew MacLeod
  -- strict thread matches above, loose matches on Subject: below --
2003-12-15 20:47 Chris Lattner
2003-12-07 16:22 Zdenek Dvorak
2003-12-07 17:14 ` Diego Novillo
2003-12-07 17:28   ` Zdenek Dvorak
2003-12-07 17:36     ` Diego Novillo
2003-12-07 18:09       ` Zdenek Dvorak
2003-12-11 19:39         ` law
2003-12-07 22:20       ` Steven Bosscher
2003-12-09 14:30         ` Andrew MacLeod
2003-12-09 20:40           ` Zdenek Dvorak
2003-12-11 19:41           ` law
2003-12-11 19:38       ` law
2003-12-11 19:52         ` Zdenek Dvorak
2003-12-11 22:36         ` Zdenek Dvorak
2003-12-11 23:34           ` Andrew MacLeod
2003-12-15 19:10           ` Andrew MacLeod
2003-12-15 19:19             ` Zdenek Dvorak
2003-12-15 20:55               ` Andrew MacLeod
2003-12-15 21:06                 ` Zdenek Dvorak
2003-12-15 21:39                   ` Andrew MacLeod
2003-12-15 21:49                     ` Zdenek Dvorak
2003-12-15 22:04                       ` Andrew MacLeod
2003-12-15 22:39                         ` law
2003-12-17  4:56                       ` law
2003-12-16 23:32               ` Andrew MacLeod
2003-12-17  0:09                 ` Zdenek Dvorak
2003-12-17  0:21                   ` Andrew MacLeod
2003-12-17  3:28                 ` law
2003-12-15 19:28             ` Diego Novillo

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=Pine.LNX.4.44.0312132121220.23347-100000@nondot.org \
    --to=sabre@nondot.org \
    --cc=amacleod@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=rakdver@atrey.karlin.mff.cuni.cz \
    /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).