[LLVMdev] Can WriteBitcodeToFile be parallelized?

Nick Lewycky nlewycky at google.com
Mon Mar 31 15:29:48 PDT 2014


On 31 March 2014 12:35, Yuri <yuri at rawbw.com> wrote:

> This function (understandably) takes quite a long time, because it has to
> go through each function in module and write its binary.
> But it probably can be parallelized if different threads would write
> binaries separately, and then merge them together.
>
> Is this implemented or planned?


I've never heard this proposed before. Are you interested in working on it?

Note that we require the output to be deterministic, so what exactly would
you be doing? Performing the write out to a memory buffer for each
function, then another thread which passes through these memory buffers
sequentially and issues the actual I/O calls?

I don't think there's currently even primitives in LLVM to do thread
management yet, but now that we've moved to C++11, <thread> may be unlocked?

I'm hopeful the same technique could end up being used for multi-threaded
per-function .s and .o emission.

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140331/f9f37aba/attachment.html>


More information about the llvm-dev mailing list