[RISCV] Add -riscv-v-fixed-length-vector-elen-max to limit the ELEN used for fixed...
authorCraig Topper <craig.topper@sifive.com>
Fri, 27 Aug 2021 16:51:05 +0000 (09:51 -0700)
committerCraig Topper <craig.topper@sifive.com>
Fri, 27 Aug 2021 17:17:35 +0000 (10:17 -0700)
commit0eeab8b2825ca9582b211fb5fbe782f702b30db7
tree87f49d7b8e731c5af54298321c8442fb3ceb2068
parent3ec634e65a02d5f443cc982e9e00ec4e51143d07
[RISCV] Add -riscv-v-fixed-length-vector-elen-max to limit the ELEN used for fixed length vectorization.

This adds an ELEN limit for fixed length vectors. This will scalarize
any elements larger than this. It will also disable some fractional
LMULs. For example, if ELEN=32 then mf8 becomes illegal, i32/f32
vectors can't use any fractional LMULs, i16/f16 can only use mf2,
and i8 can use mf2 and mf4.

We may also need something for the scalable vectors, but that has
interactions with the intrinsics and we can't scalarize a scalable
vector.

Longer term this should come from one of the Zve* features
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVSubtarget.cpp
llvm/lib/Target/RISCV/RISCVSubtarget.h
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-elen.ll [new file with mode: 0644]