[ORC] Switch to asynchronous resolution in JITSymbolResolver.
authorLang Hames <lhames@gmail.com>
Tue, 25 Sep 2018 04:43:38 +0000 (04:43 +0000)
committerLang Hames <lhames@gmail.com>
Tue, 25 Sep 2018 04:43:38 +0000 (04:43 +0000)
commit0e5b60326e306cba3f4434692e5d37ffee8a2ae9
treef3861542b7857a06845397b7708d143f16f494e7
parent3c3e1c62650abb8692b43ba96b0f252418bc5057
[ORC] Switch to asynchronous resolution in JITSymbolResolver.

Asynchronous resolution (where the caller receives a callback once the requested
set of symbols are resolved) is a core part of the new concurrent ORC APIs. This
change extends the asynchronous resolution model down to RuntimeDyld, which is
necessary to prevent deadlocks when compiling/linking on a fixed number of
threads: If RuntimeDyld's linking process were a blocking operation, then any
complete K-graph in a program will require at least K threads to link in the
worst case, as each thread would block waiting for all the others to complete.
Using callbacks instead allows the work to be passed between dependent threads
until it is complete.

For backwards compatibility, all existing RuntimeDyld functions will continue
to operate in blocking mode as before. This change will enable the introduction
of a new async finalization process in a subsequent patch to enable asynchronous
JIT linking.

llvm-svn: 342939
llvm/include/llvm/ExecutionEngine/JITSymbol.h
llvm/include/llvm/ExecutionEngine/Orc/Core.h
llvm/include/llvm/ExecutionEngine/Orc/Legacy.h
llvm/lib/ExecutionEngine/Orc/Legacy.cpp
llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp
llvm/lib/ExecutionEngine/RuntimeDyld/JITSymbol.cpp
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h