search for: runfunct

Displaying 20 results from an estimated 280 matches for "runfunct".

Did you mean: runfunc
2015 Sep 18
2
ExecutionEngine::runFunction and libffi
I noticed that runFunction (for MCJIT) is very limited. At the same time the interpreter already has a fairly generic way of calling functions from a pointer and a Function * (for description) using libffi. Would it make sense to pull that functionality out into a small support library and using it in MCJIT? As is runFunc...
2013 Jan 30
2
[LLVMdev] Jump back to/return from runFunction
How can I properly exit from code being executed via "ExecutionEngine::runFunction"? My JIT'd code is executing and it calls a function in the host program. This host function then decides the executing code should be stopped and wants to return from runFunction. I've considered setjmp/longjmp, but I'm not sure if this would properly clean up the ExecutionEng...
2013 Jan 30
0
[LLVMdev] Jump back to/return from runFunction
On Jan 29, 2013, at 21:41 , edA-qa mort-ora-y <eda-qa at disemia.com> wrote: > How can I properly exit from code being executed via > "ExecutionEngine::runFunction"? My JIT'd code is executing and it calls > a function in the host program. This host function then decides the > executing code should be stopped and wants to return from runFunction. If the executing code wants to return, it should just return. I take it that doesn't work f...
2013 Jan 30
3
[LLVMdev] Calling dispatch_async() within call to ExecutionEngine::runFunction()
My host app calls runFunction() on my JITed code. It, in turn, calls a C function ("decode()") in the host app that then calls dispatch_async(). The runFunction() call returns as expected, but the block passed to dispatch_async() never gets called. The async block is supposed to call a function pointer callback tha...
2010 Mar 18
2
[LLVMdev] JIT : Does it cache the compiled code of executed functions upon runFunction(..)?
...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 EE->runFunction(function, args) with different args in each round. My question - Does section 4 above makes the EE recompile the function 1000 times? If no, why is the performance is so bad? what am I doing wrong ? Maybe I should somehow cache the function's binary code? llvm-version 2.7 OS: Linux 2.6.3...
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 runFunction to run to double-convince yourself. :) Olivier. On Thu, Mar 18, 2010 at 9:21 AM, Gabi <bugspynet at gmail.com&...
2007 Jun 12
0
[LLVMdev] How to call native functions from bytecode run in JIT?
...apping at > all. Looking at the output of "nm codegen1" I realized that "get5" was a C+ + function whose name was mangled to "__Z4get5v". Surrounding it by extern "C" helped a lot :) Now the function is found by the JIT and I can call it using EE->runFunction als well as using a CallInst. > Does this work? However, one strange effet remains: if I first call the function using EE->runFunction and then try to call it using a CallInst inside another function I get the old "relocation" error in PPCJITInfo.cpp, again. Using a CallI...
2013 Jan 30
0
[LLVMdev] Calling dispatch_async() within call to ExecutionEngine::runFunction()
I have used libdispatch (on FreeBSD) from JIT'd code without any issues, so I think your bug is elsewhere. David On 30 Jan 2013, at 07:43, Rick Mann wrote: > My host app calls runFunction() on my JITed code. It, in turn, calls a C function ("decode()") in the host app that then calls dispatch_async(). The runFunction() call returns as expected, but the block passed to dispatch_async() never gets called. The async block is supposed to call a function pointer callback tha...
2010 Mar 19
2
[LLVMdev] JIT : Does it cache the compiled code of executed functions upon runFunction(..)?
..."define i32 @someFunc(i32 %x) ) The function was generated using "getOrInsertFunction(name, Type::getFloatTy(ctx), Type::getFloatTy(ctx), (Type*)NULL); And the orginal slow execution was: std::vector<GenericValue> args(1); args[0].FloatVal = 8.0f; GenericValue retVal = EE -> runFunction(f, args); return retVal.FloatVal; -- Regards, Gabi http://bugspy.net
2007 Jun 12
3
[LLVMdev] How to call native functions from bytecode run in JIT?
On Tue, 12 Jun 2007, Jan Rehders wrote: >> Jan, how are you doing this? Are you creating an external LLVM >> Function object named "get5", then using EE::addGlobalMapping? If >> 'get5' exists in the address space, why not just let the JIT resolve it >> (which will then create the stub)? > > Yes. I create a Function with matching signature,
2010 Mar 19
0
[LLVMdev] JIT : Does it cache the compiled code of executed functions upon runFunction(..)?
...unction pointer before calling it as I described, which is efficient. In the case that there is a function of unknown prototype, the JIT codegens a short snippet of code that calls the underlying function. So far as I know this entry point is not cached and lives as long as the JIT, so if you use runFunction repeatedly you will be generating many snippets of machine code and leaking memory. The leak could be fixed by freeing the stub before returning its return value. Hope that helps, Reid On Fri, Mar 19, 2010 at 5:27 AM, Gabi <bugspynet at gmail.com> wrote: > Reid, > > Thanks! You...
2009 Oct 28
2
[LLVMdev] JIT, FFI
Hello, I'm new to LLVM and I had a question about it: when we call the JIT::runFunction, since llvm doesn't has a full FFI, there are some cases in which the JIT needs to codegen a stub function to call the function we are interested, my question is: this stub function will remains in the module until when ? What are the most efficient way to remove it from the module and memor...
2012 Nov 27
2
[LLVMdev] MCJIT and Lazy Function Creators
I guess we'll have to add that to the list of things that needs to be done to replace the old JIT. In the projects I've worked on that use MCJIT, we've been using getPointerToFunction and then calling it from outside the MCJIT engine, but I suppose that the generic handling in runFunction would be useful in some cases. -Andy -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Óscar Fuentes Sent: Monday, November 26, 2012 5:09 PM To: llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] MCJIT and Lazy Function Creators Ós...
2010 Aug 15
2
[LLVMdev] "UNREACHABLE executed!" error?
What does this error mean? I'm getting it from an ExecutionEngine::runFunction() call. The function I'm passing it was run through verifyFunction() right before the runFunction() call. I can't seem to find anything that tells me what causes this, only specific (but seemingly unrelated to my problem) cases of it happening. -------------- next part -------------- An...
2010 Aug 19
1
[LLVMdev] how to runFunction? passing in an int
I wish to run a function passing in an int value of 5 as a single parameter. can you please complete the code as all the examples I can find are old. llvm::Function *EntryFn = Mod->getFunction("createModule"); if (!EntryFn) { return 255; } else { EE->runFunction(EntryFn, ???????); } Thank you! -- View this message in context: http://old.nabble.com/how-to-runFunction--passing-in-an-int-tp29479138p29479138.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
2012 Nov 27
0
[LLVMdev] MCJIT and Lazy Function Creators
...ll have to add that to the list of things that needs to be > done to replace the old JIT. > > In the projects I've worked on that use MCJIT, we've been using > getPointerToFunction and then calling it from outside the MCJIT > engine, but I suppose that the generic handling in runFunction would > be useful in some cases. FWIW, in my language `main' and other externally-callable function does not have a fixed signature: it can take and return any type(s) from a set of well-known types. Most test cases here are failing because, for returning a string, `main' is called w...
2013 Jan 30
1
[LLVMdev] Jump back to/return from runFunction
...rolled by the host to detect misbehaving guest code. Therefore the guest can't be expected to cooperate in this situation. I'm not concerned about any tracking in the guest code, it will handle a premature finish just fine. I'm more worried about the LLVM internals: if I longjmp out of runFunction I'm assuming LLVM may leak resources, or be left in a dirty state. My guess is that exceptions won't actually work. This is because the guest code can actually use exceptions (or will, not yet in my case). I assume that if the host is also compiled with LLVM then the exception handling...
2008 Nov 15
1
[LLVMdev] How to use EE->runFunction for a function with StructRet set?
...gt;getTargetData()->getABITypeSize(structRetType); // Make room on stack void* p = alloca(size); // Create parameter list std::vector<GenericValue> parameters; GenericValue structRetParameter; structRetParameter = PTOGV(p); parameters.push_back(structRetParameter); EE->runFunction(F, parameters); // Copy and print result std::string result = *(std::string*)p; std::cout << "Result: " << result << std::endl; // TODO: call std::string destructor return 0; } = Compile = g++ -o TestStructRet TestStructRet.cc `llvm-config --cxxflags --...
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 thoughts? greet...
2012 Nov 07
0
[LLVMdev] How to get a custom type from ExecutionEngine::runFunction
I'm starting to work with custom types and wondering how I can pass/return them via the ExecutionEngine? runFunction returns only a GenericValue, so it appears somehow I must make use of its pointer member. For example, how do call this function/type: %struct.mine = type { i32, i8, float, double } define void @make_struct(%struct.mine* noalias sret %agg.result, i32 %a, i8 signext %b) -- edA-qa mort-ora-y...