On 9/2/25 5:49 AM, Robin Dapp wrote:
Hi, This patch changes is_vlmax_len_p to handle VLS modes properly. Before we would check if len == GET_MODE_NUNITS (mode). This works vor VLA modes but not necessarily for VLS modes. We regularly have e.g. small VLS modes where LEN equals their number of units but which do not span a full vector. Therefore now check if len * GET_MODE_UNIT_SIZE (mode) equals BYTES_PER_RISCV_VECTOR * TARGET_MAX_LMUL. Changing this uncovered an oversight in avlprop where we used GET_MODE_NUNITS as AVL when GET_MODE_NUNITS / NF would be correct. The testsuite is unchanged. I didn't bother to add a dedicated test because we would have seen the fallout anyway once the gather patch lands. Regtested on rv64gcv_zvl512b. Regards Robin gcc/ChangeLog: * config/riscv/riscv-v.cc (is_vlmax_len_p): Properly handle VLS modes. (imm_avl_p): Fix VLS length check. (expand_strided_load): Use is_vlmax_len_p. (expand_strided_store): Ditto. * config/riscv/riscv-avlprop.cc (pass_avlprop::execute): Use GET_MODE_NUNITS / NF as avl.
OK. Jeff