[PATCH] D95222: [LTO] Update splitCodeGen to take a reference to the module. (NFC)

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 08:48:16 PST 2021


tejohnson added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/ParallelCG.h:36
 ///
-/// \returns M if OSs.size() == 1, otherwise returns std::unique_ptr<Module>().
-std::unique_ptr<Module>
-splitCodeGen(std::unique_ptr<Module> M, ArrayRef<raw_pwrite_stream *> OSs,
-             ArrayRef<llvm::raw_pwrite_stream *> BCOSs,
-             const std::function<std::unique_ptr<TargetMachine>()> &TMFactory,
-             CodeGenFileType FileType = CGFT_ObjectFile,
-             bool PreserveLocals = false);
+/// Does not modify \p M.
+void splitCodeGen(
----------------
I don't think this comment is accurate. Looking at splitCodeGen, in the case of parallelism=1 it will call codegen() on the input Module, which will apply passes to emit the Module, which in turn will modify it. In the case of parallelism>1, it will call SplitModule, which will externalize some symbols before doing the cloning (because the default of PreserveLocals is false).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95222



More information about the llvm-commits mailing list