Skip to content

Commit 2b4c50e

Browse files
RossComputerGuyjoaosaffran
authored and
joaosaffran
committed
[ORC][unittests] Remove hard coded 16k page size (llvm#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 llvm#116753 on an Ampere Altra Q64-22 CC @lhames
1 parent cd68219 commit 2b4c50e

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

llvm/unittests/ExecutionEngine/Orc/JITLinkRedirectionManagerTest.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,18 @@ class JITLinkRedirectionManagerTest : public testing::Test {
4848
if (Triple.isPPC())
4949
GTEST_SKIP();
5050

51+
auto PageSize = sys::Process::getPageSize();
52+
if (!PageSize) {
53+
consumeError(PageSize.takeError());
54+
GTEST_SKIP();
55+
}
56+
5157
ES = std::make_unique<ExecutionSession>(
5258
std::make_unique<UnsupportedExecutorProcessControl>(
53-
nullptr, nullptr, JTMB->getTargetTriple().getTriple()));
59+
nullptr, nullptr, JTMB->getTargetTriple().getTriple(), *PageSize));
5460
JD = &ES->createBareJITDylib("main");
5561
ObjLinkingLayer = std::make_unique<ObjectLinkingLayer>(
56-
*ES, std::make_unique<InProcessMemoryManager>(16384));
62+
*ES, std::make_unique<InProcessMemoryManager>(*PageSize));
5763
DL = std::make_unique<DataLayout>(std::move(*DLOrErr));
5864
}
5965
JITDylib *JD{nullptr};

llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,17 @@ class ReOptimizeLayerTest : public testing::Test {
6666
consumeError(DLOrErr.takeError());
6767
GTEST_SKIP();
6868
}
69+
70+
auto PageSize = sys::Process::getPageSize();
71+
if (!PageSize) {
72+
consumeError(PageSize.takeError());
73+
GTEST_SKIP();
74+
}
75+
6976
ES = std::make_unique<ExecutionSession>(std::move(*EPC));
7077
JD = &ES->createBareJITDylib("main");
7178
ObjLinkingLayer = std::make_unique<ObjectLinkingLayer>(
72-
*ES, std::make_unique<InProcessMemoryManager>(16384));
79+
*ES, std::make_unique<InProcessMemoryManager>(*PageSize));
7380
DL = std::make_unique<DataLayout>(std::move(*DLOrErr));
7481

7582
auto TM = JTMB->createTargetMachine();

0 commit comments

Comments
 (0)