summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ExecutionEngine/Orc/CompileOnDemandLayerTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ORC] Rename ORC layers to make the "new" ORC layers the default.Lang Hames2018-10-151-89/+0
| | | | | | | | | | | | | This commit adds a 'Legacy' prefix to old ORC layers and utilities, and removes the '2' suffix from the new ORC layers. If you wish to continue using the old ORC layers you will need to add a 'Legacy' prefix to your classes. If you were already using the new ORC layers you will need to drop the '2' suffix. The legacy layers will remain in-tree until the new layers reach feature parity with them. This will involve adding support for removing code from the new layers, and ensuring that performance is comperable. llvm-svn: 344572
* [ORC] Refactor trampoline pool management out of JITCompileCallbackManager.Lang Hames2018-09-261-4/+9
| | | | | | | | | | | | | | | | | This will allow trampoline pools to be re-used for a new lazy-reexport utility that generates looks up function bodies using the standard symbol lookup process (rather than using a user provided compile function). This new utility provides the same capabilities (since MaterializationUnits already allow user supplied compile functions to be run) as JITCompileCallbackManager, but can use the new asynchronous lookup functions to avoid blocking a compile thread. This patch also updates createLocalCompileCallbackManager to return an error if a callback manager can not be created, and updates clients of that API to account for the change. Finally, the OrcCBindingsStack is updates so that if a callback manager is not available for the target platform a valid stack (without support for lazy compilation) can still be constructed. llvm-svn: 343059
* [ORC] Use JITEvaluatedSymbol for IndirectStubsManager findStub and findPointer.Lang Hames2018-06-031-2/+2
| | | | | | | | Existing implementations of these methods do not require lazy materialization, and switching to JITEvaluatedSymbol allows us to remove error checking on the client side. llvm-svn: 333835
* [ORC] Update JITCompileCallbackManager to support multi-threaded code.Lang Hames2018-05-301-2/+3
| | | | | | | | | Previously JITCompileCallbackManager only supported single threaded code. This patch embeds a VSO (see include/llvm/ExecutionEngine/Orc/Core.h) in the callback manager. The VSO ensures that the compile callback is only executed once and that the resulting address cached for use by subsequent re-entries. llvm-svn: 333490
* [ORC] Create a new SymbolStringPool by default in ExecutionSession constructor.Lang Hames2018-04-021-2/+1
| | | | | | This makes the common case of constructing an ExecutionSession tidier. llvm-svn: 329013
* [ORC] Start migrating ORC layers to use the new ORC Core.h APIs.Lang Hames2018-02-061-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular this patch switches RTDyldObjectLinkingLayer to use orc::SymbolResolver and threads the requried changse (ExecutionSession references and VModuleKeys) through the existing layer APIs. The purpose of the new resolver interface is to improve query performance and better support parallelism, both in JIT'd code and within the compiler itself. The most visibile change is switch of the <Layer>::addModule signatures from: Expected<Handle> addModule(std::shared_ptr<ModuleType> Mod, std::shared_ptr<JITSymbolResolver> Resolver) to: Expected<Handle> addModule(VModuleKey K, std::shared_ptr<ModuleType> Mod); Typical usage of addModule will now look like: auto K = ES.allocateVModuleKey(); Resolvers[K] = createSymbolResolver(...); Layer.addModule(K, std::move(Mod)); See the BuildingAJIT tutorial code for example usage. llvm-svn: 324405
* [ORC] Update the GlobalMappingLayer interface to fit the error-ized layerLang Hames2017-09-281-12/+9
| | | | | | | | | concept. Add a unit-test to make sure we don't backslide, and tweak the MockBaseLayer utility to make it easier to test this kind of thing in the future. llvm-svn: 314374
* [ORC] Add an Error return to the JITCompileCallbackManager::grow method.Lang Hames2017-09-031-1/+1
| | | | | | | | Calling grow may result in an error if, for example, this is a callback manager for a remote target. We need to be able to return this error to the callee. llvm-svn: 312429
* [ORC] Errorize the ORC APIs.Lang Hames2017-07-071-2/+3
| | | | | | | | This patch updates the ORC layers and utilities to return and propagate llvm::Errors where appropriate. This is necessary to allow ORC to safely handle error cases in cross-process and remote JITing. llvm-svn: 307350
* Re-sort #include lines for unittests. This uses a slightly modifiedChandler Carruth2017-06-061-1/+1
| | | | | | | | | | | | | | | clang-format (https://reviews.llvm.org/D33932) to keep primary headers at the top and handle new utility headers like 'gmock' consistently with other utility headers. No other change was made. I did no manual edits, all of this is clang-format. This should allow other changes to have more clear and focused diffs, and is especially motivated by moving some headers into more focused libraries. llvm-svn: 304786
* [ExecutionEngine][MCJIT][Orc] Replace RuntimeDyld::SymbolInfo with JITSymbol.Lang Hames2016-08-011-2/+2
| | | | | | | | | | | | | | | | This patch replaces RuntimeDyld::SymbolInfo with JITSymbol: A symbol class that is capable of lazy materialization (i.e. the symbol definition needn't be emitted until the address is requested). This can be used to support common and weak symbols in the JIT (though this is not implemented in this patch). For consistency, RuntimeDyld::SymbolResolver is renamed to JITSymbolResolver. For space efficiency a new class, JITEvaluatedSymbol, is introduced that behaves like the old RuntimeDyld::SymbolInfo - i.e. it is just a pair of an address and symbol flags. Instances of JITEvaluatedSymbol can be used in symbol-tables to avoid paying the space cost of the materializer. llvm-svn: 277386
* [ORC] clang-format code that was touched in r267457. NFC.Lang Hames2016-04-251-16/+14
| | | | | | | Commit r267457 made a lot of type-substitutions threw off code formatting and alignment. This patch should tidy those changes up. llvm-svn: 267475
* [ORC] Thread Error/Expected through the RPC library.Lang Hames2016-04-251-3/+3
| | | | | | | | | | This replaces use of std::error_code and ErrorOr in the ORC RPC support library with Error and Expected. This required updating the OrcRemoteTarget API, Client, and server code, as well as updating the Orc C API. This patch also fixes several instances where Errors were dropped. llvm-svn: 267457
* [Orc] Rename IndirectStubsManagerBase to IndirectStubsManager.Lang Hames2015-12-061-1/+1
| | | | | | No functional change. llvm-svn: 254885
* [Orc] Move some code up into the JITCompileCallbackManager base class. NFC.Lang Hames2015-12-041-10/+2
| | | | llvm-svn: 254778
* [Orc] Rename JITCompileCallbackManagerBase to JITCompileCallbackManager.Lang Hames2015-12-041-2/+2
| | | | | | | | | This class is turning into a useful interface, rather than an implementation detail, so I'm dropping the 'Base' suffix. No functional change. llvm-svn: 254693
* Orc: Streamline some lambda usage in a unit testDavid Blaikie2015-11-041-9/+5
| | | | llvm-svn: 252070
* Revert "Revert "[Orc] Directly emit machine code for the x86 resolver block ↵Rafael Espindola2015-11-031-2/+2
| | | | | | | | | | and trampolines."" This reverts commit r251937. The test was updated to the new API, bring the API back. llvm-svn: 251944
* Revert "[Orc] Directly emit machine code for the x86 resolver block and ↵Rafael Espindola2015-11-031-2/+2
| | | | | | | | | | trampolines." This reverts commit r251933. It broke the build of examples/Kaleidoscope/Orc/fully_lazy/toy.cpp. llvm-svn: 251937
* [Orc] Directly emit machine code for the x86 resolver block and trampolines.Lang Hames2015-11-031-2/+2
| | | | | | | | | | | | | | Bypassing LLVM for this has a number of benefits: 1) Laziness support becomes asm-syntax agnostic (previously lazy jitting didn't work on Windows as the resolver block was in Darwin asm). 2) For cross-process JITs, it allows resolver blocks and trampolines to be emitted directly in the target process, reducing cross process traffic. 3) It should be marginally faster. llvm-svn: 251933
* [Orc] Teach IndirectStubsManager to manage an expandable pool of stubs, ratherLang Hames2015-10-291-0/+5
| | | | | | | than a pre-allocated slab of stubs. Also add a convenience method for creating a single stub, rather than a whole block a time. llvm-svn: 251658
* [Orc] Rename IndirectStubsManagerBase method 'init' to 'createStubs'.Lang Hames2015-10-291-1/+1
| | | | llvm-svn: 251641
* [Orc] Make CompileOnDemandLayer::findSymbol call BaseLayer::findSymbol if noLang Hames2015-10-201-0/+82
symbol definition is found in the logical dylibs. llvm-svn: 250796
OpenPOWER on IntegriCloud