From: Richard Biener <richard.guenther@gmail.com>
To: "Bin.Cheng" <amker.cheng@gmail.com>
Cc: Bin Cheng <Bin.Cheng@arm.com>,"gcc-patches@gcc.gnu.org"
<gcc-patches@gcc.gnu.org>,nd <nd@arm.com>,"matz@suse.de"
<matz@suse.de>
Subject: Re: [PATCH GCC][V2]A simple implementation of loop interchange
Date: Thu, 30 Nov 2017 18:41:00 -0000 [thread overview]
Message-ID: <124F1441-8D71-42CB-BFEF-27D46CD2CD5C@gmail.com> (raw)
In-Reply-To: <CAHFci2-8cUh_i9i0e6qdBE8DwqK-fwzAqmsB4_64iak6uV+T_g@mail.gmail.com>
On November 30, 2017 7:20:18 PM GMT+01:00, "Bin.Cheng" <amker.cheng@gmail.com> wrote:
>On Thu, Nov 30, 2017 at 3:51 PM, Richard Biener
><richard.guenther@gmail.com> wrote:
>> On Thu, Nov 30, 2017 at 4:09 PM, Richard Biener
>> <richard.guenther@gmail.com> wrote:
>>> On Thu, Nov 30, 2017 at 3:13 PM, Bin.Cheng <amker.cheng@gmail.com>
>wrote:
>>>> On Thu, Nov 30, 2017 at 1:01 PM, Richard Biener
>>>> <richard.guenther@gmail.com> wrote:
>>>
>>> Ok, I'd like to "dumb" the pass down to the level we can solve the
>>> bwave case (which I realize is already one of the more complicated
>ones).
>>>
>>> Just because it's already late for GCC 8.
>>
>> For reference I'll commit the following tomorrow, will play with
>adding
>> a testcase for bwaves and doing the multiple_of_p thing we talked
>about.
>Given instantiated scev in parameterized case like:
>{{{p_19(D), +, 8}_1, +, (long unsigned int) n_16(D) * 8}_2, +, (long
>unsigned int) (n_16(D) * n_16(D)) * 8}_3
>it's ideal if we can relate the variable part in stride with loop
>niters. Unfortunately that's impractical because niter
>computation and address computation may expand variables differently.
> As in case of bwaves.
>This leaves us the method to check multiple relation for stride itself:
>(long unsigned int) (n_16(D) * n_16(D)) * 8 ;;stride X
> vs.
>(long unsigned int) n_16(D) * 8 ;;stride Y
> vs.
>8
>;;stride Z
From inner loop to outer, we check if Y is multiple of Z and if X is
>multiple of Y, so strides computed are like:
>8 * AVG_LOOP_NITERS * AVG_LOOP_NITERS
> vs.
>8 * AVG_LOOP_NITERS
> vs.
>8
>
>To make it general, we also need to check if X is multiple of previous
>stride (Z, in this case) if check on Y failed.
>
>The multiple check on tree expr is weak, so one question is how to do
>if failed. Giving up or using a placeholder const stride?
The question is whether we are interested in just whether strideA is bigger than strideB or in the actual difference. If the former then substituting a constant of course works. For multiplications that's even reasonable but for other ops the relation gets too weak IMHO. Maybe we can extract sth like factors we can more easily relate. I guess only experiments will tell. At least we should separate step extraction and this 'analysis' given if all steps are constant we can employ more precise cost models.
Richard.
>Thanks,
>bin
>>
>> Richard.
prev parent reply other threads:[~2017-11-30 18:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-28 15:55 Bin Cheng
2017-11-28 16:14 ` David Malcolm
2017-11-28 16:16 ` Bin.Cheng
2017-11-30 13:19 ` Richard Biener
2017-11-30 14:34 ` Richard Biener
2017-11-30 15:07 ` Bin.Cheng
2017-11-30 15:14 ` Richard Biener
2017-11-30 16:01 ` Richard Biener
2017-11-30 18:24 ` Bin.Cheng
2017-11-30 18:41 ` Richard Biener [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=124F1441-8D71-42CB-BFEF-27D46CD2CD5C@gmail.com \
--to=richard.guenther@gmail.com \
--cc=Bin.Cheng@arm.com \
--cc=amker.cheng@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=matz@suse.de \
--cc=nd@arm.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).