[llvm-branch-commits] [llvm] 7b11f56 - [JITLink] Rename PostAllocationPasses to PreFixupPasses.

Lang Hames via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Jan 10 23:39:28 PST 2021


Author: Lang Hames
Date: 2021-01-11T18:33:50+11:00
New Revision: 7b11f564dcfc867c3e7a2075e8a943014fe30780

URL: https://github.com/llvm/llvm-project/commit/7b11f564dcfc867c3e7a2075e8a943014fe30780
DIFF: https://github.com/llvm/llvm-project/commit/7b11f564dcfc867c3e7a2075e8a943014fe30780.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
    llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
    llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp
    llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
index 6de0cd589aad..72daf76b501a 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 ea05b6c7e638..f3a150d23737 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<LinkGraph> 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 f29f6592e6ff..d6ad364add12 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<JITLinkerBase> 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 34e0c3250495..e32bf847014b 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<LinkGraph> 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))


        


More information about the llvm-branch-commits mailing list