[mlir][spirv] Enhance structure type member decoration handling
authorHazemAbdelhafez <23439402+HazemAbdelhafez@users.noreply.github.com>
Wed, 10 Jun 2020 23:15:55 +0000 (19:15 -0400)
committerLei Zhang <antiagainst@google.com>
Wed, 10 Jun 2020 23:25:03 +0000 (19:25 -0400)
commit4b7aa6c8c1b0f68c6800225b39b3b389adf31332
tree31c92c7f63569254c9afaeb1ec5293587ff78cc7
parentd93d8fcdec68211fd3ac7f586fa67bc065acef6a
[mlir][spirv] Enhance structure type member decoration handling

Modify structure type in SPIR-V dialect to support:
1) Multiple decorations per structure member
2) Key-value based decorations (e.g., MatrixStride)

This commit kept the Offset decoration separate from members'
decorations container for easier implementation and logical clarity.
As such, all references to Structure layoutinfo are now offsetinfo,
and any member layout defining decoration (e.g., RowMajor for Matrix)
will be add to the members' decorations container along with its
value if any.

Differential Revision: https://reviews.llvm.org/D81426
mlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h
mlir/include/mlir/IR/DialectImplementation.h
mlir/lib/Dialect/SPIRV/LayoutUtils.cpp
mlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
mlir/lib/Dialect/SPIRV/SPIRVTypes.cpp
mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
mlir/lib/Parser/Parser.cpp
mlir/test/Dialect/SPIRV/Serialization/struct.mlir
mlir/test/Dialect/SPIRV/types.mlir
mlir/unittests/Dialect/SPIRV/SerializationTest.cpp