https://github.com/llvmbot updated https://github.com/llvm/llvm-project/pull/127144
>From a54f1aaa4b6a59047be0d26b5bbc5e63393ba90b Mon Sep 17 00:00:00 2001 From: Tristan Ross <tristan.r...@midstall.com> Date: Thu, 13 Feb 2025 14:56:55 -0800 Subject: [PATCH] [ORC][unittests] Remove hard coded 16k page size (#127115) Fixes a couple hard coded 16k values which is being used as the page size. Replaces the hard coded value with the system's page size. This fixes #116753 on an Ampere Altra Q64-22 CC @lhames (cherry picked from commit 415607e10b56d0e6c4661ff1ec5b9b46bf433cba) --- .../Orc/JITLinkRedirectionManagerTest.cpp | 10 ++++++++-- .../ExecutionEngine/Orc/ReOptimizeLayerTest.cpp | 9 ++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/llvm/unittests/ExecutionEngine/Orc/JITLinkRedirectionManagerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/JITLinkRedirectionManagerTest.cpp index 4b8a3efe680f1..a57241b8a3da6 100644 --- a/llvm/unittests/ExecutionEngine/Orc/JITLinkRedirectionManagerTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/JITLinkRedirectionManagerTest.cpp @@ -48,12 +48,18 @@ class JITLinkRedirectionManagerTest : public testing::Test { if (Triple.isPPC()) GTEST_SKIP(); + auto PageSize = sys::Process::getPageSize(); + if (!PageSize) { + consumeError(PageSize.takeError()); + GTEST_SKIP(); + } + ES = std::make_unique<ExecutionSession>( std::make_unique<UnsupportedExecutorProcessControl>( - nullptr, nullptr, JTMB->getTargetTriple().getTriple())); + nullptr, nullptr, JTMB->getTargetTriple().getTriple(), *PageSize)); JD = &ES->createBareJITDylib("main"); ObjLinkingLayer = std::make_unique<ObjectLinkingLayer>( - *ES, std::make_unique<InProcessMemoryManager>(16384)); + *ES, std::make_unique<InProcessMemoryManager>(*PageSize)); DL = std::make_unique<DataLayout>(std::move(*DLOrErr)); } JITDylib *JD{nullptr}; diff --git a/llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp index 083a924ce9aa1..991b12def55fa 100644 --- a/llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp @@ -66,10 +66,17 @@ class ReOptimizeLayerTest : public testing::Test { consumeError(DLOrErr.takeError()); GTEST_SKIP(); } + + auto PageSize = sys::Process::getPageSize(); + if (!PageSize) { + consumeError(PageSize.takeError()); + GTEST_SKIP(); + } + ES = std::make_unique<ExecutionSession>(std::move(*EPC)); JD = &ES->createBareJITDylib("main"); ObjLinkingLayer = std::make_unique<ObjectLinkingLayer>( - *ES, std::make_unique<InProcessMemoryManager>(16384)); + *ES, std::make_unique<InProcessMemoryManager>(*PageSize)); DL = std::make_unique<DataLayout>(std::move(*DLOrErr)); auto TM = JTMB->createTargetMachine(); _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits