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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 14:19:17 PST 2021


fhahn 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(
----------------
tejohnson wrote:
> 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).
Yes you are right, that wasn't right. I meant to say it preserves the semantics of the original module. I removed the comment.


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