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