OSDN Git Service

[mlir][spirv] Introduce OwningSPIRVModuleRef for ownership
authorLei Zhang <antiagainst@google.com>
Tue, 7 Jul 2020 12:28:25 +0000 (08:28 -0400)
committerLei Zhang <antiagainst@google.com>
Tue, 7 Jul 2020 12:29:27 +0000 (08:29 -0400)
commitb80508703fd7f88a7922c9c8f02c696be1db8034
tree8a28b59aa748515674b13af762f0456b17ec9407
parent7bf299c8d8d59304fb821f8811618cdeb1d1f1fd
[mlir][spirv] Introduce OwningSPIRVModuleRef for ownership

Similar to OwningModuleRef, OwningSPIRVModuleRef signals ownership
transfer clearly. This is useful for APIs like spirv::deserialize,
where a spirv::ModuleOp is returned by deserializing SPIR-V binary
module.

This addresses the ASAN error as reported in
https://bugs.llvm.org/show_bug.cgi?id=46272

Differential Revision: https://reviews.llvm.org/D81652
mlir/include/mlir/Dialect/SPIRV/SPIRVModule.h [new file with mode: 0644]
mlir/include/mlir/Dialect/SPIRV/Serialization.h
mlir/include/mlir/IR/Module.h
mlir/include/mlir/IR/OwningOpRefBase.h [new file with mode: 0644]
mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
mlir/lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp
mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp