public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marc Glisse <marc.glisse@inria.fr>
To: "Bin.Cheng" <amker.cheng@gmail.com>
Cc: gcc-patches List <gcc-patches@gcc.gnu.org>,
	    Richard Biener <richard.guenther@gmail.com>
Subject: Re: [PATCH GCC][1/2]Feed bound computation to folder in loop split
Date: Mon, 24 Jul 2017 14:31:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1707241611570.2780@stedding.saclay.inria.fr> (raw)
In-Reply-To: <CAHFci297zVQREPSEfrdLaf0_Qzemtfp-FLrfwb4qzjd7gNr_Dg@mail.gmail.com>

On Mon, 24 Jul 2017, Bin.Cheng wrote:

> On Mon, Jul 24, 2017 at 2:59 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
>> On Mon, 24 Jul 2017, Bin.Cheng wrote:
>>
>>> But since definition of _197 isn't in current stmt sequence, call "o31
>>> = do_valueize (valueize, o31)" will return NULL.  As a result, it's
>>> not matched.
>>
>>
>> Wait, actually, how was your fold_build* version working? Why was the first
>> addition "in the current generic tree" and why isn't it "in current stmt
>> sequence"?
> Maybe I didn't express it clearly.  In compute_new_first_bound, we
> have stmt sequence "_124 = _197 + 1", and we try to simplify "_124 -
> 1" by calling gimple_build.  The definition of _197 is a PHI and isn't
> in current stmt sequence.  For fold_build* version, it builds
> expression "_197 + 1 - 1" and simplifies it.

It seems like it shouldn't be relevant whether the definition of _197 is 
in the stmt sequence or not, but indeed we seem to generate a lot of calls 
to do_valueize... I had misunderstood the issue, sorry.

Strangely, for a pattern like
(simplify (plus @0 @1) @0)
we generate no call to valueize, while for the following
(simplify (plus @0 (minus @1 @2)) @0)
we generate 3 calls to do_valueize.

I think we need Richard to say what the intent is for the valueization 
function. It is used both to stop looking at defining stmt if the return 
is NULL, and to replace/optimize one SSA_NAME with another, but currently 
it seems hard to prevent looking at the defining statement without 
preventing from looking at the SSA_NAME at all.

I guess we'll need a fix in genmatch...

-- 
Marc Glisse

  reply	other threads:[~2017-07-24 14:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 13:07 Bin Cheng
2017-06-16 10:49 ` Richard Biener
2017-06-16 13:06   ` Bin.Cheng
2017-06-16 13:10     ` Richard Biener
2017-06-16 13:31       ` Bin.Cheng
2017-06-16 16:16         ` Richard Biener
2017-06-16 16:23           ` Bin.Cheng
2017-06-16 16:48             ` Marc Glisse
2017-06-16 16:58               ` Bin.Cheng
2017-06-16 17:04               ` Andrew Pinski
2017-07-24 11:45               ` Bin.Cheng
2017-07-24 12:16                 ` Marc Glisse
2017-07-24 13:49                   ` Bin.Cheng
2017-07-24 13:59                 ` Marc Glisse
2017-07-24 14:06                   ` Bin.Cheng
2017-07-24 14:31                     ` Marc Glisse [this message]
2017-07-24 14:37                       ` Bin.Cheng
2017-07-24 14:52                         ` Marc Glisse
2017-07-25 14:32                       ` Richard Biener
2017-07-25 17:45                         ` Marc Glisse
2017-07-26  7:48                           ` Richard Biener
2017-07-26  9:08                             ` Richard Sandiford
2017-07-26  9:38                               ` Marc Glisse
2017-07-26  9:45                                 ` Richard Sandiford
2017-07-26  9:57                                   ` Marc Glisse
2017-07-26 11:13                                     ` Richard Biener
2017-07-26 11:46                             ` Richard Biener

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.DEB.2.20.1707241611570.2780@stedding.saclay.inria.fr \
    --to=marc.glisse@inria.fr \
    --cc=amker.cheng@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.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).