Page MenuHomePhabricator

[ORC] Add JITLink-compatible remote memory-manager and LLJITWithChildProcess example
ClosedPublic

Authored by sgraenitz on Aug 13 2020, 11:44 AM.

Details

Summary

This adds RemoteJITLinkMemoryManager is a new subclass of OrcRemoteTargetClient. It implements jitlink::JITLinkMemoryManager and targets the OrcRemoteTargetRPCAPI.

Behavior should be very similar to RemoteRTDyldMemoryManager. The essential differnce with JITLink is that allocations work in isolation from its memory manager. Thus, the RemoteJITLinkMemoryManager might be seen as "JITLink allocation factory".

RPCMMAlloc is another subclass of OrcRemoteTargetClient and implements the actual functionality. It allocates working memory on the host and target memory on the remote target. Upon finalization working memory is copied over to the tagrte address space. Finalization can be asynchronous for JITLink allocations, but I don't see that it makes a difference here.

Diff Detail

Event Timeline

sgraenitz created this revision.Aug 13 2020, 11:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 13 2020, 11:44 AM
sgraenitz requested review of this revision.Aug 13 2020, 11:44 AM

I didn't see a memory manager in the new TargetProcessControl API (yet). Maybe it can also be migrated there.

What's all the clang-tidy errors from pre-merge check? Haven't had any linting issues locally. Are we supposed to add entries to this clang-tidy.ignore?

lhames accepted this revision.Aug 13 2020, 2:08 PM

LGTM.

This is amazing timing too -- I'm actually working on ORCRPCTargetProcessControl implementation right now, but haven't had time to write an allocator for it yet. Would you mind if I moved yours into a header once my patch is ready?

This revision is now accepted and ready to land.Aug 13 2020, 2:08 PM

I didn't see a memory manager in the new TargetProcessControl API (yet). Maybe it can also be migrated there.

What's all the clang-tidy errors from pre-merge check? Haven't had any linting issues locally. Are we supposed to add entries to this clang-tidy.ignore?

I'm not sure about the pre-merge checks. Most of those looked like noise to me? Was the patch already clang-formatted?

This revision was landed with ongoing or failed builds.Aug 14 2020, 2:35 AM
This revision was automatically updated to reflect the committed changes.

Would you mind if I moved yours into a header once my patch is ready?

Yes please.

I'm not sure about the pre-merge checks. Most of those looked like noise to me? Was the patch already clang-formatted?

Yes, I did clang-format it before submitting. Well, let's see.

Fixed with commit 28e1015e327ec56ac4bf93967d3aa2915b215e36

[ORC] Fix missing include in OrcRemoteTargetClient.h