similar to: [LLVMdev] JIT question: Inner workings of getPointerToFunction()

Displaying 20 results from an estimated 4000 matches similar to: "[LLVMdev] JIT question: Inner workings of getPointerToFunction()"

2008 May 27
0
[LLVMdev] JIT question: Inner workings of getPointerToFunction()
Hi, I was just reading through the Kaleidoscope tutorial (which is greatly written and understandable, thanks! ) hoping to get some glimpse about the workings of the JIT and the optimizations that are done at run time. I am curious as to how LLVM's JIT dynamically generates native code from bit code at run time and runs that code (I think my question is also somewhat more general in the sense
2012 Aug 06
2
[LLVMdev] Question about llvm JIT
I have a function in llvm ir as follows: def [2 x [3 x double]] @fun() { return [ ... ]; // a [2 x [3 x double]] constant } I would like to JIT this function in C. I first get the void pointer using: void *FPtr = TheExecutionEngine->getPointerToFunction( func ); Then I need to conver this void pointer to the corresponding C function pointer type, and then call the function
2012 Aug 06
0
[LLVMdev] Question about llvm JIT
On Mon, Aug 6, 2012 at 9:35 AM, Peng Cheng <gm4cheng at gmail.com> wrote: > I have a function in llvm ir as follows: > > def [2 x [3 x double]] @fun() > { > return [ ... ]; // a [2 x [3 x double]] constant > } > > I would like to JIT this function in C. > > I first get the void pointer using: > > void *FPtr =
2010 May 13
3
[LLVMdev] Handling of thread_local globals by llc -march=cpp
target triple = "i386-pc-linux-gnu" On 13/05/2010, at 9:25 PM, Anton Korobeynikov wrote: >> int (*FP)() = (int (*)())FPtr; >> int res = FP(); >> >> when the function executes correctly in the case of instead having created a standard global variable. > What is the platform you're running the code on? > > -- > With best regards, Anton
2010 May 13
0
[LLVMdev] Handling of thread_local globals by llc -march=cpp
I note also that this is not a currently unsupported target case where an error should/could/would be produced on attempting to emit code with thread local references. I say this because clang is able to compile both c source with __thread on a global and bc containing a @variable = thread_local global ... and a function that references the thread local global variable to both assembly and machine
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 +
2010 May 13
2
[LLVMdev] Handling of thread_local globals by llc -march=cpp
Thanks for the quick reply and fix. Now it just means I have to hunt further in exploring why, in my simple test program, replacing the following line of code: GlobalVariable* global = new GlobalVariable(*MyModule, IntegerType::get(getGlobalContext(), 32), false, GlobalValue::ExternalLinkage, 0, "global"); with the following line of code: GlobalVariable* global = new
2009 Nov 19
2
[LLVMdev] fastcc and ExecutionEngine::getPointerToFunction()
Yesterday I realised that if a Function has the calling convention set to "fast", then it is a bad idea to call it through the function pointer one gets from ExecutionEngine::getPointerToFunction(). The problem is that when calling it from my C++ program, the call will be made C-style, while the function expects to be called the fastcc way. Could LLVM either warn the user of this,
2013 Jan 26
1
[LLVMdev] MCJIT/interpreter and iostream
As of LLVM 3.2, is it possible to use iostream with the MCJIT or interpreter execution engines? I'm getting some errors... Each of these commands correctly prints "hello": echo -e '#include <stdio.h>\nint main(){ printf("hello"); }' | clang -cc1 -emit-llvm-bc -x c++ | lli -use-mcjit echo -e '#include <iostream>\nint main(){ std::cout <<
2009 Nov 19
2
[LLVMdev] fastcc and ExecutionEngine::getPointerToFunction()
Er... Sending this to the list instead of the parent... On Thu, Nov 19, 2009 at 4:49 AM, Hans Wennborg <hans at hanshq.net> wrote: > Yesterday I realised that if a Function has the calling convention set > to "fast", then it is a bad idea to call it through the function pointer > one gets from ExecutionEngine::getPointerToFunction(). > > The problem is that when
2010 Oct 26
2
[LLVMdev] handle error of getPointerToFunction
Hi! I have this scenario: executionEngine->getPointerToFunction fails because a symbol can not be resolved. What can I do to catch this error? is an exception thrown? currently the program simply exits. returning NULL would be ok too. -Jochen
2010 Oct 27
0
[LLVMdev] handle error of getPointerToFunction
Can you be more precise about where the error occurs? Depending on where it is, LLVM may or may not be able to propagate the error safely. Reid On Tue, Oct 26, 2010 at 4:05 PM, Jochen Wilhelmy <j.wilhelmy at arcor.de> wrote: > Hi! > > I have this scenario: > executionEngine->getPointerToFunction fails because a symbol can not be > resolved. > > What can I do to
2010 Feb 17
2
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
I am new to llvm so I might be missing a critical step. My system is Fedora 12 but this also happens in Mac OS X 10.6.2. Here are the steps I used to compile llvm: export TARGETS=x86,x86_64,cpp export INSTALLDIR=/home/rovitotv/llvm ../llvm-2.6/configure --prefix=$INSTALLDIR --enable-bindings=none --enable-targets=$TARGETS --enable-optimized --with-llvmgccdir=$INSTALLDIR
2013 Jun 04
0
[LLVMdev] MCJIT and Kaleidoscope Tutorial
Hi Dmitri, You might want to try replacing the call to JMM->invalidInstructionCache() with a call to TheExecutionEngine->finalizeObject(). If you are getting a non-NULL pointer from getPointerToFunction but it crashes when you try to call it, that is most likely because the memory for the generated code has not been marked as executable. That happens inside finalizeObject, which also
2010 Feb 17
0
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
First, you have to call llvm-g++ to use the llvm-gcc front end, but it doesn't matter here. I'd like to suggest that you use pastebin to put your code and the send us the link, so that we can download it. The problem is that TheExecutionEngine is set to NULL (maybe because of a previous error), but it will be really better if you use pastebin. On Wed, Feb 17, 2010 at 6:01 AM, Todd Rovito
2009 Nov 12
1
[ win32utils-Bugs-27425 ] win32-open3 doesn't build with 1.9.1
Bugs item #27425, was opened at 2009-11-11 21:15 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=27425&group_id=85 Category: win32-open3 Group: Code Status: Open Resolution: None Priority: 3 Submitted By: Daniel Berger (djberg96) Assigned to: Nobody (None) Summary: win32-open3 doesn''t build with 1.9.1 Initial Comment: Windows XP VC++ 9
2009 Jul 04
4
[LLVMdev] ModuleProvider materializeFunction
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 + JIT? My understanding (perhaps
2009 Nov 19
1
[LLVMdev] fastcc and ExecutionEngine::getPointerToFunction()
On Thu, Nov 19, 2009 at 12:45 PM, Samuel Crow <samuraileumas at yahoo.com> wrote: > > > > > ----- Original Message ---- >> From: Kenneth Uildriks <kennethuil at gmail.com> >> To: Samuel Crow <samuraileumas at yahoo.com> >> Cc: OvermindDL1 <overminddl1 at gmail.com>; LLVM Developers Mailing List <llvmdev at cs.uiuc.edu> >> Sent:
2017 Jan 10
2
[cfe-dev] Modernizing LLVM Coding Style Guide and enforcing Clang-tidy
2017-01-10 0:06 GMT+01:00 David Blaikie <dblaikie at gmail.com>: > > > On Mon, Jan 9, 2017 at 2:59 PM Sanjoy Das via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Hi, >> >> Sorry I fat fingered an earlier send in the previous email. I was >> trying to say: >> >> On Mon, Jan 9, 2017 at 2:52 PM, Sanjoy Das >> <sanjoy at
2017 Jan 09
3
[cfe-dev] Modernizing LLVM Coding Style Guide and enforcing Clang-tidy
Hi, Sorry I fat fingered an earlier send in the previous email. I was trying to say: On Mon, Jan 9, 2017 at 2:52 PM, Sanjoy Das <sanjoy at playingwithpointers.com> wrote: >> +1 Exactly this. >> I don't think C programmer will not understand using. The "=" makes it much >> simpler to read, even if it is the first time you see it, which is not the >>