From: Lang Hames Date: Mon, 11 Jan 2021 07:30:09 +0000 (+1100) Subject: [JITLink] Rename PostAllocationPasses to PreFixupPasses. X-Git-Tag: llvmorg-13-init~1573 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b11f564dcfc867c3e7a2075e8a943014fe30780;p=platform%2Fupstream%2Fllvm.git [JITLink] Rename PostAllocationPasses to PreFixupPasses. PreFixupPasses better reflects when these passes will run. A future patch will (re)introduce a PostAllocationPasses list that will run after allocation, but before JITLinkContext::notifyResolved is called to notify the rest of the JIT about the resolved symbol addresses. --- diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h index 6de0cd5..72daf76 100644 --- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h +++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h @@ -1227,11 +1227,11 @@ struct PassConfiguration { /// /// These passes are called on the graph after memory has been allocated, /// content copied into working memory, and nodes have been assigned their - /// final addresses. + /// final addresses, but before any fixups have been applied. /// /// Notable use cases: Late link-time optimizations like GOT and stub /// elimination. - LinkGraphPassList PostAllocationPasses; + LinkGraphPassList PreFixupPasses; /// Post-fixup passes. /// diff --git a/llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp b/llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp index ea05b6c..f3a150d 100644 --- a/llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp +++ b/llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp @@ -679,7 +679,7 @@ void link_ELF_x86_64(std::unique_ptr G, }); // Add GOT/Stubs optimizer pass. - Config.PostAllocationPasses.push_back(optimizeELF_x86_64_GOTAndStubs); + Config.PreFixupPasses.push_back(optimizeELF_x86_64_GOTAndStubs); if (auto Err = Ctx->modifyPassConfig(G->getTargetTriple(), Config)) return Ctx->notifyFailed(std::move(Err)); diff --git a/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp b/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp index f29f659..d6ad364 100644 --- a/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp +++ b/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp @@ -114,7 +114,7 @@ void JITLinkerBase::linkPhase2(std::unique_ptr Self, dumpGraph(dbgs()); }); - if (auto Err = runPasses(Passes.PostAllocationPasses)) + if (auto Err = runPasses(Passes.PreFixupPasses)) return deallocateAndBailOut(std::move(Err)); LLVM_DEBUG({ diff --git a/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp b/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp index 34e0c32..e32bf84 100644 --- a/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp +++ b/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp @@ -685,7 +685,7 @@ void link_MachO_x86_64(std::unique_ptr G, }); // Add GOT/Stubs optimizer pass. - Config.PostAllocationPasses.push_back(optimizeMachO_x86_64_GOTAndStubs); + Config.PreFixupPasses.push_back(optimizeMachO_x86_64_GOTAndStubs); } if (auto Err = Ctx->modifyPassConfig(G->getTargetTriple(), Config))