[spirv] Support OpPhi using block arguments
authorLei Zhang <antiagainst@google.com>
Mon, 28 Oct 2019 22:58:11 +0000 (15:58 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Mon, 28 Oct 2019 22:58:42 +0000 (15:58 -0700)
commitca2538e9a749deeedb6c790d85d811133e88ad91
treeb5485be24589b9b55a6e3156377e77f81f304c2b
parent66ec24d83310dd623d79619840313f98e9a72644
[spirv] Support OpPhi using block arguments

This CL adds another control flow instruction in SPIR-V: OpPhi.
It is modelled as block arguments to be idiomatic with MLIR.
See the rationale.md doc for "Block Arguments vs PHI nodes".
Serialization and deserialization is updated to convert between
block arguments and SPIR-V OpPhi instructions.

PiperOrigin-RevId: 277161545
mlir/g3doc/Dialects/SPIR-V.md
mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
mlir/test/Dialect/SPIRV/Serialization/phi.mlir [new file with mode: 0644]