<div dir="ltr">Hi All,<div><br></div><div>I was hoping to land the refactor on the mainline this weekend, but no such luck: I've still got one outstanding remote-JIT test failure that I need to work through tomorrow. In the meantime I've posted the very-nearly-complete patch at [1].</div><div><br></div><div>Two preliminary patches that aim to support the refactor did land today:</div><div><br></div><div>"[ORC] Add TaskDispatch API and thread it through ExecutorProcessControl" [2].</div><div><br></div><div>TaskDispatcher provides an interface for dispatching orc::Tasks that includes a shutdown operation to wait for dispatched work to complete (in this sense it is a generalization of ExecutionSession::DispatchTaskFunction, which only dispatches). In the future it will replace DispatchTaskFunction in ExecutionSession, but in this patch the goal was to add a TaskDispatcher to ExecutorProcessControl. The memory manager refactor makes heavy use of asynchronous functions, so we want a way to dispatch handlers rather than running them in-place where (e.g. in SimpleRemoteEPC) they might block a listener thread (potentially causing a deadlock).</div><div><br></div><div>[ORC] Add optional RunPolicy to ExecutorProcessControl::callWrapperAsync. [3]<br></div><div><br></div><div>The patch above fixes the (potential) deadlock issue by allowing us to dispatch handlers, but we don't want to dispatch all of them: dispatch involves heap allocation, and may require inter-thread communication. That's all wasted for short handlers, like the ones that set promise values in the synchronous convenience functions. The RunPolicy utility allows us to specify, on a per-handler basis, whether handlers should be run in-place, dispatched, or executed some other way.</div><div><br></div><div>Once the memory manager refactor lands the next big task will be updating the Platforms and ORC runtime to use it.</div><div><br></div><div>-- Lang.</div><div><br></div><div>[1] <a href="https://github.com/lhames/llvm-project/commit/4be3e7a00bbbc41308c8eadb40c234198b17fb71">https://github.com/lhames/llvm-project/commit/4be3e7a00bbbc41308c8eadb40c234198b17fb71</a></div><div>[2] <a href="https://github.com/llvm/llvm-project/commit/f34116168964be7886622e6f9b574f5c2d460ac9">https://github.com/llvm/llvm-project/commit/f34116168964be7886622e6f9b574f5c2d460ac9</a></div><div>[3] <a href="https://github.com/llvm/llvm-project/commit/4d7cea3d2e833209d06e201a273f97342035c196">https://github.com/llvm/llvm-project/commit/4d7cea3d2e833209d06e201a273f97342035c196</a></div></div>