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

25915 Commits

Author SHA1 Message Date
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
Mike Aizatsky
d03c218611 [llvm-symbolizer] -print-source-context-lines option to print source code around the line.
Differential Revision: http://reviews.llvm.org/D15909

llvm-svn: 257236
2016-01-09 00:14:35 +00:00
Sanjay Patel
48f8ec9e7d don't repeat variable/function names in comments; NFC
llvm-svn: 257227
2016-01-08 23:04:05 +00:00
Xinliang David Li
caf757f298 [PGO] Introducing version mask macro/NFC
llvm-svn: 257224
2016-01-08 22:55:16 +00:00
Matthias Braun
d04fcb716a LiveInterval: Adapt commen to the LI->LR change.
llvm-svn: 257196
2016-01-08 19:25:31 +00:00
Xinliang David Li
7cc3407c44 Minor fix -- use the right version enum/NFC
llvm-svn: 257194
2016-01-08 19:21:32 +00:00
Justin Bogner
879f86bb78 LoopInfo: Simplify ownership of Loop objects
It's strange that LoopInfo mostly owns the Loop objects, but that it
defers deleting them to the loop pass manager. Instead, change the
oddly named "updateUnloop" to "markAsRemoved" and have it queue the
Loop object for deletion. We can't delete the Loop immediately when we
remove it, since we need its pointer identity still, so we'll mark the
object as "invalid" so that clients can see what's going on.

llvm-svn: 257191
2016-01-08 19:08:53 +00:00
Easwaran Raman
251ea8cd28 Remove CloningDirector and associated code
With the removal of the old landing pad code in r249918, CloningDirector is not
 used anywhere else. NFCI.

llvm-svn: 257185
2016-01-08 18:23:17 +00:00
Teresa Johnson
675bf59b32 [ThinLTO] Use new in-place symbol changes for exporting module
Due to the new in-place ThinLTO symbol handling support added in
r257174, we now invoke renameModuleForThinLTO on the current
module from within the FunctionImport pass.

Additionally, renameModuleForThinLTO no longer needs to return the
Module as it is performing the renaming in place on the one provided.

This commit will be immediately preceeded by a companion clang patch to
remove its invocation of renameModuleForThinLTO.

llvm-svn: 257181
2016-01-08 17:06:29 +00:00
Teresa Johnson
5e0ce11a8d [ThinLTO] Enable in-place symbol changes for exporting module
Summary:
Move ThinLTO global value processing functions out of ModuleLinker and
into a new ThinLTOGlobalProcessor class, which performs any necessary
linkage and naming changes on the given module in place.

As a result, renameModuleForThinLTO no longer needs to create a new
Module when performing any necessary local to global promotion on a
module that we are possibly exporting from during a ThinLTO backend
compilation.

During function importing the ThinLTO processing is still invoked from
the ModuleLinker (via the new class), as it needs to perform renaming and
linkage changes on the source module, e.g. in order to get the correct
renaming during local to global promotion.

Reviewers: joker.eph

Subscribers: davidxl, llvm-commits, joker.eph

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

llvm-svn: 257174
2016-01-08 15:00:00 +00:00
Chandler Carruth
1b5532dd29 [attrs] Split the late-revisit pattern for deducing norecurse in
a top-down manner into a true top-down or RPO pass over the call graph.

There are specific patterns of function attributes, notably the
norecurse attribute, which are most effectively propagated top-down
because all they us caller information.

Walk in RPO over the call graph SCCs takes the form of a module pass run
immediately after the CGSCC pass managers postorder walk of the SCCs,
trying again to deduce norerucrse for each singular SCC in the call
graph.

This removes a very legacy pass manager specific trick of using a lazy
revisit list traversed during finalization of the CGSCC pass. There is
no analogous finalization step in the new pass manager, and a lazy
revisit list is just trying to produce an RPO iteration of the call
graph. We can do that more directly if more expensively. It seems
unlikely that this will be the expensive part of any compilation though
as we never examine the function bodies here. Even in an LTO run over
a very large module, this should be a reasonable fast set of operations
over a reasonably small working set -- the function call graph itself.

In the future, if this really is a compile time performance issue, we
can look at building support for both post order and RPO traversals
directly into a pass manager that builds and maintains the PO list of
SCCs.

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

llvm-svn: 257163
2016-01-08 10:55:52 +00:00