Vector types of rank > 1 are converted to array(s) of vector type(s).
Arrays in LLVM cannot contain scalable vectors since the size is unknown
at compile-time, but it's currently trying to do so and creating 1-D
vector types where the number of scalable dims is greater than the rank,
triggering an assert in llvm-project/llvm/include/llvm/ADT/ArrayRef.h:255:
Assertion `Index < Length && "Invalid index!"' failed.
This patch fixes this so there's only a single scalable dim. This needs
fixing properly by adding support for converting scalable vectors of
rank > 1 to LLVM but at least now it will fail expectedly during
conversion to LLVM with:
Assertion `isValidElementType(ElementType) && "Invalid type for array element!"' failed.
rather than with a cryptic assert.