Displaying 20 results from an estimated 20000 matches similar to: "[LLVMdev] Having JIT resolve extern "C" functions declared in executible"
2009 Jul 02
3
[LLVMdev] Having JIT resolve extern "C" functions declared in executible
Hi,
I am having some difficulties getting the LLVM JIT to resolve extern "C" functions which I have defined in source file and invoking them via EE::runFunction() after generating a Function prototype for it. Is this possible or do I need to generate a .so for my functions are link against it?
Thanks in advanced,
Carter.
Sorry for the double post but apparently I mistakenly tagged
2009 Jul 02
0
[LLVMdev] Having JIT resolve extern "C" functions declared in executible
On Jul 2, 2009, at 1:05 AM, Carter Cheng wrote:
> I am having some difficulties getting the LLVM JIT to resolve extern
> "C" functions which I have defined in source file and invoking them
> via EE::runFunction() after generating a Function prototype for it.
> Is this possible or do I need to generate a .so for my functions are
> link against it?
If the JIT needs
2009 Jul 04
2
[LLVMdev] Having JIT resolve extern "C" functions declared in executible
John McCall wrote:
> On Jul 2, 2009, at 1:05 AM, Carter Cheng wrote:
>> I am having some difficulties getting the LLVM JIT to resolve extern
>> "C" functions which I have defined in source file and invoking them
>> via EE::runFunction() after generating a Function prototype for it.
>> Is this possible or do I need to generate a .so for my functions are
2009 Aug 22
0
[LLVMdev] Having JIT resolve extern "C" functions declared in executible
I think you might have to provide an empty list if your function
doesn't take parameters. Maybe using an irbuilder would help?
-bw
On Aug 22, 2009, at 2:13 PM, Renato Golin <rengolin at systemcall.org>
wrote:
> 2009/7/4 Albert Graef <Dr.Graef at t-online.de>:
>> This is all I ever needed to interface to C functions using LLVM.
>> It's
>> really
2009 Aug 23
1
[LLVMdev] Having JIT resolve extern "C" functions declared in executible
2009/8/22 Bill Wendling <isanbard at gmail.com>:
> I think you might have to provide an empty list if your function doesn't
> take parameters. Maybe using an irbuilder would help?
It does take one parameter. Here's the important bits:
// My Function
extern "C"
void print(double X) {
printf("%f\n", X);
}
// Args type
std::vector<const Type*>
2009 Aug 22
1
[LLVMdev] Having JIT resolve extern "C" functions declared in executible
2009/7/4 Albert Graef <Dr.Graef at t-online.de>:
> This is all I ever needed to interface to C functions using LLVM. It's
> really easy. Of course you still need a prototype of the external
> function (function definition without body) in your IR, but that's it.
Hi Albert,
I'm having a similar problem and I found I can't declare the function
and use it, most likely
2010 Mar 18
0
[LLVMdev] JIT : Does it cache the compiled code of executed functions upon runFunction(..)?
Hi Gabi,
I have no idea why your performances is not as expected with such low level
of informations.
But, I know that the binary code is cached by the JIT. You can find the code
in JIT.cpp to convince yourself :
runFunction -> getPointerToFunction ->getPointerToGlobalIfAvailable which
returns the native address of the jitted function.
You can even try to measure time needed by each
2010 Mar 19
0
[LLVMdev] JIT : Does it cache the compiled code of executed functions upon runFunction(..)?
Probably because the integer version of the prototype is
special-cased. The problem is that the JIT has a C function pointer
of an arbitrary type that it only finds out about at runtime.
Normally, if you call a function pointer with a known type, your
compiler will generate the proper calling code and allocate the
arguments in registers or on the stack. However, doing that inside
the JIT would
2010 Mar 18
2
[LLVMdev] JIT : Does it cache the compiled code of executed functions upon runFunction(..)?
Hello
I have the following scenario, and I am not sure why the performance
is so bad (take 30 minutes to complete with very simple generated
functions):
1. Create module
2. Do something like EE =
EngineBuilder(theModule).setEngineKind(EngineKind::JIT).create();
3. Create a function in the module: theModule->getOrInsertFunction(..)
4. Execute 1000 times the function using
2010 Mar 19
2
[LLVMdev] JIT : Does it cache the compiled code of executed functions upon runFunction(..)?
Reid,
Thanks! You were right!
Changing the code to:
float (*theF)(float) = (float (*)(float)) EE -> getPointerToFunction(f);
float retVal = theF(arg1);
made the difference. Now it is dozens of times faster!
I don't really understand the cause though..
Why doesn't ExecutionEngine cope well with "define float
@someFunc(float %x)" and needs this trick ? (but copes well with
2007 Jun 12
0
[LLVMdev] How to call native functions from bytecode run in JIT?
Hi,
> Okay. If the function exists in your application's address space
> already,
> just name the LLVM function the same name as the native function
> and the
> JIT should find it an do the right thing. This is how it finds
> printf and
> a variety of other things. You don't need to call addGlobalMapping at
> all.
Looking at the output of "nm
2009 Jul 04
0
[LLVMdev] ModuleProvider materializeFunction
Carter Cheng wrote:
> I have tracing the calls to materializeFunction in the LLVM code in hopes of determining how to properly utilize this function but from my explorations I gather it's just a hook which is called by the JIT system and I would mostly have to do the work myself.
>
> What is the preferred way to inject a llvm:Function which contains basic blocks into the Module +
2007 Jun 14
0
[LLVMdev] How to call native functions from bytecode run in JIT?
Hi Jan,
In gcc for Linux, you have the -rdynamic option that allows an
executable to dlsym its symbols. Since llvm use dlsym to find the
symbols, you could try with this option. That's what I did. And don't
forget to use the C++ name if you compile with C++.
Cheers,
Nicolas
Jan Rehders wrote:
> Hi,
>
> I was able to try this on linux again. Unfortunately it doesn't work
2007 Jun 13
5
[LLVMdev] How to call native functions from bytecode run in JIT?
Hi,
I was able to try this on linux again. Unfortunately it doesn't work
at all (neither using runFunction nor a CallInst). It simply says
function called get5 not known. Calling printf the same way works,
though. On linux the function is exported as "get5" from the
executable while it is called "_get5" on OS X. I could not spot any
other differences.. any
2007 Jun 10
0
[LLVMdev] How to call native functions from bytecode run in JIT?
Are you able make calls to well known external functions such as
printf? As far as I known, this capability is well tested on x86 /
Linux.
I am wondering if there is some name mangling issue?
Evan
On Jun 7, 2007, at 8:38 AM, Jan Rehders wrote:
> Hello,
>
> can anyone help me calling native functions from LLVM-Bytecode
> functions run in the JIT?
>
> I have a program
2007 Jun 07
2
[LLVMdev] How to call native functions from bytecode run in JIT?
Hello,
can anyone help me calling native functions from LLVM-Bytecode
functions run in the JIT?
I have a program which creates an LLVM execution engine and adds
modules and functions
to it on the fly. I need to call some native functions of my program
from bytecode functions which causes some troubles as it appears not
to be documented. My test scenario works like the following:
I have
2008 Aug 01
0
[LLVMdev] LLVM JIT: How to install a callback for a function loaded in at runtime
Hi Carter,
Carter Cheng wrote:
> Hello,
>
> This is probably a bit of a beginner's question but I am new to LLVM
> I have been examining the possibility of constructing something similar to the JnJVM for a language which supports dynamic class loading. The problem I am having is determining how the JIT system allows for dynamic loading of functions into the JIT. The paper
2004 Aug 10
1
[LLVMdev] API on JIT, code snippets
Valery,
Your JIT sample program has been added to projects/HowToUseJIT.
I have defaulted the license to the standard UIUC license. Let me know if
that's not okay and I'll fix it.
If you continue to work on this (providing a command line option to use either
interpreter or JIT would be nice), please provide patches against these files
and I'll commit them for you.
Here's the
2008 Nov 30
1
[LLVMdev] Beginner's question concerning JIT
Hi,
I have been looking at the LLVM JIT system as a basis for a project I am working on and had a few beginner's questions which I was hoping someone might be able to answer and which I haven't yet been able to figure out reading the source code. If anyone could provide some help I would appreciate it.
1) How does one go about calling a precompiled function external to the JIT from a JIT
2009 Mar 22
0
[LLVMdev] Possible memory leakage in the LLVM JIT Engine
Hi,
Was this ever resolved?
I'm curious, I'm also in a situation where there may be many (very
many) JITted functions over the history of an application (which may
be running for many days)
Thanks
On Mar 20, 2009, at 7:34 AM, George Giorgidze wrote:
> Hi,
>
> In my application I am JITing thousands of functions, though I am
> doing it sequantially and running only