7 years agoOrcRemoteTargetServer.h: Suppress a warning. [-Wunused-variable]
NAKAMURA Takumi [Tue, 12 Jan 2016 01:23:43 +0000 (01:23 +0000)]
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

7 years agolli: Fix warnings. [-Wsign-compare]
NAKAMURA Takumi [Tue, 12 Jan 2016 01:23:30 +0000 (01:23 +0000)]
lli: Fix warnings. [-Wsign-compare]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257430 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCXX_FAST_TLS calling convention: performance improvement for x86-64.
Manman Ren [Tue, 12 Jan 2016 01:08:46 +0000 (01:08 +0000)]
CXX_FAST_TLS calling convention: performance improvement for x86-64.

This is the same change on x86-64 as r255821 on AArch64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257428 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoLoopUnroll: Make canUnrollCompletely static - it doesn't use any state. NFC
Justin Bogner [Tue, 12 Jan 2016 01:06:32 +0000 (01:06 +0000)]
LoopUnroll: Make canUnrollCompletely static - it doesn't use any state. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257427 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoLoopUnroll: Clean up the maze of initialization for unroll parameters. NFC
Justin Bogner [Tue, 12 Jan 2016 00:55:26 +0000 (00:55 +0000)]
LoopUnroll: Clean up the maze of initialization for unroll parameters. NFC

The layering of where the various loop unroll parameters are
initialized and overridden here was very confusing, making it pretty
difficult to tell just how the various sources interacted. Instead, we
put all of the initialization logic together in a single function so
that it's obvious what overrides what.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257426 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCXX_FAST_TLS calling convention: performance improvement for ARM.
Manman Ren [Tue, 12 Jan 2016 00:47:18 +0000 (00:47 +0000)]
CXX_FAST_TLS calling convention: performance improvement for ARM.

This is the same change on ARM as r255821 on AArch64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257424 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] extend the weak memcmp/strcmp/strncmp interceptors to receive the result...
Kostya Serebryany [Tue, 12 Jan 2016 00:43:42 +0000 (00:43 +0000)]
[libFuzzer] extend the weak memcmp/strcmp/strncmp interceptors to receive the result of the computations. With that, don't do any mutations if memcmp/etc returned 0

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257423 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[IRMover] Don't copy personality, etc unless creating def
Teresa Johnson [Tue, 12 Jan 2016 00:24:24 +0000 (00:24 +0000)]
[IRMover] Don't copy personality, etc unless creating def

Function::copyAttributesFrom will copy the personality function, prefix
data and prolog data from the source function to the new function, and
is invoked when the IRMover copies the function prototype. This puts a
reference to a constant in the source module on a function in the dest
module, which causes an error when deleting the source module after
importing, since the personality function in the source module still has
uses (this would presumably also be an issue for the prologue and prefix
data). Remove the copies added to the dest copy when creating the new
prototype, as they are mapped properly when/if we link the function body.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257420 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] XFAIL a few remote-jit test cases that I missed in r257391.
Lang Hames [Mon, 11 Jan 2016 23:57:39 +0000 (23:57 +0000)]
[Orc] XFAIL a few remote-jit test cases that I missed in r257391.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257419 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCXX_FAST_TLS calling convention: Add support for ARM on Darwin.
Manman Ren [Mon, 11 Jan 2016 23:50:43 +0000 (23:50 +0000)]
CXX_FAST_TLS calling convention: Add support for ARM on Darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257417 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Define WebAssembly-specific relocation codes.
Dan Gohman [Mon, 11 Jan 2016 23:38:05 +0000 (23:38 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257416 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAvoid the deprecated GetVersionEx API
Reid Kleckner [Mon, 11 Jan 2016 23:33:03 +0000 (23:33 +0000)]
Avoid the deprecated GetVersionEx API

Apparently the preferred version is the incredibly complicated
VerifyVersionInfoW function.

Rename the function to avoid potential future name clashes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257415 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LibCallSimplifier] use instruction-level fast-math-flags to transform log calls
Sanjay Patel [Mon, 11 Jan 2016 23:31:48 +0000 (23:31 +0000)]
[LibCallSimplifier] use instruction-level fast-math-flags to transform log calls

Also, add tests to verify that we're checking 'fast' on both calls of each transform pair,
tighten the CHECK lines, and give the tests more meaningful names.

This is a continuation of:

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257414 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove a bugs assert.
Rafael Espindola [Mon, 11 Jan 2016 23:21:45 +0000 (23:21 +0000)]
Remove a bugs assert.

There is no reason the value being printed has to be positive.
Fixes pr25802.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257412 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agolli-child-target: Introduce a new dependency on RuntimeDyld.
NAKAMURA Takumi [Mon, 11 Jan 2016 23:12:30 +0000 (23:12 +0000)]
lli-child-target: Introduce a new dependency on RuntimeDyld.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257410 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LibCallSimplifier] don't allow sqrt transform unless all ops are unsafe
Sanjay Patel [Mon, 11 Jan 2016 22:50:36 +0000 (22:50 +0000)]
[LibCallSimplifier] don't allow sqrt transform unless all ops are unsafe

Fix the FIXME added with:

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257404 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoLoopUnroll: Use the optsize threshold for minsize as well
Justin Bogner [Mon, 11 Jan 2016 22:39:43 +0000 (22:39 +0000)]
LoopUnroll: Use the optsize threshold for minsize as well

Currently we're unrolling loops more in minsize than in optsize, which
means -Oz will have a larger code size than -Os. That doesn't make any

This resolves the FIXME about this in LoopUnrollPass and extends the
optsize test to make sure we use the smaller threshold for minsize as

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257402 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agomore space; NFC
Sanjay Patel [Mon, 11 Jan 2016 22:35:39 +0000 (22:35 +0000)]
more space; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257401 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LibCallSimplifier] use instruction-level fast-math-flags to transform sqrt calls
Sanjay Patel [Mon, 11 Jan 2016 22:34:19 +0000 (22:34 +0000)]
[LibCallSimplifier] use instruction-level fast-math-flags to transform sqrt calls

This is a continuation of adding FMF to call instructions:

The intent of the patch is to preserve the current behavior of the transform except
that we use the sqrt instruction's 'fast' attribute as a trigger rather than the
function-level attribute.

But this raises a bug noted by the new FIXME comment.

In order to do this transform:
sqrt((x * x) * y) ---> fabs(x) * sqrt(y)

...we need all of the sqrt, the first fmul, and the second fmul to be 'fast'.
If any of those ops is strict, we should bail out.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257400 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agogetParent()->getParent() == getFunction() and clang-format ; NFC
Sanjay Patel [Mon, 11 Jan 2016 22:24:35 +0000 (22:24 +0000)]
getParent()->getParent() == getFunction() and clang-format ; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257399 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agodon't repeat function names in comments; NFC
Sanjay Patel [Mon, 11 Jan 2016 22:14:42 +0000 (22:14 +0000)]
don't repeat function names in comments; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257396 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd a missing error handling to llvm-lto.
Rafael Espindola [Mon, 11 Jan 2016 22:08:22 +0000 (22:08 +0000)]
Add a missing error handling to llvm-lto.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257395 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Reorganize address offset folding.
Dan Gohman [Mon, 11 Jan 2016 22:05:44 +0000 (22:05 +0000)]
[WebAssembly] Reorganize address offset folding.

Always expect tglobaladdr and texternalsym to be wrapped in
WebAssemblywrapper nodes. Also, split out a regPlusGA from regPlusImm so
that it can special-case global addresses, as they can be folded in more

Unfortunately this doesn't enable any new optimizations yet due to
SelectionDAG limitations. I'll be submitting changes to the SelectionDAG
infrastructure, along with tests, in a separate patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257394 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Implement {{s|u}}int_to_fp i64 -> f32
Matt Arsenault [Mon, 11 Jan 2016 22:01:48 +0000 (22:01 +0000)]
AMDGPU: Implement {{s|u}}int_to_fp i64 -> f32

The old lowering for uint_to_fp failed opencl conformance.
It might be OK for fast math mode, but I'm not sure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257393 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoXFAIL the LLI remote JIT tests on Win32.
Lang Hames [Mon, 11 Jan 2016 21:41:34 +0000 (21:41 +0000)]
XFAIL the LLI remote JIT tests on Win32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257391 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSplit resolveCycles(bool AllowTemps) into two interfaces and document
Teresa Johnson [Mon, 11 Jan 2016 21:37:41 +0000 (21:37 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257389 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoBumpPtrAllocator::Reset should also poison the first slab which doesn't get deallocated.
Pete Cooper [Mon, 11 Jan 2016 21:28:03 +0000 (21:28 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257388 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Cleanup udiv test
Matt Arsenault [Mon, 11 Jan 2016 21:18:40 +0000 (21:18 +0000)]
AMDGPU: Cleanup udiv test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257387 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Fix crash with dispatch.ptr intrinsic with non-HSA target
Matt Arsenault [Mon, 11 Jan 2016 21:18:33 +0000 (21:18 +0000)]
AMDGPU: Fix crash with dispatch.ptr intrinsic with non-HSA target

It might be better to let this be a select failure instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257386 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Add AVX512 testcase for r248965/PR24512.
Ahmed Bougacha [Mon, 11 Jan 2016 21:16:21 +0000 (21:16 +0000)]
[X86] Add AVX512 testcase for r248965/PR24512.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257385 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[Windows] Simplify assertion code. NFC."
Reid Kleckner [Mon, 11 Jan 2016 21:07:48 +0000 (21:07 +0000)]
Revert "[Windows] Simplify assertion code. NFC."

This reverts commit r254363.

load64BitDebugHelp() has the side effect of loading dbghelp and setting
globals. It should be called in no-asserts builds as well as debug

llvm_unreachable is also not appropriate here, since we actually want to
return if dbghelp couldn't be loaded in a non-asserts build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257384 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ORC] Add explicit move construction/assignment to
Lang Hames [Mon, 11 Jan 2016 20:52:33 +0000 (20:52 +0000)]
[ORC] Add explicit move construction/assignment to

More MSVC bot appeasement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257382 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUpdate the VS getting started docs to reflect the current state of support
Reid Kleckner [Mon, 11 Jan 2016 20:51:57 +0000 (20:51 +0000)]
Update the VS getting started docs to reflect the current state of support

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257381 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse ::GetVersionEx directly rather than the Win8.1 SDK helpers
Reid Kleckner [Mon, 11 Jan 2016 20:35:45 +0000 (20:35 +0000)]
Use ::GetVersionEx directly rather than the Win8.1 SDK helpers

This removes ifdefs and fixes the build for users of the Win8.0 SDK,
which I happen to be. Upgrading is not hard, but executing the same code
everywhere seems better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257379 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ORC] More MSVC error wrangling.
Lang Hames [Mon, 11 Jan 2016 20:25:25 +0000 (20:25 +0000)]
[ORC] More MSVC error wrangling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257377 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoEnsure -mcpu=xscale works for arm targets, after rL252903 and rL252904
Dimitry Andric [Mon, 11 Jan 2016 20:12:53 +0000 (20:12 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257376 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[sanitizer] [msan] Fix origin store of array types
Adhemerval Zanella [Mon, 11 Jan 2016 19:55:27 +0000 (19:55 +0000)]
[sanitizer] [msan] Fix origin store of array types

This patch fixes the memory sanitizer origin store instrumentation for
array types.  This can be triggered by cases where frontend lowers
function return to array type instead of aggregation.

For instance, the C code:

struct mypair {
 int64_t x;
 int y;

mypair my_make_pair(int64_t x, int y)  {
 mypair p;
 p.x = x;
 p.y = y;
 return p;

int foo (int p)
  mypair z = my_make_pair(p, 0);
  return z.y + z.x;

It will be lowered with target set to aarch64-linux and -O0 to:

define i32 @_Z3fooi(i32 %p) #0 {
%call = call [2 x i64] @_Z12my_make_pairxi(i64 %conv, i32 0)
%1 = bitcast %struct.mypair* %z to [2 x i64]*
store [2 x i64] %call, [2 x i64]* %1, align 8

The origin store will emit a 'icmp' to test each store value again the
TLS origin array.  However since 'icmp' does not support ArrayType the
memory instrumentation phase will bail out with an error.

This patch change it by using the same strategy used for struct type on

It fixes the 'test/msan/insertvalue_origin.cc' for aarch64 (the -O0 case).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257375 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Fix missing return.
Lang Hames [Mon, 11 Jan 2016 19:40:25 +0000 (19:40 +0000)]
[Orc] Fix missing return.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257373 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Add explicit move construction/assignment to RCMemoryManager.
Lang Hames [Mon, 11 Jan 2016 19:39:49 +0000 (19:39 +0000)]
[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

7 years agoFix some GCC 4.7 issues with the new Orc remote JIT support
David Blaikie [Mon, 11 Jan 2016 19:26:01 +0000 (19:26 +0000)]
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

7 years agoCode refactoring for commit r257278.
Chen Li [Mon, 11 Jan 2016 19:20:53 +0000 (19:20 +0000)]
Code refactoring for commit r257278.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257366 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[NFC] Fix whitespace.
Chad Rosier [Mon, 11 Jan 2016 19:17:36 +0000 (19:17 +0000)]
[NFC] Fix whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257365 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ORC] Explicitly delete copy constructors for RCMemoryManager::Alloc.
Lang Hames [Mon, 11 Jan 2016 19:05:45 +0000 (19:05 +0000)]
[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

7 years ago[Orc] Include <system_error> in OrcTargetClient.
Lang Hames [Mon, 11 Jan 2016 18:48:37 +0000 (18:48 +0000)]
[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

7 years agolli/ChildTarget now depends on OrcJIT. Add that component to the Makefile.
Lang Hames [Mon, 11 Jan 2016 17:44:07 +0000 (17:44 +0000)]
lli/ChildTarget now depends on OrcJIT. Add that component to the Makefile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257360 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove the remote-JIT small code model tests for now. They're causing
Lang Hames [Mon, 11 Jan 2016 17:38:25 +0000 (17:38 +0000)]
Remove the remote-JIT small code model tests for now. They're causing
intermittent XPASSes on some builders.

These can be reinstated when we have proper support for small-code model in
the JIT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257359 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] More explicit move construction/assignment to appease MSVC.
Lang Hames [Mon, 11 Jan 2016 17:32:03 +0000 (17:32 +0000)]
[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

7 years agoXFAIL the remote small code model tests on x86. Small code model is not properly
Lang Hames [Mon, 11 Jan 2016 17:09:58 +0000 (17:09 +0000)]
XFAIL the remote small code model tests on x86. Small code model is not properly
supported, and only worked previously because we weren't really running them

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257355 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: int_to_fp test cleanups
Matt Arsenault [Mon, 11 Jan 2016 17:02:10 +0000 (17:02 +0000)]
AMDGPU: int_to_fp test cleanups

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257354 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Fix ctlz combine for sub 32-bit types
Matt Arsenault [Mon, 11 Jan 2016 17:02:06 +0000 (17:02 +0000)]
AMDGPU: Fix ctlz combine for sub 32-bit types

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257353 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Pattern match ffbh pattern to instruction.
Matt Arsenault [Mon, 11 Jan 2016 17:02:00 +0000 (17:02 +0000)]
AMDGPU: Pattern match ffbh pattern to instruction.

The hardware instruction's output on 0 is -1 rather than 32.
Eliminate a test and select to -1. This removes an extra instruction
from the compatability function with HSAIL's firstbit instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257352 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LLI] Remove dependence on RemoteTarget.cpp from ChildTarget's Makefile.
Lang Hames [Mon, 11 Jan 2016 17:00:31 +0000 (17:00 +0000)]
[LLI] Remove dependence on RemoteTarget.cpp from ChildTarget's Makefile.

RemoteTarget.cpp was removed in r257343.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257351 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ORC] Pacify MSVC by adding explicit move construction/assignment to
Lang Hames [Mon, 11 Jan 2016 16:56:24 +0000 (16:56 +0000)]
[ORC] Pacify MSVC by adding explicit move construction/assignment to

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257350 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ORC] Change 'auto' to 'std::error_code' to try to coax GCC builder into
Lang Hames [Mon, 11 Jan 2016 16:52:11 +0000 (16:52 +0000)]
[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

7 years agoAMDGPU: Custom lower i64 ctlz
Matt Arsenault [Mon, 11 Jan 2016 16:50:29 +0000 (16:50 +0000)]
AMDGPU: Custom lower i64 ctlz

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257348 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMips: Remove lowerSELECT_CC
Matt Arsenault [Mon, 11 Jan 2016 16:44:48 +0000 (16:44 +0000)]
Mips: Remove lowerSELECT_CC

This is the same as the default expansion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257346 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoLegalizeDAG: Expand ctlz with ctlz_zero_undef if legal
Matt Arsenault [Mon, 11 Jan 2016 16:37:46 +0000 (16:37 +0000)]
LegalizeDAG: Expand ctlz with ctlz_zero_undef if legal

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257345 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Remove dead target dag combine
Matt Arsenault [Mon, 11 Jan 2016 16:37:40 +0000 (16:37 +0000)]
AMDGPU: Remove dead target dag combine

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257344 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LLI] Replace the LLI remote-JIT support with the new ORC remote-JIT components.
Lang Hames [Mon, 11 Jan 2016 16:35:55 +0000 (16:35 +0000)]
[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

7 years agoRevert r257164 - it has caused spec2k6 failures in LTO mode
Silviu Baranga [Mon, 11 Jan 2016 16:19:38 +0000 (16:19 +0000)]
Revert r257164 - it has caused spec2k6 failures in LTO mode

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257340 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[mips] Never select JAL for calls to an absolute immediate address.
Daniel Sanders [Mon, 11 Jan 2016 15:57:46 +0000 (15:57 +0000)]
[mips] Never select JAL for calls to an absolute immediate address.

It actually takes an offset into the current PC-region.

This fixes the 'expr' command in lldb.

Reviewers: vkalintiris, jaydeep, bhushan

Subscribers: dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257339 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Add check for nullptr in getFixupNoBits
Krzysztof Parzyszek [Mon, 11 Jan 2016 15:51:53 +0000 (15:51 +0000)]
[Hexagon] Add check for nullptr in getFixupNoBits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257338 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Add implicit uses of GP to GP-relative loads and stores
Krzysztof Parzyszek [Mon, 11 Jan 2016 15:49:58 +0000 (15:49 +0000)]
[Hexagon] Add implicit uses of GP to GP-relative loads and stores

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257337 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Mark D14 and GP as reserved registers
Krzysztof Parzyszek [Mon, 11 Jan 2016 15:47:41 +0000 (15:47 +0000)]
[Hexagon] Mark D14 and GP as reserved registers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257336 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Reduce complexity of the LEA optimization pass, by Andrey Turetsky.
Alexey Bataev [Mon, 11 Jan 2016 11:52:29 +0000 (11:52 +0000)]
[X86] Reduce complexity of the LEA optimization pass, by Andrey Turetsky.
In the OptimizeLEA pass keep instructions' positions in the basic block saved and use them for calculation of the distance between two instructions instead of std::distance. This reduces complexity of the pass from O(n^3) to O(n^2) and thus the compile time.
Differential Revision: http://reviews.llvm.org/D15692

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257328 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[BranchFolding] Set correct mem refs (2nd try)
Junmo Park [Mon, 11 Jan 2016 07:15:38 +0000 (07:15 +0000)]
[BranchFolding] Set correct mem refs (2nd try)

This is a recommit of r257253 which was reverted in r257270.
Previous testcase can make failure on some targets due to using opt with O3 option.

Original Summary:
Merge MBBICommon and MBBI's MMOs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257317 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ORC] Move ORC RPC helper classes that rely on partial specialization into a
Lang Hames [Mon, 11 Jan 2016 05:44:39 +0000 (05:44 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257316 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[TableGen] Allow asm writer to use up to 3 OpInfo tables instead of 2. This allows...
Craig Topper [Mon, 11 Jan 2016 05:13:41 +0000 (05:13 +0000)]
[TableGen] Allow asm writer to use up to 3 OpInfo tables instead of 2. This allows x86 to use 56 total bits made up of a 32-bit, 16-bit, and 8-bit table. Previously we were using 64 total bits.

This saves 14K from the x86 table size. And saves space on other targets as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257315 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[TableGen] Remove unnecessary 0 terminator from an array that only existed to prevent...
Craig Topper [Mon, 11 Jan 2016 05:13:38 +0000 (05:13 +0000)]
[TableGen] Remove unnecessary 0 terminator from an array that only existed to prevent ending an array with a comma. But that's perfectly legal and not something we need to prevent. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257314 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix examples corresponding to r257302.
NAKAMURA Takumi [Mon, 11 Jan 2016 05:04:20 +0000 (05:04 +0000)]
Fix examples corresponding to r257302.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257313 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Remove the empty class definitions in RPCUtils.h in the hope of working
Lang Hames [Mon, 11 Jan 2016 04:04:20 +0000 (04:04 +0000)]
[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

7 years agoMove all decls in coverage namespace into CoverageMapping.h/NFC
Xinliang David Li [Mon, 11 Jan 2016 03:54:18 +0000 (03:54 +0000)]
Move all decls in coverage namespace into CoverageMapping.h/NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257311 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoOrc] Drop PageSize member from Orc architecture support class in favour of
Lang Hames [Mon, 11 Jan 2016 02:41:17 +0000 (02:41 +0000)]
Orc] Drop PageSize member from Orc architecture support class in favour of
Process::getPageSize() - the former is redundant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257310 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Remove the FPRPCChannel class from RPCChannel.h - it requires unistd.h,
Lang Hames [Mon, 11 Jan 2016 02:15:12 +0000 (02:15 +0000)]
[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

7 years ago[TableGen] Remove a few spaces from AsmMatcher output. NFC
Craig Topper [Mon, 11 Jan 2016 02:11:36 +0000 (02:11 +0000)]
[TableGen] Remove a few spaces from AsmMatcher output. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257308 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Include the IndirectionUtils header in OrcRemoteTargetClient.
Lang Hames [Mon, 11 Jan 2016 01:59:35 +0000 (01:59 +0000)]
[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

7 years ago[Orc] Remote the <unistd> include introduced in r257305 - it's not needed, and
Lang Hames [Mon, 11 Jan 2016 01:55:19 +0000 (01:55 +0000)]
[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

7 years ago[Orc] Add support for remote JITing to the ORC API.
Lang Hames [Mon, 11 Jan 2016 01:40:11 +0000 (01:40 +0000)]
[Orc] Add support for remote JITing to the ORC API.

This patch adds utilities to ORC for managing a remote JIT target. It consists

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

4. A helper class for building servers that can handle the RPC calls. See

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

7 years ago[AVX-512] Remove another extra space from the Intel syntax asm strings.
Craig Topper [Mon, 11 Jan 2016 01:03:40 +0000 (01:03 +0000)]
[AVX-512] Remove another extra space from the Intel syntax asm strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257304 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX-512] Fix test case update missed in r257299.
Craig Topper [Mon, 11 Jan 2016 00:56:48 +0000 (00:56 +0000)]
[AVX-512] Fix test case update missed in r257299.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257303 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Rename OrcTargetSupport to OrcArchitectureSupport to avoid confusion with
Lang Hames [Mon, 11 Jan 2016 00:56:15 +0000 (00:56 +0000)]
[Orc] Rename OrcTargetSupport to OrcArchitectureSupport to avoid confusion with
the upcoming remote-target support classes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257302 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX-512] Remove more superfluous spaces from asm strings.
Craig Topper [Mon, 11 Jan 2016 00:44:58 +0000 (00:44 +0000)]
[AVX-512] Remove more superfluous spaces from asm strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257301 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX-512] Remove unused Round and Itinerary from the maskable_cmp multiclasses. They...
Craig Topper [Mon, 11 Jan 2016 00:44:56 +0000 (00:44 +0000)]
[AVX-512] Remove unused Round and Itinerary from the maskable_cmp multiclasses. They weren't used and there were extra spaces in the asm string to prepare for the concatenations of the round string that wasn't ever used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257300 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX-512] Make spacing between comma and {sae} operand consistent in asm strings.
Craig Topper [Mon, 11 Jan 2016 00:44:52 +0000 (00:44 +0000)]
[AVX-512] Make spacing between comma and {sae} operand consistent in asm strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257299 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Remove extra spaces from MPX instruction asm strings.
Craig Topper [Mon, 11 Jan 2016 00:44:46 +0000 (00:44 +0000)]
[X86] Remove extra spaces from MPX instruction asm strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257298 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Add error codes and a new std::error_category for remote-jit errors.
Lang Hames [Mon, 11 Jan 2016 00:34:13 +0000 (00:34 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257297 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[RuntimeDyld] Add a notifyObjectLoaded method to RuntimeDyld::MemoryManager.
Lang Hames [Sun, 10 Jan 2016 23:59:41 +0000 (23:59 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257296 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMove coveragemap_error enum into coverage namespace and InstrProf.h /NFC
Xinliang David Li [Sun, 10 Jan 2016 21:56:33 +0000 (21:56 +0000)]
Move coveragemap_error enum into coverage namespace and InstrProf.h /NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257295 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[RuntimeDyld] Add alignment arguments to the reserveAllocationSpace method of
Lang Hames [Sun, 10 Jan 2016 18:51:50 +0000 (18:51 +0000)]
[RuntimeDyld] Add alignment arguments to the reserveAllocationSpace method of

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257294 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SectionMemoryManager] Don't just drop the RO free list
Keno Fischer [Sun, 10 Jan 2016 18:17:12 +0000 (18:17 +0000)]
[SectionMemoryManager] Don't just drop the RO free list

In r255760, I optimized the SectionMemoryManager to make better use
of virtual memory on platforms where the allocation granularity was
bigger than the protection granularity. As part of this, fixing up
the free list became more complicated and was moved into
`applyMemoryGroupPermissions`. Unfortunately, I forgot to actually
remove the call that drops the free list for RO memory (I did
remove the corresponding one for RX memory), defeating the whole

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257293 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSpeed up LiveDebugValues
Daniel Berlin [Sun, 10 Jan 2016 18:08:32 +0000 (18:08 +0000)]
Speed up LiveDebugValues

Use proper dataflow ordering to speed convergence.
This will converge the testcase on bug 26055 in 2 iterations.

(data structures speedups to come to make even that faster)

Reviewers: kcc, samsonov, echristo, dblaikie, tvvikram

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257292 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoOrcJITTests//ObjectLinkingLayerTest.cpp: Appease msc18's C2327. It seems definition...
NAKAMURA Takumi [Sun, 10 Jan 2016 15:56:49 +0000 (15:56 +0000)]
OrcJITTests//ObjectLinkingLayerTest.cpp: Appease msc18's C2327. It seems 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257290 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Another stab at fixing the PointerEmbeddedInt build for MSVC.
Benjamin Kramer [Sun, 10 Jan 2016 14:27:26 +0000 (14:27 +0000)]
[ADT] Another stab at fixing the PointerEmbeddedInt build for MSVC.

MSVC18 seems to have other problems here, just hardcode uintptr_t.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257289 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Unbreak PointerEmbeddedInt build with MSVC.
Benjamin Kramer [Sun, 10 Jan 2016 14:06:29 +0000 (14:06 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257288 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoOptimized instruction sequence for sitofp operation on X86-32
Elena Demikhovsky [Sun, 10 Jan 2016 09:41:22 +0000 (09:41 +0000)]
Optimized instruction sequence for sitofp operation on X86-32
Optimized sitofp i64 %x to double. The current sequence

movl %ecx, 8(%esp)
movl %edx, 12(%esp)
fildll 8(%esp)

is replaced with:

movd %ecx, %xmm0
movd %edx, %xmm1
punpckldq %xmm1, %xmm0
movq %xmm0, 8(%esp)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257285 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Add an abstraction for embedding an integer within a pointer-like
Chandler Carruth [Sun, 10 Jan 2016 09:40:13 +0000 (09:40 +0000)]
[ADT] Add an abstraction for embedding an integer within a pointer-like

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257284 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX512] add PRORVQ and PRORVD Intrinsic
Michael Zuckerman [Sun, 10 Jan 2016 09:16:41 +0000 (09:16 +0000)]
[AVX512] add PRORVQ and PRORVD Intrinsic

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257283 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Add a sum type abstraction for pointer-like types.
Chandler Carruth [Sun, 10 Jan 2016 08:48:23 +0000 (08:48 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257282 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Remove 'reinterpreted as a pointer' from some Twine comments. Integers have...
Craig Topper [Sun, 10 Jan 2016 08:27:13 +0000 (08:27 +0000)]
[ADT] Remove 'reinterpreted as a pointer' from some Twine comments. Integers have been stored directly in a union for some time. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257281 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd test for r257279.
David Majnemer [Sun, 10 Jan 2016 07:13:33 +0000 (07:13 +0000)]
Add test for r257279.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257280 91177308-0d34-0410-b5e6-96231b3b80d8