Skip to content

Commit

Permalink
[ORC][unittests] Remove hard coded 16k page size (llvm#127115)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
RossComputerGuy authored Feb 13, 2025
1 parent 5ee9787 commit 415607e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
9 changes: 8 additions & 1 deletion llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 415607e

Please sign in to comment.