[PATCH] New GlobalMappingLayer for Orc

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 22:59:37 PDT 2015


Hi Andy,

Thanks for working on this. I think ORC can get away with a much simpler
global mapping scheme than ExecutionEngine had: ORC layers should deal only
with string symbol names and TargetAddresses, never Value*s or void*s
(though we can provide free functions for convenience to make it easy to
use these). The full interface to the GlobalMappingLayer should just be: {
<Constructor>, setGlobalMapping(Symbol, Address),
removeGlobalMapping(Symbol), clearGlobalMappings(), addModuleSet,
findSymbol, findSymbolIn, emitAndFinalize, and removeModule }. I don't
think we need the reverse mapping: ORC needs a way to get symbols from
addresses, but to go the other way you would usually attach debug info,
rather than maintaining a reverse symbol table. Finally, this should be a
module layer (like IRTransformLayer) rather than an ObjectLayer.

I'm happy to adapt your patch with this in mind if you like - I believe the
Kaleidoscope example would still work as expected with the changes I would
make. Otherwise if you'd like to update the patch I'd be happy to review
the changes too.

Cheers,
Lang.


On Tue, Aug 25, 2015 at 2:41 PM, Lang Hames <lhames at gmail.com> wrote:

> Hi Andy, David,
>
> I have spotted it, I've just been flat out with the Kaleidoscope update.
> I'm planning to review this this evening. :)
>
> - Lang.
>
>
> On Tue, Aug 25, 2015 at 2:33 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
>> +Lang to the actual 'to' line so he's got a greater chance of spotting it
>>
>> On Tue, Aug 25, 2015 at 2:31 PM, Andy Somogyi via llvm-commits <
>> llvm-commits at lists.llvm.org> wrote:
>>
>>> Hey Lang,
>>>
>>> Would you mind having a look at this patch, it adds a new
>>> GlobalMappingLayer to Orc, and it can be used in the new Kaleidoscope
>>> updates to add existing global mappings like were possible with the
>>> previous JIT ExecutionEngine.
>>>
>>>
>>>
>>> On Aug 22, 2015, at 1:29 AM, Andy Somogyi <andy.somogyi at gmail.com>
>>> wrote:
>>>
>>> Attached is a patch that contains the new GlobalMappingLayer for Orc.
>>>
>>> This layer allows existing global values to be added and resolved in the
>>> Orc JIT just like it was possible with ExecutionEngine. The Orc
>>> kaleidoscope example was updated to use the new GlobalMappingLayer, and
>>> actually use the three defined external functions.
>>>
>>> The new layer contains all the functionality that ExecutionEngine had,
>>> and with this layer, it should be very straightforward to finish the
>>> OrcMCJITReplacement to reference existing C functions and data.
>>>
>>>
>>> <0001-New-GlobalMappingLayer-to-allow-existing-functions-t.patch>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150825/2ad4bbbf/attachment.html>


More information about the llvm-commits mailing list