search for: symbolinfo

Displaying 19 results from an estimated 19 matches for "symbolinfo".

2015 Aug 13
4
Linking existing functions from JITed code
...::addGlobalMapping related function to my JIT context, and I create a lambda resolver as such: JITContext::addModule(…) { auto Resolver = createLambdaResolver( [&](const std::string &name) { // look up first in JIT'ed code if (auto sym = findMangledSymbol(name)) { return RuntimeDyld::SymbolInfo(sym.getAddress(), sym.getFlags()); return RuntimeDyld::SymbolInfo(nullptr); } // look up in added globals if (auto addr = getPointerToGlobalMapping(name)) { return RuntimeDyld::SymbolInfo(addr, JITSymbolFlags::Exported); } // finally try to look up existing process symbols, note // this works for...
2015 Aug 13
2
Linking existing functions from JITed code
...esolver as such: >> >> JITContext::addModule(…) { >> >> auto Resolver = createLambdaResolver( >> [&](const std::string &name) { >> >> // look up first in JIT'ed code >> if (auto sym = findMangledSymbol(name)) { >> return RuntimeDyld::SymbolInfo(sym.getAddress(), >> sym.getFlags()); >> return RuntimeDyld::SymbolInfo(nullptr); >> } >> >> // look up in added globals >> if (auto addr = getPointerToGlobalMapping(name)) { >> return RuntimeDyld::SymbolInfo(addr, JITSymbolFlags::Exported); >> } >...
2015 Aug 20
2
Linking existing functions from JITed code
...t;> JITContext::addModule(…) { >>> >>> auto Resolver = createLambdaResolver( >>> [&](const std::string &name) { >>> >>> // look up first in JIT'ed code >>> if (auto sym = findMangledSymbol(name)) { >>> return RuntimeDyld::SymbolInfo(sym.getAddress(), >>> sym.getFlags()); >>> return RuntimeDyld::SymbolInfo(nullptr); >>> } >>> >>> // look up in added globals >>> if (auto addr = getPointerToGlobalMapping(name)) { >>> return RuntimeDyld::SymbolInfo(addr, JITSymbolFlags...
2015 Aug 20
2
Linking existing functions from JITed code
...ITContext::addModule(…) { >>> >>> auto Resolver = createLambdaResolver( >>> [&](const std::string &name) { >>> >>> // look up first in JIT'ed code >>> if (auto sym = findMangledSymbol(name)) { >>> return RuntimeDyld::SymbolInfo(sym.getAddress(), >>> sym.getFlags()); >>> return RuntimeDyld::SymbolInfo(nullptr); >>> } >>> >>> // look up in added globals >>> if (auto addr = getPointerToGlobalMapping(name)) { >>> return RuntimeDyld::SymbolInfo(addr, JI...
2016 May 17
3
External function resolution: MCJIT vs ORC JIT
...// Set up compilation if (orc) { auto Resolver = llvm::orc::createLambdaResolver( // External lookup functor [&](const std::string &name) { if (auto Sym = Compilelayer.findSymbol(name, true)) return llvm::RuntimeDyld::SymbolInfo(Sym.getAddress(), Sym.getFlags()); // If not found as a symbol, look up in current process. // Why doesn't this work? if (auto Addr = llvm::RTDyldMemoryManager::getSymbolAddressInProcess(name)) return llvm::RuntimeDyld::SymbolI...
2019 May 09
3
Can I use the JIT interface to create trampolines? (For functions and global values)
Dear LLVM-Mailing list (again), I still have another beginners question in my mind - thank you for your patience. Again I was playing around, but this time with llvm::Function. In an older question I learned, that I can replace a llvm::Function directly with an address. llvm::Function *function = mainModue->getFunction("puts"); function->replaceAllUsesWith(
2017 Nov 19
2
JIT and atexit crash
...9; anymore, which leads to the crash. Given that my assumption is correct what can we do about this? Is there anything that can be done to cover this case inside of the Orc engine? Currently, I worked around this problem by resolving atexit to my custom function that does nothing. RuntimeDyld::SymbolInfo findSymbol(const std::string &Name) { if (Name == "_atexit") { return findSymbol("mull_custom_test_at_exit"); } if (auto SymAddr = RTDyldMemoryManager::getSymbolAddressInProcess(Name)) return RuntimeDyld::SymbolInfo(SymAddr, JITSymbolFlags::Exported)...
2016 May 19
2
External function resolution: MCJIT vs ORC JIT
...if (orc) { > auto Resolver = llvm::orc::createLambdaResolver( > // External lookup functor > [&](const std::string &name) { > if (auto Sym = Compilelayer.findSymbol(name, true)) > return llvm::RuntimeDyld::SymbolInfo(Sym.getAddress(), Sym.getFlags()); > // If not found as a symbol, look up in current process. > // Why doesn't this work? > if (auto Addr = llvm::RTDyldMemoryManager::getSymbolAddressInProcess(name)) > return llvm::...
2016 May 20
0
External function resolution: MCJIT vs ORC JIT
...auto Resolver = llvm::orc::createLambdaResolver( >> // External lookup functor >> [&](const std::string &name) { >> if (auto Sym = Compilelayer.findSymbol(name, true)) >> return >> llvm::RuntimeDyld::SymbolInfo(Sym.getAddress(), Sym.getFlags()); >> // If not found as a symbol, look up in current process. >> // Why doesn't this work? >> if (auto Addr = >> llvm::RTDyldMemoryManager::getSymbolAddressInProcess(name)) >>...
2016 May 22
1
External function resolution: MCJIT vs ORC JIT
...t; auto Resolver = llvm::orc::createLambdaResolver( >> // External lookup functor >> [&](const std::string &name) { >> if (auto Sym = Compilelayer.findSymbol(name, true)) >> return llvm::RuntimeDyld::SymbolInfo(Sym.getAddress(), Sym.getFlags()); >> // If not found as a symbol, look up in current process. >> // Why doesn't this work? >> if (auto Addr = llvm::RTDyldMemoryManager::getSymbolAddressInProcess(name)) >>...
2017 Nov 23
1
JIT and atexit crash
Hi, Not sure whether this matches your use case, but the Orc-based JIT used in LLI appears to be using `llvm::orc::LocalCXXRuntimeOverrides` (http://llvm.org/doxygen/classllvm_1_1orc_1_1LocalCXXRuntimeOverrides.html) to override `__cxa_atexit`: https://github.com/llvm-mirror/llvm/blob/release_50/tools/lli/OrcLazyJIT.h#L74
2016 Apr 02
2
getSymbolAddressInProcess returning null
Tried that, still didn't work. Then I tried making a direct API call, GetProcAddress(GetModuleHandle(0),"foo") And this works if and only if __declspec(dllexport) is supplied. So it looks like we were both right. On Sat, Apr 2, 2016 at 9:29 AM, NAKAMURA Takumi <geek4civic at gmail.com> wrote: > Have you tried to add dllexport? > > On Sat, Apr 2, 2016 at 4:23 PM
2016 Jul 07
2
ObjectCache and getFunctionAddress issue
...orModule call, the findExistingSymbol is invoked. For some reason it cannot find my symbol. My symbol exists in the Module that was used as input for generateCodeForModule. It uses the object cache and that code was valid and generated in the previous run. I tried to traced further in RuntimeDyld::SymbolInfo getSymbol() and could see that the GlobalSymbolTable did not contained my symbol. I obviously forgot something or did something wrong, what puzzeld me is that is quite semi-random. Even the most simple statements such as int x = 1; (no dependencies) sometime fails. I did not hardcode any ptrs in...
2016 Mar 30
1
JIT compiler and calls to existing functions
We use an explicit relocation step to deal with this. We generate code into a temporary memory location, then relocate it into a reserved area of memory which is always within a small relative offset of other interesting code. This allows us to get pc relative calls. Philip On 03/30/2016 05:53 AM, Matt Godbolt wrote: > For what it's worth we did a similar thing, but > overrode
2016 May 27
1
ORC and MCJIT clients: Heads up, API breaking changes in the pipeline.
Hi Lang, thanks for announcing. Would be great if you could send another short notice as soon as the actual patch exists. Best, Stefan Am 24.05.16 um 23:06 schrieb Lang Hames via llvm-dev: > Hi All, > > I'm going to be making some API breaking changes to the ORC APIs, and > to the RuntimeDyld class (which underlies MCJIT). The changes may > affect MCJIT clients but are unlikely
2016 May 24
2
ORC and MCJIT clients: Heads up, API breaking changes in the pipeline.
Hi All, I'm going to be making some API breaking changes to the ORC APIs, and to the RuntimeDyld class (which underlies MCJIT). The changes may affect MCJIT clients but are unlikely to. Where they do the fixes are likely to be trivial. ORC clients will be affected, but the fixes should also be straightforward. I have three upcoming changes in mind: 1) RuntimeDyld (the linker underlying
2015 May 30
2
[LLVMdev] MCJit interface question
Agreed, that sounds like the best plan. I'll look into moving LLILC to ORC. Thanks -Joseph From: Russell Hadley Sent: Friday, May 29, 2015 8:13 PM To: Lang Hames; Joseph Tremoulet Cc: llvmdev at cs.uiuc.edu Subject: RE: [LLVMdev] MCJit interface question Hey Joseph, What Lang said made me wonder. Is it the right time for us (LLILC) to move to ORC? The long term plan was to go there but
2016 Mar 30
4
JIT compiler and calls to existing functions
For what it's worth we did a similar thing, but overrode RTDyldMemoryManager directly This allowed us to control where the RAM was allocated too (e.g. guarantee it was in the low 4GB so we could use small memory model and avoid the mov rax, xxxxxxx; call rax code generated for x86)*, and also override findSymbol() to have the same behaviour as described in 4). --matt * later issues in not
2015 Jul 27
15
[LLVMdev] Help with using LLVM to re-compile hot functions at run-time
Hi Again, I'm a little confused regarding what is the exact Orc's functions I should use in order to save the functions code in a code cache so it could be later replaced with different versions of it and I appreciate your help. Just a reminder I want to dynamically recompile the program based on profile collected at the run-time. I would like to start executing the program from the