This PR implements a MVP version of an MLIR lowering pipeline to SPIR-V. The goal is to have a better test coverage of SPIR-V compilation upstream and enable writing simple kernels by hand. The dialects supported in this version include arith
, vector
(only 1-D vectors with size 2,3,4,8 or 16), scf
, ub
, index
, func
and math
.
Relevant links:
Future plans:
- Add conversion patterns for other dialects, e.g.
gpu
,tensor
, etc. - Include vector transformation to unroll vectors to 1-D, and handle those with illegal sizes.
- Implement multiple-return. SPIR-V does not support multiple return values since a
spirv.func
can only return zero or one values. It might be possible to wrap the return values in aspirv.struct
. - Add a conversion for
scf.parallel
.