[RISCV] Match splatted load to scalar load + splat. Form strided load during isel.
authorCraig Topper <craig.topper@sifive.com>
Mon, 26 Apr 2021 20:23:22 +0000 (13:23 -0700)
committerCraig Topper <craig.topper@sifive.com>
Mon, 26 Apr 2021 20:32:03 +0000 (13:32 -0700)
commite2cd92cb9bc2d71ff6fe0299583e48b38c1c6b97
tree07f6261889e89ae9f5479c7e85756bee1ca56e29
parentb81244fa4ff9188df22847c6e11e050892292002
[RISCV] Match splatted load to scalar load + splat. Form strided load during isel.

This modifies my previous patch to push the strided load formation
to isel. This gives us opportunity to fold the splat into a .vx
operation first. Using a scalar register and a .vx operation reduces
vector register pressure which can be important for larger LMULs.

If we can't fold the splat into a .vx operation, then it can make
sense to use a strided load to free up the vector arithmetic
ALU to do actual arithmetic rather than tying it up with vmv.v.x.

Reviewed By: khchen

Differential Revision: https://reviews.llvm.org/D101138
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-buildvec.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-shuffles.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-insert.ll