[spirv] Use I32EnumAttr for enum attributes
authorLei Zhang <antiagainst@google.com>
Tue, 2 Jul 2019 13:02:20 +0000 (06:02 -0700)
committerjpienaar <jpienaar@google.com>
Tue, 2 Jul 2019 17:28:24 +0000 (10:28 -0700)
commit32f3c6c74e1a7fc197f58441d5826cac193fe0d3
treedf3578d2be106992b35070c57d55cee630c0d244
parent25f29e1b15021661508f4864b24840137d9e8d8a
[spirv] Use I32EnumAttr for enum attributes

This saves us the excessive string conversions and comparisons in
verification and transformation and scopes them only to parsing
and printing, which are meant for I/O so string conversions should
be fine.

In order to do this, changed the custom assembly format of
spv.module regarding addressing model and memory model.

PiperOrigin-RevId: 256149856
12 files changed:
mlir/include/mlir/SPIRV/SPIRVBase.td
mlir/include/mlir/SPIRV/SPIRVOps.h
mlir/include/mlir/SPIRV/SPIRVStructureOps.td
mlir/include/mlir/SPIRV/SPIRVTypes.h
mlir/lib/SPIRV/SPIRVOps.cpp
mlir/lib/SPIRV/SPIRVTypes.cpp
mlir/lib/SPIRV/Serialization/Deserializer.cpp
mlir/lib/SPIRV/Serialization/Serializer.cpp
mlir/test/SPIRV/Serialization/minimal-module.mlir
mlir/test/SPIRV/ops.mlir
mlir/test/SPIRV/structure-ops.mlir
mlir/utils/spirv/gen_spirv_dialect.py