[RISCV] Disable <vscale x 1 x *> types with Zve32x or Zve32f.
authorCraig Topper <craig.topper@sifive.com>
Thu, 23 Jun 2022 15:41:12 +0000 (08:41 -0700)
committerCraig Topper <craig.topper@sifive.com>
Thu, 23 Jun 2022 15:49:18 +0000 (08:49 -0700)
commit8b10ffabae48ae6eae5ece711c13b93f9c232515
tree036185b933e00ee44d3d6b1de2c7a497bb0c6d6d
parent0ec87addb7d17b45f68e003e22e96d479a70b070
[RISCV] Disable <vscale x 1 x *> types with Zve32x or Zve32f.

According to the vector spec, mf8 is not supported for i8 if ELEN
is 32. Similarily mf4 is not suported for i16/f16 or mf2 for i32/f32.

Since RVVBitsPerBlock is 64 and LMUL is calculated as
((MinNumElements * ElementSize) / RVVBitsPerBlock) this means we
need to disable any type with MinNumElements==1.

For generic IR, these types will now be widened in type legalization.
For RVV intrinsics, we'll probably hit a fatal error somewhere. I plan
to work on disabling the intrinsics in the riscv_vector.h header.

Reviewed By: arcbbb

Differential Revision: https://reviews.llvm.org/D128286
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/rvv/zve32-types.ll [new file with mode: 0644]