[Lldb-commits] [PATCH] D72624: [WIP] TargetMachine Hook for Module Metadata

Kuan Hsu Chen (Zakk) via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 13 10:12:26 PDT 2020


khchen added a comment.
Herald added a reviewer: herhut.
Herald added subscribers: frgossen, grosul1, Joonsoo.

Hi @lenary, I added a PoC patch D78035 <https://reviews.llvm.org/D78035> to complete ThinLTO based on this patch.

There is also a missed hook in `ParallelCG.cpp`

  @@ -28,6 +28,7 @@ static void codegen(Module *M, llvm::raw_pwrite_stream &OS,
                       function_ref<std::unique_ptr<TargetMachine>()> TMFactory,
                       CodeGenFileType FileType) {
     std::unique_ptr<TargetMachine> TM = TMFactory();
  +  TM->initializeOptionsWithModuleMetadata(*M);
     legacy::PassManager CodeGenPasses;
     if (TM->addPassesToEmitFile(CodeGenPasses, OS, nullptr, FileType))
       report_fatal_error("Failed to setup codegen");

I'm not sure passing Module in Target::createTargetMachine() is a good or not,
because maybe the module flag will changed in next time on JIT compilation scenario?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72624/new/

https://reviews.llvm.org/D72624





More information about the lldb-commits mailing list