[RISCV] Prevent crashes when bitcasting between fixed vectors and scalars.
authorCraig Topper <craig.topper@sifive.com>
Wed, 10 Nov 2021 16:56:00 +0000 (08:56 -0800)
committerCraig Topper <craig.topper@sifive.com>
Wed, 10 Nov 2021 17:21:52 +0000 (09:21 -0800)
commit57bc7b108937d325187e5672daf63f2a31a89912
treef65c242b1da20501a6026b5b2498d3f84317c99e
parent48bb5f4cbe8d5951c1153e469dc6713a122b7fa3
[RISCV] Prevent crashes when bitcasting between fixed vectors and scalars.

Not all scalar element types are allowed in vectors so we may not
be able to bitcast to a 1 element vector to use insert/extract.

This will become a bigger issue when the Zve extensions are commited.
For now, I'm using the ELEN limit to limit the element types.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D113219
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-bitcast.ll