summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ExecutionEngine/Orc
Commit message (Collapse)AuthorAgeFilesLines
...
* [Orc] Add conversion to/from RuntimeDyld::SymbolInfo for JITSymbol.Lang Hames2016-05-311-1/+1
| | | | | | | | | | This tidies up some code that was manually constructing RuntimeDyld::SymbolInfo instances from JITSymbols. It will save more mess in the future when JITSymbol::getAddress is extended to return an Expected<TargetAddress> rather than just a TargetAddress, since we'll be able to embed the error checking in the conversion. llvm-svn: 271350
* [ORC] clang-format code that was touched in r267457. NFC.Lang Hames2016-04-252-90/+53
| | | | | | | 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-252-11/+11
| | | | | | | | | | 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] Add pthread dependence to the RPCUtilsTest unit test.Lang Hames2016-04-191-0/+2
| | | | llvm-svn: 266766
* [Orc] Disable RPC callST unit test until the S390 failures encountered duringLang Hames2016-04-191-20/+22
| | | | | | | http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/3459 can be debugged/fixed. llvm-svn: 266717
* [Orc] Tidy up some of the RPC primitives, add a unit-test for the callSTLang Hames2016-04-191-42/+95
| | | | | | (synchronous call) primitive. llvm-svn: 266711
* [Orc] Re-commit r266581 with fixes for MSVC, and format cleanups.Lang Hames2016-04-181-27/+76
| | | | | | | | | | Fixes: (1) Removes constexpr (unsupported in MSVC) (2) Move constructors (remove explicitly defaulted ones) (3) <future> - Add warning suppression for MSVC. llvm-svn: 266663
* Revert 266581 (and follow-up 266588), it doesn't build on Windows.Nico Weber2016-04-181-76/+27
| | | | | | | | | | Three problems: 1. <future> can't be easily used. If you must use it, see include/Support/ThreadPool.h for how. 2. constexpr problems, even after 266588. 3. Move assignment operators can't be defaulted in MSVC2013. llvm-svn: 266615
* [ORC] Generalize the ORC RPC utils to support RPC function return values andLang Hames2016-04-181-27/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | asynchronous call/handle. Also updates the ORC remote JIT API to use the new scheme. The previous version of the RPC tools only supported void functions, and required the user to manually call a paired function to return results. This patch replaces the Procedure typedef (which only supported void functions) with the Function typedef which supports return values, e.g.: Function<FooId, int32_t(std::string)> Foo; The RPC primitives and channel operations are also expanded. RPC channels must support four new operations: startSendMessage, endSendMessage, startRecieveMessage and endRecieveMessage, to handle channel locking. In addition, serialization support for tuples to RPCChannels is added to enable multiple return values. The RPC primitives are expanded from callAppend, call, expect and handle, to: appendCallAsync - Make an asynchronous call to the given function. callAsync - The same as appendCallAsync, but calls send on the channel when done. callSTHandling - Blocking call for single-threaded code. Wraps a call to callAsync then waits on the result, using a user-supplied handler to handle any callbacks from the remote. callST - The same as callSTHandling, except that it doesn't handle callbacks - it expects the result to be the first return. expect and handle - as before. handleResponse - Handle a response from the remote. waitForResult - Wait for the response with the given sequence number to arrive. llvm-svn: 266581
* Remove every uses of getGlobalContext() in LLVM (but the C API)Mehdi Amini2016-04-144-20/+20
| | | | | | | | | | | At the same time, fixes InstructionsTest::CastInst unittest: yes you can leave the IR in an invalid state and exit when you don't destroy the context (like the global one), no longer now. This is the first part of http://reviews.llvm.org/D19094 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266379
* Revert "Fix Clang-tidy modernize-deprecated-headers warnings in remaining ↵Duncan P. N. Exon Smith2016-04-051-4/+4
| | | | | | | | | | files; other minor fixes." This reverts commit r265454 since it broke the build. E.g.: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/22413/ llvm-svn: 265459
* Fix Clang-tidy modernize-deprecated-headers warnings in remaining files; ↵Eugene Zelenko2016-04-051-4/+4
| | | | | | | | | | | | other minor fixes. Some Include What You Use suggestions were used too. Use anonymous namespaces in source files. Differential revision: http://reviews.llvm.org/D18778 llvm-svn: 265454
* [Orc] Switch RPC Procedure to take a function type, rather than an arg list.Lang Hames2016-03-211-12/+4
| | | | | | No functional change, just a little more readable. llvm-svn: 263951
* [Orc] Add lazy-JITting support for i386.Lang Hames2016-02-101-1/+3
| | | | | | | | | | | This patch adds a new class, OrcI386, which contains the hooks needed to support lazy-JITing on i386 (currently only for Pentium 2 or above, as the JIT re-entry code uses the FXSAVE/FXRSTOR instructions). Support for i386 is enabled in the LLI lazy JIT and the Orc C API, and regression and unit tests are enabled for this architecture. llvm-svn: 260338
* [Unittest] Clean up formatting, NFCJoseph Tremoulet2016-02-031-55/+54
| | | | | | | | | | | | | | Summary: Use an early return to reduce indentation. Remove unused local. Reviewers: dblaikie, lhames Subscribers: lhames, llvm-commits Differential Revision: http://reviews.llvm.org/D16513 llvm-svn: 259663
* Remove autoconf supportChris Bieneman2016-01-261-16/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; ↵Eugene Zelenko2016-01-261-6/+2
| | | | | | | | other minor fixes. Differential revision: reviews.llvm.org/D16568 llvm-svn: 258831
* ObjectTransformLayerTest.cpp: Rework r258633. [-Winconsistent-missing-override]NAKAMURA Takumi2016-01-231-1/+1
| | | | | | Sorry for the noise. llvm-svn: 258635
* ObjectTransformLayerTest.cpp: Fix a warning. [-Wredundant-move]NAKAMURA Takumi2016-01-231-1/+1
| | | | llvm-svn: 258634
* ObjectTransformLayerTest.cpp: Fix a warning. [-Winconsistent-missing-override]NAKAMURA Takumi2016-01-231-1/+1
| | | | llvm-svn: 258633
* [ORC] Update ObjectTransformLayer signatureJoseph Tremoulet2016-01-231-6/+69
| | | | | | | | | | | | | | | | | | | | Summary: Update ObjectTransformLayer::addObjectSet to take the object set by value rather than reference and pass it to the base layer with move semantics rather than copy, to match r258185's changes to ObjectLinkingLayer. Update the unit test to verify that ObjectTransformLayer's signature stays in sync with ObjectLinkingLayer's. Reviewers: lhames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16414 llvm-svn: 258630
* [Orc] Try to turn Orc execution unit tests back on for Linux.Lang Hames2016-01-201-1/+1
| | | | | | | The fix in r258324 (plus r258354) should allow Orc execution tests to run on Linux. llvm-svn: 258358
* [Orc] Refactor ObjectLinkingLayer::addObjectSet to defer loading objects untilLang Hames2016-01-191-0/+72
| | | | | | | | | | | | | | | | they're needed. Prior to this patch objects were loaded (via RuntimeDyld::loadObject) when they were added to the ObjectLinkingLayer, but were not relocated and finalized until a symbol address was requested. In the interim, another object could be loaded and finalized with the same memory manager, causing relocation/finalization of the first object to fail (as the first finalization call may have marked the allocated memory for the first object read-only). By deferring the loadObject call (and subsequent memory allocations) until an object file is needed we can avoid prematurely finalizing memory. llvm-svn: 258185
* [Orc] Revert r258031 - it broke the builders.Lang Hames2016-01-181-1/+1
| | | | llvm-svn: 258034
* [Orc] Expand a comment explaining a unit test.Lang Hames2016-01-181-0/+5
| | | | llvm-svn: 258032
* [Orc] Enable ORC execution unit tests on non-windows platforms.Lang Hames2016-01-181-1/+1
| | | | | | | | | | | Previously these were Darwin-only. Since the switch to direct binary emission of stubs, trampolines and resolver blocks, these should work on other *nix platforms too. These tests can be enabled on Windows once known issues with ORC's handling of Windows symbol mangling (see e.g. https://llvm.org/PR25940) have been fixed. llvm-svn: 258031
* [Orc] Add support for remote JITing to the ORC API.Lang Hames2016-01-112-0/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds utilities to ORC for managing a remote JIT target. It consists of: 1. A very primitive RPC system for making calls over a byte-stream. See RPCChannel.h, RPCUtils.h. 2. An RPC API defined in the above system for managing memory, looking up symbols, creating stubs, etc. on a remote target. See OrcRemoteTargetRPCAPI.h. 3. An interface for creating high-level JIT components (memory managers, callback managers, stub managers, etc.) that operate over the RPC API. See OrcRemoteTargetClient.h. 4. A helper class for building servers that can handle the RPC calls. See OrcRemoteTargetServer.h. The system is designed to work neatly with the existing ORC components and functionality. In particular, the ORC callback API (and consequently the CompileOnDemandLayer) is supported, enabling lazy compilation of remote code. Assuming this doesn't trigger any builder failures, a follow-up patch will be committed which tests these utilities by using them to replace LLI's existing remote-JITing demo code. llvm-svn: 257305
* OrcJITTests//ObjectLinkingLayerTest.cpp: Appease msc18's C2327. It seems ↵NAKAMURA Takumi2016-01-101-9/+9
| | | | | | | | | | | definition of nested class would confuse the context. llvm\unittests\ExecutionEngine\Orc\ObjectLinkingLayerTest.cpp(115) : error C2327: 'llvm::OrcExecutionTest::TM' : is not a type name, static, or enumerator llvm\unittests\ExecutionEngine\Orc\ObjectLinkingLayerTest.cpp(115) : error C2065: 'TM' : undeclared identifier FYI, "this->TM" was valid even before moving class SectionMemoryManagerWrapper. llvm-svn: 257290
* [Orc][RuntimeDyld] Prevent duplicate calls to finalizeMemory on shared memoryLang Hames2016-01-093-4/+86
| | | | | | | | | | | | | | | | | | | | | | | managers. Prior to this patch, recursive finalization (where finalization of one RuntimeDyld instance triggers finalization of another instance on which the first depends) could trigger memory access failures: When the inner (dependent) RuntimeDyld instance and its memory manager are finalized, memory allocated (but not yet relocated) by the outer instance is locked, and relocation in the outer instance fails with a memory access error. This patch adds a latch to the RuntimeDyld::MemoryManager base class that is checked by a new method: RuntimeDyld::finalizeWithMemoryManagerLocking, ensuring that shared memory managers are only finalized by the outermost RuntimeDyld instance. This allows ORC clients to supply the same memory manager to multiple calls to addModuleSet. In particular it enables the use of user-supplied memory managers with the CompileOnDemandLayer which must reuse the supplied memory manager for each function that is lazily compiled. llvm-svn: 257263
* Reorganize the C API headers to improve build times.Eric Christopher2015-12-181-0/+1
| | | | | | | | | Type specific declarations have been moved to Type.h and error handling routines have been moved to ErrorHandling.h. Both are included in Core.h so nothing should change for projects directly including the headers, but transitive dependencies may be affected. llvm-svn: 255965
* [Orc] Removing traces of takeOwnershipOfBuffers left after r251560.Lang Hames2015-12-071-27/+0
| | | | | | Patch by Joshua Gerrard. Thanks Joshua! llvm-svn: 254919
* [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
* Fix some Clang-tidy modernize warnings, other minor fixes.Eugene Zelenko2015-11-041-9/+7
| | | | | | | | Fixed warnings are: modernize-use-override, modernize-use-nullptr and modernize-redundant-void-arg. Differential revision: http://reviews.llvm.org/D14312 llvm-svn: 252087
* Orc: Streamline some lambda usage in a unit testDavid Blaikie2015-11-041-9/+5
| | | | llvm-svn: 252070
* Silence an extra semicolon warning; NFC.Aaron Ballman2015-11-041-1/+1
| | | | llvm-svn: 252046
* Revert "Revert "[Orc] Directly emit machine code for the x86 resolver block ↵Rafael Espindola2015-11-032-5/+5
| | | | | | | | | | 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-032-5/+5
| | | | | | | | | | 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-032-5/+5
| | | | | | | | | | | | | | 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] Expose the compile callback API through the C bindings.Lang Hames2015-10-302-22/+71
| | | | llvm-svn: 251683
* [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
* OrcJITTests: Update libdeps corresponding to r251604.NAKAMURA Takumi2015-10-291-0/+2
| | | | llvm-svn: 251619
* [Orc] Add missing file for r251604.Lang Hames2015-10-291-0/+94
| | | | llvm-svn: 251605
* [Orc] Add support for RuntimeDyld::setProcessAllSections.Lang Hames2015-10-291-0/+1
| | | | llvm-svn: 251604
* [Orc] Require target support for host before running execution unit tests.Lang Hames2015-10-281-3/+6
| | | | | | | Orc unit tests that execute code shouldn't run if the compiler doesn't have target support for the host machine. llvm-svn: 251551
* OrcJITTests: Prune unused libdeps.NAKAMURA Takumi2015-10-281-2/+0
| | | | llvm-svn: 251506
* OrcJITTests: Update libdeps.NAKAMURA Takumi2015-10-281-0/+1
| | | | llvm-svn: 251504
* Fix a -Wpessimizing-move warning.Craig Topper2015-10-281-1/+1
| | | | llvm-svn: 251495
OpenPOWER on IntegriCloud