[Mlir-commits] [mlir] 8f72717 - [MLIR][SPIRV] Fixed dialect loading in deserialization

George Mitenkov llvmlistbot at llvm.org
Thu Sep 24 06:56:51 PDT 2020


Author: George Mitenkov
Date: 2020-09-24T16:56:14+03:00
New Revision: 8f72717ebe27209a11be80629c667332cd5e4e60

URL: https://github.com/llvm/llvm-project/commit/8f72717ebe27209a11be80629c667332cd5e4e60
DIFF: https://github.com/llvm/llvm-project/commit/8f72717ebe27209a11be80629c667332cd5e4e60.diff

LOG: [MLIR][SPIRV] Fixed dialect loading in deserialization

Fixed an error when deserializing the SPIR-V binary
to MLIR SPIR-V. Before, the SPIR-V dialect was not loaded
explicitly into the context, which resulted in unregistered
operation error.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D88223

Added: 
    

Modified: 
    mlir/lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp b/mlir/lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp
index ee2a1e436446..267c6b2aa9ac 100644
--- a/mlir/lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp
+++ b/mlir/lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp
@@ -38,7 +38,7 @@ using namespace mlir;
 // `inputFilename` and returns a module containing the SPIR-V module.
 static OwningModuleRef deserializeModule(const llvm::MemoryBuffer *input,
                                          MLIRContext *context) {
-  Builder builder(context);
+  context->loadDialect<spirv::SPIRVDialect>();
 
   // Make sure the input stream can be treated as a stream of SPIR-V words
   auto start = input->getBufferStart();


        


More information about the Mlir-commits mailing list