[Mlir-commits] [mlir] 050cc1c - [mlir] Add InitializeNativeTargetAsmParser to ExecutionEngine.

Nicolas Vasilache llvmlistbot at llvm.org
Mon Nov 22 03:29:47 PST 2021


Author: Nicolas Vasilache
Date: 2021-11-22T11:28:14Z
New Revision: 050cc1cd6e6882eadba6e5ea7b588ca0b8aa1b12

URL: https://github.com/llvm/llvm-project/commit/050cc1cd6e6882eadba6e5ea7b588ca0b8aa1b12
DIFF: https://github.com/llvm/llvm-project/commit/050cc1cd6e6882eadba6e5ea7b588ca0b8aa1b12.diff

LOG: [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

Added: 
    

Modified: 
    mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp
    mlir/lib/ExecutionEngine/CMakeLists.txt
    utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

Removed: 
    


################################################################################
diff  --git a/mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp b/mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp
index 42bacd96725a1..a9bb09e61808e 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 c52837c2e9ad9..2264e91d2fa01 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 f5d7a7d0a8cd7..b29c59e3a0f1f 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",
     ],
 )


        


More information about the Mlir-commits mailing list