[mlir][spirv] De-template deserialization
authorLei Zhang <antiagainst@google.com>
Wed, 23 Dec 2020 19:37:52 +0000 (14:37 -0500)
committerLei Zhang <antiagainst@google.com>
Wed, 23 Dec 2020 19:45:46 +0000 (14:45 -0500)
commitae895ac4b9fa86b9471617357f66c0cd6cdb70b8
tree5a1a68acd2fce8cf2a77e16a49fbb6ce0aebdafb
parent897990e614c8d609b2f62dde4f82eb3e96f9f0be
[mlir][spirv] De-template deserialization

Previously for each op we generate a separate deserialization
method for it. Those deserialization methods duplicate the logic
of parsing operands/results/attributes and such.

This commit creates a generic method and let suitable op-specific
deserialization method to call into it.

wc -l SPIRVSerialization.inc: before 13290; after: 8304 (So -4986)

Reviewed By: hanchung, ThomasRaoux

Differential Revision: https://reviews.llvm.org/D93504
mlir/lib/Target/SPIRV/Deserialization.cpp
mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp