[MLIR][SPIRV] Create new ctx for deserialization in roundtrips.
authorergawy <kareem.ergawy@gmail.com>
Fri, 18 Sep 2020 15:47:37 +0000 (11:47 -0400)
committerLei Zhang <antiagainst@google.com>
Fri, 18 Sep 2020 15:53:51 +0000 (11:53 -0400)
commit7b61b192753360427fade9c9c5b68cd76adfc665
tree6eed3bca4a0c667bb3ca4beb329c6b757fc5f9cc
parent88a1d402d6c60aa182b9d83d39c9e3ab46a830c0
[MLIR][SPIRV] Create new ctx for deserialization in roundtrips.

Roundtripping SPIR-V modules used the same MLIRContext object for both
ways of the trip. This resulted in deserialization using a context
object already containing Types constructed during serialization.
This commit rectifies that by creating a new MLIRContext during
deserialization.

Reviewed By: mravishankar, antiagainst

Differential Revision: https://reviews.llvm.org/D87692
mlir/lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp