When building multiple modules should I be using multiple LLVMContext's or just one of them shared between the modules? I'm a little bit uncertain in regards to how the types work. The IR type checking appears to check exact ptrs for equality so how would multiple contexts actually work? Or is the type checking limited to within a given module? -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally sign your emails. Encrypt: I'm also happy to receive encrypted mail. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 261 bytes Desc: OpenPGP digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130131/3f05f8cf/attachment.sig>
Hi, 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. 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. 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. - Lang. On Wed, Jan 30, 2013 at 10:20 PM, edA-qa mort-ora-y <eda-qa at disemia.com>wrote:> When building multiple modules should I be using multiple LLVMContext's > or just one of them shared between the modules? > > I'm a little bit uncertain in regards to how the types work. The IR type > checking appears to check exact ptrs for equality so how would multiple > contexts actually work? Or is the type checking limited to within a > given module? > > -- > edA-qa mort-ora-y > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- > Sign: Please digitally sign your emails. > Encrypt: I'm also happy to receive encrypted mail. > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130213/34df63e9/attachment.html>
On Feb 13, 2013, at 17:26 , Lang Hames <lhames at gmail.com> wrote:> 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. > > 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. > > 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.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? What's the linking API? -- Rick