Displaying 20 results from an estimated 1100 matches similar to: "Kaleidoscope tutorial: extern functions failing"
2016 Apr 01
2
Kaleidoscope on Windows - bug maybe found?
To try to find out why it was crashing, I followed the trail of function
calls:
C:\llvm\examples\Kaleidoscope\Orc\initial\toy.cpp
auto ExprSymbol = J.findUnmangledSymbol("__anon_expr");
JITSymbol findUnmangledSymbol(const std::string Name) {
return findSymbol(mangle(Name));
}
JITSymbol findSymbol(const std::string &Name) {
return CompileLayer.findSymbol(Name,
2017 Feb 06
3
Kaleidoscope tutorial: comments, corrections and Windows support
Hi,
I'm currently working my way through the tutorial with LLVM 3.9.1 on
Windows (finished chapter 4) and stumbled over a few things which could
be improved:
- "LLVMContext" does not exist as a variable -> "TheContext"
- Chapter 3: 5 times
- Chapter 4: 1 time
- Chapter 5: 4 times
- Chapter 6: 2 times
- Chapter 7: 2 times
3.4. Function Code
2019 Sep 19
3
"corrupted size vs. prev_size" when calling ExecutionSession::lookup()
Hi, I wrote a compiler that generate IR code and run it on the JIT, and
there randomly crashed due to "corrupted size vs. prev_size" depends on the
IR code generated from the source code.
Here's how I created the JIT:
llvm::InitializeNativeTarget();
llvm::InitializeNativeTargetAsmPrinter();
llvm::InitializeNativeTargetAsmParser();
// create jit
llvm::orc::ExecutionSession
2019 Mar 22
2
MCJIT, can't use with math functions
Hi,
for my application (uses Builder and MCJIT) I am making the transition
LLVM 6.0 -> 8.0.
It runs fine for self-contained functions, but whenever a jit-ed
function contains calls to the math library (e.g. @cosf) it seems to
have problems getting the address after successfully finding the symbol:
Failure value returned from cantFail wrapped call
UNREACHABLE executed at
2016 Apr 01
0
Kaleidoscope on Windows - bug maybe found?
Addendum: this still fails:
auto ExprSymbol = J.findSymbol("putchard");
As yet, I have no idea why - that symbol even seemed to be exported:
extern "C"
double putchard(double X) {
putchar((char)X);
return 0;
}
On Fri, Apr 1, 2016 at 2:42 AM, Russell Wallace <russell.wallace at gmail.com>
wrote:
> To try to find out why it was crashing, I followed the
2016 May 17
3
External function resolution: MCJIT vs ORC JIT
When using ORC JIT, I'm having trouble with external function resolution (that is, of a function defined in the app, with C linkage).
I add a declaration for the function to my IR, and when I use MCJIT, it finds it and all is well, But when I use ORC JIT (I *think* correctly, at least it closely matches what I see in the tutorial), I get an LLVM error, "Program used external function
2008 Sep 25
3
[LLVMdev] Kaleidoscope doesn't work properly
Hi
I hope this is a proper place to put my question.
I've compiled Kaleidoscope from "Adding JIT and Optimizer Support" tutorial.
Basically it works just fine but when I try to run extern'ed putchard
function it aborts.
Please, tell me what am I doing wrong?
Here is more information:
My PC runs FreeBSD.
I've copied the toy source code exactly and didn't change it.
2016 May 19
2
External function resolution: MCJIT vs ORC JIT
Thanks so much! This seems to do the trick. I would have spun my wheels for a long time before discovering all of this, wow.
Do I even want to know what additional chickens need to be sacrificed to get this to work on Windows?
-- lg
> On May 18, 2016, at 1:52 PM, Lang Hames <lhames at gmail.com> wrote:
>
> Hi Larry,
>
> You're basically there, but you're hitting
2016 May 20
0
External function resolution: MCJIT vs ORC JIT
Hi Larry,
Thanks so much! This seems to do the trick. I would have spun my wheels for
> a long time before discovering all of this, wow.
No worries. :)
I'll try to keep this in mind and make sure I address it in future
Kaleidoscope tutorial chapters - these issues tripped me up the first time
I encountered them too.
Do I even want to know what additional chickens need to be sacrificed
2016 Mar 31
1
Kaleidoscope examples on Windows
Are the Kaleidoscope examples supposed to work on Windows? e.g.
C:\llvm\examples\Kaleidoscope\Orc\initial\toy.cpp
when I try to compile this with clang it gives compile time error
messages, and when I try with Microsoft C++ it generates an executable that
runs but crashes when I type in an expression; I get similar results with
a few of the other versions. I can give more detailed feedback if
2016 May 22
1
External function resolution: MCJIT vs ORC JIT
>> llvm::sys::DynamicLibrary::LoadLibraryPermanently(nullptr)
This is one is a bit tricky and hard to find.
I spent quiet some time digging into MC and ORC JIT execution engines trying to find what makes them work.
The problem is that this trick (LoadLibraryPermanently) happens inside of EngineBuilder, despite that the functionality belongs to a JIT engine itself, not to the builder.
I
2008 Sep 01
3
[LLVMdev] Unresolveable fallthrough functions
Hello,
> ready> ERROR: Program used external function 'putchard' which could not be
> resolved!
> Any idea of what could be wrong?
Please make sure you're using C linkage for such functions, due to mangling the name of
function being emitted is not "putchard". Something like this:
extern "C" void putchard(char c) {
...
}
Or, just provide a mapping
2008 Sep 01
0
[LLVMdev] Unresolveable fallthrough functions
Anton Korobeynikov wrote:
>
> Hello,
>
>> ready> ERROR: Program used external function 'putchard' which could not
>> be
>> resolved!
>> Any idea of what could be wrong?
> Please make sure you're using C linkage for such functions, due to
> mangling the name of
> function being emitted is not "putchard". Something like this:
>
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
2020 Apr 13
2
LLVM 10 ORC2 issue with symbol resolution
Hi Dibyendu,
I had a look - to be honest I am not sure where the error is being
> reported from. It looks like this:
> JIT session error: Symbols not found: [ luaV_tointeger_, luaG_runerror ]
> I don't think it is from any logging I am doing.
Errors in ORC may trigger cascading failures. E.g. if two different modules
M1 and M2 both reference a function "foo" which cannot
2020 Apr 13
2
LLVM 10 ORC2 issue with symbol resolution
Hi Lang,
On Mon, 13 Apr 2020 at 19:12, Lang Hames <lhames at gmail.com> wrote:
>
>> 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.
>
>
> The doxygen comments should be up-to-date, as should
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 */
2008 Sep 25
0
[LLVMdev] Kaleidoscope doesn't work properly
Link with -rdynamic or provide a mapping.
/Stein Roger
Andrii Vasyliev wrote:
> Hi
>
> I hope this is a proper place to put my question.
>
> I've compiled Kaleidoscope from "Adding JIT and Optimizer Support" tutorial.
> Basically it works just fine but when I try to run extern'ed putchard
> function it aborts.
> Please, tell me what am I doing wrong?
2019 Mar 26
2
ORC JIT fails with standard math librrary
Hi,
I still can't get IR functions to JIT compile with the ORC JIT when they
contain a call to the standard math library. Attached is a minimal exploit.
The program uses the KaleidoscopeJIT.h that ships with LLVM 8 (except
that I had to expose the Datalayout). It reads from the filesystem an IR
file (filename "func_works.ll" or "func_cos_fails.ll) and asks the ORC
JIT
2018 Jun 28
3
Since MCJIT I can't get libm functions to work
I am upgrading our JIT application to use LLVM 6.0.0, and with this
transition I am making the move to use the new MCJIT facility.
A problem I am encountering is that the math functions from libm are not
resolved/found. I am using the lambda resolver from the KaleidoscopeJIT
class which first searches the present modules and, if that is
unsuccessful, continues the search in the whole process