From: Daniel Berlin <dan@cgsoftware.com>
To: law@redhat.com
Cc: gcc@gcc.gnu.org
Subject: Re: Higher level RTL issues
Date: Tue, 09 Oct 2001 21:18:00 -0000 [thread overview]
Message-ID: <CCB1DD56-BD35-11D5-867A-0030657B5340@cgsoftware.com> (raw)
In-Reply-To: <15984.1002682121@localhost.localdomain>
On Tuesday, October 9, 2001, at 10:48 PM, law@redhat.com wrote:
>
> I know folks have heard me mention the idea of a higher level RTL from
> time to time. I must apologize for not posting this earlier -- oh well,
> life goes on. I must also apologize as this isn't 100% complete, but
> given that I haven't posted anything about it already and the fact that
> I'm going on vacation tomorrow, I figured I'd at least get this info out
> and let folks chew on it while I'm gone.
>
> I don't think there's any significant disagreement that a higher level
> IL would be useful.
> What is a subject of debate is whether we have
> a lower tree form, higher RTL form or some other form. I think if we
> look at the set of problems we want to solve we can get a good feel for
> which of the 3 choices makes the most sense.
>
>
> I'm looking at the new IL as a way to enable an SSA optimization path.
Okey dokey.
> On
> that optimization path I'm initially looking at the following
> optimizations:
>
> * Sparse conditional constant propagation (ssa-ccp.c)
>
> * Traditional dead code elimination (ssa-dce.c)
>
> * Aggressive dead code elimination (ssa-dce.c)
>
> * Register coalescing and renaming (ssa.c)
>
> * Dominator based value numbering (will eventually be in ssa.c)
>
> Certainly there will be more optimizations in the future, but I think
> this
> set gives us a good idea of the kinds of optimization problems I want to
> solve.
I don't think that these are representative of the type of problems we
*should* be looking to solve.
These are pretty basic ssa optimizations, not something to look at when
determining the type of IL you need.
If we only use these as the things to base requirements on, you'll never
get much improvement in performance.
At least, as they exist now.
Why?
Because the main optimizations needed right now relate to memory and
loops.
You can perform very interesting loop and memory optimizations in SSA
form.
However, having simply a higher level RTL would not help them
significantly (>5%, i'd guesstimate), unless you tackle the issues of
array indices and memory.
So to not take this into account at all when designing an IR better for
SSA (whether it be a higher level RTL or whatever), would be a shame.
>
> Let's first consider Tree SSA work Diego's doing vs our existing SSA
> translator. The SSA naming discipline in Diego's work is merely a
> conceptual model -- we do not actually rewrite the tree structures to
> conform to SSA naming rules. The nice thing about this model is you
> don't actually have to convert the IL into and out of SSA form.
>
> 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.
>
>
Sorry, this isn't correrct.
Factored use-def chains are more powerful than traditional SSA form,
it's an extended variant of SSA, because it can handle backwards
problems as well.
To get the equivalent, you'd need to take traditional SSA form,and give
unique names to uses as well.
Anything you can do in traditional SSA, you can do with fud chains. You
can link defs->uses just as well as you can link the uses->defs.
It's absolutely trivial.
The point of FUD is to allow not doing phyiscal renaming (saving
memory), and to give use-def chains as well, without the cost of the
renaming, so you can solve backwards dataflow problems, as demand driven
optimizations often require.
I.E. It allows you to do things like demand-driven constant propagation.
http://www.acm.org/pubs/articles/proceedings/sac/326619/p400-stoltz/p400-stoltz .
pdf
In short, use def-use chains rather than use-def chains (we aren't
currently creating them in tree-ssa, but this can be rectified very
easily, i've already done it for SSA loop optimizations), and your
problem is solved.
> GVN and dominator based
> value numbering can create situations where we have two SSA names live
> at
> the same time.
> It's probably true that other interesting optimizations
> could create similar situations. I believe this argues that either the
> tree SSA needs to do rewriting or that tree SSA is not suitable for the
> class of optimizations I'm trying to implement.
>
I believe you are incorrect on both counts.
It's trivial to extend the tree SSA to do what you want, and it
*shouldn't* do rewriting
>
> jeff
next prev parent reply other threads:[~2001-10-09 21:18 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
2001-10-19 14:39 ` law
2001-10-19 12:19 ` law
2001-10-09 21:18 ` Daniel Berlin [this message]
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=CCB1DD56-BD35-11D5-867A-0030657B5340@cgsoftware.com \
--to=dan@cgsoftware.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).