From: Jeff Law <jeffreyalaw@gmail.com>
To: juzhe.zhong@rivai.ai, gcc-patches@gcc.gnu.org
Cc: kito.cheng@gmail.com, palmer@dabbelt.com
Subject: Re: [PATCH] RISC-V: Fine tune RA constraint for narrow instructions
Date: Tue, 14 Mar 2023 11:59:15 -0600 [thread overview]
Message-ID: <9182aed0-3376-d904-087b-670d383c3769@gmail.com> (raw)
In-Reply-To: <20230310030205.90760-1-juzhe.zhong@rivai.ai>
On 3/9/23 20:02, juzhe.zhong@rivai.ai wrote:
> From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
>
> According to RVV ISA, for narrow instructions:
>
> The destination EEW is smaller than the source EEW and the overlap is
> in the lowest-numbered part of the source register group.
> (e.g., when LMUL=1, vnsrl.wi v0, v0, 3 is legal, but a destination of v1 is not).
>
> We should allow narrow instructions partially overlap base on the rule of RVV ISA above
> so that we could exploit the useage of vector registers.
>
> Consider these cases:
> https://godbolt.org/z/o6sc4eqGj
>
> some cases in LLVM have redundant move instructions,
> some cases in LLVM have redundant register spillings.
>
> Now after this patch, GCC can have perfect RA && codegen for different pressure RA cases.
>
> gcc/ChangeLog:
>
> * config/riscv/vector.md: Fine tune RA constraints.
>
> gcc/testsuite/ChangeLog:
>
> * gcc.target/riscv/rvv/base/narrow_constraint-1.c: New test.
> * gcc.target/riscv/rvv/base/narrow_constraint-10.c: New test.
> * gcc.target/riscv/rvv/base/narrow_constraint-11.c: New test.
> * gcc.target/riscv/rvv/base/narrow_constraint-2.c: New test.
> * gcc.target/riscv/rvv/base/narrow_constraint-3.c: New test.
> * gcc.target/riscv/rvv/base/narrow_constraint-4.c: New test.
> * gcc.target/riscv/rvv/base/narrow_constraint-5.c: New test.
> * gcc.target/riscv/rvv/base/narrow_constraint-6.c: New test.
> * gcc.target/riscv/rvv/base/narrow_constraint-7.c: New test.
> * gcc.target/riscv/rvv/base/narrow_constraint-8.c: New test.
> * gcc.target/riscv/rvv/base/narrow_constraint-9.c: New test.
ISTM this should wait for gcc-14. Yea, the risk is low and limited to
RVV, but it seems to fall outside the basic intrinsic support we agreed
to allow into gcc-13 post-feature-freeze.
Comments?
Jeff
prev parent reply other threads:[~2023-03-14 17:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 3:02 juzhe.zhong
2023-03-14 17:59 ` Jeff Law [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=9182aed0-3376-d904-087b-670d383c3769@gmail.com \
--to=jeffreyalaw@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=juzhe.zhong@rivai.ai \
--cc=kito.cheng@gmail.com \
--cc=palmer@dabbelt.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).