This is an archive of the discontinued LLVM Phabricator instance.

Break out OrcError and RPC
ClosedPublic

Authored by beanz on Oct 9 2019, 2:28 PM.

Details

Summary

When createing an ORC remote JIT target the current library split forces the target process to link large portions of LLVM (Core, Execution Engine, JITLink, Object, MC, Passes, RuntimeDyld, Support, Target, and TransformUtils). This occurs because the ORC RPC interfaces rely on the static globals the ORC Error types require, which starts a cycle of pulling in more and more.

This patch breaks the ORC RPC Error implementations out into an "OrcError" library which only depends on LLVM Support. It also pulls the ORC RPC headers into their own subdirectory.

With this patch code can include the Orc/RPC/*.h headers and will only incur link dependencies on LLVMOrcError and LLVMSupport.

Diff Detail

Event Timeline

beanz created this revision.Oct 9 2019, 2:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 9 2019, 2:28 PM
lhames accepted this revision.Oct 10 2019, 4:55 PM

Hi Chris,

Thanks for working on this — it’ll be great not to drag all those extra dependencies in.

I think I would prefer to have an OrcRPC library (rather than OrcError), and split up the error definitions (RPC errors go in OrcRPC, others go in Orc Core). That said I’m happy for this to land as is and we can make that change in-tree.

Longer term I’d love to break Orc up even more: Ideally there would be a Core library that depends on nothing but Support and Object, and an OrcIR library for IR layers. I think we can tackle that after ORCv1 is killed off though.

— Lang.

This revision is now accepted and ready to land.Oct 10 2019, 4:55 PM
This revision was automatically updated to reflect the committed changes.