[RISCV] Use non-strided load if VL=1 for optimized zero stride loads
authorLuke Lau <luke@igalia.com>
Wed, 5 Apr 2023 12:35:08 +0000 (13:35 +0100)
committerLuke Lau <luke@igalia.com>
Thu, 6 Apr 2023 10:22:14 +0000 (11:22 +0100)
commit5f2145adf9e343e950935cac1c9030f8ca597912
treeb247dfb2c7fae8ed97890875e8dc34a449d9fd6f
parentb02e2ed7ac71137430fc9fc8b32bed344f5e7fef
[RISCV] Use non-strided load if VL=1 for optimized zero stride loads

When optimizing vmv.s.x/vmv.v.x's of scalar loads, if VL is known to be
1 then we don't need to perform a stride of x0, and can just do a
regular load.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D147609
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-mask-buildvec.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-masked-gather.ll