[LLVMdev] Thread-safe cloning

Reid Kleckner rnk at google.com
Tue Jun 18 10:29:03 PDT 2013


You could probably round trip it through bitcode in memory.  I think all of
the IR cloning functionality assumes that only one context is being used.
 Even if the serialization isn't efficient as a clone could be, it should
give you very high confidence that everything Just Works.  :)


On Tue, Jun 18, 2013 at 1:16 PM, Andrew Clinton <andrew at sidefx.com> wrote:

> I have a Module/LLVMContext that I'd like to clone and manipulate in
> different threads (each thread may perform different translation /
> optimization, so they need unique copies).  Currently this process has to
> be locked, since each clone of the Module still refers to the same
> LLVMContext.  Is there a way to clone both the Module and LLVMContext so
> that the copies can be manipulated independently in different threads?
>
> Andrew
> ______________________________**_________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130618/3bc15501/attachment.html>


More information about the llvm-dev mailing list