From d456f587588cc1948c3a38ed7ffa5af6bcfbcd76 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Wed, 15 Oct 2025 15:56:28 +1100 Subject: [PATCH] [ORC] Use MapperJITLinkMemoryManager for ReOptimizeLayerTest. This is an attempted fix for https://github.com/llvm/llvm-project/issues/158270. The issue described sounds like it may be caused by non-contiguous regions returned for separate allocations by the default memory manager. Using MapperJITLinkMemoryMnaager with a 10Mb slab size should fix the issue. --- llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp index cd10ffe53d0f0..f35a3783394c9 100644 --- a/llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp @@ -9,6 +9,7 @@ #include "llvm/ExecutionEngine/Orc/IRTransformLayer.h" #include "llvm/ExecutionEngine/Orc/JITLinkRedirectableSymbolManager.h" #include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h" +#include "llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h" #include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h" #include "llvm/ExecutionEngine/Orc/ObjectTransformLayer.h" #include "llvm/ExecutionEngine/Orc/SelfExecutorProcessControl.h" @@ -84,8 +85,11 @@ class ReOptimizeLayerTest : public testing::Test { ES = std::make_unique(std::move(*EPC)); JD = &ES->createBareJITDylib("main"); + ObjLinkingLayer = std::make_unique( - *ES, std::make_unique(*PageSize)); + *ES, std::make_unique( + 10 * 1024 * 1024, + std::make_unique(*PageSize))); DL = std::make_unique(std::move(*DLOrErr)); auto TM = JTMB->createTargetMachine();