[spirv] Allow block arguments on spv.Branch(Conditional)
authorLei Zhang <antiagainst@google.com>
Tue, 22 Oct 2019 00:31:32 +0000 (17:31 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Tue, 22 Oct 2019 00:32:00 +0000 (17:32 -0700)
commitd9fe892e4228909908cf9b0f6dd80d9b56c060b4
tree45ae2b1346c012798ed42d599750b2395010432a
parent5f867d26b47c0b1fb0a46306bd3b30e1eea0961a
[spirv] Allow block arguments on spv.Branch(Conditional)

We will use block arguments as the way to model SPIR-V OpPhi in
the SPIR-V dialect.

This CL also adds a few useful helper methods to both ops to
get the block arguments.

Also added tests for branch weight (de)serialization.

PiperOrigin-RevId: 275960797
mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
mlir/test/Dialect/SPIRV/Serialization/loop.mlir
mlir/test/Dialect/SPIRV/Serialization/selection.mlir
mlir/test/Dialect/SPIRV/control-flow-ops.mlir