public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Daniel Berlin <dan@cgsoftware.com>
To: Diego Novillo <dnovillo@redhat.com>
Cc: law@redhat.com, gcc@gcc.gnu.org
Subject: Re: Higher level RTL issues
Date: Tue, 09 Oct 2001 22:23:00 -0000	[thread overview]
Message-ID: <EED10DA7-BD3E-11D5-867A-0030657B5340@cgsoftware.com> (raw)
In-Reply-To: <20011010004858.B2756@tornado.cygnus.com>

On Wednesday, October 10, 2001, at 12:48  AM, Diego Novillo wrote:

> On Wed, 10 Oct 2001, Daniel Berlin wrote:
>
>>
>> On Tuesday, October 9, 2001, at 11:53  PM, Diego Novillo wrote:
>>
>>> On Tue, 09 Oct 2001, Jeff Law wrote:
>>>
>>>> That model works fine for a class of optimization problems, but 
>>>> breaks
>>>> down
>>>> with any optimization which potentially has two SSA names for the 
>>>> same
>>>> variable live at the same point in the program.  GVN and dominator
>>>> based
>>>> value numbering can create situations where we have two SSA names 
>>>> live
>>>> at
>>>> the same time.
>>>>
>>> Sorry, you missed me here.  Would you have an example?  I agree
>>> that we might find the FUD chains representation restricted for
>>> some optimizations, but I'm not sure I follow this particular
>>> case.  We can at least support most/all interesting loop
>>> transformations with FUD chains.
>>
>> There can exist no optimization that can be performed in a renamed SSA
>> form (with both *uses* and *defs* renamed to be unique) that can't be
>> performed on a factored representation where names point to the 
>> reaching
>                                                ^^^^^
> 					       references
>> def/use.
>> They are provably equivalent.
>>
> I think Jeff was referring to ease of use, rather than actual
> limitation.
I'm not so sure, given what he said about value numbering, so i thought 
i'd just point it out. It certainly would not require a rewrite of the 
tree-ssa stuff.
And nascent has examples of most of the algorithms he wants to 
implement, implemented on factored representations, and they are 
comparable in implementation ease to the traditional versions.

> The FUD chains camp usually goes on and on about the
> advantages of not blowing up your symbol table to hell and back,
> and also they dislike the idea of the compiler actually
> re-writing the code to do analysis.
Yup.
>  The renaming camp, argues
> that you have to jump through hoops to maintain the two views of
> the program. Both POVs seem valid to me.
>
Same here.
> I never really decided which one I like best.  I do find the FUD
> chains less intrusive, but I'm not sure they are so easy to deal
> with once you start doing incremental updates of your SSA form.
It's just as easy to relink a bunch of pointers, as  it is to rename a 
bunch of variables.
At least, it should be.
It's a data structures problem more than anything else.
> I never dealt with incremental updates, I just re-ran SSA all
> over again.  Then again, I never had to worry about compile-time
> performance :)
>
:)
In reality, the real problem with the two camps is that the "best" 
representation depends on external factors.
For ease of algorithms, speed, and memory usage, fud is probably better 
for backwards problems, traditional for forwards problems.
However, using both is not really an option, because who the heck wants 
two ssa representations to maintain?  Even if you were wacky, and 
decided you were going to fake one from the other, in your nice C++ 
compiler than only walked the IR using iterators, you'd still have a 
mess (probably even more so).

It's around this point in trying to weigh each that i usually give up on 
SSA and move on to looking at sparse evaluation graphs.

Trying to argue which of factored vs explicit SSA forms is best is 
comparable to arguing whether sparse bitmaps are better than dense ones, 
or adjacency lists are better for graphs than an adjacency matrix.
It's rather silly trying to make generalizations about it.
However, for the explicit purpose of SSA on trees, since you deal mostly 
with recursive algorithms already, a factored representation makes more 
sense, since the algorithms used on them tend to be recursive as well.
For an RTL form, where you tend to walk insns iteratively, an explicit 
representation makes more sense, but if we implement optimizations 
needing renamed uses, it might use too much memory.
If for_each_rtx becomes the preferred walking method, than a factored 
representation would be right there too.
Unless the plan was to only do SSA at the new IL level (IE not do 
tree-ssa, not do rtl-ssa), in which case it becomes a case of looking 
into a crystal ball and using tea leaves.

>> You can just as easily do factored DU chains, and have an SSA
>> form with explicit use-def chains through renaming. The main
>> advantage to factored chains is that it doesn't require
>> renaming. This matters a heck of a lot more for uses than defs,
>> since there are a lot more uses than defs.
>>
> We already have def-use chains and pretty soon we will also have
> def-def chains for non-killing definitions like array assignments
> and pointer dereferences.
>
Cool.

>
> Diego.

  reply	other threads:[~2001-10-09 22:23 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-09 19:46 law
2001-10-09 20:54 ` Diego Novillo
2001-10-09 21:27   ` Daniel Berlin
2001-10-09 21:49     ` Diego Novillo
2001-10-09 22:23       ` Daniel Berlin [this message]
2001-10-19 14:39     ` law
2001-10-19 12:19   ` law
2001-10-09 21:18 ` Daniel Berlin
2001-10-09 21:33   ` Diego Novillo
2001-10-19 14:37   ` law
2001-10-19 15:53     ` Daniel Berlin
2001-10-22  9:31       ` law
2001-10-22 11:49         ` Daniel Berlin
2001-10-13  2:27 ` Jan Hubicka
2001-10-19 12:03   ` law
2001-10-21 10:40     ` Jan Hubicka
2001-10-22  8:28       ` law
2001-10-22  8:36         ` Daniel Berlin
2001-10-22  8:56           ` law
2001-10-22  9:07           ` Jan Hubicka
2001-10-22 11:32             ` law
2001-10-22 15:07               ` Richard Henderson
2001-10-23 15:16               ` Joern Rennecke
2001-10-22 16:22     ` Joern Rennecke
2001-10-23  3:02       ` Jan Hubicka
2001-10-23 15:28         ` law
2001-10-24  7:59           ` Jan Hubicka
2001-10-22 11:30 law
2001-10-22 13:10 ` Daniel Berlin
2001-10-22 14:02   ` law
2001-10-22 14:25     ` Daniel Berlin
2001-10-22 14:28       ` Daniel Berlin
2001-10-22 14:48         ` law
2001-11-13 13:41 ` 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=EED10DA7-BD3E-11D5-867A-0030657B5340@cgsoftware.com \
    --to=dan@cgsoftware.com \
    --cc=dnovillo@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=law@redhat.com \
    /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).