Commit Graph

490 Commits

Author SHA1 Message Date
Lang Hames
1d95ab2d6c [Orc] Add stack-realignment code to the i386 resolver function.
The resolver uses the fxsave/fxrstor instructions, which require 16-byte
alignment, to save SSE state to the stack. Since 16-byte alignment can't be
assumed on all OSes (and all i386 OSes share this function) - add code to
automatically bump the alignment to 16-bytes on entry to the function.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 22:50:26 +00:00
Lang Hames
db7e3d1e5c [Orc] Add lazy-JITting support for i386.
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260338 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 01:02:33 +00:00
Lang Hames
8192ebb6c0 [Orc] Slightly improve the x86-64 resolver block machine code.
Replace leaq + movq of a pointer with a single movabsq.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259968 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-06 00:55:08 +00:00
Lang Hames
f823e149af [Orc] Stub addresses should be based on stub size, not pointer size.
This didn't affect X86_64, which is the only client of this code at the moment,
as stubs and pointers are both 8-bytes there. It will affect other platforms
though.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 21:38:30 +00:00
Lang Hames
9c1744ae4d [Orc] Turn OrcX86_64::IndirectStubsInfo into a template helper class:
GenericIndirectStubsInfo.

This will allow architecture support classes for other architectures to re-use
this code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 19:31:15 +00:00
Benjamin Kramer
b8c1bbf870 One more batch of self-containing headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258974 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 19:29:56 +00:00
Eugene Zelenko
51ecde1f0a Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes.
Differential revision: reviews.llvm.org/D16568


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 18:48:36 +00:00
Joseph Tremoulet
88a19038a7 [ORC] Update ObjectTransformLayer signature
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258630 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 18:36:01 +00:00
Lang Hames
801561e2bb [Orc] 'this' qualify more lambda-captured members.
More workaround attempts for GCC ICEs.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258288 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 05:10:59 +00:00
Lang Hames
61cac3cdc5 [Orc] More qualifications of lambda-captured member variables to fix GCC ICEs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258286 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 04:32:05 +00:00
Lang Hames
6e2f199988 [Orc] Qualify captured variable to work around GCC ICE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258278 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 03:12:40 +00:00
Lang Hames
b8b874987e [Orc] Oops - lambda capture changed in r258206 was correct.
Fully qualify reference to Finalized in the body of the lambda instead to work
around GCC ICE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258208 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 22:32:58 +00:00
Lang Hames
b9be9b997a [Orc] Add missing capture to lambda.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258206 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 22:31:01 +00:00
Lang Hames
f32ef420e6 [Orc] Qualify call to make_unique to avoid ambiguity with std::make_unique.
This should fix some of the bot failures associated with r258185.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258204 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 22:22:43 +00:00
Lang Hames
08e6e6af38 [Orc] Fix a stale comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258187 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 21:13:54 +00:00
Lang Hames
1665b573d9 [Orc] Refactor ObjectLinkingLayer::addObjectSet to defer loading objects until
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258185 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 21:06:38 +00:00
Lang Hames
eb57e783f7 [Orc] Remove some reinterpret casts in debugging output.
These casts were from function pointer to data pointer type, which some
compilers (including GCC) may warn about. In all cases where these casts were
used the original value was still available as a TargetAddress (uint64_t), so
we can just print a formatted version of that instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257932 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15 21:14:05 +00:00
Lang Hames
1bad448558 [Orc] Add a void cast to work around a GCC diagnostic bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257927 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15 19:37:14 +00:00
David Blaikie
1215450590 Orc: Simplify some things with NSDMIs and some braced init.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14 23:33:43 +00:00
Lang Hames
f881fc9fb9 [Orc] Add support for EH-frame registration to the Orc Remote Target utility
classes.

OrcRemoteTargetClient::RCMemoryManager will now register EH frames with the
server automatically. This allows remote-execution of code that uses exceptions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257816 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14 22:02:03 +00:00
Rui Ueyama
3edb0ec229 Update to use new name alignTo().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257804 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14 21:06:47 +00:00
Lang Hames
06f2160e1e [ORC] Add extra debugging output to OrcRemoteTargetServer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257577 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 06:34:57 +00:00
Lang Hames
c161401717 [ORC] Fix typo in debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257576 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 06:08:07 +00:00
Lang Hames
05e78944a1 [ORC] More cleanup, partially aimed at working around GCC ICE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 19:01:49 +00:00
Lang Hames
9859617d8c [Orc] Replace lambda with a helper method.
This is good cleanup, but I'm also hoping it'll fix some more GCC ICEs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257498 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 18:17:23 +00:00
Lang Hames
09c7fb3a60 [Orc] Clang-format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257487 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 17:06:32 +00:00
Lang Hames
dab4109a7b [Orc] Take another shot at working around the GCC 4.7 ICE in
http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/27486



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257486 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 17:04:12 +00:00
Lang Hames
08529ecce9 [Orc] Comment out debugging output in OrcRemoteTargetClient::reserveMem to see
whether this affects the GCC 4.7 ICE on
http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75 .



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257458 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 07:26:28 +00:00
Lang Hames
deddff8498 [ORC] Remove extraneous '&'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257455 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 07:10:10 +00:00
Lang Hames
86ece97a37 [ORC] Replace some more 'auto' uses with std::error_code.
One of the GCC 4.7 bots doesn't seem to like auto, and is currently suffering
from an ICE. I'm hoping this will help.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257454 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 07:09:41 +00:00
Lang Hames
d696c2c2a2 [Orc] Add overloads of RPC::handle and RPC::expect that take member functions as
handlers.

It is expected that RPC handlers will usually be member functions. Accepting them
directly in handle and expect allows for the remove of a lot of lambdas an
explicit error variables.

This patch also uses this new feature to substantially tidy up the
OrcRemoteTargetServer class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 06:48:52 +00:00
NAKAMURA Takumi
1005fa61a4 OrcRemoteTargetServer.h: Suppress a warning. [-Wunused-variable]
FIXME: It may return ErrorOr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257431 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 01:23:43 +00:00
Lang Hames
169ee125af [ORC] Add explicit move construction/assignment to
OrcRemoteTargetClient::ObjectAllocs.

More MSVC bot appeasement.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257382 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 20:52:33 +00:00
Lang Hames
2133a4e140 [ORC] More MSVC error wrangling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257377 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 20:25:25 +00:00
Lang Hames
b843a2acf7 [Orc] Fix missing return.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257373 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 19:40:25 +00:00
Lang Hames
ada56848f5 [Orc] Add explicit move construction/assignment to RCMemoryManager.
Yet another attempt to pacify MSVC.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257372 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 19:39:49 +00:00
David Blaikie
c45bf3b4bf Fix some GCC 4.7 issues with the new Orc remote JIT support
I'm still seeing GCC ICE locally, but figured I'd throw this at the wall
& see if it sticks for the bots at least. Will continue investigating
the ICE in any case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257367 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 19:26:01 +00:00
Lang Hames
57ad02c289 [ORC] Explicitly delete copy constructors for RCMemoryManager::Alloc.
More MSVC bot appeasement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257364 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 19:05:45 +00:00
Lang Hames
d357cbfd50 [Orc] Include <system_error> in OrcTargetClient.
Another shot at appeasing the clang-x86_64-ubuntu-gdb-75 builder.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257362 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 18:48:37 +00:00
Lang Hames
27bceca193 [Orc] More explicit move construction/assignment to appease MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257358 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 17:32:03 +00:00
Lang Hames
392fee2351 [ORC] Pacify MSVC by adding explicit move construction/assignment to
OrcRemoteTargetServer::Allocator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 16:56:24 +00:00
Lang Hames
f1e6e63761 [ORC] Change 'auto' to 'std::error_code' to try to coax GCC builder into
providing a more helpful error diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257349 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 16:52:11 +00:00
Lang Hames
b20e09ca99 [LLI] Replace the LLI remote-JIT support with the new ORC remote-JIT components.
The new ORC remote-JITing support provides a superset of the old code's
functionality, so we can replace the old stuff. As a bonus, a couple of
previously XFAILed tests have started passing.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257343 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 16:35:55 +00:00
Lang Hames
cdd3d384cd [ORC] Move ORC RPC helper classes that rely on partial specialization into a
non-template base class.

Hopefully this should fix the issues with the windows bots arrising from
r257305.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 05:44:39 +00:00
Lang Hames
9705af5059 [Orc] Remove the empty class definitions in RPCUtils.h in the hope of working
around MSVC's C2783 error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257312 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 04:04:20 +00:00
Lang Hames
140f7b56a0 Orc] Drop PageSize member from Orc architecture support class in favour of
Process::getPageSize() - the former is redundant.

NFC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257310 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 02:41:17 +00:00
Lang Hames
ed650a3bd9 [Orc] Remove the FPRPCChannel class from RPCChannel.h - it requires unistd.h,
which was removed in r257306.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257309 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 02:15:12 +00:00
Lang Hames
542664f869 [Orc] Include the IndirectionUtils header in OrcRemoteTargetClient.
This should fix the modules builder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257307 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 01:59:35 +00:00
Lang Hames
838d9256d8 [Orc] Remote the <unistd> include introduced in r257305 - it's not needed, and
broke the windows bots.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257306 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 01:55:19 +00:00
Lang Hames
51c60258a4 [Orc] Add support for remote JITing to the ORC API.
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257305 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 01:40:11 +00:00