public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <richard.guenther@gmail.com>
To: Ira Rosen <ira.rosen@linaro.org>
Cc: gcc-patches@gcc.gnu.org, Patch Tracking <patches@linaro.org>
Subject: Re: [RFC][patch] If-conversion of COMPONENT_REFs
Date: Wed, 30 Mar 2011 11:21:00 -0000	[thread overview]
Message-ID: <AANLkTimfAb+L5VA=KWaF=ZWAX8s8HKbXF3tx-KWjvWkU@mail.gmail.com> (raw)
In-Reply-To: <AANLkTin7SZSErUguxdcu-upF+GRq+sUz0ooeqt7g53JX@mail.gmail.com>

On Wed, Mar 30, 2011 at 11:13 AM, Ira Rosen <ira.rosen@linaro.org> wrote:
> Hi,
>
> With this patch a data-ref is marked as unconditionally read or
> written also if its adjacent field is read or written unconditionally
> in the loop.
> My concern is that this is not safe enough, even though the fields
> have to be non-pointers and non-aggregates, and this optimization is
> applied only with -ftree-loop-if-convert-stores flag.
>
> Bootstrapped on powerpc64-suse-linux and tested on x86_64-suse-linux.
>
> OK for trunk?

The restrictions do not make too much sense to me.  For the C++
memory model we can't do speculative stores at all, but for the
rest I'd say just checking if the data-refs access the same object
is enough, thus, instead of same_data_refs (a, b) simply check
operand_equal_p (DR_BASE_ADDRESS (a), DR_BASE_ADDRESS (b), 0)
or operand_equal_p (get_base_address (DR_REF (a)), get_base_address
(DR_REF (b)), 0), whatever makes more sense (I always confuse what
the contents of the various DR fields are).

Thanks,
Richard.

> Thanks,
> Ira
>
>
> ChangeLog:
>
>         * tree-if-conv.c (memrefs_read_or_written_unconditionally): Return true
>         if an adjacent field of the data-ref is accessed unconditionally.
>
> testsuite/ChangeLog:
>
>         * gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c: New test.
>         * gcc.dg/vect/vect.exp: Run if-cvt-stores-vect* tests with
>         -ftree-loop-if-convert-stores.
>

  reply	other threads:[~2011-03-30 11:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30  9:41 Ira Rosen
2011-03-30 11:21 ` Richard Guenther [this message]
2011-03-30 12:41   ` Ira Rosen
2011-03-30 13:03     ` Richard Guenther
2011-03-30 13:55       ` Ira Rosen
2011-04-01  6:43         ` Ira Rosen
2011-04-02  7:36           ` Richard Guenther

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='AANLkTimfAb+L5VA=KWaF=ZWAX8s8HKbXF3tx-KWjvWkU@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ira.rosen@linaro.org \
    --cc=patches@linaro.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).