[JITLink] Rename PostAllocationPasses to PreFixupPasses.
authorLang Hames <lhames@gmail.com>
Mon, 11 Jan 2021 07:30:09 +0000 (18:30 +1100)
committerLang Hames <lhames@gmail.com>
Mon, 11 Jan 2021 07:33:50 +0000 (18:33 +1100)
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.

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

index 6de0cd5..72daf76 100644 (file)
@@ -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.
   ///
index ea05b6c..f3a150d 100644 (file)
@@ -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));
index f29f659..d6ad364 100644 (file)
@@ -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({
index 34e0c32..e32bf84 100644 (file)
@@ -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))