[MLIR][SPIRV] Add (de-)serialization support for SpecConstantOpeation.
authorergawy <kareem.ergawy@gmail.com>
Mon, 11 Jan 2021 06:37:34 +0000 (07:37 +0100)
committerKareemErgawy-TomTom <kareem.ergawy@gmail.com>
Mon, 11 Jan 2021 06:37:50 +0000 (07:37 +0100)
commita40767ec8851b997e4dcc9987078bd02670f8c7f
tree6601526778d4fb75c6a3e7b150a2d1e6dcd2bc70
parentb8d28420885a42d16a57e02c28129d0eb92474a1
[MLIR][SPIRV] Add (de-)serialization support for SpecConstantOpeation.

This commit adds support for (de-)serializing SpecConstantOpeation. One
thing worth noting is that during deserialization, we assign a fake ID to
enclosed ops inside SpecConstantOpeation. We need to do this in order
for deserialization logic to properly update ID to value map and to
later reference the created value from the sibling 'spv::YieldOp'.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D93591
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td
mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
mlir/lib/Target/SPIRV/Deserialization.cpp
mlir/lib/Target/SPIRV/Serialization.cpp
mlir/test/Dialect/SPIRV/IR/structure-ops.mlir
mlir/test/Target/SPIRV/spec-constant.mlir