summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ORC] Re-apply 286620 with fixes for the ErrorSuccess class.Lang Hames2016-11-111-53/+0
| | | | llvm-svn: 286639
* [ORC] Revert r286620 while I investigate a bot failure.Lang Hames2016-11-111-0/+53
| | | | llvm-svn: 286621
* [ORC] Refactor the ORC RPC utilities to add some new features.Lang Hames2016-11-111-53/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (1) Add support for function key negotiation. The previous version of the RPC required both sides to maintain the same enumeration for functions in the API. This means that any version skew between the client and server would result in communication failure. With this version of the patch functions (and serializable types) are defined with string names, and the derived function signature strings are used to negotiate the actual function keys (which are used for efficient call serialization). This allows clients to connect to any server that supports a superset of the API (based on the function signatures it supports). (2) Add a callAsync primitive. The callAsync primitive can be used to install a return value handler that will run as soon as the RPC function's return value is sent back from the remote. (3) Launch policies for RPC function handlers. The new addHandler method, which installs handlers for RPC functions, takes two arguments: (1) the handler itself, and (2) an optional "launch policy". When the RPC function is called, the launch policy (if present) is invoked to actually launch the handler. This allows the handler to be spawned on a background thread, or added to a work list. If no launch policy is used, the handler is run on the server thread itself. This should only be used for short-running handlers, or entirely synchronous RPC APIs. (4) Zero cost cross type serialization. You can now define serialization from any type to a different "wire" type. For example, this allows you to call an RPC function that's defined to take a std::string while passing a StringRef argument. If a serializer from StringRef to std::string has been defined for the channel type this will be used to serialize the argument without having to construct a std::string instance. This allows buffer reference types to be used as arguments to RPC calls without requiring a copy of the buffer to be made. llvm-svn: 286620
* [Orc] Re-commit r266581 with fixes for MSVC, and format cleanups.Lang Hames2016-04-181-35/+25
| | | | | | | | | | Fixes: (1) Removes constexpr (unsupported in MSVC) (2) Move constructors (remove explicitly defaulted ones) (3) <future> - Add warning suppression for MSVC. llvm-svn: 266663
* Revert 266581 (and follow-up 266588), it doesn't build on Windows.Nico Weber2016-04-181-25/+35
| | | | | | | | | | Three problems: 1. <future> can't be easily used. If you must use it, see include/Support/ThreadPool.h for how. 2. constexpr problems, even after 266588. 3. Move assignment operators can't be defaulted in MSVC2013. llvm-svn: 266615
* [ORC] Generalize the ORC RPC utils to support RPC function return values andLang Hames2016-04-181-35/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | asynchronous call/handle. Also updates the ORC remote JIT API to use the new scheme. The previous version of the RPC tools only supported void functions, and required the user to manually call a paired function to return results. This patch replaces the Procedure typedef (which only supported void functions) with the Function typedef which supports return values, e.g.: Function<FooId, int32_t(std::string)> Foo; The RPC primitives and channel operations are also expanded. RPC channels must support four new operations: startSendMessage, endSendMessage, startRecieveMessage and endRecieveMessage, to handle channel locking. In addition, serialization support for tuples to RPCChannels is added to enable multiple return values. The RPC primitives are expanded from callAppend, call, expect and handle, to: appendCallAsync - Make an asynchronous call to the given function. callAsync - The same as appendCallAsync, but calls send on the channel when done. callSTHandling - Blocking call for single-threaded code. Wraps a call to callAsync then waits on the result, using a user-supplied handler to handle any callbacks from the remote. callST - The same as callSTHandling, except that it doesn't handle callbacks - it expects the result to be the first return. expect and handle - as before. handleResponse - Handle a response from the remote. waitForResult - Wait for the response with the given sequence number to arrive. llvm-svn: 266581
* [Orc] #undef a MACRO after I'm done with it.Lang Hames2016-01-191-7/+10
| | | | | | | | Suggested by Philip Reames in review of r257951. Thanks Philip! llvm-svn: 258203
* [Orc] Replace switch cases with a macro.Lang Hames2016-01-151-62/+35
| | | | | | | | | The cases of this switch are all perfectly regular (except for the first case). A macro is more readable here. Thanks to Dave Blaikie for the suggestion. llvm-svn: 257951
* [Orc] Add support for EH-frame registration to the Orc Remote Target utilityLang Hames2016-01-141-0/+4
| | | | | | | | | classes. OrcRemoteTargetClient::RCMemoryManager will now register EH frames with the server automatically. This allows remote-execution of code that uses exceptions. llvm-svn: 257816
* [Orc] Add support for remote JITing to the ORC API.Lang Hames2016-01-111-0/+83
This patch adds utilities to ORC for managing a remote JIT target. It consists of: 1. A very primitive RPC system for making calls over a byte-stream. See RPCChannel.h, RPCUtils.h. 2. An RPC API defined in the above system for managing memory, looking up symbols, creating stubs, etc. on a remote target. See OrcRemoteTargetRPCAPI.h. 3. An interface for creating high-level JIT components (memory managers, callback managers, stub managers, etc.) that operate over the RPC API. See OrcRemoteTargetClient.h. 4. A helper class for building servers that can handle the RPC calls. See OrcRemoteTargetServer.h. The system is designed to work neatly with the existing ORC components and functionality. In particular, the ORC callback API (and consequently the CompileOnDemandLayer) is supported, enabling lazy compilation of remote code. Assuming this doesn't trigger any builder failures, a follow-up patch will be committed which tests these utilities by using them to replace LLI's existing remote-JITing demo code. llvm-svn: 257305
OpenPOWER on IntegriCloud