https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112438
--- Comment #6 from Kito Cheng <kito at gcc dot gnu.org> --- The key is the splat of VLMAX instruction need move into loop body, but AVL propagation should still able to do: ``` foo(int, int*, int*): ble a0,zero,.L5 csrr a5,vlenb srli a5,a5,2 vsetvli a3,zero,e32,m1,ta,ma vid.v v2 .L3: vsetvli a5,a0,e32,m1,ta,ma slli a4,a5,2 vle32.v v1,0(a1) sub a0,a0,a5 vadd.vv v1,v1,v2 vse32.v v1,0(a2) add a1,a1,a4 vmv.v.x v4,a5 # Move to here, splat vl to a5 rather than VLMAX vsetvli a5,zero,e32,m1,ta,ma --- > redundant add a2,a2,a4 vadd.vv v2,v2,v4 bne a0,zero,.L3 .L5: ret ```