search for: linkmodules

Displaying 20 results from an estimated 146 matches for "linkmodules".

2010 Jun 18
0
[LLVMdev] having troubles mixing ExecutionEngine::runStaticConstructorsDestructors() and Linker::LinkModules()
The use case is to create a module A, JIT from it, then extend the module with new code (create a new module B and use Linker::LinkModules() to merge into A, and be able to JIT the new symbols). This appears to work ok, except that static constructors are giving me a headache. Generally, I start like this: Create module A (e.g. via Clang, LLVM API etc.) EE->addModule(A); EE->runStaticConstructorsDestructors(A, false); EE->...
2015 Jun 01
2
[LLVMdev] Linking modules across contexts crashes
...m Rafael's work on tools/gold-plugin/gold-plugin.cpp. It might be easier to look at there. > On Fri, May 29, 2015 at 5:18 PM, Yuri <yuri at rawbw.com> wrote: > I get a crash when I try to link multiple modules registered in their individual contexts. > Documentation for Linker::LinkModules doesn't mention anything about contexts, and the first link succeeds. But the second link crashes. The problem is that a fair number of things referenced by a Module are owned by its LLVMContext (types, constants, metadata, and some other things). > Is this not the right way to merge such...
2015 May 30
2
[LLVMdev] Linking modules across contexts crashes
I get a crash when I try to link multiple modules registered in their individual contexts. Documentation for Linker::LinkModules doesn't mention anything about contexts, and the first link succeeds. But the second link crashes. Is this not the right way to merge such modules? If not, then what is the right way? In any case, documentation for Linker::LinkModules should say if contexts are or aren't expected to be...
2013 Dec 17
3
[LLVMdev] How to do bitcode archive linking correctly?
...first attempt at linking in a bitcode archive ourselves can be seen in [1]. This approach does not work correctly, it's incredibly slow and I'm not convinced it will resolve all undefined or weak symbols like linking with an archive normally should. This leads me to ask * How does Linker::LinkModules() [2] behave? Does it just blindly concatenate modules ( that might explain the slow down ) or does it actually check the symbol tables of the modules and only link in `Src` if `Dest` has unresolved or weak symbols that `Src` can provide? * If Linker::LinkModules() does decide to merge `Src` into...
2015 Jun 02
2
[LLVMdev] Linking modules across contexts crashes
...ol linkModuleFromDifferentContext(Module &D, const Module &S) { >> SmallVector<char, 256> Buffer; >> writeBitcodeToBuffer(S, Buffer); >> >> std::unique_ptr<Module> M = readBitcodeFromBuffer(D.getContext()); >> return Linker::LinkModules(&D, M.get()); >> } > > Duncan, > > Thanks for this workaround, i works. However, going to binary and back causes the significant bump in the process user time (14s->16s), while the wall clock time still lower due to parallelization. > > There should be the func...
2013 Dec 17
0
[LLVMdev] How to do bitcode archive linking correctly?
...bitcode archive ourselves can be seen in [1]. > > This approach does not work correctly, it's incredibly slow and I'm > not convinced it will resolve all undefined or weak symbols like > linking with an archive normally should. This leads me to ask > > * How does Linker::LinkModules() [2] behave? Does it just blindly > concatenate modules ( that might explain the slow down ) or does it > actually check the symbol tables of the modules and only link in `Src` > if `Dest` has unresolved or weak symbols that `Src` can provide? > > * If Linker::LinkModules() does d...
2012 Feb 19
1
[LLVMdev] LinkModules triple/datatype mismatch warnings a bit strict?
Hi, I'm fairly new at poking around in llvm internals so if you find misconceptions / problems with the below let me know, this is just how I've understood this so far. When doing a build which uses functionality from LinkModules to combine bitcode from different versions of LLVM, or between LLVM-GCC (I know) and Clang, I've noticed that multiple warnings which sometimes seem extraneous are generated because a direct string comparison is used to determine whether to warn. The warnings are generated in llvm::ModuleLink...
2016 Apr 20
2
Lazily Loaded Modules and Linker::LinkOnlyNeeded
...9000 functions), and link some user module into this (which is in all practical use cases much smaller). Then, post linking, we have a pass that runs over the module and rips out all the un-materialized functions that weren't being used in the original user module. I only just noticed that LinkModules has a flags parameter that can take a LinkOnlyNeeded flag, which made me wonder if I could reverse the link order (EG. link from the lazily loaded runtime module into the user module), set the LinkOnlyNeeded flag, and hey presto, we wouldn't need to have a cleanup pass that ran afterwards r...
2012 Jun 02
2
[LLVMdev] dynamic linkage for jit
...I want to execute functions in a module, this module will have dependencies resolved in other modules. the modules might change (dynamic compilation environment) so i would prefer not not link all the dependencies in a single monolithic module, that is, if it can be avoided I hope to use Linker::linkModules but this is always destructive. That is ok for one module depending on a single one, since if that one changed, is no big deal, but isn't it overkill to rebuild and relink N-1 modules that did not change just because of a single one that changed? I wonder if there is a non-destructive version...
2011 Sep 08
1
[LLVMdev] Merging Modules
...I can merge one > Module into another?**** > ** ** > I have a list of Modules each containing one Function. I would like to > combine them all into one monolithic Module before transforming and > optimizing (The original Modules must remain unmodified)**** > > > See Linker::LinkModules(..). > Mm, I think LinkModules is destructive to one of its input modules. Try CloneFunction http://llvm.org/doxygen/namespacellvm.html#aabb040f50a7e75ad8d58bfc5d95636a4 maybe? > - > Devang > > > _______________________________________________ > LLVM Developers mailing list...
2013 Mar 29
1
[LLVMdev] How to use the llvm::Linker?
...} }; } char Hello2::ID = 0; static RegisterPass<Hello2> Y1("hello2", "Hello World Pass (with getAnalysisUsage implemented)"); But ,when i run the pass with opt, there will be a Error: ./bin/opt: symbol lookup error: ./lib/Hello.so: undefined symbol: _ZN4llvm6Linker11LinkModulesEPNS_6ModuleES2_jPSs by the c++filt, the function name is : llvm::Linker::LinkModules(llvm::Module*, llvm::Module*, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*) So I think, may I should Modify the cmake, I want to know how to modify the fi...
2012 Jun 07
0
[LLVMdev] dynamic linkage for jit
...I want to execute functions in a module, this module will have dependencies resolved in other modules. the modules might change (dynamic compilation environment) so i would prefer not not link all the dependencies in a single monolithic module, that is, if it can be avoided I hope to use Linker::linkModules but this is always destructive. That is ok for one module depending on a single one, since if that one changed, is no big deal, but isn't it overkill to rebuild and relink N-1 modules that did not change just because of a single one that changed? I wonder if there is a non-destructive version...
2012 Jul 11
2
[LLVMdev] dynamic linkage for jit
...tions in a module, this module will have dependencies > resolved in other modules. the modules might change (dynamic compilation > environment) so i would prefer not not link all the dependencies in a single > monolithic module, that is, if it can be avoided > > I hope to use Linker::linkModules but this is always destructive. That is ok for > one module depending on a single one, since if that one changed, is no big deal, > but isn't it overkill to rebuild and relink N-1 modules that did not change just > because of a single one that changed? > > I wonder if there is a...
2010 Mar 01
0
[LLVMdev] 2nd attempt for a working patch for bug 2606
...b 26, 2010, at 21:17, Jeffrey Yasskin wrote: > > You currently have nearly the same loop in getOrEmitGlobalVariable() > and getPointerToFunction(). Can you unify those, perhaps by making > them searches for GlobalValues with getNamedValue()? > > GetLinkageResult() in lib/Linker/LinkModules.cpp has a lot of logic > about choosing a function based on its linkage. You should read that > to figure out how to filter GVs with various linkages in your search. When I'm able to write a unit test, I'll re-submit a patch which will contain a JIT function to handle GlobalValues (b...
2016 Apr 20
2
Lazily Loaded Modules and Linker::LinkOnlyNeeded
...rse to what I would intuitively do (i.e. load the runtime > into my module). > > Then, post linking, we have a pass that runs over the module and rips out > all the un-materialized functions that weren't being used in the original > user module. > > I only just noticed that LinkModules has a flags parameter that can take a > LinkOnlyNeeded flag, which made me wonder if I could reverse the link order > (EG. link from the lazily loaded runtime module into the user module), set > the LinkOnlyNeeded flag, and hey presto, we wouldn't need to have a cleanup > pass that...
2010 Feb 27
2
[LLVMdev] 2nd attempt for a working patch for bug 2606
...You're right, getLazyFunctionStub is the badly-named function you want. You currently have nearly the same loop in getOrEmitGlobalVariable() and getPointerToFunction(). Can you unify those, perhaps by making them searches for GlobalValues with getNamedValue()? GetLinkageResult() in lib/Linker/LinkModules.cpp has a lot of logic about choosing a function based on its linkage. You should read that to figure out how to filter GVs with various linkages in your search. Please add some tests for cross-module JITting. You'll find some of the functions defined in unittests/ExecutionEngine/JIT/JITTest.c...
2011 Sep 08
2
[LLVMdev] Merging Modules
Hi, Can anyone point me to some code (or offer advice) on how I can merge one Module into another? I have a list of Modules each containing one Function. I would like to combine them all into one monolithic Module before transforming and optimizing (The original Modules must remain unmodified) Thanks, paul -------------- next part -------------- An HTML attachment was scrubbed... URL:
2011 Sep 08
0
[LLVMdev] Merging Modules
...some code (or offer advice) on how I can merge one Module into another? > > I have a list of Modules each containing one Function. I would like to combine them all into one monolithic Module before transforming and optimizing (The original Modules must remain unmodified) > See Linker::LinkModules(..). - Devang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110908/ce4fe35f/attachment.html>
2010 Feb 26
2
[LLVMdev] VIM mode line comments
...ments inside of LLVM source files? I would like to do this inside of the MicroBlaze backend to ensure that tabs are expanded into exactly two spaces. I see that right now the following files have these vim mode line comments: include/llvm/ADT/SetVector.h lib/Archive/ArchiveInternals.h lib/Linker/LinkModules.cpp lib/Transforms/IPO/DeadTypeElimination.cpp lib/VMCore/Function.cpp Since this does not seem to be a wide spread practice I thought I would ask before I made the changes. -- Wesley Peck University of Kansas SLDG Laboratory
2013 Jun 27
2
[LLVMdev] Problem with linking modules which use a shared type
...: ret void } ===================== ; ModuleID = 'm2' %T = type { i32 } declare void @f(%T) define void @h(%T) { b: call void @f(%T %0) ret void } However, if both modules are linked together as per // link Linker::LinkModules( m1, m2, Linker::DestroySource, nullptr ); verifyModule(*m1); the type %T in both modules will not be unified, but instead two separate types %T and %0 will be introduced, leading to the following IR code, which of course won't pass the verification any more due to type incompatibilities...