[Mlir-commits] [mlir] f02716a - [MLIR] Fix build without native arch

Nikita Popov llvmlistbot at llvm.org
Thu May 12 00:50:58 PDT 2022


Author: Nikita Popov
Date: 2022-05-12T09:50:51+02:00
New Revision: f02716a806339f2d8894502f2a7902fec50ef918

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

LOG: [MLIR] Fix build without native arch

D125214 split off a MLIRExecutionEngineUtils library that is used
by MLIRGPUTransforms. However, currently the entire ExecutionEngine
directory is skipped if the LLVM_NATIVE_ARCH target is not available.

Move the check for LLVM_NATIVE_ARCH, such that MLIRExecutionEngineUtils
always gets built, and only the JIT-related libraries are omitted
without native arch.

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

Added: 
    

Modified: 
    mlir/lib/CMakeLists.txt
    mlir/lib/ExecutionEngine/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/lib/CMakeLists.txt b/mlir/lib/CMakeLists.txt
index 672a013445e88..523a2d4e7fc71 100644
--- a/mlir/lib/CMakeLists.txt
+++ b/mlir/lib/CMakeLists.txt
@@ -15,8 +15,4 @@ add_subdirectory(TableGen)
 add_subdirectory(Target)
 add_subdirectory(Tools)
 add_subdirectory(Transforms)
-
-# Only enable the ExecutionEngine if the native target is configured in.
-if(TARGET ${LLVM_NATIVE_ARCH})
-  add_subdirectory(ExecutionEngine)
-endif()
+add_subdirectory(ExecutionEngine)

diff  --git a/mlir/lib/ExecutionEngine/CMakeLists.txt b/mlir/lib/ExecutionEngine/CMakeLists.txt
index 687f88fe81f97..76c4d3ddf8ed1 100644
--- a/mlir/lib/ExecutionEngine/CMakeLists.txt
+++ b/mlir/lib/ExecutionEngine/CMakeLists.txt
@@ -13,16 +13,6 @@ set(LLVM_OPTIONAL_SOURCES
   JitRunner.cpp
   )
 
-if(LLVM_USE_INTEL_JITEVENTS)
-  set(LLVM_JIT_LISTENER_LIB
-      IntelJITEvents)
-endif(LLVM_USE_INTEL_JITEVENTS)
-
-if(LLVM_USE_PERF)
-  set(LLVM_JIT_LISTENER_LIB
-      PerfJITEvents)
-endif(LLVM_USE_PERF)
-
 # Use a separate library for OptUtils, to avoid pulling in the entire JIT and
 # codegen infrastructure. Unlike MLIRExecutionEngine, this is part of
 # libMLIR.so.
@@ -48,6 +38,21 @@ add_mlir_library(MLIRExecutionEngineUtils
   Passes
   )
 
+# Only enable the ExecutionEngine if the native target is configured in.
+if(NOT TARGET ${LLVM_NATIVE_ARCH})
+  return()
+endif()
+
+if(LLVM_USE_INTEL_JITEVENTS)
+  set(LLVM_JIT_LISTENER_LIB
+      IntelJITEvents)
+endif(LLVM_USE_INTEL_JITEVENTS)
+
+if(LLVM_USE_PERF)
+  set(LLVM_JIT_LISTENER_LIB
+      PerfJITEvents)
+endif(LLVM_USE_PERF)
+
 add_mlir_library(MLIRExecutionEngine
   ExecutionEngine.cpp
 


        


More information about the Mlir-commits mailing list