public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Daniel Berlin <dberlin@dberlin.org>
To: Diego Novillo <dnovillo@redhat.com>
Cc: Jan Vroonhof <jan.vroonhof@ntlworld.com>,
	"gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: [tree-ssa] Out of SSA status and issues
Date: Wed, 14 May 2003 19:11:00 -0000	[thread overview]
Message-ID: <E625FF8C-863F-11D7-B8AC-000A95A34564@dberlin.org> (raw)
In-Reply-To: <1052937198.8234.47.camel@frodo.toronto.redhat.com>


On Wednesday, May 14, 2003, at 02:33  PM, Diego Novillo wrote:

> On Tue, 2003-05-13 at 13:29, Jan Vroonhof wrote:
>
>> However, Not treating this as a PRE problem might have the tendency to
>> move the load towards entry and the store towards exit too much,
>> increasing register pressure and putting loads and stores in codepaths
>> that previously didn't have them. This seems to suggest leaving it to 
>> PRE.
>>
> Exactly.  This is what we are converging to.  In my initial design, I
> had thought that by treating INDIRECT_REF nodes like regular variables
> would simplify the implementation and give us the extra benefit of 
> being
> able to do the same transformations we do to any other variable.  Boy,
> was I wrong!
>
> INDIRECT_REF nodes are like any other unary expression (OK, they have
> slightly different semantics as they can be on the LHS of an
> assignment)

This is why there is an ELEFT tree expression (in fact, specifically 
for this reason).

> , so the expression-SSA built by SSAPRE is perfect for them.
> All we need is to do is build the SSA form for expressions and let that
> framework handle them.
>
> Daniel, how clean is the separation between the expression-SSA and the
> PRE specific bits in SSAPRE?  It'd be nice if we have a clean 
> separation
> between the infrastructure proper and the various passes we want to do
> that operate on expressions.

Besides the fact that there are SSAPRE specific fields in the various 
E* structures, into-ESSA and PRE are cleanly separated.
You could stop after the call to rename_1, and you'd have ESSA 
structures available in expr_info.
We don't tack the EUSE/EDEF onto statements, for lack of any point in 
doing so for SSAPRE (we always walk them in pre-order, DT order, and 
keep pointers to all of them in an array).
The statement associated with a node is available from an E* node.
We do, however, tack ephi nodes onto BB's.

Remember also that we build ESSA for one lexical expression at a time, 
optimize the expression's occurrences, then move out of ESSA and move 
to the next lexical expression.  So if you are expecting to build ESSA 
for all expressions at once, it would
1. Be heavy on memory, most likely (in particular, the number of phi 
nodes would be high, since you have a phi node everywhere any variable  
in the expression has a phi, in addition to the IDF of the statement).
2. Probably require changes to the helper routines, but not much.

An ESSA optimization pass should probably be working one lexical 
expression at a time anyway.

The ESSA structures are factored (IE linked), but the version number is 
stored in the structures explicitly if one wants it (we use it for 
available expression determination).

Out-of-ESSA isn't really the same as out-of-SSA, because these are 
expressions, not variables, and thus they never occur on the LHS except 
for load PRE.  Out-of-ESSA is quite simple as a result.  It expects 
something else to set the save and reload flags on the EUSE's, and it 
just saves to and reloads from, temporaries, where told to.  It also 
creates phis for the ephis.


I'm not sure you can come up with an ESSA pass that is useful besides 
PRE, that runs after PRE.  Value numbering can easily be done on ESSA 
if you want (Open64 has a value numbering pass formulated using the 
SSAPRE pieces to do the work of renaming and saving). Past that, it's 
hard to come up with a useful pass.
Since load PRE is promoting pointer accesses into temporaries where 
possible/profitable, the regular SSA optimizers can take care of 
working on pointers by working on the temporaries.  Value numbering 
would take care of the constant loads/stores.
Other than that, let's see:
1.  All partially redundant expressions are eliminated
2.  Constant propagation on non-pointer expressions is the same as 
constant propagation on the variables *in* the expression.
3.  Whatever copy-prop you can do can be integrated into the 
code_motion pass (it's on my todo list).

--Dan
>
> Diego.
>

  reply	other threads:[~2003-05-14 19:11 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-12 14:42 Andrew MacLeod
2003-05-12 15:38 ` Diego Novillo
2003-05-12 15:57   ` Andrew MacLeod
2003-05-12 16:05     ` Michael Matz
2003-05-12 16:10       ` Andrew MacLeod
2003-05-12 16:16       ` law
2003-05-12 17:08     ` law
2003-05-12 17:12       ` Andrew MacLeod
2003-05-12 17:26         ` law
2003-05-12 18:57 ` Andrew MacLeod
2003-05-13  9:07   ` Michael Matz
2003-05-13 12:42     ` Diego Novillo
2003-05-13 12:50       ` Andrew MacLeod
2003-05-13 13:05         ` Diego Novillo
2003-05-13 13:29           ` Andrew MacLeod
2003-05-13 13:57             ` Diego Novillo
2003-05-13 12:57       ` Michael Matz
2003-05-13 13:11         ` Diego Novillo
2003-05-13 13:18           ` Andrew MacLeod
2003-05-14 17:19             ` Jan Vroonhof
2003-05-14 18:05               ` Andrew MacLeod
2003-05-14 18:33               ` Diego Novillo
2003-05-14 19:11                 ` Daniel Berlin [this message]
2003-05-13 15:01         ` Daniel Berlin
2003-05-13 12:33   ` Diego Novillo
2003-05-13 12:49     ` Andrew MacLeod
2003-05-13 12:58       ` Diego Novillo
2003-05-13 13:17 Richard Kenner
2003-05-13 13:27 ` Diego Novillo
2003-05-13 13:40 ` Michael Matz
2003-05-13 15:08 ` Michael S. Zick
2003-05-13 13:42 Richard Kenner
2003-05-13 15:23 Richard Kenner
2003-05-13 18:50 ` Geoff Keating
2003-05-13 23:28   ` Michael S. Zick
2003-05-17 17:19 ` Michael S. Zick

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=E625FF8C-863F-11D7-B8AC-000A95A34564@dberlin.org \
    --to=dberlin@dberlin.org \
    --cc=dnovillo@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jan.vroonhof@ntlworld.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).