[RISCV][VP] Lower FP VP ISD nodes to RVV instructions
authorFraser Cormack <fraser@codeplay.com>
Mon, 14 Jun 2021 10:00:25 +0000 (11:00 +0100)
committerFraser Cormack <fraser@codeplay.com>
Thu, 17 Jun 2021 09:04:00 +0000 (10:04 +0100)
commitfed1503e855a1e3cf936fa0866f099bf1c8c9416
treec882486980db0efe6746b6fcbb6461559a38be40
parent05e95d2dd74973dd5163b7d44828fac61e416452
[RISCV][VP] Lower FP VP ISD nodes to RVV instructions

With the exception of `frem`, this patch supports the current set of VP
floating-point binary intrinsics by lowering them to to RVV instructions. It
does so by using the existing `RISCVISD *_VL` custom nodes as an intermediate
layer. Both scalable and fixed-length vectors are supported by using this
method.

The `frem` node is unsupported due to a lack of available instructions. For
fixed-length vectors we could scalarize but that option is not (currently)
available for scalable-vector types. The support is intentionally left out so
it equivalent for both vector types.

The matching of vector/scalar forms is currently lacking, as scalable vector
types do not lower to the custom `VFMV_V_F_VL` node. We could either make
floating-point scalable vector splats lower to this node, or support the
matching of multiple kinds of splat via a `ComplexPattern`, much like we do for
integer types.

Reviewed By: rogfer01

Differential Revision: https://reviews.llvm.org/D104237
13 files changed:
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfadd-vp.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfdiv-vp.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfmul-vp.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfrdiv-vp.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfrsub-vp.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfsub-vp.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/vfadd-vp.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/vfdiv-vp.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/vfmul-vp.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/vfrdiv-vp.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/vfrsub-vp.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/vfsub-vp.ll [new file with mode: 0644]