From: Andrew MacLeod <amacleod@redhat.com>
To: Diego Novillo <dnovillo@redhat.com>
Cc: gcc mailing list <gcc@gcc.gnu.org>
Subject: Re: [tree-ssa] RFC: Dropping INDIRECT_REF variables
Date: Wed, 14 May 2003 16:16:00 -0000 [thread overview]
Message-ID: <1052929000.3373.360.camel@p4> (raw)
In-Reply-To: <20030514150917.GA12344@tornado.toronto.redhat.com>
On Wed, 2003-05-14 at 11:09, Diego Novillo wrote:
> - The SSA->normal pass may also need to handle INDIRECT_REF
> variables with care. Since an INDIRECT_REF variable has two
> SSA versions in it, overlapping live ranges of the base pointer
> or the INDIRECT_REF node may need extra supporting code (this
> is just a vague concern, Andrew?).
>
The SSA->Normal pass is in the process of ignoring INDIRECT_REF
variables anyway, but it does have to handle them when they occur as
real operands..
ie
T.14 = (*p_5)_8
needs to be recognized by the SSA->normal translator, and converted to
T.14 = *p_5
So it requires a bunch of special casing during building, analyzing/ and
translation out. Having them go away or at least never be a part of a
real operands is the way to go.
> - We disable the ability to treat non-aliased pointer
> dereferences as if they were variables. We would lose the
> ability to do some optimizations like:
>
> foo () foo ()
> { {
> char[7] * T.1; char[7] * T.1;
> char T.2; char T.2;
> char * s; char * s;
>
> T.1 = "string"; | return (int)100;
> s = (char *)T.1; <
> *s = 100; <
> T.2 = *s; <
> return (int)T.2; <
> } }
>
> I can live with this loss. I cannot say for sure if this is
> going to be a real problem because I still haven't implemented
> the change. If it turns out to be a huge loss, then we should
> either reconsider or think of alternatives.
>
All you were doing were taking unaliased dereferences, and replacing
them with a variable. It was basically a simple expression replacement
based on a single simple case... a dereference of a memory location that
wasn't alasied with anything.
I find it hard to beleive that this isn't going to be caught by some
other optimization that handles expressions and looks at loads and
stores.
Andrew
next prev parent reply other threads:[~2003-05-14 16:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-14 15:09 Diego Novillo
2003-05-14 15:31 ` Timothy J. Wood
2003-05-14 16:06 ` Diego Novillo
2003-05-14 16:55 ` Dale Johannesen
2003-05-14 16:58 ` David Edelsohn
2003-05-19 20:24 ` tm_gccmail
2003-05-14 16:01 ` Daniel Berlin
2003-05-14 16:11 ` Diego Novillo
2003-05-14 16:16 ` Andrew MacLeod [this message]
2003-05-14 16:24 ` Daniel Berlin
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=1052929000.3373.360.camel@p4 \
--to=amacleod@redhat.com \
--cc=dnovillo@redhat.com \
--cc=gcc@gcc.gnu.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).