| Issue |
161856
|
| Summary |
[SPIRV] Legalize long vector types
|
| Labels |
backend:SPIR-V
|
| Assignees |
s-perron
|
| Reporter |
s-perron
|
In SPIR-V, not all vector lengths are legal.
1. Vectors of size 1 are not allowed. They must be turned into scalars.
2. The sizes 2, 3, and 4 are allowed.
3. Above 4, the only sizes allowed are 8 and 16, but only if the Vector16 capability is used. That capability is not available to shaders only Kernels.
>From HLSL, there are two ways in which longer vector types can come up.
1. Expansion of certain builtins like asuint (https://github.com/llvm/llvm-project/issues/153091).
2. The llvm matrix representation uses vectors (See https://llvm.org/devmtg/2020-09/slides/Hahn-Matrix_Support_in_LLVM_and_Clang.pdf).
We need to modify the SPIRV backend to turn longer vectors into spir-v matrix types, and update instructions that cannot work on a matrix type to reference a single element of the matrix.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs