Use operand number during serialization to get the <id>s of the operands
authorMahesh Ravishankar <ravishankarm@google.com>
Wed, 31 Jul 2019 19:34:17 +0000 (12:34 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Wed, 31 Jul 2019 19:34:51 +0000 (12:34 -0700)
commitcf66d7bb74c482f153cac4715531477e828f4ea4
treec5453f084541d12e06074b48269e68ed62dc8d9c
parentce358f9b37e7af3917907db723705353cb725c5e
Use operand number during serialization to get the <id>s of the operands

During serialization, the operand number must be used to get the
values assocaited with an operand. Using the argument number in Op
specification was wrong since some of the elements in the arguments
list might be attributes on the operation. This resulted in a segfault
during serialization.
Add a test that exercise that path.

PiperOrigin-RevId: 260977758
mlir/test/Dialect/SPIRV/Serialization/variables_init.mlir [new file with mode: 0644]
mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp