Thanks Jeff. Address comments: [PATCH V2] RISC-V: Fix mem-to-mem VLS move pattern[PR111566] (gnu.org)
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. Does it look more reasonable ? juzhe.zh...@rivai.ai From: Jeff Law Date: 2023-09-26 21:35 To: Juzhe-Zhong; 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 07:15, Juzhe-Zhong wrote: > The mem-to-mem insn pattern is splitted from reg-to-mem/mem-to-reg/reg-to-reg > causes ICE in RA since RA prefer they stay together. > > Now, we split mem-to-mem as a pure pre-RA split pattern and only allow > define_insn match mem-to-mem VLS move in pre-RA stage (Forbid mem-to-mem move > after RA). > > Tested no difference. Committed. > > PR target/111566 > > gcc/ChangeLog: > > * config/riscv/vector.md (*mov<mode>_mem_to_mem): > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/rvv/fortran/pr111566.f90: New test. ChangeLog for the vector.md is missing. In general we shouldn't be allowing mem->mem in most patterns since the hardware doesn't actually implement such instructions. I suspect that's the real problem here and that ultimately you're just papering over it. Jeff