6 Commits

Author SHA1 Message Date
Lang Hames
adae88fe6f [ORC] Fix a think-o in the current AsynchronousSymbolQuery test.
This *should* be a no-op as far as the current failure is concerned, but needs
to be fixed anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321919 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 01:06:05 +00:00
Lang Hames
cac7dd493a [ORC] Re-apply just the AsynchronousSymbolLookup class from r321838 while I
investigate builder / test failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321910 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 22:50:43 +00:00
Lang Hames
d84b15b1d9 [ORC] Re-revert r321838: Tests are still failing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321858 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 03:10:15 +00:00
Lang Hames
9b3761cc7d [ORC] Re-apply r321838 - Addition of new ORC core APIs.
The original commit broke the builders due to a think-o in an assertion:
AsynchronousSymbolQuery's constructor needs to check the callback member
variables, not the constructor arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321853 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 02:21:02 +00:00
Lang Hames
60d5d5c881 Revert r321838 -- It broke some of the builders.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321842 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 00:29:37 +00:00
Lang Hames
de9aafe93f [ORC] Add new core ORC APIs (Core.h/Core.cpp): VSO, AsynchronousSymbolQuery and
SymbolSource.

These new APIs are a first stab at tackling some current shortcomings of ORC,
especially in performance and threading support.

VSO (Virtual Shared Object) is a symbol table representing the symbol
definitions of a set of modules that behave as if they had been statically
linked together into a shared object or dylib. Symbol definitions, either
pre-defined addresses or lazy definitions, can be added and queries for symbol
addresses made. The table applies the same linkage strength rules that static
linkers do when constructing a dylib or shared object: duplicate definitions
result in errors, strong definitions override weak or common ones. This class
should improve symbol lookup speed by providing centralized symbol tables (as
compared to the findSymbol implementation in the in-tree ORC layers, which
maintain one symbol table per object file / module added).

AsynchronousSymbolQuery is a query for the addresses of a set of symbols.
Query results are returned via a callback once they become available. Querying
for a set of symbols, rather than one symbol at a time (as the current lookup
scheme does) the JIT has the opportunity to make better use of available
resources (e.g. by spawning multiple jobs to materialize the requested symbols
if possible). Returning results via a callback makes queries asynchronous, so
queries from multiple threads of JIT'd code can proceed simultaneously.

SymbolSource represents a source of symbol definitions. It is used when
adding lazy symbol definitions to a VSO. Symbol definitions can be materialized
when needed or discarded if a stronger definition is found. Materializing on
demand via SymbolSources should (eventually) allow us to remove the lazy
materializers from JITSymbol, which will in turn allow the removal of many
current error checks and reduce the number of RPC round-trips involved in
materializing remote symbols. Adding a discard function allows sources to
discard symbol definitions (or mark them as available_externally), reducing the
amount of redundant code generated by the JIT for ODR symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321838 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 00:04:16 +00:00