public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: 钟居哲 <juzhe.zhong@rivai.ai>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,  rguenther <rguenther@suse.de>
Subject: Re: [PATCH V14] VECT: Add decrement IV iteration loop control by variable amount support
Date: Wed, 24 May 2023 16:31:39 +0100	[thread overview]
Message-ID: <mpto7m9eof8.fsf@arm.com> (raw)
In-Reply-To: <7AF1D88A0988DC3D+2023052423130398041121@rivai.ai> (=?utf-8?B?IumSn+WxheWTsiIncw==?= message of "Wed, 24 May 2023 23:13:04 +0800")

钟居哲 <juzhe.zhong@rivai.ai> writes:
> Hi, the .optimized dump is like this:
>
>   <bb 2> [local count: 21045336]:
>   ivtmp.26_36 = (unsigned long) &x;
>   ivtmp.27_3 = (unsigned long) &y;
>   ivtmp.30_6 = (unsigned long) &MEM <int[200]> [(void *)&y + 16B];
>   ivtmp.31_10 = (unsigned long) &MEM <int[200]> [(void *)&y + 32B];
>   ivtmp.32_14 = (unsigned long) &MEM <int[200]> [(void *)&y + 48B];
>
>   <bb 3> [local count: 273589366]:
>   # ivtmp_72 = PHI <ivtmp_73(3), 100(2)>
>   # ivtmp.26_41 = PHI <ivtmp.26_37(3), ivtmp.26_36(2)>
>   # ivtmp.27_1 = PHI <ivtmp.27_2(3), ivtmp.27_3(2)>
>   # ivtmp.30_4 = PHI <ivtmp.30_5(3), ivtmp.30_6(2)>
>   # ivtmp.31_8 = PHI <ivtmp.31_9(3), ivtmp.31_10(2)>
>   # ivtmp.32_12 = PHI <ivtmp.32_13(3), ivtmp.32_14(2)>
>   loop_len_34 = MIN_EXPR <ivtmp_72, 8>;
>   loop_len_48 = MIN_EXPR <loop_len_34, 4>;
>   _74 = loop_len_34 - loop_len_48;

Yeah, I think this needs to be:

  loop_len_48 = MIN_EXPR <loop_len_34 * 2, 4>;
  _74 = loop_len_34 * 2 - loop_len_48;
  
(as valid gimple).  The point is that...

>   loop_len_49 = MIN_EXPR <_74, 4>;
>   _75 = _74 - loop_len_49;
>   loop_len_50 = MIN_EXPR <_75, 4>;
>   loop_len_51 = _75 - loop_len_50;

...there are 4 lengths capped to 4, for a total element count of 16.
But loop_len_34 is never greater than 8.

So for this case we either need to multiply, or we need to create
a fresh IV for the second rgroup.  Both approaches are fine.

Thanks,
Richard

  reply	other threads:[~2023-05-24 15:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24 14:48 juzhe.zhong
2023-05-24 15:07 ` Richard Sandiford
2023-05-24 15:13   ` 钟居哲
2023-05-24 15:31     ` Richard Sandiford [this message]
2023-05-24 15:42       ` 钟居哲
2023-05-24 15:47         ` Richard Sandiford
2023-05-24 15:52           ` 钟居哲
2023-05-24 16:00             ` Richard Sandiford
2023-05-24 16:15               ` 钟居哲
2023-05-24 16:37               ` 钟居哲
2023-05-24 20:05                 ` Richard Sandiford
2023-05-25  3:05                   ` juzhe.zhong
     [not found]   ` <2023052423130398041121@rivai.ai>
2023-05-24 15:31     ` 回复: " 钟居哲

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=mpto7m9eof8.fsf@arm.com \
    --to=richard.sandiford@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=juzhe.zhong@rivai.ai \
    --cc=rguenther@suse.de \
    /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).