similar to: [LLVMdev] How to free memory of JIT'd function

Displaying 20 results from an estimated 4000 matches similar to: "[LLVMdev] How to free memory of JIT'd function"

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
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
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
2012 Dec 13
0
[LLVMdev] Memory leaks after llvm_shutdown
Hi llvmdev! In our project (Windows, Visual Studio compiler) we've got some frontend which generates LLVM IR. Now I'm observing strange *llvm_shutdown* behavior. If I called it when I was done using the LLVM APIs I saw that destructors of static objects created new ManagedStatic objects, which was never freed. Then I tried to use static global llvm_shutdown_obj to cause destruction
2008 Nov 04
2
[LLVMdev] Basic questions
Hi, I apologize in advance if this is not the correct place to ask these questions, but I would be very grateful for redirection to the appropriate list/docs if so. I've just started with LLVM in the last week or so, and have worked my way through the Kaleidoscope tutorial, the IR docs & programmers manual, plus a few of the examples; everything makes sense. But there's one
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,
2010 May 27
1
[LLVMdev] Deep JIT specialization
Hi Chris, Thanks for pointing me to that presentation! It helped me come up with a strategy that I believe might work: 1) Use CloneFunction() to make a copy of the original unspecialized (but optimized) function. 2) Specialize it using a custom function pass which identifies the specialization parameters and substitutes them with given run-time constants. 3) Run the function through a
2016 Sep 14
4
setDataLayout segfault
I get a segfault with this code when setting the data layout: int main(int argc, char** argv) { llvm::InitializeNativeTarget(); llvm::LLVMContext TheContext; unique_ptr<Module> Mod(new Module("A",TheContext)); llvm::EngineBuilder engineBuilder(std::move(Mod)); std::string mcjit_error; engineBuilder.setMCPU(llvm::sys::getHostCPUName());
2006 Mar 23
0
[LLVMdev] Re: LLVM JIT questions
<ccing llvmdev> On Thu, 23 Mar 2006, Eric van Riet Paap wrote: > I am experimenting with the LLVM JIT as a future codegenerator for the PyPy > JIT. The basics are working which I am extremely happy with! Great! > Maybe you could answer a few questions? (I'm away until monday) > > * Is there a way to show the generated code? Yes, pass -print-machineinstrs into the LLVM
2015 Mar 20
2
[LLVMdev] LLVM Exception Handling
Hi, I am trying to implement a scenario similar to running ExceptionDemo.cpp with parameter -1 (where the JITed code calls the C++ function which throws an exception) Different from the given example I am using IRParser instead of IRBuilder. I can successfully catch the exception in Linux but the program crashes in Mac and Windows. The code is similar to as follows: ### The test.cpp :
2010 May 27
0
[LLVMdev] Deep JIT specialization
On May 27, 2010, at 6:08 AM, Nicolas Capens wrote: > Hi all, > > I'm attempting to use LLVM for run-time code specialization, but I'm facing a performance hurdle. I'm currently performing the specialization during the AST to LLVM IR translation, but unfortunately this leads to relatively slow recompiles as LLVM has to perform all the heavy (optimization) passes over and
2008 Dec 23
2
[LLVMdev] ParseAssemblyString change of behaviour
Hi, when upgrading my compiler from LLVM 2.1 to 2.4 I stumbled upon a change of behaviour in ParseAssemblyString. For an interactive toplevel I am generating .ll source and feeding it into ParseAssemblyString like this: Module* parsedModule = ParseAssemblyString( code, targetModule, &errorInfo ); where targetModule is the module I expect all the LLVM code to go. Until 2.1 the
2008 Dec 23
0
[LLVMdev] ParseAssemblyString change of behaviour
On Dec 23, 2008, at 7:15 AM, Jan Rehders wrote: > Hi, > > when upgrading my compiler from LLVM 2.1 to 2.4 I stumbled upon a > change of behaviour in ParseAssemblyString. For an interactive > toplevel I am generating .ll source and feeding it into > ParseAssemblyString like this: Hi Jan, I don't think that there is any intentional change here. It sounds like a bug.
2010 May 18
0
[LLVMdev] Possible memory leak in LLVM 2.5
I'm unfamiliar with the leak you've just described, but Jeffrey Yasskin has done a lot of work cleaning up leaks for 2.7 and trunk. I was just going to mention that unless the function you are calling via runFunction has a simple prototype that's special cased in runFunction, it will generate its own stub function for every call. If you don't want to worry about that, you can call
2016 Sep 14
2
setDataLayout segfault
Ok. I can make a copy of the unique_ptr before moving it into the builder's constructor and use the copy later on. It is confusing to require a unique_ptr. Frank On 09/14/2016 12:11 PM, Frank Winter via llvm-dev wrote: > I am constructing the engine builder in the following way: > > llvm::SMDiagnostic Err; > unique_ptr<Module> Mod = getLazyIRFileModule("f.ll",
2010 May 18
2
[LLVMdev] Possible memory leak in LLVM 2.5
Hi, I'm current using LLVM 2.5 to JIT code in a event driven language running on a game engine. Haven't updated to 2.7 yet, but I do intend to. When checking for memory leaks I found that each time I was calling EE->runFunction after creating a stub function to execute an event, all the pass information was being repeatedly added to PMDataManager. I have changed addAnalysisImplsPair
2007 Dec 04
2
[LLVMdev] Memory allocation (or deallocation) model?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've been reading the headers and http://llvm.org/releases/2.1/docs/ProgrammersManual.html and I'm still confused about a pretty fundamental point... who is expected to clean up various objects when we're finished with them, and when? Let's say I've created a module, retrieved a bunch of types, created a function, a basic block,
2006 Nov 28
2
[LLVMdev] question about the LLVM JIT
<cc'ing llvmdev> On Tue, 28 Nov 2006, Eric van Riet Paap wrote: > I'm working on using the LLVM JIT in PyPy and I hop you can give me a few > hint. ok > I have some things working at and try to write C++ code for what I need > from Python. The unittest I am working on at the moment is looks like > this > > --- Python code... > llglobalmul4 =
2006 May 05
2
[LLVMdev] ExecutionEngine blew the stack ?
On Fri, 5 May 2006, Simon Burton wrote: > This leads me to my next question: as I make more and more functions > with the EE, it slows down. I am re-using the Module, ExistingModuleProvider, > and ExecutionEngine, and pumping the parser like so: > M = ParseAssemblyString(AsmString, M); > ISTM that there should be a way of creating multiple modules/EEs but I ran > into trouble