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

Praveen Velliengiri via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 12 13:54:48 PDT 2019


Hi Chris,
You approach to emit globals seems correct to me, there is also a
possibility that unused globals being removed. Could you please describe
your problem?
For question 2:
You can lookup the globals with their source name, besides ORC do internal
interning of Symbols.

On Mon, 12 Aug 2019 at 22:57, David Blaikie via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> +Lang Hames <lhames at gmail.com>, Admiral of the Orcish Fleet (Lang's the
> primary developer/creator of the ORC JIT & might have some answers to your
> question)
>
> On Thu, Aug 8, 2019 at 4:15 PM chris boese via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> 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.
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190813/59057d94/attachment.html>


More information about the llvm-dev mailing list