summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* [ORC] Move symbol-scanning and discard from BasicIRLayerMaterializationUnit inLang Hames2018-05-221-12/+14
| | | | | | | | | to a base class (IRMaterializationUnit). The new class, IRMaterializationUnit, provides a convenient base for any client that wants to write a materializer for LLVM IR. llvm-svn: 332993
* [LKH] Add a replacement RTDyldLayer.Lang Hames2018-05-212-0/+97
| | | | llvm-svn: 332918
* [ORC] Preserve Materializing symbol flag during resolution.Lang Hames2018-05-211-3/+4
| | | | llvm-svn: 332899
* [ORC] Lookup now returns an error if any symbols are not found.Lang Hames2018-05-211-2/+33
| | | | | | | | | | | Also tightens the behavior of ExecutionSession::failQuery. Queries can usually only be failed by marking a symbol as failed-to-materialize, but ExecutionSession::failQuery provides a second route, and both routes may be executed from different threads. In the case that a query has already been failed due to a materialization error, ExecutionSession::failQuery will direct the error to ExecutionSession::reportError instead. llvm-svn: 332898
* [ORC] Remove the optional MaterializationResponsibility argument from lookup.Lang Hames2018-05-211-16/+10
| | | | | | | | The lookup function provides blocking symbol resolution for JIT clients (not layers themselves) so it does not need to track symbol dependencies via a MaterializationResponsibility. llvm-svn: 332897
* [ORC] Add IRLayer and ObjectLayer interfaces and related MaterializationUnits.Lang Hames2018-05-212-0/+111
| | | | llvm-svn: 332896
* [ORC] Consolidate materialization errors, and generate them in VSO'sLang Hames2018-05-171-28/+17
| | | | | | | | | | | notifyFailed method rather than passing in an error generator. VSO::notifyFailed is responsible for notifying queries that they will not succeed due to error. In practice the queries don't care about the details of the failure, just the fact that a failure occurred for some symbols. Having VSO::notifyFailed take care of this simplifies the interface. llvm-svn: 332666
* [ORC] Rewrite the VSO symbol table yet again. Update related utilities.Lang Hames2018-05-164-438/+694
| | | | | | | | | | | | | | | | | | | VSOs now track dependencies for materializing symbols. Each symbol must have its dependencies registered with the VSO prior to finalization. Usually this will involve registering the dependencies returned in AsynchronousSymbolQuery::ResolutionResults for queries made while linking the symbols being materialized. Queries against symbols are notified that a symbol is ready once it and all of its transitive dependencies are finalized, allowing compilation work to be broken up and moved between threads without queries returning until their symbols fully safe to access / execute. Related utilities (VSO, MaterializationUnit, MaterializationResponsibility) are updated to support dependence tracking and more explicitly track responsibility for symbols from the point of definition until they are finalized. llvm-svn: 332541
* Rename DEBUG macro to LLVM_DEBUG.Nicola Zaghen2018-05-1416-216/+227
| | | | | | | | | | | | | | | | The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM - Manual change to APInt - Manually chage DOCS as regex doesn't match it. In the transition period the DEBUG() macro is still present and aliased to the LLVM_DEBUG() one. Differential Revision: https://reviews.llvm.org/D43624 llvm-svn: 332240
* [RuntimeDyld][MachO] Properly handle thumb to thumb calls within a section.Lang Hames2018-05-091-1/+19
| | | | | | | | | | | Previously thumb bits were only checked for external relocations (thumb to arm code and vice-versa). This patch adds detection for thumb callees in the same section asthe (also thumb) caller. The MachO/Thumb test case is updated to cover this, and redundant checks (handled by the MachO/ARM test) are removed. llvm-svn: 331838
* Remove @brief commands from doxygen comments, too.Adrian Prantl2018-05-013-4/+4
| | | | | | | | | | | | | | | | | This is a follow-up to r331272. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done https://reviews.llvm.org/D46290 llvm-svn: 331275
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-013-24/+24
| | | | | | | | | | | | | | | | We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46290 llvm-svn: 331272
* IWYU for llvm-config.h in llvm, additions.Nico Weber2018-04-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See r331124 for how I made a list of files missing the include. I then ran this Python script: for f in open('filelist.txt'): f = f.strip() fl = open(f).readlines() found = False for i in xrange(len(fl)): p = '#include "llvm/' if not fl[i].startswith(p): continue if fl[i][len(p):] > 'Config': fl.insert(i, '#include "llvm/Config/llvm-config.h"\n') found = True break if not found: print 'not found', f else: open(f, 'w').write(''.join(fl)) and then looked through everything with `svn diff | diffstat -l | xargs -n 1000 gvim -p` and tried to fix include ordering and whatnot. No intended behavior change. llvm-svn: 331184
* [ORC] Fix an assertion condition from r329934.Lang Hames2018-04-191-2/+2
| | | | | | Thanks to Alexander Ivchenko for finding the issue! llvm-svn: 330359
* [ORC] Make VSO symbol resolution/finalization operations private.Lang Hames2018-04-191-85/+109
| | | | | | | | This forces these operations to be carried out via a MaterializationResponsibility instance, ensuring responsibility is explicitly tracked. llvm-svn: 330356
* [ORC] Add a MaterializationResponsibility class to track responsibility forLang Hames2018-04-163-58/+125
| | | | | | | | | | | | | | | | | materializing function definitions. MaterializationUnit instances are responsible for resolving and finalizing symbol definitions when their materialize method is called. By contract, the MaterializationUnit must materialize all definitions it is responsible for and no others. If it can not materialize all definitions (because of some error) then it must notify the associated VSO about each definition that could not be materialized. The MaterializationResponsibility class tracks this responsibility, asserting that all required symbols are resolved and finalized, and that no extraneous symbols are resolved or finalized. In the event of an error it provides a convenience method for notifying the VSO about each definition that could not be materialized. llvm-svn: 330142
* [ORC] Merge VSO notifyResolutionFailed and notifyFinalizationFailed in toLang Hames2018-04-161-35/+16
| | | | | | | | | notifyMaterializationFailed. The notifyMaterializationFailed method can determine which error to raise by looking at which queue the pending queries are in (resolution or finalization). llvm-svn: 330141
* Rename ObjectMemoryBuffer to SmallVectorMemoryBuffer; NFCIWeiming Zhao2018-04-162-2/+2
| | | | | | | | | | | | | | Summary: As discussed in https://reviews.llvm.org/D45606, it makes more sense to name the class as SmallVectorMemoryBuffer Reviewers: bkramer, dblaikie Reviewed By: dblaikie Subscribers: mehdi_amini, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D45661 llvm-svn: 330107
* NFC: Move ObjectMemoryBuffer to supportWeiming Zhao2018-04-151-1/+1
| | | | | | | | | | | | | | | | Summary: Since the class is used by both MCJIT and LTO, it makes more sense to move it to Support lib. This is a follow up patch to r329929 and https://reviews.llvm.org/D45244 Reviewers: bkramer, dblaikie Reviewed By: bkramer Subscribers: mehdi_amini, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D45606 llvm-svn: 330093
* [ORC] Use insert rather than emplace.Lang Hames2018-04-121-19/+19
| | | | | | | Hopefully this will fix the build failure at http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/9028 llvm-svn: 329944
* [ORC] Plumb error notifications through the VSO interface.Lang Hames2018-04-124-203/+327
| | | | | | | This allows materializers to notify the VSO that they were unable to resolve or finalize symbols. llvm-svn: 329934
* [MCJIT] Remove the anchor from mcjit.Benjamin Kramer2018-04-121-2/+0
| | | | | | | This is a layering violation. LTO shouldn't depend on MCJIT. The right fix for this is moving the class somewhere else. llvm-svn: 329929
* Add missing vtable anchorsWeiming Zhao2018-04-114-0/+9
| | | | | | | | | | | | | | Summary: This patch adds anchor() for MemoryBuffer, raw_fd_ostream, RTDyldMemoryManager, SectionMemoryManager, etc. Reviewers: jlebar, eli.friedman, dblaikie Reviewed By: dblaikie Subscribers: mehdi_amini, mgorny, dblaikie, weimingz, llvm-commits Differential Revision: https://reviews.llvm.org/D45244 llvm-svn: 329861
* [RuntimeDyld][PowerPC] Use global entry points for calls between sections.Lang Hames2018-04-051-9/+13
| | | | | | | | | | | | | | | | | | Functions in different objects may use different TOCs, so calls between such functions should use the global entry point of the callee which updates the TOC pointer. This should fix a bug that the Numba developers encountered (see https://github.com/numba/numba/issues/2451). Patch by Olexa Bilaniuk. Thanks Olexa! No RuntimeDyld checker test case yet as I am not familiar enough with how RuntimeDyldELF fixes up call-sites, but I do not want to hold up landing this. I will continue to work on it and see if I can rope some powerpc experts in. llvm-svn: 329335
* Reapply r329133 with fix.Lang Hames2018-04-041-5/+36
| | | | llvm-svn: 329136
* Revert r329133 "[RuntimeDyld][AArch64] Add some error pluming / generation..."Lang Hames2018-04-041-32/+4
| | | | | | This broke a number of buildbots. Looking in to it now... llvm-svn: 329135
* [RuntimeDyld][AArch64] Add some error pluming / generation to catch unhandledLang Hames2018-04-031-4/+32
| | | | | | relocation types on AArch64. llvm-svn: 329133
* [ORC] Create a new SymbolStringPool by default in ExecutionSession constructor.Lang Hames2018-04-023-12/+3
| | | | | | This makes the common case of constructing an ExecutionSession tidier. llvm-svn: 329013
* [ORC] Fix ORC on platforms without indirection support.Lang Hames2018-03-281-1/+5
| | | | | | | | | | Previously this crashed because a nullptr (returned by createLocalIndirectStubsManagerBuilder() on platforms without indirection support) functor was unconditionally invoked. Patch by Andres Freund. Thanks Andres! llvm-svn: 328687
* Remove unused file, ExecutionEngine/MCJIT/ObjectBuffer.hDavid Blaikie2018-03-261-48/+0
| | | | | | | This header also wasn't self contained/modular - but with no users, it didn't seem worth fixing because it'd break so easily again. llvm-svn: 328565
* Fix layering by moving Support/CodeGenCWrappers.h to TargetDavid Blaikie2018-03-231-1/+1
| | | | | | | | This includes llvm-c/TargetMachine.h which is logically part of libTarget (since libTarget implements llvm-c/TargetMachine.h's functions). llvm-svn: 328394
* [ORC] Don't fully qualify explicit destructor call -- it confuses some ↵Lang Hames2018-03-201-4/+2
| | | | | | | | | compilers. This should fix the builder failure at http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/19224 llvm-svn: 327955
* [ORC] Rename SymbolSource to MaterializationUnit, and make the materializationLang Hames2018-03-201-111/+167
| | | | | | | | | | | | | | | | | | | operation all-or-nothing, rather than allowing materialization on a per-symbol basis. This addresses a shortcoming of per-symbol materialization: If a MaterializationUnit (/SymbolSource) wants to materialize more symbols than requested (which is likely: most materializers will want to materialize whole modules) then it needs a way to notify the symbol table about the extra symbols being materialized. This process (checking what has been requested against what is being provided and notifying the symbol table about the difference) has to be repeated at every level of the JIT stack. Making materialization all-or-nothing eliminates this issue, simplifying both materializer implementations and the symbol table (VSO class) API. The cost is that per-symbol materialization (e.g. for individual symbols in a module) now requires multiple MaterializationUnits. llvm-svn: 327946
* [ORC] Re-apply r327566 with a fix for test-global-ctors.ll.Lang Hames2018-03-155-47/+69
| | | | | | Also clang-formats the patch, which I should have done the first time around. llvm-svn: 327594
OpenPOWER on IntegriCloud