public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
To: Andrew Pinski <pinskia@physics.uc.edu>
Cc: Jan Hubicka <jh@suse.cz>, Jason Merrill <jason@redhat.com>,
	law@redhat.com, gcc@gcc.gnu.org, Jan Hubicka <hubicka@ucw.cz>
Subject: Re: tree-SSA and indirect references.
Date: Tue, 20 Jan 2004 18:15:00 -0000	[thread overview]
Message-ID: <20040120181503.GF7564@redhat.com> (raw)
In-Reply-To: <B86102FC-4B69-11D8-8143-000393A6D2F2@physics.uc.edu>

On Tue, Jan 20, 2004 at 08:57:24AM -0800, Andrew Pinski wrote:
> There is also PR 8781 which has the same exact problem and it is 
> shorter.

This is a different problem.  There are no casts involved.
After SRA and DCE, we have

  pred<D1926> = f;
  pred<D1933>.pred = &pred<D1926>;
  pred<D1940>.pred = &pred<D1933>;
  pred<D1947>.pred = &pred<D1940>;
  pred<D1954>.pred = &pred<D1947>;
  pred<D1961>.pred = &pred<D1954>;
  pred<D1968>.pred = &pred<D1961>;
  pred<D1975>.pred = &pred<D1968>;
  pred<D1982>.pred = &pred<D1975>;
  T.1<D2040>_54 = pred<D1933>.pred;
  T.2<D2041>_55 = *T.1<D2040>_54;
  T.3<D2042>_56 = T.2_55 ();

We don't get f propagated to T.2<D2041>_55 because (1) SRA doesn't
work on structures whose address is taken, and (2) we don't have
even *simplistic* propagation of field values for addressed structs.
Point the second is criminal.

The reason we don't delete 

  pred<D1940>.pred = &pred<D1933>;
  pred<D1947>.pred = &pred<D1940>;
  pred<D1954>.pred = &pred<D1947>;
  pred<D1961>.pred = &pred<D1954>;
  pred<D1968>.pred = &pred<D1961>;
  pred<D1975>.pred = &pred<D1968>;
  pred<D1982>.pred = &pred<D1975>;

is that we think that these objects have all have their address
taken, and thus might be referenced by the function call.  There
was one more iteration on the end that DCE removed, so in theory
repeated applications of DCE would clean this up.  However, I 
think the most dramatic improvement would be escape analysis.
None of the addresses in the chain is stored in globally accessible
memory, and thus the function call can't reference any of the
addresses, and thus they are all dead.


r~

      reply	other threads:[~2004-01-20 18:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-20  0:31 Jan Hubicka
2004-01-20  0:59 ` Richard Henderson
2004-01-20  9:50   ` Jan Hubicka
2004-01-20 10:21     ` Richard Henderson
2004-01-20 14:25       ` Jan Hubicka
2004-01-20 16:57         ` Andrew Pinski
2004-01-20 18:15           ` Richard Henderson [this message]

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=20040120181503.GF7564@redhat.com \
    --to=rth@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=jason@redhat.com \
    --cc=jh@suse.cz \
    --cc=law@redhat.com \
    --cc=pinskia@physics.uc.edu \
    /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).