[llvm-dev] ORC JIT api, object files and stackmaps

Christian Schafmeister via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 5 10:44:56 PST 2018


I think I found the answer to #3 and #4.
(a) I overloaded the SectionMemoryManager::finalizeMemory(...) method.
(b) I first call the base classes method (maybe not necessary).
(c) At this point the __llvm_stackmaps section that I saved in thread local
memory when allocateDataSection was called appears to be fully set up and
relocated.


On Mon, Nov 5, 2018 at 12:36 PM Christian Schafmeister <meister at temple.edu>
wrote:

> I have a few questions about the new ORC JIT.
>
> I saw Lang Hames (hi!) excellent talk at the llvm-dev meeting a few weeks
> ago. The ORC JIT is undergoing some API changes and I'd like/need to take
> advantage of them.
>
> (1) How do I take ownership of the ObjectFile once the ORC JIT has created
> it?
>     I'd like to take ownership of object files generated by the ORC JIT so
> that I can save them to disk and in later sessions reload them.
> (2) How would I pass an ObjectFile saved in question#1 back to ORC so that
> it will relocate it and generate function pointers?
> (3) How do I get access to the relocated ObjectFile sections?
>     Currently I subclass SectionMemoryManager and implement
> allocateDataSection(...)
>     I can get the memory for the "__llvm_stackmaps" section - but I don't
> know when/if the contents have been fully set up with relocated function
> pointers.
> (4) For the "__llvm_stackmaps" section - will I need to do any relocation
> to obtain the function pointers?
>
> Background:
> I'm using llvm.experimental.stackmaps to register one variable in each
> stack frame that contains spilled register arguments.
> I've figured out how to get access to the stackmaps for code that I load
> into my system from dynamic libraries that our compiler generates.
> The answers to questions above will help me get access to the stackmaps
> from ORC JITted code.
>
> --
> Christian Schafmeister
> Professor, Chemistry Department
> Temple University
>


-- 
Christian Schafmeister
Professor, Chemistry Department
Temple University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181105/007f0b26/attachment.html>


More information about the llvm-dev mailing list