[RISCV][VP] Custom lower VP_SCATTER and VP_GATHER
authorFraser Cormack <fraser@codeplay.com>
Tue, 31 Aug 2021 11:43:12 +0000 (12:43 +0100)
committerFraser Cormack <fraser@codeplay.com>
Tue, 7 Sep 2021 09:43:07 +0000 (10:43 +0100)
commitf4dee8cb82d199f843b0ca7e9846470f3912f593
tree6ba26729d255659b00bcfb6af294e7f4c8c3fe0f
parent03512ae9bf31b725d8233c03094fd463b5f46285
[RISCV][VP] Custom lower VP_SCATTER and VP_GATHER

This patch adds support for the `VP_SCATTER` and `VP_GATHER` nodes by
lowering them to RVV's `vsox`/`vlux` instructions, respectively. This
process is almost identical to the existing `MSCATTER`/`MGATHER` support.

One extra change was made to `SelectionDAGLegalize` so that
`VP_SCATTER`'s operation action is derived from its stored "value"
operand rather than its return type (which is always the chain).

Reviewed By: craig.topper, rogfer01

Differential Revision: https://reviews.llvm.org/D108987
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.h
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vpgather.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vpscatter.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/vpgather-sdnode.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/vpscatter-sdnode.ll [new file with mode: 0644]