[Mlir-commits] [mlir] 6e7a449 - [MLIR] Enable dylib init/deinit in execution engine on AArch64 platform (#172833)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Dec 18 16:55:25 PST 2025
Author: Giacomo Castiglioni
Date: 2025-12-19T01:55:21+01:00
New Revision: 6e7a44986d833a2486890bc127d3a3882e7d003a
URL: https://github.com/llvm/llvm-project/commit/6e7a44986d833a2486890bc127d3a3882e7d003a
DIFF: https://github.com/llvm/llvm-project/commit/6e7a44986d833a2486890bc127d3a3882e7d003a.diff
LOG: [MLIR] Enable dylib init/deinit in execution engine on AArch64 platform (#172833)
This PR enables JIT initialize for AArch64. Up to now it was disabled
because of #71963 which was recently fixed by #71968.
Added:
Modified:
mlir/lib/ExecutionEngine/ExecutionEngine.cpp
Removed:
################################################################################
diff --git a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
index 287c52a262c11..9b16e09124aa3 100644
--- a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -218,9 +218,7 @@ ExecutionEngine::ExecutionEngine(bool enableObjectDump,
ExecutionEngine::~ExecutionEngine() {
// Execute the global destructors from the module being processed.
- // TODO: Allow JIT deinitialize for AArch64. Currently there's a bug causing a
- // crash for AArch64 see related issue #71963.
- if (jit && !jit->getTargetTriple().isAArch64())
+ if (jit)
llvm::consumeError(jit->deinitialize(jit->getMainJITDylib()));
// Run all dynamic library destroy callbacks to prepare for the shutdown.
for (LibraryDestroyFn destroy : destroyFns)
@@ -314,10 +312,14 @@ ExecutionEngine::create(Operation *m, const ExecutionEngineOptions &options,
// Callback to create the object layer with symbol resolution to current
// process and dynamically linked libraries.
auto objectLinkingLayerCreator = [&](ExecutionSession &session) {
+ // Needed to respect AArch64 ABI requirements on the distance between
+ // TEXT and GOT sections.
+ bool reserveAlloc = llvmModule->getTargetTriple().isAArch64();
auto objectLayer = std::make_unique<RTDyldObjectLinkingLayer>(
- session, [sectionMemoryMapper =
- options.sectionMemoryMapper](const MemoryBuffer &) {
- return std::make_unique<SectionMemoryManager>(sectionMemoryMapper);
+ session, [sectionMemoryMapper = options.sectionMemoryMapper,
+ reserveAlloc](const MemoryBuffer &) {
+ return std::make_unique<SectionMemoryManager>(sectionMemoryMapper,
+ reserveAlloc);
});
// Register JIT event listeners if they are enabled.
@@ -449,9 +451,6 @@ Error ExecutionEngine::invokePacked(StringRef name,
void ExecutionEngine::initialize() {
if (isInitialized)
return;
- // TODO: Allow JIT initialize for AArch64. Currently there's a bug causing a
- // crash for AArch64 see related issue #71963.
- if (!jit->getTargetTriple().isAArch64())
- cantFail(jit->initialize(jit->getMainJITDylib()));
+ cantFail(jit->initialize(jit->getMainJITDylib()));
isInitialized = true;
}
More information about the Mlir-commits
mailing list