public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <rguenther@suse.de>
To: Mark Mitchell <mark@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org
Subject: Re: [PATCH][RFC] Adjust the middle-end memory model
Date: Wed, 20 May 2009 14:13:00 -0000	[thread overview]
Message-ID: <alpine.LNX.2.00.0905201022290.25789@zhemvz.fhfr.qr> (raw)
In-Reply-To: <4A12F125.6030309@codesourcery.com>

On Tue, 19 May 2009, Mark Mitchell wrote:

> Richard Guenther wrote:
> 
> >>  - The tree alias oracle got similar functionality, refs_anti_dependent
> >>    and refs_output_dependent and the tree level data dependence
> >>    analysis code makes use of these.
> 
> Do we still use TBAA for the original motivating reason for adding it,
> e.g.,:
> 
>   void f(float *f, int *n) {
>     for (int i = 0; i < *n; ++i) {
>       f[i] *= 2;
>     }
>   }
> 
> where here you want to know that "f[i]" does not modify "*n"?
> 
> (Yes, that code is kinda hokey, in that real-world code would probably
> not pass n by-reference, but of course this happens with structures and
> such...)

Yes, for the purpose of hoisting the load of *n out of the loop (if
a store to f[i] would clobber *n then you wouldn't be allowed to read
it back as int).  What matters for hoisting loads is whether there
is a true dependence between *n and f[i] which there is not, as we
still disambiguate using TBAA for true dependence queries.

The difference is if you want to sink a load from *n beyond the
store to f[i] - in which case you ask if there is an anti-dependence
which we cannot exclude in this case (no TBAA is allowed here).

The latter is to make placement new and friends work.

Richard.

  reply	other threads:[~2009-05-20  8:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.LNX.2.00.0905081221560.25789@zhemvz.fhfr.qr>
2009-05-19 15:25 ` Richard Guenther
2009-05-19 19:10   ` Mark Mitchell
2009-05-20 14:13     ` Richard Guenther [this message]
2009-05-20 18:15       ` Mark Mitchell
2009-05-20 21:34         ` Richard Guenther
2009-05-21  5:11           ` Mark Mitchell
2009-05-22 15:17             ` Richard Guenther
2009-05-23  7:05               ` Mark Mitchell

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=alpine.LNX.2.00.0905201022290.25789@zhemvz.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=mark@codesourcery.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).