[MLIR][SPIRV] Control attributes support for loop and selection
authorGeorge Mitenkov <georgemitenk0v@gmail.com>
Mon, 3 Aug 2020 06:31:08 +0000 (09:31 +0300)
committerGeorge Mitenkov <georgemitenk0v@gmail.com>
Mon, 3 Aug 2020 06:31:37 +0000 (09:31 +0300)
commit91f6a5f7854a542611ed76442acb1ec375a9feb2
treee649fa86c1e88c886e918df9896547375825d871
parentc41a18cf61790fc898dcda1055c3efbf442c14c0
[MLIR][SPIRV] Control attributes support for loop and selection

This patch handles loopControl and selectionControl in parsing and
printing. In order to reuse the functionality, and avoid handling cases when
`{` of the region is parsed as a dictionary attribute, `control` keyword was
introduced.`None` is a default control attribute. This functionality can be
later extended to `spv.func`.
Also, loopControl and selectionControl can now be (de)serialized.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D84175
mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
mlir/test/Dialect/SPIRV/Serialization/loop.mlir
mlir/test/Dialect/SPIRV/Serialization/selection.mlir
mlir/test/Dialect/SPIRV/control-flow-ops.mlir