From: Hao Liu OS <hliu@os.amperecomputing.com>
To: Jeff Law <jeffreyalaw@gmail.com>,
Richard Biener <richard.guenther@gmail.com>
Cc: "GCC-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Vect: use a small step to calculate induction for the unrolled loop (PR tree-optimization/110449)
Date: Fri, 7 Jul 2023 02:23:16 +0000 [thread overview]
Message-ID: <SJ2PR01MB863546DA9032E9432BA80742E12DA@SJ2PR01MB8635.prod.exchangelabs.com> (raw)
In-Reply-To: <81f484bc-edea-f1ae-8929-2dd728bd3726@gmail.com>
Hi Jeff,
Thanks for your help.
Actually I have write access as I was added to the "contributor list". Anyway, that's very kind of you to help committing the patch.
Thanks,
-Hao
________________________________________
From: Jeff Law <jeffreyalaw@gmail.com>
Sent: Friday, July 7, 2023 0:06
To: Richard Biener; Hao Liu OS
Cc: GCC-patches@gcc.gnu.org
Subject: Re: [PATCH] Vect: use a small step to calculate induction for the unrolled loop (PR tree-optimization/110449)
On 7/6/23 06:44, Richard Biener via Gcc-patches wrote:
> On Wed, Jul 5, 2023 at 8:44 AM Hao Liu OS via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
>>
>> Hi,
>>
>> If a loop is unrolled by n times during vectoriation, two steps are used to
>> calculate the induction variable:
>> - The small step for the unrolled ith-copy: vec_1 = vec_iv + (VF/n * Step)
>> - The large step for the whole loop: vec_loop = vec_iv + (VF * Step)
>>
>> This patch calculates an extra vec_n to replace vec_loop:
>> vec_n = vec_prev + (VF/n * S) = vec_iv + (VF/n * S) * n = vec_loop.
>>
>> So that we can save the large step register and related operations.
>
> OK. It would be nice to avoid the dead stmts created earlier though.
>
> Thanks,
> Richard.
>
>> gcc/ChangeLog:
>>
>> PR tree-optimization/110449
>> * tree-vect-loop.cc (vectorizable_induction): use vec_n to replace
>> vec_loop for the unrolled loop.
>>
>> gcc/testsuite/ChangeLog:
>>
>> * gcc.target/aarch64/pr110449.c: New testcase.
I didn't see Hao Liu in the MAINTAINERS file, so probably doesn't have
write access. Therefore I went ahead and pushed this for Hao.
jeff
next prev parent reply other threads:[~2023-07-07 2:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-05 6:43 Hao Liu OS
2023-07-06 12:44 ` Richard Biener
2023-07-06 16:06 ` Jeff Law
2023-07-07 2:23 ` Hao Liu OS [this message]
2023-07-06 17:50 ` Richard Sandiford
2023-07-07 5:32 ` Richard Biener
2023-07-07 7:53 ` Richard Sandiford
2023-07-07 10:23 ` 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=SJ2PR01MB863546DA9032E9432BA80742E12DA@SJ2PR01MB8635.prod.exchangelabs.com \
--to=hliu@os.amperecomputing.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jeffreyalaw@gmail.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).