[spirv] Fix the entry block to start with OpLabel
authorLei Zhang <antiagainst@google.com>
Tue, 27 Aug 2019 17:50:58 +0000 (10:50 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Tue, 27 Aug 2019 17:51:26 +0000 (10:51 -0700)
commit3af6b533812ce43b2b53f3c8ef905f73881ea7f8
tree76bb19d1e9767290f6abeec897580f36d18cd352
parent4ced99c085e62f681276a06e0ce842b190900d32
[spirv] Fix the entry block to start with OpLabel

Each basic block in SPIR-V must start with an OpLabel instruction.
We don't support control flow yet, so this CL just makes sure that
the entry block follows this rule and is valid.

PiperOrigin-RevId: 265718841
mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp