1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

25925 Commits

Author SHA1 Message Date
Lang Hames
2a97df2ff4 [Orc] Replace lambda with a helper method.
This is good cleanup, but I'm also hoping it'll fix some more GCC ICEs.

llvm-svn: 257498
2016-01-12 18:17:23 +00:00
Sanjay Patel
eb6cf93f57 function names start with a lower case letter ; NFC
llvm-svn: 257496
2016-01-12 18:03:37 +00:00
Lang Hames
f47a39aea4 [Orc] Clang-format.
llvm-svn: 257487
2016-01-12 17:06:32 +00:00
Lang Hames
475699ce0b [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

llvm-svn: 257486
2016-01-12 17:04:12 +00:00
Keno Fischer
b466194d5d [ARM] Fix several state persistence bugs
Summary:
This fixes three bugs, in all of which state is not or incorrecly reset between
objects (i.e. when reusing the same pass manager to create multiple object
files):
1) AttributeSection needs to be reset to nullptr, because otherwise the backend
   will try to emit into the old object file's attribute section causing a
   segmentation fault.
2) MappingSymbolCounter needs to be reset, otherwise the second object file
   will start where the first one left off.
3) The MCStreamer base class resets the Streamer's e_flags settings. Since
   EF_ARM_EABI_VER5 is set on streamer creation, we need to set it again
   after the MCStreamer was rest.

Also rename Reset (uppser case) to EHReset to avoid confusion with
reset (lower case).

Reviewers: rengolin
Differential Revision: http://reviews.llvm.org/D15950

llvm-svn: 257473
2016-01-12 13:38:15 +00:00
Igor Breger
46e273fe48 AVX512: VPMOVAPS/PD and VPMOVUPS/PD (load) intrinsic implementation.
Differential Revision: http://reviews.llvm.org/D16042

llvm-svn: 257463
2016-01-12 10:02:32 +00:00
Lang Hames
918799e0ad [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 .

llvm-svn: 257458
2016-01-12 07:26:28 +00:00
Lang Hames
3ec88cdc93 [ORC] Remove extraneous '&'.
llvm-svn: 257455
2016-01-12 07:10:10 +00:00
Lang Hames
65803871bd [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.

llvm-svn: 257454
2016-01-12 07:09:41 +00:00
Lang Hames
f37b24374f [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.

llvm-svn: 257452
2016-01-12 06:48:52 +00:00
Dan Gohman
9a08bce090 [WebAssembly] Define a custom segment type for function definitions.
Since function definitions are not loaded into the address space, PT_LOAD is
inappropriate. PT_WEBASSEMBLY_FUNCTIONS is used to identify where the function
definitions are so that they can be processed at program startup time.

llvm-svn: 257436
2016-01-12 02:58:12 +00:00
NAKAMURA Takumi
049c623237 OrcRemoteTargetServer.h: Suppress a warning. [-Wunused-variable]
FIXME: It may return ErrorOr.
llvm-svn: 257431
2016-01-12 01:23:43 +00:00
Dan Gohman
28312257c8 [WebAssembly] Define WebAssembly-specific relocation codes.
Currently WebAssembly has two kinds of relocations; data addresses and
function addresses. This adds ELF relocations for them, as well as an
MC symbol kind to indicate which type of relocation is needed.

llvm-svn: 257416
2016-01-11 23:38:05 +00:00
Teresa Johnson
c5417f559e Split resolveCycles(bool AllowTemps) into two interfaces and document
Address review feedback from r255909.

Move body of resolveCycles(bool AllowTemps) to
resolveRecursivelyImpl(bool AllowTemps). Revert resolveCycles back
to asserting on temps, and add new resolveNonTemporaries interface
to invoke the new implementation with AllowTemps=true. Document
the differences between these interfaces, specifically the effect
on RAUW support and uniquing. Call appropriate interface from
ValueMapper.

llvm-svn: 257389
2016-01-11 21:37:41 +00:00
Pete Cooper
6968094852 BumpPtrAllocator::Reset should also poison the first slab which doesn't get deallocated.
When asan is enabled, we poison slabs as we allocate them, and only unpoison the pieces
we need from the slab.

However, in Reset, we were failing to reset the state of the slab back to being poisoned.

Patch by b17 c0de.

llvm-svn: 257388
2016-01-11 21:28:03 +00:00
Lang Hames
cf27cdf11f [ORC] Add explicit move construction/assignment to
OrcRemoteTargetClient::ObjectAllocs.

More MSVC bot appeasement.

llvm-svn: 257382
2016-01-11 20:52:33 +00:00
Lang Hames
fcaa6caed5 [ORC] More MSVC error wrangling.
llvm-svn: 257377
2016-01-11 20:25:25 +00:00
Dimitry Andric
f8ee8c016c Ensure -mcpu=xscale works for arm targets, after rL252903 and rL252904
After these revisions, for arm targets, the -mcpu=xscale option caused
an error: "the clang compiler does not support '-mcpu=xscale'".  Adding
"v5e" as a SUB_ARCH in ARMTargetParser.def helps.

Submitted by: Andrew Turner
Differential Revision: http://reviews.llvm.org/D16043

llvm-svn: 257376
2016-01-11 20:12:53 +00:00
Lang Hames
789b9a4918 [Orc] Fix missing return.
llvm-svn: 257373
2016-01-11 19:40:25 +00:00
Lang Hames
9f11bb5b33 [Orc] Add explicit move construction/assignment to RCMemoryManager.
Yet another attempt to pacify MSVC.

llvm-svn: 257372
2016-01-11 19:39:49 +00:00
David Blaikie
e31830eba8 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.

llvm-svn: 257367
2016-01-11 19:26:01 +00:00
Lang Hames
fed2407e06 [ORC] Explicitly delete copy constructors for RCMemoryManager::Alloc.
More MSVC bot appeasement.

llvm-svn: 257364
2016-01-11 19:05:45 +00:00
Lang Hames
4857d16b5d [Orc] Include <system_error> in OrcTargetClient.
Another shot at appeasing the clang-x86_64-ubuntu-gdb-75 builder.

llvm-svn: 257362
2016-01-11 18:48:37 +00:00
Lang Hames
a872375ec6 [Orc] More explicit move construction/assignment to appease MSVC.
llvm-svn: 257358
2016-01-11 17:32:03 +00:00
Lang Hames
eff773999e [ORC] Pacify MSVC by adding explicit move construction/assignment to
OrcRemoteTargetServer::Allocator.

llvm-svn: 257350
2016-01-11 16:56:24 +00:00
Lang Hames
1753332c86 [ORC] Change 'auto' to 'std::error_code' to try to coax GCC builder into
providing a more helpful error diagnostic.

llvm-svn: 257349
2016-01-11 16:52:11 +00:00
Lang Hames
0c18396b3b [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.

llvm-svn: 257343
2016-01-11 16:35:55 +00:00
Lang Hames
10ff8aebeb [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.

llvm-svn: 257316
2016-01-11 05:44:39 +00:00
Lang Hames
673deb3f03 [Orc] Remove the empty class definitions in RPCUtils.h in the hope of working
around MSVC's C2783 error.

llvm-svn: 257312
2016-01-11 04:04:20 +00:00
Xinliang David Li
abd11e3a7a Move all decls in coverage namespace into CoverageMapping.h/NFC
llvm-svn: 257311
2016-01-11 03:54:18 +00:00
Lang Hames
9e749a8bf3 Orc] Drop PageSize member from Orc architecture support class in favour of
Process::getPageSize() - the former is redundant.

NFC.

llvm-svn: 257310
2016-01-11 02:41:17 +00:00
Lang Hames
bd29b673ab [Orc] Remove the FPRPCChannel class from RPCChannel.h - it requires unistd.h,
which was removed in r257306.

llvm-svn: 257309
2016-01-11 02:15:12 +00:00
Lang Hames
bed94788cf [Orc] Include the IndirectionUtils header in OrcRemoteTargetClient.
This should fix the modules builder.

llvm-svn: 257307
2016-01-11 01:59:35 +00:00
Lang Hames
61dee24618 [Orc] Remote the <unistd> include introduced in r257305 - it's not needed, and
broke the windows bots.

llvm-svn: 257306
2016-01-11 01:55:19 +00:00
Lang Hames
dac7e64ae5 [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.

llvm-svn: 257305
2016-01-11 01:40:11 +00:00
Lang Hames
ecc377c6e6 [Orc] Rename OrcTargetSupport to OrcArchitectureSupport to avoid confusion with
the upcoming remote-target support classes.

llvm-svn: 257302
2016-01-11 00:56:15 +00:00
Lang Hames
26e35e4614 [Orc] Add error codes and a new std::error_category for remote-jit errors.
These will be used by an upcoming patch that adds remote-jit support utilities
to ORC.

llvm-svn: 257297
2016-01-11 00:34:13 +00:00
Lang Hames
e5c7dde8bf [RuntimeDyld] Add a notifyObjectLoaded method to RuntimeDyld::MemoryManager.
This is a more generic version of the MCJITMemoryManager::notifyObjectLoaded
method: It provides only a RuntimeDyld reference (rather than an
ExecutionEngine), and so can be used with ORC JIT stacks.

llvm-svn: 257296
2016-01-10 23:59:41 +00:00
Xinliang David Li
623cbbe965 Move coveragemap_error enum into coverage namespace and InstrProf.h /NFC
llvm-svn: 257295
2016-01-10 21:56:33 +00:00
Lang Hames
387a94a205 [RuntimeDyld] Add alignment arguments to the reserveAllocationSpace method of
RuntimeDyld::MemoryManager.

The RuntimeDyld::MemoryManager::reserveAllocationSpace method is called when
object files are loaded, and gives clients a chance to pre-allocate memory for
all segments. Previously only the size of each segment (code, ro-data, rw-data)
was supplied but not the alignment. This hasn't caused any problems so far, as
most clients allocate via the MemoryBlock interface which returns page-aligned
blocks. Adding alignment arguments enables finer grained allocation while still
satisfying alignment restrictions.

llvm-svn: 257294
2016-01-10 18:51:50 +00:00
Benjamin Kramer
cd2490f7bc [ADT] Another stab at fixing the PointerEmbeddedInt build for MSVC.
MSVC18 seems to have other problems here, just hardcode uintptr_t.

llvm-svn: 257289
2016-01-10 14:27:26 +00:00
Benjamin Kramer
cdf764c720 [ADT] Unbreak PointerEmbeddedInt build with MSVC.
MSVC seems to have problems looking up Value inside of the template. Not
really sure whether that's a bug there or Clang and GCC being too
permissive.

llvm-svn: 257288
2016-01-10 14:06:29 +00:00
Chandler Carruth
8bbd7bacc1 [ADT] Add an abstraction for embedding an integer within a pointer-like
type.

This makes it easy and safe to use a set of flags as one elmenet of
a tagged union with pointers. There is quite a bit of code that has
historically done this by casting arbitrary integers to "pointers" and
assuming that this was safe and reliable. It is neither, and has started
to rear its head by triggering safety asserts in various abstractions
like PointerLikeTypeTraits when the integers chosen are invariably poor
choices for *some* platform and *some* situation. Not to mention the
(hopefully unlikely) prospect of one of these integers actually getting
allocated!

With this, it will be straightforward to build type safe abstractions
like this without being error prone. The abstraction itself is also
remarkably simple thanks to the implicit conversion.

This use case and pattern was also independently created by the folks
working on Swift, and they're going to incrementally add any missing
functionality they find.

Differential Revision: http://reviews.llvm.org/D15844

llvm-svn: 257284
2016-01-10 09:40:13 +00:00
Michael Zuckerman
142f0a5d1e [AVX512] add PRORVQ and PRORVD Intrinsic
Differential Revision:http://reviews.llvm.org/D15955

llvm-svn: 257283
2016-01-10 09:16:41 +00:00
Chandler Carruth
2cfc282af1 [ADT] Add a sum type abstraction for pointer-like types.
This is a much more general and powerful form of PointerUnion. It
provides a reasonably complete sum type (from type theory) for
pointer-like types. It has several significant advantages over the
existing PointerUnion infrastructure:

1) It allows more than two pointer types to participate without awkward
   nesting structures.
2) It directly exposes the tag so that it is convenient to write
   switches over the possible members.
3) It can re-use the same type for multiple tag values, something that
   has been worked around by either abusing PointerIntPair or defining
   nonce types and doing unsafe pointer casting.
4) It supports customization of the PointerLikeTypeTraits used for
   specific member types. This means it could (in theory) be used even
   with types that are over-aligned on allocation to expose larger
   numbers of bits to the tag.

All in all, I think it is at least complimentary to the existing
infrastructure, and a strict improvement for some use cases.

Differential Revision: http://reviews.llvm.org/D15843

llvm-svn: 257282
2016-01-10 08:48:23 +00:00
Craig Topper
3a8b432ce1 [ADT] Remove 'reinterpreted as a pointer' from some Twine comments. Integers have been stored directly in a union for some time. NFC
llvm-svn: 257281
2016-01-10 08:27:13 +00:00
David Majnemer
9af45892a7 [JumpThreading] Don't forget to report that the IR changed
JumpThreading's runOnFunction is supposed to return true if it made any
changes.  JumpThreading has a call to removeUnreachableBlocks which may
result in changes to the IR but runOnFunction didn't appropriate account
for this possibility, leading to badness.

While we are here, make sure to call LazyValueInfo::eraseBlock in
removeUnreachableBlocks;  JumpThreading preserves LVI.

This fixes PR26096.

llvm-svn: 257279
2016-01-10 07:13:04 +00:00
Lang Hames
cd4f591ec9 [Orc] Fix MSVC build errors due to r257265 by adding explicit move construction
and assignment to LogicalDylibResources.

llvm-svn: 257269
2016-01-09 22:05:08 +00:00
Lang Hames
7d118365e3 [Orc] Enable user-supplied memory managers in the CompileOnDemand layer.
Previously the CompileOnDemand layer was hard-coded to use a new
SectionMemoryManager for each function when it was called.

llvm-svn: 257265
2016-01-09 20:55:18 +00:00
Lang Hames
f1200209c6 [Orc][RuntimeDyld] Prevent duplicate calls to finalizeMemory on shared memory
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
2016-01-09 19:50:40 +00:00