[PATCH] D15390: [ThinLTO] Launch importing backends in parallel threads from gold plugin

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 08:10:35 PST 2016


tejohnson added inline comments.

================
Comment at: tools/gold/gold-plugin.cpp:972
@@ +971,3 @@
+
+  // We create a new CodeGen object for each thread, since each needs a
+  // separate output stream and TargetMachine.
----------------
rafael wrote:
> s/thread/task/
Fixed here and a couple other places.

================
Comment at: tools/gold/gold-plugin.cpp:1029
@@ +1028,3 @@
+  {
+    ThreadPool CodegenThreadPool(MaxThreads);
+    for (auto &BC : BCs) {
----------------
rafael wrote:
> It is nice that now we always use a ThreadPool.
> 
> It would be awesome if this could be refactored so that there was just one ThreadPool for thinlto and conventional parallel codegen.
> 
> 
The task type is different, and the iteration/handling to add tasks is different - I'm not sure how much code reuse we would get by sharing the thread pool creation and management code. The code to create the thread pool and insert into it is pretty minimal by itself. Also note that you never are using both thread pools in a single compilation.


http://reviews.llvm.org/D15390





More information about the llvm-commits mailing list