search for: getmainjitdylib

Displaying 20 results from an estimated 20 matches for "getmainjitdylib".

2019 Sep 19
3
"corrupted size vs. prev_size" when calling ExecutionSession::lookup()
...Manager>(); }); auto JTMB = llvm::orc::JITTargetMachineBuilder::detectHost(); auto DL = JTMB->getDefaultDataLayoutForTarget(); llvm::orc::IRCompileLayer CompileLayer(ES, ObjectLayer, llvm::orc::ConcurrentIRCompiler(std::move(*JTMB))); llvm::orc::MangleAndInterner Mangle(ES, *DL); ES.getMainJITDylib().setGenerator( llvm::cantFail(llvm::orc::DynamicLibrarySearchGenerator::GetForCurrentProcess(*DL))); // ... large part to generate IR code . if (llvm::verifyModule(*AST::getModule(), &llvm::errs())) { return 0; } else { std::cout << "Verified success\n"; } /...
2019 Sep 19
2
Errata: The JIT tutorial
For example, the illustrate part says "ES.getMainJITDylib().setGenerator" while the full code list says "ES.getMainJITDylib().addGenerator", I guess the API is changed, the tutorial part is up to date while the full code list leaves to the old version. On Thu, Sep 19, 2019 at 10:51 AM Yafei Liu <yfliu at mobvoi.com> wrote: > Yes,...
2019 Sep 12
2
Questions after completed Kaleidoscope Chapter 1
...tput clean. > > > > > > > > Generator function > > > > Why does the generator function looks like this: “SymbolNameSet(JITDylib > &Parent, const SymbolNameSet &Names)”? > > > > I understood, that the “Parent” will be the value from > “ES.getMainJITDylib()” while “Names” will have the names that should be > resolved. I saw an implementation for the Generator function that kinda > looked like that: > > { > > > > orc::SymbolNameSet Added; > > > > orc::SymbolMap NewSymbols; > > > > > &...
2019 Sep 12
2
Questions after completed Kaleidoscope Chapter 1
...something, or silence it? I want to keep my console output clean. 1. Generator function Why does the generator function looks like this: "SymbolNameSet(JITDylib &Parent, const SymbolNameSet &Names)"? I understood, that the "Parent" will be the value from "ES.getMainJITDylib()" while "Names" will have the names that should be resolved. I saw an implementation for the Generator function that kinda looked like that: { orc::SymbolNameSet Added; orc::SymbolMap NewSymbols; for(auto &Name : Names) { Added.inse...
2019 Sep 18
2
Errata: The JIT tutorial
Hi Yafei, First 2 chapters of the tutorial is up-to-date with ORC v2 APIs. I hope nothing changed in docs and code. Did you got compilation errors? On Thu, 19 Sep 2019 at 00:47, David Blaikie via llvm-dev < llvm-dev at lists.llvm.org> wrote: > +Lang for JIT things > > On Tue, Sep 17, 2019 at 7:01 PM Yafei Liu via llvm-dev < > llvm-dev at lists.llvm.org> wrote: >
2020 Apr 13
4
LLVM 10 ORC2 issue with symbol resolution
Hi, I updated my project to LLVM 10.0 today and I am getting JIT symbol resolution errors. I could not find any example or updated tutorial or documentation that describes the new api - as all documentation seems out of date. I paste below some code snippets that show what I am doing: /* global syms is a array mapping names to function addresses */
2020 Sep 23
2
ORC JIT - Can modules independently managed with one LLJIT instance? + problems with ExecutionSession.lookup
...ymbolLookupSet lookupSet; this->undefinedReferences.clear(); for(const auto &element : this->symbolsOfInterrest) { lookupSet.add(element.second.name,llvm::orc::SymbolLookupFlags::WeaklyReferencedSymbol); } auto result = ES.lookup({{&jit->getMainJITDylib(), llvm::orc::JITDylibLookupFlags::MatchAllSymbols}}, lookupSet, llvm::orc::LookupKind::Static, llvm::orc::SymbolState::Resolved); if(result) { for(const auto &element : *result) { const llvm::StringRef &name = (*element.first);...
2019 Sep 25
4
Questions after playing around with KaleidoscopeJIT (With source files)
...ed for the symbol "?planschiValue@@3HB" and called "replaceAllUsesWith" to replace the symbol with the correct address. (See PlanschbeckenJIT.cpp:31) 2.) I set my own GeneratorFunction and provided addresses for the symbols (See PlanschbeckenJIT.cpp:95) 3.) I can use this->es.getMainJITDylib().define Each way worked fine. But I felt that way 2.) was the most annoying way, because I had to provide many other addresses. So what way is the best? Or can I 'freely' choose? Is it possible to have multiple GeneratorFunctions? I would like to use the 'default' DynamicLibrarySe...
2020 Oct 05
2
LLJIT: __{math}_finite symbols not resolved ?
...I can say > that definitively. I usually develop on MacOS, but I'll set up a VM and see > if I can reproduce this locally to get some more insight here. > > In the meantime one workaround would be to define absoluteSymbol entries > for these functions: > > auto Err = J->getMainJITDylib().define( > absoluteSymbols({ > { J->mangleAndIntern("__log_finite"), > pointerToJITTargetAddress(&__log_finite) }, > { J->mangleAndIntern("__exp2_finite"), > pointerToJITTargetAddress(&__exp2_finite) } > })); > > -- Lang. > &g...
2020 Oct 05
2
LLJIT: __{math}_finite symbols not resolved ?
Hello, Right now I am just using a Generator to look for symbols in my process (which links dynamically against libc / libm). It seems to have no trouble finding every other libc / libm / libc++ / ... symbol so I assumed that it was not necessary to specifically link against libm where these __finite symbols reside: $ nm -D /usr/lib/libm.so.6 | grep finite 0000000000050540 T
2019 Nov 12
3
ORC API C Standard/System Libraries
Hi all, First of all, I want to say that I really appreciate all the work that's gone into LLVM, clang and the ORC API. I would be very unlikely to be doing my current project if they weren't available. I'm using the ORC API to JIT some C code (soon to be C++) on Windows. (I was on LLVM 8.0.0 but it didn't handle the 'allocator' attribute so I upgraded to LLVM 9.0.0.)
2020 Sep 24
2
ORC JIT - Can modules independently managed with one LLJIT instance? + problems with ExecutionSession.lookup
...licktime/v1/query?url=http%3a%2f%2felement.second.name&umid=0e7ae036-6054-4cfd-8013-5cc37f16d67a&auth=b6f66d00f8195cc5198eee21f0dbabe6af0a3180-bedda45c2776595c390d63af4d6c24c16f889af2>,llvm::orc::SymbolLookupFlags::WeaklyReferencedSymbol); } auto result = ES.lookup({{&jit->getMainJITDylib(), llvm::orc::JITDylibLookupFlags::MatchAllSymbols}}, lookupSet, llvm::orc::LookupKind::Static, llvm::orc::SymbolState::Resolved); if(result) { for(const auto &element : *result) { const llvm::StringRef &name = (*element.first);...
2020 Sep 28
2
ORC JIT - different behaviour of ExecutionSession.lookup?
...issued something like that: auto &ES = this->jit->getExecutionSession(); SymbolLookupSet lookupSet; lookupSet.add("?Sampler@@YAXXZ", llvm::orc::SymbolLookupFlags::WeaklyReferencedSymbol); ES.lookup({{&jit->getMainJITDylib(), llvm::orc::JITDylibLookupFlags::MatchAllSymbols}}, lookupSet, llvm::orc::LookupKind::Static, llvm::orc::SymbolState::Resolved); Even though the "tryToGenerate" function of my DefinitionGenerator returned a "llvm::orc::SymbolsNotFound" for the "?_Plansch_test@@3HA",...
2019 Aug 14
3
ORC v2 question
Hi Lang, On Tue, 13 Aug 2019 at 23:26, Lang Hames <lhames at gmail.com> wrote: >> I also get this message: >> JIT session error: Symbols not found: { raise_error } > > > Ahh -- I see the problem. The DynamicLibrarySearchGenerator is using the getAddressOfSymbol method, which (under the hood) is basically issuing an appropriate dlsym lookup, and that does not find
2020 Apr 13
2
LLVM 10 ORC2 issue with symbol resolution
...for LLJIT in llvm/examples/LLJITExamples (LLVM 10) or llvm/examples/OrcV2Examples (master). If you come across any documentation in master that appears to be out of date please let me know and I will fix it. > Sadly http://llvm.org/docs/ORCv2.html is out of date. For example: auto &JD = ES.getMainJITDylib(); This api no longer exists. I did look at OrcV2Examples but did not see any that were trying to set up external symbols. Did I miss something? > The BuildingAJIT tutorial series is known to be out of date. I'm hoping to have that fixed by LLVM 11 but there is some feature work that I ne...
2020 Mar 18
4
[ORC JIT] -Resolving cross references in a multi-process scenario
Hi Bjoern, Thanks for your patience. The good news is that there is a neater way to do this: ExecutionSession's lookup methods take a orc::SymbolState parameter which describes the state that symbols must reach before a query can return (See https://github.com/llvm/llvm-project/blob/d1a7bfca74365c6523e647fcedd84f8fa1972dd3/llvm/include/llvm/ExecutionEngine/Orc/Core.h#L1273).In your case you
2019 Jul 18
2
Eager compilation and relocatable dynamic linkable code-generation
Hi all, I am following the LLVM JIT tutorial API based on: https://llvm.org/docs/tutorial/BuildingAJIT1.html I have 2 independent questions: 1. The tutorial mentions that "*will defer compilation of the module until any of its definitions is looked up*". Does that mean to force eager compilation, i have to keep track of all functions added to the Module and do a lookup? I want the
2020 Sep 29
3
ORC JIT - different behaviour of ExecutionSession.lookup?
...issued something like that: auto &ES = this->jit->getExecutionSession(); SymbolLookupSet lookupSet; lookupSet.add("?Sampler@@YAXXZ", llvm::orc::SymbolLookupFlags::WeaklyReferencedSymbol); ES.lookup({{&jit->getMainJITDylib(), llvm::orc::JITDylibLookupFlags::MatchAllSymbols}}, lookupSet, llvm::orc::LookupKind::Static, llvm::orc::SymbolState::Resolved); Even though the "tryToGenerate" function of my DefinitionGenerator returned a "llvm::orc::SymbolsNotFound" for the "?_Plansch_test@@3HA",...
2020 Sep 30
2
ORC JIT - different behaviour of ExecutionSession.lookup?
...issued something like that: auto &ES = this->jit->getExecutionSession(); SymbolLookupSet lookupSet; lookupSet.add("?Sampler@@YAXXZ", llvm::orc::SymbolLookupFlags::WeaklyReferencedSymbol); ES.lookup({{&jit->getMainJITDylib(), llvm::orc::JITDylibLookupFlags::MatchAllSymbols}}, lookupSet, llvm::orc::LookupKind::Static, llvm::orc::SymbolState::Resolved); Even though the "tryToGenerate" function of my DefinitionGenerator returned a "llvm::orc::SymbolsNotFound" for the "?_Plansch_test@@3HA",...
2020 Oct 01
2
ORC JIT - different behaviour of ExecutionSession.lookup?
...issued something like that: auto &ES = this->jit->getExecutionSession(); SymbolLookupSet lookupSet; lookupSet.add("?Sampler@@YAXXZ", llvm::orc::SymbolLookupFlags::WeaklyReferencedSymbol); ES.lookup({{&jit->getMainJITDylib(), llvm::orc::JITDylibLookupFlags::MatchAllSymbols}}, lookupSet, llvm::orc::LookupKind::Static, llvm::orc::SymbolState::Resolved); Even though the "tryToGenerate" function of my DefinitionGenerator returned a "llvm::orc::SymbolsNotFound" for the "?_Plansch_test@@3HA",...