[Mlir-commits] [mlir] 3c3ebeb - Revert "[mlir][RunnerUtils] Make symbols private + implement loading mechanism."

Mitch Phillips llvmlistbot at llvm.org
Wed Jun 21 16:02:57 PDT 2023


Author: Mitch Phillips
Date: 2023-06-22T01:01:19+02:00
New Revision: 3c3ebebca2b7e61bdd6610ac33e5016703c11c1b

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

LOG: Revert "[mlir][RunnerUtils] Make symbols private + implement loading mechanism."

This reverts commit bba2b656110209a3d9863b92c060082479b06ab1.

Reason: Broke the HWASan buildbot. See https://reviews.llvm.org/D153250
for more information.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/lib/ExecutionEngine/CMakeLists.txt b/mlir/lib/ExecutionEngine/CMakeLists.txt
index ab33fb5b430fb..39cc9c060db78 100644
--- a/mlir/lib/ExecutionEngine/CMakeLists.txt
+++ b/mlir/lib/ExecutionEngine/CMakeLists.txt
@@ -156,14 +156,7 @@ if(LLVM_ENABLE_PIC)
 
     EXCLUDE_FROM_LIBMLIR
   )
-  set_property(TARGET mlir_runner_utils PROPERTY CXX_VISIBILITY_PRESET hidden)
   target_compile_definitions(mlir_runner_utils PRIVATE mlir_runner_utils_EXPORTS)
-  if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
-    # Don't export symbols from link-time dependencies, these are internal
-    # implementation details.
-    # FIXME: Add a similar fix for Windows.
-    target_link_options(mlir_runner_utils PRIVATE "-Wl,-exclude-libs,ALL")
-  endif()
 
   add_mlir_library(mlir_async_runtime
     SHARED

diff  --git a/mlir/lib/ExecutionEngine/RunnerUtils.cpp b/mlir/lib/ExecutionEngine/RunnerUtils.cpp
index b1fc190ea63d5..ccf5309487637 100644
--- a/mlir/lib/ExecutionEngine/RunnerUtils.cpp
+++ b/mlir/lib/ExecutionEngine/RunnerUtils.cpp
@@ -14,7 +14,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "mlir/ExecutionEngine/RunnerUtils.h"
-#include "llvm/ADT/StringMap.h"
 #include <chrono>
 
 // NOLINTBEGIN(*-identifier-naming)
@@ -288,85 +287,4 @@ extern "C" int64_t verifyMemRefC64(int64_t rank, void *actualPtr,
   return _mlir_ciface_verifyMemRefC64(&actualDesc, &expectedDesc);
 }
 
-//===----------------------------------------------------------------------===//
-// MLIR ExecutionEngine dynamic library integration.
-//===----------------------------------------------------------------------===//
-
-// Visual Studio had a bug that fails to compile nested generic lambdas
-// inside an `extern "C"` function.
-//   https://developercommunity.visualstudio.com/content/problem/475494/clexe-error-with-lambda-inside-function-templates.html
-// The bug is fixed in VS2019 16.1. Separating the declaration and definition is
-// a work around for older versions of Visual Studio.
-extern "C" MLIR_RUNNERUTILS_EXPORT void
-__mlir_execution_engine_init(llvm::StringMap<void *> &exportSymbols);
-
-void __mlir_execution_engine_init(llvm::StringMap<void *> &exportSymbols) {
-  auto exportSymbol = [&](llvm::StringRef name, auto ptr) {
-    assert(exportSymbols.count(name) == 0 && "symbol already exists");
-    exportSymbols[name] = reinterpret_cast<void *>(ptr);
-  };
-
-  exportSymbol("_mlir_ciface_printMemrefShapeI8",
-               &_mlir_ciface_printMemrefShapeI8);
-  exportSymbol("_mlir_ciface_printMemrefShapeI32",
-               &_mlir_ciface_printMemrefShapeI32);
-  exportSymbol("_mlir_ciface_printMemrefShapeI64",
-               &_mlir_ciface_printMemrefShapeI64);
-  exportSymbol("_mlir_ciface_printMemrefShapeF32",
-               &_mlir_ciface_printMemrefShapeF32);
-  exportSymbol("_mlir_ciface_printMemrefShapeF64",
-               &_mlir_ciface_printMemrefShapeF64);
-  exportSymbol("_mlir_ciface_printMemrefShapeInd",
-               &_mlir_ciface_printMemrefShapeInd);
-  exportSymbol("_mlir_ciface_printMemrefShapeC32",
-               &_mlir_ciface_printMemrefShapeC32);
-  exportSymbol("_mlir_ciface_printMemrefShapeC64",
-               &_mlir_ciface_printMemrefShapeC64);
-  exportSymbol("_mlir_ciface_printMemrefI8", &_mlir_ciface_printMemrefI8);
-  exportSymbol("_mlir_ciface_printMemrefI32", &_mlir_ciface_printMemrefI32);
-  exportSymbol("_mlir_ciface_printMemrefI64", &_mlir_ciface_printMemrefI64);
-  exportSymbol("_mlir_ciface_printMemrefF32", &_mlir_ciface_printMemrefF32);
-  exportSymbol("_mlir_ciface_printMemrefF64", &_mlir_ciface_printMemrefF64);
-  exportSymbol("_mlir_ciface_printMemrefInd", &_mlir_ciface_printMemrefInd);
-  exportSymbol("_mlir_ciface_printMemrefC32", &_mlir_ciface_printMemrefC32);
-  exportSymbol("_mlir_ciface_printMemrefC64", &_mlir_ciface_printMemrefC64);
-  exportSymbol("_mlir_ciface_nanoTime", &_mlir_ciface_nanoTime);
-  exportSymbol("printMemrefI32", &printMemrefI32);
-  exportSymbol("printMemrefI64", &printMemrefI64);
-  exportSymbol("printMemrefF32", &printMemrefF32);
-  exportSymbol("printMemrefF64", &printMemrefF64);
-  exportSymbol("printMemrefInd", &printMemrefInd);
-  exportSymbol("printMemrefC32", &printMemrefC32);
-  exportSymbol("printMemrefC64", &printMemrefC64);
-  exportSymbol("printCString", &printCString);
-  exportSymbol("_mlir_ciface_printMemref0dF32", &_mlir_ciface_printMemref0dF32);
-  exportSymbol("_mlir_ciface_printMemref1dF32", &_mlir_ciface_printMemref1dF32);
-  exportSymbol("_mlir_ciface_printMemref2dF32", &_mlir_ciface_printMemref2dF32);
-  exportSymbol("_mlir_ciface_printMemref3dF32", &_mlir_ciface_printMemref3dF32);
-  exportSymbol("_mlir_ciface_printMemref4dF32", &_mlir_ciface_printMemref4dF32);
-  exportSymbol("_mlir_ciface_printMemref1dI8", &_mlir_ciface_printMemref1dI8);
-  exportSymbol("_mlir_ciface_printMemref1dI32", &_mlir_ciface_printMemref1dI32);
-  exportSymbol("_mlir_ciface_printMemref1dI64", &_mlir_ciface_printMemref1dI64);
-  exportSymbol("_mlir_ciface_printMemref1dF64", &_mlir_ciface_printMemref1dF64);
-  exportSymbol("_mlir_ciface_printMemref1dInd", &_mlir_ciface_printMemref1dInd);
-  exportSymbol("_mlir_ciface_printMemref1dC32", &_mlir_ciface_printMemref1dC32);
-  exportSymbol("_mlir_ciface_printMemref1dC64", &_mlir_ciface_printMemref1dC64);
-  exportSymbol("_mlir_ciface_printMemrefVector4x4xf32",
-               &_mlir_ciface_printMemrefVector4x4xf32);
-  exportSymbol("_mlir_ciface_verifyMemRefI32", &_mlir_ciface_verifyMemRefI32);
-  exportSymbol("_mlir_ciface_verifyMemRefF32", &_mlir_ciface_verifyMemRefF32);
-  exportSymbol("_mlir_ciface_verifyMemRefF64", &_mlir_ciface_verifyMemRefF64);
-  exportSymbol("_mlir_ciface_verifyMemRefInd", &_mlir_ciface_verifyMemRefInd);
-  exportSymbol("_mlir_ciface_verifyMemRefC32", &_mlir_ciface_verifyMemRefC32);
-  exportSymbol("_mlir_ciface_verifyMemRefC64", &_mlir_ciface_verifyMemRefC64);
-  exportSymbol("verifyMemRefI32", &verifyMemRefI32);
-  exportSymbol("verifyMemRefF32", &verifyMemRefF32);
-  exportSymbol("verifyMemRefF64", &verifyMemRefF64);
-  exportSymbol("verifyMemRefInd", &verifyMemRefInd);
-  exportSymbol("verifyMemRefC32", &verifyMemRefC32);
-  exportSymbol("verifyMemRefC64", &verifyMemRefC64);
-}
-
-extern "C" MLIR_RUNNERUTILS_EXPORT void __mlir_execution_engine_destroy() {}
-
 // NOLINTEND(*-identifier-naming)


        


More information about the Mlir-commits mailing list