search for: exprsymbol

Displaying 10 results from an estimated 10 matches for "exprsymbol".

2019 Jan 07
2
Kaleidoscope tutorial: extern functions failing
...and returns 0. extern "C" DLLEXPORT double putchard(double X) { fputc((char)X, stderr); return 0; } Other posts online suggest that this issue could be caused by not compiling with -rdynamic, but I am. The actual error is occuring with the following code (on the cantFail line) auto ExprSymbol = TheJIT->findSymbol("__anon_expr"); assert(ExprSymbol && "Function not found"); // cast to double-returning function double (*FP)() = (double (*)())(intptr_t)cantFail(ExprSymbol.getAddress()); fprintf(stderr, "Evaluated to %f\n", FP()); and some investiga...
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, true); } CompileLayerT CompileLayer; typedef I...
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...
2016 May 17
3
External function resolution: MCJIT vs ORC JIT
....setErrorStr (&engine_errors); EE.reset (engine_builder.create()); EE->finalizeObject (); } // Ask for a callable function typedef float (*FuncFloatFloat)(float); FuncFloatFloat my_executable_function = NULL; if (orc) { auto ExprSymbol = Compilelayer.findSymbol ("myfunc", true); my_executable_function = (FuncFloatFloat) ExprSymbol.getAddress (); } else { my_executable_function = (FuncFloatFloat) EE->getFunctionAddress ("myfunc"); } assert (my_executable_function); printf (&q...
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 19
2
External function resolution: MCJIT vs ORC JIT
...ine_errors); > EE.reset (engine_builder.create()); > EE->finalizeObject (); > } > > // Ask for a callable function > typedef float (*FuncFloatFloat)(float); > FuncFloatFloat my_executable_function = NULL; > if (orc) { > auto ExprSymbol = Compilelayer.findSymbol ("myfunc", true); > my_executable_function = (FuncFloatFloat) ExprSymbol.getAddress (); > } else { > my_executable_function = (FuncFloatFloat) EE->getFunctionAddress ("myfunc"); > } > > assert (my_execut...
2016 May 20
0
External function resolution: MCJIT vs ORC JIT
...set (engine_builder.create()); >> EE->finalizeObject (); >> } >> >> // Ask for a callable function >> typedef float (*FuncFloatFloat)(float); >> FuncFloatFloat my_executable_function = NULL; >> if (orc) { >> auto ExprSymbol = Compilelayer.findSymbol ("myfunc", true); >> my_executable_function = (FuncFloatFloat) ExprSymbol.getAddress >> (); >> } else { >> my_executable_function = (FuncFloatFloat) EE->getFunctionAddress >> ("myfunc"); >>...
2016 May 22
1
External function resolution: MCJIT vs ORC JIT
...et (engine_builder.create()); >> EE->finalizeObject (); >> } >> >> // Ask for a callable function >> typedef float (*FuncFloatFloat)(float); >> FuncFloatFloat my_executable_function = NULL; >> if (orc) { >> auto ExprSymbol = Compilelayer.findSymbol ("myfunc", true); >> my_executable_function = (FuncFloatFloat) ExprSymbol.getAddress (); >> } else { >> my_executable_function = (FuncFloatFloat) EE->getFunctionAddress ("myfunc"); >> } >> >&g...
2017 Feb 06
3
Kaleidoscope tutorial: comments, corrections and Windows support
...>print" call from chapter 3 is missing - "The KaleidoscopeJIT class is a simple JIT built specifically for these tutorials.": It would be nice to mention, where to find the include file: llvm-src/examples/Kaleidoscope/include/KaleidoscopeJIT.h - "auto ExprSymbol = TheJIT->findSymbol("__anon_expr");": On Windows, this will always fail as this function will search for "ExportedSymbolsOnly" and the exported flag seems to be implemented incorrectly for COFF in LLVM (see bug report from Russell Wallace: http://lists.l...
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