[Mlir-commits] [mlir] 3295b88 - Revert "[mlir][ExecutionEngine] Add support for global constructors and destructors" (#78164)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Jan 15 06:21:46 PST 2024


Author: Cullen Rhodes
Date: 2024-01-15T14:21:41Z
New Revision: 3295b88a664405f6e39b8df26f97e68ed1c5ab1f

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

LOG: Revert "[mlir][ExecutionEngine] Add support for global constructors and destructors" (#78164)

this is causing test failures on AArch64 linux, hitting the
following assert:

# | mlir-cpu-runner: /home/culrho01/llvm-project/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:519: void llvm::RuntimeDyldELF::resolveAArch64Relocation(const SectionEntry &, uint64_t, uint64_t, uint32_t, int64_t): Assertion `isInt<33>(Result) && "overflow check failed for relocation"' failed.

Seeing the same in buildbot as well, e.g.

https://lab.llvm.org/buildbot/#/builders/179/builds/9094/steps/12/logs/FAIL__MLIR__sparse_codegen_dim_mlir

Reverts llvm/llvm-project#78070

Added: 
    

Modified: 
    mlir/lib/ExecutionEngine/ExecutionEngine.cpp

Removed: 
    mlir/test/mlir-cpu-runner/global-constructors.mlir


################################################################################
diff  --git a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
index d4ad2da045e2c4a..267ec236d3fd590 100644
--- a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -219,9 +219,6 @@ ExecutionEngine::ExecutionEngine(bool enableObjectDump,
 }
 
 ExecutionEngine::~ExecutionEngine() {
-  // Execute the global destructors from the module being processed.
-  if (jit)
-    llvm::consumeError(jit->deinitialize(jit->getMainJITDylib()));
   // Run all dynamic library destroy callbacks to prepare for the shutdown.
   for (LibraryDestroyFn destroy : destroyFns)
     destroy();
@@ -399,9 +396,6 @@ ExecutionEngine::create(Operation *m, const ExecutionEngineOptions &options,
   };
   engine->registerSymbols(runtimeSymbolMap);
 
-  // Execute the global constructors from the module being processed.
-  cantFail(engine->jit->initialize(engine->jit->getMainJITDylib()));
-
   return std::move(engine);
 }
 

diff  --git a/mlir/test/mlir-cpu-runner/global-constructors.mlir b/mlir/test/mlir-cpu-runner/global-constructors.mlir
deleted file mode 100644
index 3ebcaeccc83e32b..000000000000000
--- a/mlir/test/mlir-cpu-runner/global-constructors.mlir
+++ /dev/null
@@ -1,32 +0,0 @@
-// RUN: mlir-cpu-runner %s -e entry -entry-point-result=void  \
-// RUN: -shared-libs=%mlir_c_runner_utils | \
-// RUN: FileCheck %s
-
-// Test that the `ctor` executes before `entry` and that `dtor` executes last.
-module {
-  llvm.func @printNewline()
-  llvm.func @printI64(i64)
-  llvm.mlir.global_ctors {ctors = [@ctor], priorities = [0 : i32]}
-  llvm.mlir.global_dtors {dtors = [@dtor], priorities = [0 : i32]}
-  llvm.func @ctor() {
-    %0 = llvm.mlir.constant(1 : i64) : i64
-    llvm.call @printI64(%0) : (i64) -> ()
-    llvm.call @printNewline() : () -> ()
-    // CHECK: 1
-    llvm.return
-  }
-  llvm.func @entry() {
-    %0 = llvm.mlir.constant(2 : i64) : i64
-    llvm.call @printI64(%0) : (i64) -> ()
-    llvm.call @printNewline() : () -> ()
-    // CHECK: 2
-    llvm.return
-  }
-  llvm.func @dtor() {
-    %0 = llvm.mlir.constant(3 : i64) : i64
-    llvm.call @printI64(%0) : (i64) -> ()
-    llvm.call @printNewline() : () -> ()
-    // CHECK: 3
-    llvm.return
-  }
-}


        


More information about the Mlir-commits mailing list