<div dir="ltr">Hi Rick,<div><br></div><div style>Yes - the usual scheme for compiling modules in parallel is to have one LLVMContext and one Module per thread.</div><div><br></div><div style>Can you clarify what you mean by sharing one module across "them all"? If you mean "Can multiple threads hack on a single Module?", then the answer is definitely no. A Module can only be associated with one LLVMContext, and you must have a different LLVMContext for each thread.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">The linker API docs can be found at <a href="http://llvm.org/doxygen/classllvm_1_1Linker.html">http://llvm.org/doxygen/classllvm_1_1Linker.html</a> . I think the best way to understand their use is just to read the llvm-link.cpp source file.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Regards,</div><div class="gmail_extra">Lang.<br><br><div class="gmail_quote">On Wed, Feb 13, 2013 at 5:36 PM, Rick Mann <span dir="ltr"><<a href="mailto:rmann@latencyzero.com" target="_blank">rmann@latencyzero.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im"><br>
On Feb 13, 2013, at 17:26 , Lang Hames <<a href="mailto:lhames@gmail.com">lhames@gmail.com</a>> wrote:<br>
<br>
> LLVMContext was designed to support multithreading by holding the compilation context for each thread in a separate LLVMContext. If you're building modules in parallel you definitely need one LLVMContext per thread.<br>
><br>
> If you're talking about compiling multiple modules sequentially with a single context I believe that should work, though I don't know how well tested it is. I think our tools usually create an LLVMContext for each Module to be compiled.<br>
><br>
> The llvm-link tool links multiple modules that share an LLVMContext (see tools/llvm-link/llvm-link.cpp), so that use case has at least been tested.<br>
<br>
</div>So, are you supposed to have one module and one context per thread when building modules in parallel? Or can you share one module across them all?<br>
<br>
What's the linking API?<br>
<span class=""><font color="#888888"><br>
--<br>
Rick<br>
<br>
<br>
<br>
</font></span></blockquote></div><br></div></div>