[LLVMdev] Deleting order and acquiring generated function

Evan Cheng evan.cheng at apple.com
Wed May 21 11:15:56 PDT 2008


When JITEmitter is teared down, it also deletes the JITMemoryManager  
instance. That in turns release the memory of the generated functions.  
Is this what you are referring to?

The DefaultJITMemoryManager is pretty simple. You can obviously write  
your own memory manager class that maps the memory in a way that's  
persistent. Then all you have to do is to pass a handle of it to  
JITEmitter.

Evan

On May 21, 2008, at 2:48 AM, Nicolas Capens wrote:

> Hi all,
>
> I’m using LLVM to generate a fairly large number of separate  
> functions at run-time. To minimize the memory overhead, I’d like to  
> delete the IR and everything else that is no longer needed after a  
> function has been generated (I don’t use lazy compilation or  
> anything like that).
>
> I noticed that deleting the ExecutionEngine deletes everything  
> (Module, Function(s), ExistingModuleProvider, and even the  
> LLVMBuilder). Unfortunately it also frees the generated function in  
> memory itself.
>
> So is there an existing way to delete everything except the in- 
> memory generated function? Alternatively, is there a way to just  
> delete the IR and related overhead so everything is ready for  
> generating the next function?
>
> If both are possible, which is the best approach? I have to generate  
> new functions from time to time, so keeping some of the LLVM objects  
> around seems like a good idea if the cost of reconstructing them is  
> considerable. As far as I can tell LLVM looks relatively light- 
> weight though so I’d prefer deleting everything and keeping just the  
> generated functions…
>
> Thanks again for any info,
>
> Nicolas Capens
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080521/f293577b/attachment.html>


More information about the llvm-dev mailing list