Porting this optimization to RISC-V Vector is pretty trivial.