[llvm-dev] New ORC v2 LLJIT - global variables

chris boese via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 8 08:56:46 PDT 2019


We are trying to switch to the new orc v2 lljit engine at my work with
hopes of parallel jitting. We are switching from the ExecutionEngine w/
OrcMCJitReplacement. We are having a hard time with global variables. We
have found a way to create/emit new globals during jitting by using the old
ExecutionEngine::getOrEmitGlobalVariable. Is there an easier way to do this
with the new jit engine? We were hoping to create a new ThreadSafeModule,
add a GlobalVariable, and then add the module to the JIT engine through
addLazyIRModule(), but this doesn't seem to work.

2nd question; Is the lookup function supposed to work with global variables
by name? Looking through the CompileOnDemandLayer it seems to change the
names of globals to "__orc_lcl.<name><id>". Does this affect the lookup
methods? I noticed that all of the globals we are looking for are tagged
with Internal linkage and end up getting emitted through extractSubModule().

Any help is appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190808/bf4f8ea4/attachment.html>


More information about the llvm-dev mailing list