search for: addglobalmap

Displaying 20 results from an estimated 160 matches for "addglobalmap".

2016 Sep 19
3
llvm interpreter does not find function defined by addGlobalMapping
Hi, I want to use a function defined in c(++)-code from code generated by llvm. For this I use ExecutionEngine.addGlobalMapping(). I started with the JIT execution engine and everything worked, then I switched to the interpreter engine and it stopped working, but only if compiled on a Linux system. More precisely it works if I use llvm 3.8.1 + gcc (Linux) + JIT llvm 3.8.0 + mingw-gcc (Windows) + JIT llvm 3....
2015 Aug 13
4
Linking existing functions from JITed code
Hi I’ve previously used the ExecutionEngine::addGlobalMapping to make existing functions available to my JITed code. I’m currently using ORC, as MCJIT does not appear to be maintained any longer (the kaleidoscope examples have not worked for some time with MCJIT). I’m using just the basic ORC CompileLayer directly. So, I’ve essentially copied the Execu...
2007 Jun 11
3
[LLVMdev] How to call native functions from bytecode run in JIT?
...say for sure what goes > wrong here. The LLVM PPC JIT certainly does produce these stubs. The PPCJITInfo::emitFunctionStub method is the one that actually creates them :) Jan, how are you doing this? Are you creating an external LLVM Function object named "get5", then using EE::addGlobalMapping? If 'get5' exists in the address space, why not just let the JIT resolve it (which will then create the stub)? -Chris -- http://nondot.org/sabre/ http://llvm.org/
2007 Jun 12
0
[LLVMdev] How to call native functions from bytecode run in JIT?
Hi, > Jan, how are you doing this? Are you creating an external LLVM > Function > object named "get5", then using EE::addGlobalMapping? If 'get5' > exists in > the address space, why not just let the JIT resolve it (which will > then > create the stub)? Yes. I create a Function with matching signature, calling conventions and external linkage which I pass together with the function's address t...
2015 Aug 13
2
Linking existing functions from JITed code
...; > (Lang developed the ORC JIT you seem to be using & can provide more > context than I have) > > On Thu, Aug 13, 2015 at 12:43 PM, Andy Somogyi via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Hi >> >> I’ve previously used the ExecutionEngine::addGlobalMapping to make >> existing functions available to my JITed code. >> >> I’m currently using ORC, as MCJIT does not appear to be maintained any >> longer (the kaleidoscope examples have not worked for some time with >> MCJIT). >> >> I’m using just the basic ORC...
2015 Aug 20
2
Linking existing functions from JITed code
...braryPermanently(nullptr); > > to add the currently running process before calling > > llvm::RTDyldMemoryManager::getSymbolAddressInProcess(name);. > > Also, all of the function needs to be declared as extern C to avoid name > mangling. > > I however think that adding the addGlobalMapping/getPointerToGlobalMapping > functions to the ORC kaleidoscope examples is very useful, as for example > one wants a set of private symbols made available to JITed code. > > > > On Aug 13, 2015, at 7:41 PM, Lang Hames <lhames at gmail.com> wrote: > > Hi Andy, > &...
2013 Nov 01
2
[LLVMdev] [Proposal] Adding callback mechanism to Execution Engines
...ew > > *Subject:* Re: [LLVMdev] [Proposal] Adding callback mechanism to > Execution Engines**** > > ** ** > > > If the function is in a statically linked module, you need to do > something to explicitly expose it. With **** > > > the older JIT engine you can use addGlobalMapping as Yaron suggests, > but I don’t think that will work**** > > > with MCJIT.**** > > ** ** > > Seems to work fine for us with MCJIT.**** > > ** ** > > - Chuck**** > > ** ** > -------------- next part -------------- An HTML attachment was scrubbed... U...
2015 Aug 20
2
Linking existing functions from JITed code
...t; >> to add the currently running process before calling >> >> llvm::RTDyldMemoryManager::getSymbolAddressInProcess(name);. >> >> Also, all of the function needs to be declared as extern C to avoid name mangling. >> >> I however think that adding the addGlobalMapping/getPointerToGlobalMapping functions to the ORC kaleidoscope examples is very useful, as for example one wants a set of private symbols made available to JITed code. >> >> >> >>> On Aug 13, 2015, at 7:41 PM, Lang Hames <lhames at gmail.com> wrote: >>&g...
2013 Nov 01
0
[LLVMdev] [Proposal] Adding callback mechanism to Execution Engines
Unless I'm missing something, indeed addGlobalMapping should not work with MCJIT. MCJIT does not consult EEState.getGlobalAddressMap when resolving symbols. Instead it uses RTDyldMemoryManager::getSymbolAddress which checks with DynamicLibrary::SearchForAddressOfSymbol, so Andy's suggestion of DynamicLibrary::addSymbol is better as it should w...
2006 Nov 28
2
[LLVMdev] question about the LLVM JIT
...lvm. > The C++ code for add_global_mapping(...) looks like this > > --- C++ code... > void add_global_mapping(const char* name, void* address) { > GlobalVariable var(Type::IntTy, false, GlobalVariable::ExternalLinkage, > 0, name, gp_module); > gp_execution_engine->addGlobalMapping(&var, address); > } This is creating a new global variable on the stack, instead of finding the existing global variable in the module. Try something like this: gp_execution_engine->addGlobalMapping(YourModule->getNamedGlobal(name), address); > The 2nd que...
2012 Nov 07
2
[LLVMdev] Using LLVM to serialize object state -- and performance
On Nov 6, 2012, at 11:49 AM, "Kaylor, Andrew" <andrew.kaylor at intel.com> wrote: > I think you may have gone beyond what I understand in how the legacy JIT code works. It looks like the call to addGlobalMapping should short-circuit the named function look up that I described ... Well, I first look for the function by name and, if I didn't find it, then I call addGlobalMapping(). But that's not where the time is going. Here: https://dl.dropbox.com/u/46791180/callgraph.pdf is a call graph...
2008 Aug 19
7
[LLVMdev] Please help with LLVM C++ integration
...te(MP, false); std::vector<const Type *> func_args; func_args.push_back(Type::Int32Ty); FunctionType * func_type = FunctionType::get(Type::Int32Ty, func_args, false); Function * my_function = Function::Create( func_type, Function::ExternalLinkage, "some_test_func", M ); EE->addGlobalMapping( my_function, (void*)&some_test_func ); Function *FooF = cast<Function>(M->getOrInsertFunction("foo", Type::Int32Ty, (Type *)0)); BasicBlock * BB = BasicBlock::Create("EntryBlock", FooF); Value *Ten = ConstantInt::get(Type::Int32Ty, 10); CallInst *Add1CallR...
2010 Jan 10
2
[LLVMdev] Using a function from another module
...solved! >> >> I'm guessing I'm either going about this wrong or missing something.  Can >> anyone offer me some insight? > > I've played around with this some more. > > It looks like the only way that I can get this to work is to do an > ExecutionEngine::addGlobalMapping() on the function declaration in moduleA to > map it to the function pointer in moduleB. > > This seems awkward, is there a better way to do this? > I'm doing the same thing, and had to do it in the same way. Just because the JIT loads two modules doesn't mean that they...
2010 Jan 10
3
[LLVMdev] Using a function from another module
...> Garrison Nope. You cannot place a call instruction into one module whose callee is a Function from another module. You have to put a declaration into the same module, and have your call instruction call that. And then they need to be linked together, either by llvm-link or (if JITting) by addGlobalMapping.
2012 Nov 06
1
[LLVMdev] Using LLVM to serialize object state -- and performance
On Nov 6, 2012, at 11:49 AM, "Kaylor, Andrew" <andrew.kaylor at intel.com> wrote: > I think you may have gone beyond what I understand in how the legacy JIT code works. It looks like the call to addGlobalMapping should short-circuit the named function look up that I described ... Well, I first look for the function by name and, if I didn't find it, then I call addGlobalMapping() > Are you writing LLVM IR to disk or machine code? Currently IR. How can I write machine code? - Paul
2007 Jun 12
3
[LLVMdev] How to call native functions from bytecode run in JIT?
On Tue, 12 Jun 2007, Jan Rehders wrote: >> Jan, how are you doing this? Are you creating an external LLVM >> Function object named "get5", then using EE::addGlobalMapping? If >> 'get5' exists in the address space, why not just let the JIT resolve it >> (which will then create the stub)? > > Yes. I create a Function with matching signature, calling conventions > and external linkage which I pass together with the function's &gt...
2010 Feb 03
0
[LLVMdev] Interpreter with multiple modules.
I have not used the C api or the interpreter, but via JIT one can use ExecutionEngine::addGlobalMapping(...) after the function decl in the foreign module. See if there is an equivalent in the C API, which will probably work for the interpreter given that this method is declared in ExecutionEngine. Also search for a previous email thread in this list. This discussion was fairly recent, and I bel...
2012 Nov 06
0
[LLVMdev] Using LLVM to serialize object state -- and performance
Hi Paul, I think you may have gone beyond what I understand in how the legacy JIT code works. It looks like the call to addGlobalMapping should short-circuit the named function look up that I described, but I can't account for why it behaves differently on Mac vs. Linux. I still don't understand how the external pointers persist between writing and reading, but it sounds like you have that worked out somehow. Are you w...
2010 Feb 03
3
[LLVMdev] Interpreter with multiple modules.
On 3 February 2010 14:13, Garrison Venn <gvenn.cfe.dev at gmail.com> wrote: > I have not used the C api or the interpreter, but via JIT one can use > ExecutionEngine::addGlobalMapping(...) after the function decl in the > foreign module. See if there is an equivalent in the C API, which will > probably work for the interpreter given that this method is declared in > ExecutionEngine. Also search for a previous email thread in this list. > This discussion was fairl...
2010 Feb 03
3
[LLVMdev] Interpreter with multiple modules.
Hi everybody, I'm currently working with LLVM (v 2.6) and I try to interpret LLVM bitcode using the c API. Here is my problem : I have two LLVMModuleRef, M1 and M2, M1 contains the function "funct()" and M2 contains a main function which call "funct()" (M2 declares "funct()" too but it doesn't define it). If I try to run the main function, I got the error