Skip to content

Commit

Permalink
[mlir][cpu-runner] register all llvm ir dialects
Browse files Browse the repository at this point in the history
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
  • Loading branch information
aartbik committed Mar 17, 2021
1 parent 9705caf commit f2557cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions mlir/tools/mlir-cpu-runner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ target_link_libraries(mlir-cpu-runner PRIVATE
MLIRJitRunner
MLIRLLVMIR
MLIRLLVMToLLVMIRTranslation
MLIROpenMP
MLIROpenMPToLLVMIRTranslation
MLIRToLLVMIRTranslationRegistration
MLIRParser
MLIRTargetLLVMIRExport
MLIRSupport
Expand Down
6 changes: 2 additions & 4 deletions mlir/tools/mlir-cpu-runner/mlir-cpu-runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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);
}

0 comments on commit f2557cf

Please sign in to comment.