mlir
mlir copied to clipboard
[spirv] Change spv.module custom assembly
Right now the arguments in spv.module is defined as
https://github.com/tensorflow/mlir/blob/199f41354c2998627f592a969bc5b31b5227a800/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td#L312-L318
Actually for $capabilities we should be able to use TypedArrayAttr<SPV_CapabilityAttr> as the kind but still parsing and printing the symbols for those capability numbers in custom assembly form.
Additionally for the custom assembly form, it would be nice to change to
`spv.module`
spv-addressing-model spv-memory-model
(`capabilities[` (spv-capability-string)+ `]`)?
(`extensions[` (spv-extension-string)+ `]`)?
(`ext-inst-sets[` (spv-extended-instruction-set-string)+ `]`)?
region
This is easier to read and more consistent with the layout of SPIR-V itself.