[PATCH] D44967: Initialize OffsetMap in a known location
    Rafael Avila de Espindola via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Mar 27 19:11:18 PDT 2018
    
    
  
espindola added inline comments.
================
Comment at: ELF/SyntheticSections.cpp:2578-2579
     MS->finalizeContents();
+    parallelForEach(MS->Sections,
+                    [](MergeInputSection *Sec) { Sec->initOffsetMap(); });
+  }
----------------
ruiu wrote:
> Is the point of this patch to parallelize `initOffsetMap`?
> 
> How many sections do you usually have MS->Sections? I thought it's not many.
> 
> Did you try parallelizing initOffsetMap itself? We have a huge number of Pieces, so there might be a large room for parallelization.
No, I used a parallelForEach mostly because it is used when splitting the sections and was the parallelism we would get before this patch (via call_once). I benchmarked without threads.
MS->Sections will probably have about one section per file for the common case of a simple string section.
Would you be OK with parallelizing initOffsetMap as a followup?
https://reviews.llvm.org/D44967
    
    
More information about the llvm-commits
mailing list