Fix parsing/printing of spv.globalVariable and spv._address_of
authorMahesh Ravishankar <ravishankarm@google.com>
Mon, 19 Aug 2019 18:38:53 +0000 (11:38 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Mon, 19 Aug 2019 18:39:25 +0000 (11:39 -0700)
commit377bfb3a142a83a8ecee5de5a6b5d571881fc2b6
tree8d9165735b6a6f18dfaa7d15b93465ff91228ad8
parentba0fa92524ce0aea2385858016bdb08bd941a10d
Fix parsing/printing of spv.globalVariable and  spv._address_of

Change the prining/parsing of spv.globalVariable to print the type of
the variable after the ':' to be consistent with MLIR convention.
The spv._address_of should print the variable type after the ':'. It was
mistakenly printing the address of the return value. Add a (missing)
test that should have caught that.
Also move spv.globalVariable and spv._address_of tests to
structure-ops.mlir.

PiperOrigin-RevId: 264204686
mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
mlir/test/Conversion/GPUToSPIRV/simple.mlir
mlir/test/Dialect/SPIRV/Serialization/entry_interface.mlir
mlir/test/Dialect/SPIRV/Serialization/variable_reference.mlir [new file with mode: 0644]
mlir/test/Dialect/SPIRV/Serialization/variables.mlir
mlir/test/Dialect/SPIRV/Serialization/variables_init.mlir
mlir/test/Dialect/SPIRV/ops.mlir
mlir/test/Dialect/SPIRV/structure-ops.mlir