Displaying 20 results from an estimated 11000 matches similar to: "[LLVMdev] Basic questions"
2008 Nov 06
0
[LLVMdev] Basic questions
Hi,
The JIT engine currently uses a single memory block for all functions that
you JIT-compile (and global variables, constants, etc..). Still, you can
easily create and delete machine code.
You can use the following functions:
engine->freeMachineCodeForFunction(function); // clean the JITed code
function->eraseFromParent(); // clean a function's IR
About the lifetime of the classes,
2008 Nov 07
2
[LLVMdev] Fwd: Basic questions
Thanks, that helps. I saw the possibility to redefine function bodies
in the Kaleidoscope tutorial. What's not so clear to me yet, is how
to support multiple Modules, but it's getting clearer now.
Can I run a potential case past you just to be sure that it is/isn't
possible?
I'd like to support users dynamically adding and using functions
(plus structs, globals etc) to a
2013 Jan 14
3
[LLVMdev] Memory clean for applications using LLVM for JIT compilation
Hello all,
I've already bothered people on IRC with this question and it was recommended to ask it here.
First of all, some context. In Rubinius (http://rubini.us/, http://github.com/rubinius/rubinius) we use LLVM for our JIT. We create LLVM IR using the C++ API and turn that into machine code using ExecutionEngine::runJITOnFunction. The resulting native code is then installed as the
2010 Jan 31
3
[LLVMdev] Redefining function
Albert Graef wrote:
> The way I do this in Pure is to always call global functions in an
> indirect fashion, using an internal global variable which holds the
> current function pointer. When a function definition gets updated, the
> Pure interpreter just jits the new function, changes the global variable
> accordingly, and frees the old code.
>
> Compared to Duncan's
2011 Dec 29
2
[LLVMdev] How to free memory of JIT'd function
Hi,
I'm testing how to free memory of a JIT'd function.
I thought ExecutionEngine::freeMachineCodeForFunction() and
Function::eraseFromParent()
would work and did a test with the following sample code.
But I found that the memory usage of the process is constantly growing as
the while loop goes.
Could someone shed light on this please?
Here is the code.
int main(int argc, char **argv) {
2010 Jan 31
2
[LLVMdev] Redefining function
Just updated the source and now I get the unreachable error again.
The JIT doesn't know how to handle a RAUW on a value it has emitted.
UNREACHABLE executed at
/home/conrado/engines/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1542!
I think that it's not helpful now, but I can post the program, if you want
me to.
On Sun, Jan 31, 2010 at 2:49 PM, Jeffrey Yasskin <jyasskin at
2009 Mar 20
2
[LLVMdev] Possible memory leakage in the LLVM JIT Engine
Hi,
In my application I am JITing thousands of functions, though I am doing it
sequantially and running only one at a time. So it is crucial to be able to
properly clean up the memory from an old JITed function when JITing and
running the new one.
I am using Haskell binding of LLVM and my application works OK. However,
memory usage increases and never decreases during the run time of my
2013 Jan 14
0
[LLVMdev] Memory clean for applications using LLVM for JIT compilation
On Mon, Jan 14, 2013 at 4:56 AM, Dirkjan Bussink <d.bussink at gmail.com>wrote:
> Hello all,
>
> I've already bothered people on IRC with this question and it was
> recommended to ask it here.
>
> First of all, some context. In Rubinius (http://rubini.us/,
> http://github.com/rubinius/rubinius) we use LLVM for our JIT. We create
> LLVM IR using the C++ API and
2010 Jan 31
0
[LLVMdev] Redefining function
On Sat, Jan 30, 2010 at 6:22 PM, Conrado Miranda
<miranda.conrado at gmail.com> wrote:
> Albert Graef wrote:
>>
>> The way I do this in Pure is to always call global functions in an
>> indirect fashion, using an internal global variable which holds the
>> current function pointer. When a function definition gets updated, the
>> Pure interpreter just jits the
2010 Feb 01
0
[LLVMdev] Redefining function
Hm, I wonder if the error message for llvm_unreachable should change.
I think I remember a couple people focusing incorrectly on the
UNREACHABLE instead of the actual error message above it (which means
it's our fault, not theirs).
Miranda, this is pointing at the same problem you had before. You have
a function JIT-compiled, and you're trying to RAUW
(ReplaceAllUsesWith) it. You'll
2010 Mar 31
1
[LLVMdev] JIT::freeMachineCodeForFunction(Function *F) on ARM
Hello Everyone,
Does void JIT::freeMachineCodeForFunction(Function *F) work on arm? I get a crash when I call it on arm.I don't have access to gdb on the simulator I am using , so can't say for sure if it works.
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2012 Jan 05
0
[LLVMdev] How to free memory of JIT'd function
Hi,
I put the sample code and a brief analysis using Valgrind to GitHub
in order to make my problem clear.
https://github.com/naosuke/how-to-free-memory-of-JIT-function
The Valgrind heap profiler indicates memory leaking but I don't get
what is wrong with the way to free memory.
If someone could please offer some advice/suggestion on this, I would
really appreciate it.
Best,
Naosuke
On
2014 Apr 26
2
[LLVMdev] Drop the machine code while executing
That's a good point. But it's worth noting that recompileAndRelinkFunction() and freeMachineCodeForFunction() are both vestiges of the old JIT (i.e. the "JIT" as opposed to the "MCJIT"). The old JIT is no longer actively supported.
-Phil
On April 26, 2014 at 9:47:05 AM, Sri (emdcdeveloper at gmail.com) wrote:
Hi Fillip
Addition to my previous
2012 Jan 10
1
[LLVMdev] How to free memory of JIT'd function
There may be another explanation, but I've seen this sort of issues before: LLVM uses several object pools (associated w/ LLVM context and JIT engine), and often objects from these pools are leaked, or the pools grow infinitely due to implementation bugs.
These are not an ordinary memory leaks, as destroying the LLVM context and/or JIT engine will successfully reclaim all the memory. The
2014 Apr 26
2
[LLVMdev] Drop the machine code while executing
Hi Filip
Thank you for your detailed explanation, I was actually
looking to implement an adaptive approach which is basically when some
function executed more frequently, I was trying to drop that function
and compiled and linked with new optimized function. I just did the
following -
whenever some function executed more times , I called-back
to program, so I that I
2014 Jun 29
2
[LLVMdev] Wrong behavior modifying and executing llvm::Function with JIT Engine
Hello,
The problem I'm having is that I modify a function body by using
'Value::replaceAllUsesWith' and then execute it with the JIT engine
several times but I always get the output from the first iteration for
all the iterations.
This is what I do:
I generate the following 2 functions on the fly based on the
FunctionType of the declaration below in C code.
define i32
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
2008 Mar 26
3
[LLVMdev] JIT and anonymous procs
On Wed, 2008-03-26 at 10:40 -0700, Chris Lattner wrote:
> On Wed, 26 Mar 2008, Jonathan S. Shapiro wrote:
> > The Kaleidoscope tutorial has us "interpreting" top-level expressions by
> > generating a one-shot anonymous procedure and executing that. Once the
> > expressions have been executed, these procedures will never be called
> > again.
> >
> >
2013 Nov 21
1
[LLVMdev] Replacing C-style function
Hi,
I am trying to replace a c-style function with another function with same
signature. Consider the following code:
std::stringstream main_c;
main_c
<<"#include <stdio.h>\n"
<<"extern \"C\" { \n"
<<"int print1()\n"
<<"{\n"
<<" printf(\"Inside
2007 Sep 28
2
[LLVMdev] Accounting for code size
On 9/28/07, Chris Lattner <sabre at nondot.org> wrote:
>
> > Sorry, I meant to ask whether it's still necessary to keep F around,
> > ie. to delete generated code. Is there a standard approach to garbage
> > collecting code in LLVM?
>
> Machine code in the JIT buffer or the LLVM IR itself?
>
Assuming I don't need to keep around the IR version of a