public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: 钟居哲 <juzhe.zhong@rivai.ai>, gcc-patches <gcc-patches@gcc.gnu.org>
Cc: "kito.cheng" <kito.cheng@gmail.com>,
	"kito.cheng" <kito.cheng@sifive.com>,
	"rdapp.gcc" <rdapp.gcc@gmail.com>
Subject: Re: [Committed] RISC-V: Fix mem-to-mem VLS move pattern[PR111566]
Date: Tue, 26 Sep 2023 09:15:27 -0600	[thread overview]
Message-ID: <2f2b555e-adb4-4cad-bbb2-936928c78de4@gmail.com> (raw)
In-Reply-To: <B8B0728B9DF5FF5C+202309262251387810051@rivai.ai>



On 9/26/23 08:51, 钟居哲 wrote:
> Thanks Jeff.
> 
> Address comments:
> [PATCH V2] RISC-V: Fix mem-to-mem VLS move pattern[PR111566] (gnu.org) 
> <https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631395.html>
> 
> Actually, we only allow mem-to-mem move for VLS modes size <= 
> MAX_BITS_PER_WORD.
> Since we want to optimize this case:
> 
> -	    typedef int8_t v2qi __attribute__ ((vector_size (2)));
> -	    v2qi v = *(v2qi*)in;
> -	    *(v2qi*)out = v;
> 
> using scalar load/store.
That should be do-able without resorting to a pattern that allowed 
mem->mem moves.

THe thing you have to be careful about is in the effort to optimize this 
case, you can end up confusing the register allocator into making poor 
choices elsewhere.  ie, once you expose a small vector move as 
implementable in GPRs you run the very real risk of pessimizing other code.

But even with that caveat, the better way to go here is to disallow the 
mem->mem case.

jeff

  reply	other threads:[~2023-09-26 15:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 13:15 Juzhe-Zhong
2023-09-26 13:35 ` Jeff Law
2023-09-26 14:51   ` 钟居哲
2023-09-26 15:15     ` Jeff Law [this message]
2023-09-26 15:27       ` 钟居哲
2023-09-26 23:08       ` 钟居哲
2023-09-27 22:07         ` Jeff Law

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=2f2b555e-adb4-4cad-bbb2-936928c78de4@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=juzhe.zhong@rivai.ai \
    --cc=kito.cheng@gmail.com \
    --cc=kito.cheng@sifive.com \
    --cc=rdapp.gcc@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).