[PATCH] D19139: [LTO] SplitCodeGen new API

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 14 17:03:40 PDT 2016


joker.eph accepted this revision.
joker.eph added a reviewer: joker.eph.
joker.eph added a comment.
This revision is now accepted and ready to land.

LGTM, with a few more fixes (see inline)


================
Comment at: include/llvm/CodeGen/ParallelCG.h:49
@@ +48,3 @@
+/// TMFactory. See the other splitCodeGen() for a more detailed description.
+///
+/// \returns M if OSs.size() == 1, otherwise returns std::unique_ptr<Module>().
----------------
Add in the documentation the fact that `TMFactory` needs to be thread safe on the client side.

================
Comment at: lib/CodeGen/ParallelCG.cpp:30
@@ +29,3 @@
+codegen(Module *M, llvm::raw_pwrite_stream &OS,
+        std::function<std::unique_ptr<TargetMachine>()> TMFactory,
+        TargetMachine::CodeGenFileType FileType) {
----------------
still missing `const &` here.

================
Comment at: lib/CodeGen/ParallelCG.cpp:99
@@ -90,4 +98,3 @@
           CodegenThreadPool.async(
-              [TheTarget, CPU, Features, Options, RM, CM, OL, FileType,
-               ThreadOS](const SmallVector<char, 0> &BC) {
+              [TMFactory, FileType, ThreadOS](const SmallVector<char, 0> &BC) {
                 LLVMContext Ctx;
----------------
`&TMFactory` (avoid copy here).


http://reviews.llvm.org/D19139





More information about the llvm-commits mailing list