summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
Commit message (Collapse)AuthorAgeFilesLines
* [ORC] Don't call isa<> on a null value.Lang Hames2018-06-261-1/+1
| | | | | | This should fix the recent builder failures in the test-global-ctors.ll testcase. llvm-svn: 335680
* [ORC] Fix a missing return value.Lang Hames2018-06-261-0/+2
| | | | llvm-svn: 335677
* [ORC] Add a dependence on MC to LLVMBuild.txtLang Hames2018-06-261-2/+2
| | | | llvm-svn: 335673
* [ORC] Add LLJIT and LLLazyJIT, and replace OrcLazyJIT in LLI with LLLazyJIT.Lang Hames2018-06-267-19/+402
| | | | | | | | | | | | | | | | | | | LLJIT is a prefabricated ORC based JIT class that is meant to be the go-to replacement for MCJIT. Unlike OrcMCJITReplacement (which will continue to be supported) it is not API or bug-for-bug compatible, but targets the same use cases: Simple, non-lazy compilation and execution of LLVM IR. LLLazyJIT extends LLJIT with support for function-at-a-time lazy compilation, similar to what was provided by LLVM's original (now long deprecated) JIT APIs. This commit also contains some simple utility classes (CtorDtorRunner2, LocalCXXRuntimeOverrides2, JITTargetMachineBuilder) to support LLJIT and LLLazyJIT. Both of these classes are works in progress. Feedback from JIT clients is very welcome! llvm-svn: 335670
* [ORC] Reset AsynchronousSymbolQuery's NotifySymbolsResolved callback on error.Lang Hames2018-06-261-3/+4
| | | | | | | | AsynchronousSymbolQuery::canStillFail checks the value of the callback to prevent sending it redundant error notifications, so we need to reset it after running it. llvm-svn: 335664
* [ORC] Move the VSOList typedef out of VSO.Lang Hames2018-06-261-3/+2
| | | | llvm-svn: 335663
* [ORC] Fix a FIXME by moving MangleAndInterner to Core.h.Lang Hames2018-06-262-12/+14
| | | | llvm-svn: 335661
* [ORC] Add a symbolAliases function to the Core APIs.Lang Hames2018-06-261-9/+80
| | | | | | symbolAliases can be used to define symbol aliases within a VSO. llvm-svn: 335565
* [ORC] Fix formatting and list pending queries in VSO::dump.Lang Hames2018-06-231-3/+7
| | | | llvm-svn: 335408
* [RuntimeDyld] Implement the ELF PIC large code model relocationsReid Kleckner2018-06-221-0/+43
| | | | | | | Prerequisite for https://reviews.llvm.org/D47211 which improves our ELF large PIC codegen. llvm-svn: 335402
* [ORC] Add an initial implementation of a replacement CompileOnDemandLayer.Lang Hames2018-06-183-1/+346
| | | | | | | | | CompileOnDemandLayer2 is a replacement for CompileOnDemandLayer built on the ORC Core APIs. Functions in added modules are extracted and compiled lazily. CompileOnDemandLayer2 supports multithreaded JIT'd code, and compilation on multiple threads. llvm-svn: 334967
* [ORC] Keep weak flag on VSO symbol tables during materialization, but treatLang Hames2018-06-181-8/+7
| | | | | | | | | | | | materializing weak symbols as strong. This removes some elaborate flag tweaking and plays nicer with RuntimeDyld, which relies of weak/common flags to determine whether it should emit a given weak definition. (Switching to strong up-front makes it appear as if there is already an overriding definition, which would require an extra back-channel to override). llvm-svn: 334966
* [ORC] Remove redundant conditionLang Hames2018-06-171-1/+1
| | | | llvm-svn: 334918
* [ORC] Only notify queries that they are resolved/ready when the query stateLang Hames2018-06-171-8/+30
| | | | | | | | changes. This guards against redundant notifications. llvm-svn: 334916
* [ORC] Suppress an unused variable warning for a debug-mode only use.Lang Hames2018-06-171-0/+1
| | | | llvm-svn: 334911
* [ORC] Erase empty dependence sets when adding new symbol dependencies.Lang Hames2018-06-171-0/+3
| | | | llvm-svn: 334910
* [ORC] In MaterializationResponsibility, only maintain the Materializing flag onLang Hames2018-06-171-2/+12
| | | | | | | | | | | symbols in debug mode. The MaterializationResponsibility class hijacks the Materializing flag to track symbols that have not yet been resolved in order to guard against redundant resolution. Since this is an API contract check and only enforced in debug mode there is no reason to maintain the flag state in release mode. llvm-svn: 334909
* [PPC64] Support "symbol@high" and "symbol@higha" symbol modifers.Sean Fertile2018-06-151-0/+2
| | | | | | | | | | Add support for the "@high" and "@higha" symbol modifiers in powerpc64 assembly. The modifiers represent accessing the segment consiting of bits 16-31 of a 64-bit address/offset. Differential Revision: https://reviews.llvm.org/D47729 llvm-svn: 334855
* Add debug info for OProfile profiling supportAndrew Kaylor2018-06-152-2/+26
| | | | | | | | Patch by Gaetano Priori Differential Revision: https://reviews.llvm.org/D47925 llvm-svn: 334782
* [ORC] Strip weak flags from a symbol once it is selected for materialization.Lang Hames2018-06-141-3/+4
| | | | | | | | | Once a symbol has been selected for materialization it can no longer be overridden. Stripping the weak flag guarantees this (override attempts will then be treated as duplicate definitions and result in a DuplicateDefinition error). llvm-svn: 334771
* [ORC] Filter out self-dependencies in VSO::addDependencies.Lang Hames2018-06-141-1/+1
| | | | llvm-svn: 334724
* [ORC] Assert that the query argument to VSO::lookup must be non-null.Lang Hames2018-06-141-0/+2
| | | | llvm-svn: 334723
* [ORC] Add a WaitUntilReady argument to blockingLookup.Lang Hames2018-06-142-24/+44
| | | | | | | | | | | If WaitUntilReady is set to true then blockingLookup will return once all requested symbols are ready. If WaitUntilReady is set to false then blockingLookup will return as soon as all requested symbols have been resolved. In the latter case, if any error occurs in finalizing the symbols it will be reported to the ExecutionSession, rather than returned by blockingLookup. llvm-svn: 334722
* [ORC] Strip the Materializing flag off finalized symbols in VSOs.Lang Hames2018-06-141-3/+6
| | | | | | Finalized symbols are no longer in the materializing state. llvm-svn: 334721
* Fix -DLLVM_ENABLE_THREADS=OFF build after r334537Hans Wennborg2018-06-131-1/+1
| | | | llvm-svn: 334582
* Remove malloc.h include from Intel JIT events codeReid Kleckner2018-06-121-1/+0
| | | | llvm-svn: 334547
* Add null check to Intel JIT event listenerReid Kleckner2018-06-121-4/+6
| | | | llvm-svn: 334544
* [ORC] Add a fallback definition generator for VSOs.Lang Hames2018-06-121-66/+100
| | | | | | | | | | | | If a VSO has a fallback definition generator attached it will be called during lookup (and lookupFlags) for any unresolved symbols. The definition generator can add new definitions to the VSO for any unresolved symbol. This allows VSOs to generate new definitions on demand. The immediate use case for this code is supporting VSOs that can import definitions found via dlsym on demand. llvm-svn: 334538
* [ORC] Refactor blocking lookup logic into the blockingLookup function, andLang Hames2018-06-124-60/+61
| | | | | | | implement existing blocking lookups (the lookup function) and JITSymbolResolverAdapter on top of that. llvm-svn: 334537
* [RuntimeDyld] Add an assert to catch misbehaving symbol resolvers.Lang Hames2018-06-121-0/+3
| | | | | | | | | Resolvers are required to find results for all requested symbols or return an error, but if a resolver fails to adhere to this contract (by returning results for only a subset of the requested symbols) then this code will infinite loop. This assertion catches resolvers that fail to adhere to the contract. llvm-svn: 334536
* [MCJIT] Call materializeAll on modules before compiling them in MCJIT.Lang Hames2018-06-121-0/+6
| | | | | | | | | This only affects modules with lazy GVMaterializers attached (usually modules read off disk using the lazy bitcode reader). For such modules, materializing before compiling prevents crashes due to missing function bodies / initializers. llvm-svn: 334535
* [ORC] Add a constructor to create an IRMaterializationUnit from a module andLang Hames2018-06-031-0/+6
| | | | | | | | | | pre-existing SymbolFlags and SymbolToDefinition maps. This constructor is useful when delegating work from an existing IRMaterialiaztionUnit to a new one, as it avoids the cost of re-computing these maps. llvm-svn: 333852
* [ORC] Add a getRequestedSymbols method to MaterializationResponsibility.Lang Hames2018-05-311-7/+37
| | | | | | | | | | | This method returns the set of symbols in the target VSO that have queries waiting on them. This can be used to make decisions about which symbols to delegate to another MaterializationUnit (typically this will involve delegating all symbols that have *not* been requested to another MaterializationUnit so that materialization of those symbols can be deferred until they are requested). llvm-svn: 333684
* [ORC] Rename IRMaterializationUnit's Discardable member to SymbolToDefinition,Lang Hames2018-05-311-4/+6
| | | | | | | | | | and make it protected rather than private. The new name reflects the actual information in the map, and this information can be useful to derived classes (for example, to quickly look up the IR definition of a requested symbol). llvm-svn: 333683
* [PowerPC] fix broken JIT-compiled code with tail call optimizationHiroshi Inoue2018-05-301-2/+3
| | | | | | | | | The relocation for branch instructions in the dynamic loader of ExecutionEngine assumes branch instructions with R_PPC64_REL24 relocation type are only bl. However, with the tail call optimization, b instructions can be also used to jump into another function. This patch makes the relocation to keep bits in the branch instruction other than the jump offset to avoid relocation rewrites a b instruction into bl. Differential Revision: https://reviews.llvm.org/D47456 llvm-svn: 333502
* [ORC] Fix an ambiguous make_unique call.Lang Hames2018-05-301-2/+2
| | | | llvm-svn: 333492
* [ORC] Update JITCompileCallbackManager to support multi-threaded code.Lang Hames2018-05-304-27/+110
| | | | | | | | | 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
* [C-API] Add functions to create GDB, Intel, Oprofile event listeners.Andres Freund2018-05-243-0/+16
| | | | | | | | | | The additions of Intel, Oprofile listeners were done blindly. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D44890 llvm-svn: 333230
* [ORC][C-API] Expose LLVMOrc{Unr,R}egisterJITEventListener().Andres Freund2018-05-241-0/+11
| | | | | | | | Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D44890 llvm-svn: 333229
* [ORC] Add ability [un]register JITEventListener on Orc C stack.Andres Freund2018-05-241-1/+40
| | | | | | | | Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D44890 llvm-svn: 333228
* [ORC] Extend object layer callbacks so JITEventListener can be supported.Andres Freund2018-05-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | Currently RTDyldObjectLinkingLayer makes it hard to support JITEventListeners. Which in turn means debugging and profiling JIT generated code hard. Supporting JITEventListeners at minimum requries a freed callback (added). As listeners expect the ObjectFile to be passed as well, an adaptor between RTDyldObjectLinkingLayer and JITEventListeners would currently need to also maintain ObjectFiles for all loaded modules. To make that less awkward, extend the callbacks to pass the ObjectFile to both Finalized and Freed callbacks. That requires extending the lifetime of the object file when callbacks are present. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D44890 llvm-svn: 333227
* Add handling for GlobalAliases in ExecutionEngine::getConstantValue.Lang Hames2018-05-241-0/+3
| | | | | | | | Patch by Brad Moody. Thanks Brad! https://reviews.llvm.org/D42160 llvm-svn: 333217
* [ORC] Add findSymbolIn() wrapper to C bindings, take #2.Andres Freund2018-05-242-0/+30
| | | | | | | | | | | | | | | | Re-appply r333147, reverted in r333152 due to a pre-existing bug. As D47308 has been merged in r333206, the OSX issue should now be resolved. In many cases JIT users will know in which module a symbol resides. Avoiding to search other modules can be more efficient. It also allows to handle duplicate symbol names between modules. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D44889 llvm-svn: 333215
* [ORC] Perform name mangling in findSymbolIn(), as done in findSymbol().Andres Freund2018-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | The lack of name mangling caused a unittest failure after r333147 (in TestEagerIRCompilation), as OSX prefixes symbol names with '_'. The lack of name mangling therefore leads to a NULL pointer being returned and then called, hence the failure. While it may look like it, this isn't an actual behavioral change, as findSymbolIn() previously was not exposed externally, and essentially dead code. Which explains why nobody noticed the issue previously. Reviewers: lhames Reviewed By: lhames Subscribers: chandlerc, llvm-commits Differential Revision: https://reviews.llvm.org/D47308 llvm-svn: 333206
* Revert r333147 "[ORC] Add findSymbolIn() wrapper to C bindings."Andres Freund2018-05-242-30/+0
| | | | | | | | | | | This reverts r333147 until https://reviews.llvm.org/D47308 is ready to be reviewed. r333147 exposed a behavioural difference between OrcCBindingsStack::findSymbolIn() and OrcCBindingsStack::findSymbol(), where only the latter does name mangling. After r333147 that causes a test failure on OSX, because the new test looks for main using findSymbolIn() but the mangled name is _main. llvm-svn: 333152
* [ORC] Add findSymbolIn() wrapper to C bindings.Andres Freund2018-05-242-0/+30
| | | | | | | | | | | | In many cases JIT users will know in which module a symbol resides. Avoiding to search other modules can be more efficient. It also allows to handle duplicate symbol names between modules. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D44889 llvm-svn: 333147
* [RuntimeDyld][MachO] Add support for MachO::ARM64_RELOC_POINTER_TO_GOT reloc.Lang Hames2018-05-231-8/+48
| | | | llvm-svn: 333130
* [LKH] Add a new IRTransformLayer.Lang Hames2018-05-232-0/+35
| | | | llvm-svn: 333129
* [LKH] Add ObjectTransformLayer2.Lang Hames2018-05-232-0/+35
| | | | llvm-svn: 333128
* [LKH] Add a new IRCompileLayer.Lang Hames2018-05-233-1/+46
| | | | llvm-svn: 333127
OpenPOWER on IntegriCloud