Hi, Jeff.

I removed mem-to-mem patterns as you suggested that means we don't have scalar 
move optimization for small size vector modes.
Is it ok for trunk?  
Since it is a bug fix patch, I hope we can land it soon. We may will find 
another way to optimize small size vector mode mem-to-mem.



juzhe.zh...@rivai.ai
 
From: Jeff Law
Date: 2023-09-26 23:15
To: 钟居哲; gcc-patches
CC: kito.cheng; kito.cheng; rdapp.gcc
Subject: Re: [Committed] RISC-V: Fix mem-to-mem VLS move pattern[PR111566]
 
 
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 via email to