[RISCV] Begin to support more subvector inserts/extracts
authorFraser Cormack <fraser@codeplay.com>
Wed, 17 Feb 2021 15:57:59 +0000 (15:57 +0000)
committerFraser Cormack <fraser@codeplay.com>
Thu, 18 Feb 2021 10:18:27 +0000 (10:18 +0000)
commitd876214990303e07310fb9f7a13b37715f051006
tree93f6152a622ac0e523f49d6e42cfc627207b1b08
parent0176fecfbcd6b867fd31d7b85cc748220150babc
[RISCV] Begin to support more subvector inserts/extracts

This patch adds support for INSERT_SUBVECTOR and EXTRACT_SUBVECTOR
(nominally where both operands are scalable vector types) where the
vector, subvector, and index align sufficiently to allow decomposition
to subregister manipulation:

* For extracts, the extracted subvector must correctly align with the
lower elements of a vector register.
* For inserts, the inserted subvector must be at least one full vector
register, and correctly align as above.

This approach should work for fixed-length vector insertion/extraction
too, but that will come later.

Reviewed By: craig.topper, khchen, arcbbb

Differential Revision: https://reviews.llvm.org/D96873
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
llvm/test/CodeGen/RISCV/rvv/extract-subvector.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/insert-subvector.ll [new file with mode: 0644]