summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lli
Commit message (Collapse)AuthorAgeFilesLines
...
* [Orc] Directly emit machine code for the x86 resolver block and trampolines.Lang Hames2015-11-032-29/+16
| | | | | | | | | | | | | | 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] Add support for emitting indirect stubs directly into the JIT target'sLang Hames2015-10-192-18/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | memory, rather than representing the stubs in IR. Update the CompileOnDemand layer to use this functionality. Directly emitting stubs is much cheaper than building them in IR and codegen'ing them (see below). It also plays well with remote JITing - stubs can be emitted directly in the target process, rather than having to send them over the wire. The downsides are: (1) Care must be taken when resolving symbols, as stub symbols are held in a separate symbol table. This is only a problem for layer writers and other people using this API directly. The CompileOnDemand layer hides this detail. (2) Aliases of function stubs can't be symbolic any more (since there's no symbol definition in IR), but must be converted into a constant pointer expression. This means that modules containing aliases of stubs cannot be cached. In practice this is unlikely to be a problem: There's no benefit to caching such a module anyway. On balance I think the extra performance is more than worth the trade-offs: In a simple stress test with 10000 dummy functions requiring stubs and a single executed "hello world" main function, directly emitting stubs reduced user time for JITing / executing by over 90% (1.5s for IR stubs vs 0.1s for direct emission). llvm-svn: 250712
* [Orc] Enable user supplied partitioning functors in the CompileOnDemand layer.Lang Hames2015-10-071-1/+8
| | | | | | | | Previously the CompileOnDemand layer always created single-function partitions. In theory this new API allows for more interesting partitions, though this has not been well tested yet. llvm-svn: 249623
* Fix lli with OrcLazyJIT: the default DataLayout was used.Mehdi Amini2015-07-301-0/+1
| | | | | | | Set the correct one using the TargetMachine instead. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 243664
* Remove access to the DataLayout in the TargetMachineMehdi Amini2015-07-242-14/+15
| | | | | | | | | | | | | | | | | | | | | | Summary: Replace getDataLayout() with a createDataLayout() method to make explicit that it is intended to create a DataLayout only and not accessing it for other purpose. This change is the last of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: jholewinski, llvm-commits, rafael, yaron.keren Differential Revision: http://reviews.llvm.org/D11103 (cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea) From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 243114
* Revert "Remove access to the DataLayout in the TargetMachine"Mehdi Amini2015-07-242-15/+14
| | | | | | | | | | This reverts commit 0f720d984f419c747709462f7476dff962c0bc41. It breaks clang too badly, I need to prepare a proper patch for clang first. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 243089
* Remove access to the DataLayout in the TargetMachineMehdi Amini2015-07-242-14/+15
| | | | | | | | | | | | | | | | | | | | | | Summary: Replace getDataLayout() with a createDataLayout() method to make explicit that it is intended to create a DataLayout only and not accessing it for other purpose. This change is the last of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: jholewinski, llvm-commits, rafael, yaron.keren Differential Revision: http://reviews.llvm.org/D11103 (cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea) From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 243083
* Simplify a few uses of remove_filename by using parent_path instead.Rafael Espindola2015-07-151-2/+1
| | | | llvm-svn: 242334
* Simplify the Mangler interface now that DataLayout is mandatory.Rafael Espindola2015-06-231-3/+1
| | | | | | | We only need to pass in a DataLayout when mangling a raw string, not when constructing the mangler. llvm-svn: 240405
* Replace string GNU Triples with llvm::Triple in ↵Daniel Sanders2015-06-161-1/+1
| | | | | | | | | | | | | | | | | | TargetMachine::getTargetTriple(). NFC. Summary: This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10381 llvm-svn: 239815
* [Orc] Tidy up initialization based on review feedback for r239561 from dblaikie.Lang Hames2015-06-121-20/+19
| | | | | | NFC. llvm-svn: 239645
* [Orc] Fix a bug in the CompileOnDemand layer where stub decls were not clonedLang Hames2015-06-121-1/+1
| | | | | | | | | | | into partitions. Also, add an option to clone stub definitions (not just decls) into partitions: these definitions could be inlined in some places to avoid the overhead of calling via the stub. Found by inspection - no test case yet, although I plan to add a unit test for this once the CompileOnDemand layer refactoring settles down. llvm-svn: 239640
* Wrap some long lines in LLVMBuild files. NFCDouglas Katzman2015-06-121-1/+11
| | | | | | | As suggested by jroelofs in a prior review (D9752), it makes sense to generally prefer multi-line format. llvm-svn: 239632
* [Orc] Remove some unnecesary includes and whitespace that slipped in to r239561.Lang Hames2015-06-111-2/+1
| | | | | | NFC. llvm-svn: 239564
* [Orc] Make partition identification in the CompileOnDemand layer lazy.Lang Hames2015-06-111-16/+20
| | | | | | This also breaks out the logical dylib symbol resolution logic. llvm-svn: 239561
* [lli] Make the OptLevel (-O=<char>) option accessible to the lazy JIT.Lang Hames2015-06-092-13/+20
| | | | | | No test case - this only affects generated code performance. llvm-svn: 239383
* add missing dependency on Target lib for toolsSanjay Patel2015-06-031-0/+1
| | | | | | | This was exposed by r238842 (which was reverted by r238900) when doing a CMake build with -DBUILD_SHARED_LIBS=ON. llvm-svn: 238953
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-2/+1
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238602
* Migrate existing backends that care about software floating pointEric Christopher2015-05-121-3/+0
| | | | | | | | | | | | | | | | | | | | to use the information in the module rather than TargetOptions. We've had and clang has used the use-soft-float attribute for some time now so have the backends set a subtarget feature based on a particular function now that subtargets are created based on functions and function attributes. For the one middle end soft float check go ahead and create an overloadable TargetLowering::useSoftFloat function that just checks the TargetSubtargetInfo in all cases. Also remove the command line option that hard codes whether or not soft-float is set by using the attribute for all of the target specific test cases - for the generic just go ahead and add the attribute in the one case that showed up. llvm-svn: 237079
* [Orc] Reapply r236465 with fixes for the MSVC bots.Lang Hames2015-05-051-7/+2
| | | | llvm-svn: 236506
* [Orc] Revert r236465 - It broke the Windows bots.Lang Hames2015-05-041-2/+7
| | | | | | | Looks like the usual missing explicit move-constructor issue with MSVC. I should have a fix shortly. llvm-svn: 236472
* Add TransformUtils dependency to lli.Pete Cooper2015-05-042-1/+2
| | | | | | After r236465, Orc uses ValueMaterializer and so needs to link against TransformUtils to get the ValueMaterializer::anchor(). llvm-svn: 236467
* [Orc] Refactor the compile-on-demand layer to make module partitioning lazy,Lang Hames2015-05-041-7/+2
| | | | | | | | | | | | | | | and avoid cloning unused decls into every partition. Module partitioning showed up as a source of significant overhead when I profiled some trivial test cases. Avoiding the overhead of partitionging for uncalled functions helps to mitigate this. This change also means that it is no longer necessary to have a LazyEmittingLayer underneath the CompileOnDemand layer, since the CompileOnDemandLayer will not extract or emit function bodies until they are called. llvm-svn: 236465
* Fix -Wpessimizing-move warnings by removing std::move calls.Richard Trieu2015-04-301-4/+4
| | | | llvm-svn: 236278
* Remove the JITEmitDebugInfo TargetOptions as they're only set andEric Christopher2015-04-191-23/+0
| | | | | | not used anywhere in llvm. llvm-svn: 235265
* lli/OrcLazyJIT.cpp: Use <cstdio> for printf(3) introduced in r234908.NAKAMURA Takumi2015-04-171-0/+1
| | | | llvm-svn: 235175
* [Orc] Refactor the CompileOnDemandLayer to make its addModuleSet methodLang Hames2015-04-151-11/+14
| | | | | | | | | signature match the other layers. This makes it possible to compose other layers (e.g. IRTransformLayer) on top of CompileOnDemandLayer. llvm-svn: 235029
* [Orc] Reapply r234815, outputting via stdout instead.Lang Hames2015-04-141-11/+12
| | | | llvm-svn: 234908
* Silencing a -Wreturn-type warning, as the switch is fully-covered; NFC.Aaron Ballman2015-04-141-0/+1
| | | | llvm-svn: 234884
* [Orc] Disambiguate call to make_unique. This should fix the builders broken byLang Hames2015-04-131-1/+2
| | | | | | r234805. llvm-svn: 234806
* [Orc] Add an Orc layer for applying arbitrary transforms to IR, use it to addLang Hames2015-04-132-7/+90
| | | | | | | debugging output to the LLI orc-lazy JIT, and update the orc-lazy "hello.ll" test to actually test for lazy compilation. llvm-svn: 234805
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-113-3/+3
| | | | | | | | | | | | | | The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' \ -j=32 -fix -format http://reviews.llvm.org/D8925 llvm-svn: 234679
* [Orc] Add support classes for inspecting and running C++ static ctor/dtors, andLang Hames2015-04-022-8/+56
| | | | | | | | | use these to add support for C++ static ctors/dtors to the Orc-lazy JIT in LLI. Replace the trivial_retval_1 regression test - the new 'hello' test is covering strictly more code. llvm-svn: 233885
* [Orc] Reflect process symbols into the LLI Orc-lazy JIT.Lang Hames2015-04-012-1/+21
| | | | | | | This makes symbol resolution essentially identical between MCJIT and the LLI Orc-lazy JIT. llvm-svn: 233786
* [Orc] Separate callback manager selection from callback manager construction forLang Hames2015-03-302-21/+29
| | | | | | | | OrcLazyJIT in lli. Separating these concerns enables more natural error handling. llvm-svn: 233579
* [MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo throughLang Hames2015-03-302-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MCJIT. This patch decouples the two responsibilities of the RTDyldMemoryManager class, memory management and symbol resolution, into two new classes: RuntimeDyld::MemoryManager and RuntimeDyld::SymbolResolver. The symbol resolution interface is modified slightly, from: uint64_t getSymbolAddress(const std::string &Name); to: RuntimeDyld::SymbolInfo findSymbol(const std::string &Name); The latter passes symbol flags along with symbol addresses, allowing RuntimeDyld and others to reason about non-strong/non-exported symbols. The memory management interface removes the following method: void notifyObjectLoaded(ExecutionEngine *EE, const object::ObjectFile &) {} as it is not related to memory management. (Note: Backwards compatibility *is* maintained for this method in MCJIT and OrcMCJITReplacement, see below). The RTDyldMemoryManager class remains in-tree for backwards compatibility. It inherits directly from RuntimeDyld::SymbolResolver, and indirectly from RuntimeDyld::MemoryManager via the new MCJITMemoryManager class, which just subclasses RuntimeDyld::MemoryManager and reintroduces the notifyObjectLoaded method for backwards compatibility). The EngineBuilder class retains the existing method: EngineBuilder& setMCJITMemoryManager(std::unique_ptr<RTDyldMemoryManager> mcjmm); and includes two new methods: EngineBuilder& setMemoryManager(std::unique_ptr<MCJITMemoryManager> MM); EngineBuilder& setSymbolResolver(std::unique_ptr<RuntimeDyld::SymbolResolver> SR); Clients should use EITHER: A single call to setMCJITMemoryManager with an RTDyldMemoryManager. OR (exclusive) One call each to each of setMemoryManager and setSymbolResolver. This patch should be fully compatible with existing uses of RTDyldMemoryManager. If it is not it should be considered a bug, and the patch either fixed or reverted. If clients find the new API to be an improvement the goal will be to deprecate and eventually remove the RTDyldMemoryManager class in favor of the new classes. llvm-svn: 233509
* [Orc] Remove another unnecessary typedef.Lang Hames2015-03-251-1/+1
| | | | llvm-svn: 233184
* [Orc][lli] Add a very simple Orc-based lazy JIT to lli.Lang Hames2015-03-254-7/+172
| | | | | | | | | | | | | | | | | This ensures that we're building and testing the CompileOnDemand layer, at least in a basic way. Currently x86-64 only, and with limited to no library calls enabled (depending on host platform). Patches welcome. ;) To enable access to the lazy JIT, this patch replaces the '-use-orcmcjit' lli option with a new option: '-jit-kind={ mcjit | orc-mcjit | orc-lazy }'. All regression tests are updated to use the new option, and one trivial test of the new lazy JIT is added. llvm-svn: 233182
* Purge unused includes throughout libSupport.Benjamin Kramer2015-03-232-0/+2
| | | | | | NFC. llvm-svn: 232976
* Fix cmake build.Rafael Espindola2015-03-181-1/+1
| | | | llvm-svn: 232663
* CMake: Disable ENABLE_EXPORTS for executables with MSVCReid Kleckner2015-03-181-1/+1
| | | | | | | | | | | | | | The MSVC linker won't produce a .lib file for an executable that doesn't export anything, and LLVM doesn't maintain dllexport annotations or .def files listing all C++ symbols. It also doesn't support exporting all symbols, like binutils ld. CMake 3.2 changed the Ninja generator to list both the .exe and .lib files as outputs of executable build targets. Ninja would always re-link executables with ENABLE_EXPORTS because the .lib output file was not present, and therefore the target was out of date. llvm-svn: 232662
* Replace a few instances of NULL with nullptr.David Majnemer2015-02-261-1/+1
| | | | llvm-svn: 230599
* [CMake] Add RuntimeDyld to libdeps corresponding to r229343.NAKAMURA Takumi2015-02-161-0/+1
| | | | llvm-svn: 229351
* Fix lli after the DebugInfo move.Zachary Turner2015-01-301-1/+1
| | | | llvm-svn: 227594
* Move DebugInfo to DebugInfo/DWARF.Zachary Turner2015-01-301-1/+1
| | | | | | | | | | | | | In preparation for adding PDB support to LLVM, this moves the DWARF parsing code to its own subdirectory under DebugInfo, and renames LLVMDebugInfo to LLVMDebugInfoDWARF. This is purely a mechanical / build system change. Differential Revision: http://reviews.llvm.org/D7269 Reviewed by: Eric Christopher llvm-svn: 227586
* [Orc] Add orcjit to the dependencies list in the Makefile for lli.Lang Hames2015-01-241-1/+1
| | | | | | This should fix a few more broken bots. llvm-svn: 226973
* [Orc] New JIT APIs.Lang Hames2015-01-232-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new set of JIT APIs to LLVM. The aim of these new APIs is to cleanly support a wider range of JIT use cases in LLVM, and encourage the development and contribution of re-usable infrastructure for LLVM JIT use-cases. These APIs are intended to live alongside the MCJIT APIs, and should not affect existing clients. Included in this patch: 1) New headers in include/llvm/ExecutionEngine/Orc that provide a set of components for building JIT infrastructure. Implementation code for these headers lives in lib/ExecutionEngine/Orc. 2) A prototype re-implementation of MCJIT (OrcMCJITReplacement) built out of the new components. 3) Minor changes to RTDyldMemoryManager needed to support the new components. These changes should not impact existing clients. 4) A new flag for lli, -use-orcmcjit, which will cause lli to use the OrcMCJITReplacement class as its underlying execution engine, rather than MCJIT itself. Tests to follow shortly. Special thanks to Michael Ilseman, Pete Cooper, David Blaikie, Eric Christopher, Justin Bogner, and Jim Grosbach for extensive feedback and discussion. llvm-svn: 226940
* Assigning and copying command line option objects shouldn't be allowed.Chris Bieneman2015-01-221-1/+1
| | | | | | | | | | | | | | | Summary: The default copy and assignment operators for these objects probably don't actually do what the clients intend, so they should be deleted. Places using the assignment operator to set the value of an option should cast to the option's data type first to call into the override for operator=. Places using the copy constructor just need to be changed to not copy (i.e. passing by const reference instead of value). Reviewers: dexonsmith, chandlerc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7114 llvm-svn: 226762
* Silence gcc 4.9.1 warning 'xyz' is used uninitialized in this function.Yaron Keren2014-12-121-7/+7
| | | | | | | | In release builds this is actually possible as without asserts there is no testing of the actual read bytes and the variables could be partially uninitialized. llvm-svn: 224114
* [MCJIT] Unique-ptrify the RTDyldMemoryManager member of MCJIT. NFC.Lang Hames2014-12-031-1/+5
| | | | llvm-svn: 223183
OpenPOWER on IntegriCloud