public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Bin.Cheng" <amker.cheng@gmail.com>
To: Richard Biener <richard.guenther@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:24:00 -0000	[thread overview]
Message-ID: <CAHFci2-8cUh_i9i0e6qdBE8DwqK-fwzAqmsB4_64iak6uV+T_g@mail.gmail.com> (raw)
In-Reply-To: <CAFiYyc0BA04HnZwX3OJh-P5JRHQGinMVJUTMq+VtinyWycO+YA@mail.gmail.com>

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?

Thanks,
bin
>
> Richard.

  reply	other threads:[~2017-11-30 18:20 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 [this message]
2017-11-30 18:41           ` 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=CAHFci2-8cUh_i9i0e6qdBE8DwqK-fwzAqmsB4_64iak6uV+T_g@mail.gmail.com \
    --to=amker.cheng@gmail.com \
    --cc=Bin.Cheng@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=matz@suse.de \
    --cc=nd@arm.com \
    --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).