[mlir][cpu-runner] register all llvm ir dialects
authorAart Bik <ajcbik@google.com>
Tue, 16 Mar 2021 18:05:09 +0000 (11:05 -0700)
committerAart Bik <ajcbik@google.com>
Wed, 17 Mar 2021 17:05:46 +0000 (10:05 -0700)
This fixes broken JIT functionality on emulator platforms.
With Alex' recent movement towards squashing llvm ir dialects
into target specific dialects, we now must ensure these dialects
are registered to the cpu runner to ensure JIT can lower this
to proper LLVM IR before handing this off to the backend.

Reviewed By: ftynse

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

mlir/tools/mlir-cpu-runner/CMakeLists.txt
mlir/tools/mlir-cpu-runner/mlir-cpu-runner.cpp

index 1135a68..cc3b468 100644 (file)
@@ -17,8 +17,7 @@ target_link_libraries(mlir-cpu-runner PRIVATE
   MLIRJitRunner
   MLIRLLVMIR
   MLIRLLVMToLLVMIRTranslation
-  MLIROpenMP
-  MLIROpenMPToLLVMIRTranslation
+  MLIRToLLVMIRTranslationRegistration
   MLIRParser
   MLIRTargetLLVMIRExport
   MLIRSupport
index d22b3a2..b1009a1 100644 (file)
@@ -16,8 +16,7 @@
 #include "mlir/ExecutionEngine/JitRunner.h"
 #include "mlir/ExecutionEngine/OptUtils.h"
 #include "mlir/IR/Dialect.h"
-#include "mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.h"
-#include "mlir/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.h"
+#include "mlir/Target/LLVMIR/Dialect/All.h"
 
 #include "llvm/Support/InitLLVM.h"
 #include "llvm/Support/TargetSelect.h"
@@ -30,8 +29,7 @@ int main(int argc, char **argv) {
   mlir::initializeLLVMPasses();
 
   mlir::DialectRegistry registry;
-  mlir::registerLLVMDialectTranslation(registry);
-  mlir::registerOpenMPDialectTranslation(registry);
+  mlir::registerAllToLLVMIRTranslations(registry);
 
   return mlir::JitRunnerMain(argc, argv, registry);
 }