[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
This commit is contained in:
George Mitenkov 2020-09-24 16:49:19 +03:00
parent 2625433e77
commit 8f72717ebe
1 changed files with 1 additions and 1 deletions

View File

@ -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();