[RISCV] Allow fractional LMUL for reduction start value
authorPhilip Reames <preames@rivosinc.com>
Mon, 12 Dec 2022 16:53:35 +0000 (08:53 -0800)
committerPhilip Reames <listmail@philipreames.com>
Mon, 12 Dec 2022 17:08:21 +0000 (09:08 -0800)
commita4b45c28a1255c27a5228363e6a94e0dde86ecca
treee340958fae57416dc6244be3f7b9ca52b09e5cb7
parent81084bfa2c3cd521697480b244ae59e80564d0a7
[RISCV] Allow fractional LMUL for reduction start value

For reductions, we need to put the start value into a source vector. For fractional LMULs, we can perform the operation at the original LMUL.  For LMUL > 1, we eventually want to use a scalar insert, but that's outside the scope of this patch.

Differential Revision: https://reviews.llvm.org/D139747
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-fp-vp.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-fp.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-int-vp.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-int.ll
llvm/test/CodeGen/RISCV/rvv/vreductions-fp-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/vreductions-fp-vp.ll
llvm/test/CodeGen/RISCV/rvv/vreductions-int-vp.ll
llvm/test/CodeGen/RISCV/rvv/vreductions-int.ll