Author: Lang Hames Date: 2022-03-02T12:59:20-08:00 New Revision: 4fde843cd5c08c16f15d11308bdefc7bd2af0302
URL: https://github.com/llvm/llvm-project/commit/4fde843cd5c08c16f15d11308bdefc7bd2af0302 DIFF: https://github.com/llvm/llvm-project/commit/4fde843cd5c08c16f15d11308bdefc7bd2af0302.diff LOG: [ORC] Set ResolverBlockAddr in EPCIndirectionUtils::writeResolverBlock. Without this, EPCIndirectionUtils::getResolverBlockAddr (and lazy compilation via EPC) won't work. No test case: lli is still using LocalLazyCallThroughManager. I'll revisit this soon when I look at adding lazy compilation support to the ORC runtime. (cherry picked from commit 34e539dcd78ab828210ecf7f7d2e9d2c986511b3) Added: Modified: llvm/include/llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h llvm/lib/ExecutionEngine/Orc/EPCIndirectionUtils.cpp Removed: ################################################################################ diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h index 92de5882bafe4..354984b540a9f 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h @@ -148,7 +148,7 @@ class EPCIndirectionUtils { std::mutex EPCUIMutex; ExecutorProcessControl &EPC; std::unique_ptr<ABISupport> ABI; - JITTargetAddress ResolverBlockAddr; + JITTargetAddress ResolverBlockAddr = 0; FinalizedAlloc ResolverBlock; std::unique_ptr<TrampolinePool> TP; std::unique_ptr<LazyCallThroughManager> LCTM; diff --git a/llvm/lib/ExecutionEngine/Orc/EPCIndirectionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/EPCIndirectionUtils.cpp index b901a2d2da236..249f02f36bae4 100644 --- a/llvm/lib/ExecutionEngine/Orc/EPCIndirectionUtils.cpp +++ b/llvm/lib/ExecutionEngine/Orc/EPCIndirectionUtils.cpp @@ -302,7 +302,8 @@ EPCIndirectionUtils::writeResolverBlock(JITTargetAddress ReentryFnAddr, return Alloc.takeError(); auto SegInfo = Alloc->getSegInfo(MemProt::Read | MemProt::Exec); - ABI->writeResolverCode(SegInfo.WorkingMem.data(), SegInfo.Addr.getValue(), + ResolverBlockAddr = SegInfo.Addr.getValue(); + ABI->writeResolverCode(SegInfo.WorkingMem.data(), ResolverBlockAddr, ReentryFnAddr, ReentryCtxAddr); auto FA = Alloc->finalize(); @@ -310,7 +311,7 @@ EPCIndirectionUtils::writeResolverBlock(JITTargetAddress ReentryFnAddr, return FA.takeError(); ResolverBlock = std::move(*FA); - return SegInfo.Addr.getValue(); + return ResolverBlockAddr; } std::unique_ptr<IndirectStubsManager> _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
