From 050cc1cd6e6882eadba6e5ea7b588ca0b8aa1b12 Mon Sep 17 00:00:00 2001 From: Nicolas Vasilache Date: Mon, 22 Nov 2021 10:57:33 +0000 Subject: [PATCH] [mlir] Add InitializeNativeTargetAsmParser to ExecutionEngine. This is required to allow python to work with lowerings that use inline_asm. Differential Revision: https://reviews.llvm.org/D114338 --- mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp | 1 + mlir/lib/ExecutionEngine/CMakeLists.txt | 1 + utils/bazel/llvm-project-overlay/mlir/BUILD.bazel | 1 + 3 files changed, 3 insertions(+) diff --git a/mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp b/mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp index 42bacd96725a..a9bb09e61808 100644 --- a/mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp +++ b/mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp @@ -22,6 +22,7 @@ mlirExecutionEngineCreate(MlirModule op, int optLevel, int numPaths, const MlirStringRef *sharedLibPaths) { static bool initOnce = [] { llvm::InitializeNativeTarget(); + llvm::InitializeNativeTargetAsmParser(); // needed for inline_asm llvm::InitializeNativeTargetAsmPrinter(); return true; }(); diff --git a/mlir/lib/ExecutionEngine/CMakeLists.txt b/mlir/lib/ExecutionEngine/CMakeLists.txt index c52837c2e9ad..2264e91d2fa0 100644 --- a/mlir/lib/ExecutionEngine/CMakeLists.txt +++ b/mlir/lib/ExecutionEngine/CMakeLists.txt @@ -26,6 +26,7 @@ add_mlir_library(MLIRExecutionEngine intrinsics_gen LINK_COMPONENTS + ${LLVM_NATIVE_ARCH}AsmParser Core Coroutines ExecutionEngine diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel index f5d7a7d0a8cd..b29c59e3a0f1 100644 --- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel @@ -4991,6 +4991,7 @@ cc_library( ":IR", ":Parser", ":Support", + "//llvm:AllTargetsAsmParsers", "//llvm:Support", ], )