platform/upstream/llvm.git
7 years ago[test] Use a helper macro to refer to MAP_ANON (NFC)
Vedant Kumar [Wed, 23 Nov 2016 22:23:42 +0000 (22:23 +0000)]
[test] Use a helper macro to refer to MAP_ANON (NFC)

Some of our internal bots use old SDK's which don't define MAP_ANON.
Use a helper macro to pass the right flag into mmap().

llvm-svn: 287833

7 years ago[ELF][MIPS] Fix handling of _gp/_gp_disp/__gnu_local_gp symbols
Simon Atanasyan [Wed, 23 Nov 2016 22:22:16 +0000 (22:22 +0000)]
[ELF][MIPS] Fix handling of _gp/_gp_disp/__gnu_local_gp symbols

Offset between beginning of a .got section and _gp symbols used in MIPS
GOT relocations calculations. Usually the expression looks like
VA + Offset - GP, where VA is the .got section address, Offset - offset
of the GOT entry, GP - offset between .got and _gp. Also there two "magic"
symbols _gp_disp and __gnu_local_gp which hold the offset mentioned above.
These symbols might be referenced by MIPS relocations.

Now the linker always defines _gp symbol and uses hardcoded value for
its initialization. So offset between .got and _gp is 0x7ff0. The _gp_disp
and __gnu_local_gp defined if required and initialized by 0x7ff0.
In fact that is not correct because _gp symbol might be defined by a linker
script and holds arbitrary value. In that case we need to use this value
in relocation calculation and initialize _gp_disp and __gnu_local_gp
properly.

The patch fixes the problem and completes fixing the bug #30311.
https://llvm.org/bugs/show_bug.cgi?id=30311

Differential revision: https://reviews.llvm.org/D27036

llvm-svn: 287832

7 years ago[SelectionDAG] Early-out in TargetLowering::expandMUL (NFC)
Nicolai Haehnle [Wed, 23 Nov 2016 22:14:20 +0000 (22:14 +0000)]
[SelectionDAG] Early-out in TargetLowering::expandMUL (NFC)

Summary: Reduce indentation level; preparation for D24956.

Reviewers: efriedma

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D27063

llvm-svn: 287831

7 years agoRemove trailing whitespace.
Rui Ueyama [Wed, 23 Nov 2016 22:10:46 +0000 (22:10 +0000)]
Remove trailing whitespace.

llvm-svn: 287830

7 years ago[libcxx] [test] D27027: Strip trailing whitespace.
Stephan T. Lavavej [Wed, 23 Nov 2016 22:03:28 +0000 (22:03 +0000)]
[libcxx] [test] D27027: Strip trailing whitespace.

llvm-svn: 287829

7 years ago[libcxx] [test] D27026: Fix copy-paste silliness; ULL can't ever be 32-bit.
Stephan T. Lavavej [Wed, 23 Nov 2016 22:02:59 +0000 (22:02 +0000)]
[libcxx] [test] D27026: Fix copy-paste silliness; ULL can't ever be 32-bit.

llvm-svn: 287828

7 years ago[libcxx] [test] D27020: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed...
Stephan T. Lavavej [Wed, 23 Nov 2016 22:02:53 +0000 (22:02 +0000)]
[libcxx] [test] D27020: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed/unsigned mismatch", part 7/12.

When initializing unsigned integers to their maximum values, change "const T M(~0);" to "const T M(static_cast<T>(-1));".

~0 and -1 are equivalent, but I consider the -1 form to be significantly clearer (and more consistent with other tests).

llvm-svn: 287827

7 years ago[libcxx] [test] D27019: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed...
Stephan T. Lavavej [Wed, 23 Nov 2016 22:02:44 +0000 (22:02 +0000)]
[libcxx] [test] D27019: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed/unsigned mismatch", part 6/12.

Add static_cast when initializing unsigned integers with negative numbers (in order to obtain big values).

llvm-svn: 287826

7 years ago[libcxx] [test] D27018: Fix MSVC warning C4018 "signed/unsigned mismatch", part 5/12.
Stephan T. Lavavej [Wed, 23 Nov 2016 22:02:35 +0000 (22:02 +0000)]
[libcxx] [test] D27018: Fix MSVC warning C4018 "signed/unsigned mismatch", part 5/12.

Various changes:

test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp
Change M from unsigned to int. It's compared against "int x",
and we binary_search() for it within a vector<int>.

test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp
test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval_param.pass.cpp
Add static_cast<unsigned> when comparing int to unsigned.

test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp
Change unsigned indices to int when we're being given int as a bound.

llvm-svn: 287825

7 years ago[libcxx] [test] D27016: Fix MSVC warning C4018 "signed/unsigned mismatch", part 4/12.
Stephan T. Lavavej [Wed, 23 Nov 2016 22:02:27 +0000 (22:02 +0000)]
[libcxx] [test] D27016: Fix MSVC warning C4018 "signed/unsigned mismatch", part 4/12.

Change "int j;" indices to "std::size_t j;".

Also, include <cstddef> when it wasn't already being included.

llvm-svn: 287824

7 years ago[libcxx] [test] D27015: Fix MSVC warning C4018 "signed/unsigned mismatch", part 3/12.
Stephan T. Lavavej [Wed, 23 Nov 2016 22:02:16 +0000 (22:02 +0000)]
[libcxx] [test] D27015: Fix MSVC warning C4018 "signed/unsigned mismatch", part 3/12.

Change unsigned to int in parameters.

llvm-svn: 287823

7 years ago[libcxx] [test] D27014: Fix MSVC warning C4018 "signed/unsigned mismatch", part 2/12.
Stephan T. Lavavej [Wed, 23 Nov 2016 22:01:58 +0000 (22:01 +0000)]
[libcxx] [test] D27014: Fix MSVC warning C4018 "signed/unsigned mismatch", part 2/12.

Add static_cast<std::size_t> when comparing int to std::size_t.

Also, include <cstddef> when it wasn't already being included.

llvm-svn: 287822

7 years ago[X86][AVX512VL] Add v2f64 -> v2i32/v2f32 + zero codegen tests
Simon Pilgrim [Wed, 23 Nov 2016 22:01:50 +0000 (22:01 +0000)]
[X86][AVX512VL] Add v2f64 -> v2i32/v2f32 + zero codegen tests

llvm-svn: 287821

7 years ago[libcxx] [test] D27013: Fix MSVC warning C4018 "signed/unsigned mismatch", part 1/12.
Stephan T. Lavavej [Wed, 23 Nov 2016 22:01:19 +0000 (22:01 +0000)]
[libcxx] [test] D27013: Fix MSVC warning C4018 "signed/unsigned mismatch", part 1/12.

Change loop indices from int to std::size_t.

Also, include <cstddef> when it wasn't already being included.

llvm-svn: 287820

7 years agoFix typo.
Hongbin Zheng [Wed, 23 Nov 2016 21:59:33 +0000 (21:59 +0000)]
Fix typo.

llvm-svn: 287819

7 years agoAMDGPU: Cleanup immediate folding code
Matt Arsenault [Wed, 23 Nov 2016 21:51:07 +0000 (21:51 +0000)]
AMDGPU: Cleanup immediate folding code

Move code down to use, reorder to avoid hard to follow
immediate folding logic.

llvm-svn: 287818

7 years agoAMDGPU: Fix debug printing
Matt Arsenault [Wed, 23 Nov 2016 21:51:05 +0000 (21:51 +0000)]
AMDGPU: Fix debug printing

The uint8_t was printed as a char which didn't really work.

llvm-svn: 287817

7 years agoUse llvm::utohexstr instead of Twine::utohexstr.
Rui Ueyama [Wed, 23 Nov 2016 21:24:26 +0000 (21:24 +0000)]
Use llvm::utohexstr instead of Twine::utohexstr.

They are essentially the same in this context, so I prefer the one
that doesn't need `Twine::`.

llvm-svn: 287814

7 years ago[X86][SSE] Add v2i64 -> v2i32 + zero codegen test
Simon Pilgrim [Wed, 23 Nov 2016 21:19:57 +0000 (21:19 +0000)]
[X86][SSE] Add v2i64 -> v2i32 + zero codegen test

llvm-svn: 287813

7 years agoAMDGPU: Fix not setting kill flag on temp reg when spilling
Matt Arsenault [Wed, 23 Nov 2016 21:00:12 +0000 (21:00 +0000)]
AMDGPU: Fix not setting kill flag on temp reg when spilling

llvm-svn: 287808

7 years agoAMDGPU: Fix adding extra implicit def of register
Matt Arsenault [Wed, 23 Nov 2016 21:00:10 +0000 (21:00 +0000)]
AMDGPU: Fix adding extra implicit def of register

In the scalar case, there's no reason to add an additional
def of the same register.

llvm-svn: 287807

7 years agoAMDGPU: Fix MMO when splitting spill
Matt Arsenault [Wed, 23 Nov 2016 20:52:53 +0000 (20:52 +0000)]
AMDGPU: Fix MMO when splitting spill

The size and offset were wrong. The size of the object was
being used for the size of the access, when here it is really
being split into 4-byte accesses. The underlying object size
is set in the MachinePointerInfo, which also didn't have the
offset set.

llvm-svn: 287806

7 years agoRevert "[lit] When setting SDKROOT on Darwin, use '--sdk macosx' to find the right...
Vedant Kumar [Wed, 23 Nov 2016 20:51:09 +0000 (20:51 +0000)]
Revert "[lit] When setting SDKROOT on Darwin, use '--sdk macosx' to find the right SDK path."

This reverts commit r287403. It breaks an internal asan bot. According
to Kuba, a fix is up for review here: https://reviews.llvm.org/D26929

llvm-svn: 287804

7 years agollvm-nm: Print correct symbol types for init and fini sections
Meador Inge [Wed, 23 Nov 2016 20:17:20 +0000 (20:17 +0000)]
llvm-nm: Print correct symbol types for init and fini sections

This patch fixes a small bug where symbols defined in the INIT
and FINI sections were incorrectly getting a type of 'n'.

Differential Revision: https://reviews.llvm.org/D26937

llvm-svn: 287803

7 years agollvm-nm: Don't print value or size for undefined or weak symbols
Meador Inge [Wed, 23 Nov 2016 20:17:15 +0000 (20:17 +0000)]
llvm-nm: Don't print value or size for undefined or weak symbols

Undefined and weak symbols don't have a meaningful size or value.
As such, nothing should be printed for those attributes (this is
already done for the address with 'U') with the BSD format.  This
matches what GNU nm does.

Note that for the POSIX.2 format [1] zero values are still
printed for the size and value.  This seems in spirit with
the format strings in that specification, but is debatable.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/

Differential Revision: https://reviews.llvm.org/D26936

llvm-svn: 287802

7 years ago[SLP] Add more tests for SLP Vectorizer.
Alexey Bataev [Wed, 23 Nov 2016 20:10:32 +0000 (20:10 +0000)]
[SLP] Add more tests for SLP Vectorizer.

llvm-svn: 287801

7 years ago[LoopUnroll] Move code to exit early. NFC.
Haicheng Wu [Wed, 23 Nov 2016 19:39:26 +0000 (19:39 +0000)]
[LoopUnroll] Move code to exit early. NFC.

Just to save some compilation time.

Differential Revision: https://reviews.llvm.org/D26784

llvm-svn: 287800

7 years agoFix this on 32 bit hosts.
Rafael Espindola [Wed, 23 Nov 2016 19:16:20 +0000 (19:16 +0000)]
Fix this on 32 bit hosts.

Looks like we have no 32 bit bot that builds with mips support.

llvm-svn: 287799

7 years agoRevert "[Triple] Add Facebook vendor"
Daniel Berlin [Wed, 23 Nov 2016 19:03:54 +0000 (19:03 +0000)]
Revert "[Triple] Add Facebook vendor"

This reverts commit r287684

Objections on the review thread had not been addressed to
prior to commit.  I asked the committer to revert, but i expect they
are gone for the US holiday or something.

llvm-svn: 287798

7 years agoFix uninitialized variable access.
Rui Ueyama [Wed, 23 Nov 2016 19:03:35 +0000 (19:03 +0000)]
Fix uninitialized variable access.

llvm-svn: 287797

7 years ago[PPC] revert r287795
Ehsan Amiri [Wed, 23 Nov 2016 18:55:17 +0000 (18:55 +0000)]
[PPC] revert r287795

A test that passed locally is failing on one of the build bots.

llvm-svn: 287796

7 years ago[PPC] support for arithmetic builtins in the FE
Ehsan Amiri [Wed, 23 Nov 2016 18:36:29 +0000 (18:36 +0000)]
[PPC] support for arithmetic builtins in the FE

(commit again after fixing the buildbot failures)
This adds various overloads of the following builtins to altivec.h:

    vec_neg
    vec_nabs
    vec_adde
    vec_addec
    vec_sube
    vec_subec
    vec_subc

Note that for vec_sub builtins on 32 bit integers, the semantics is similar to
what ISA describes for instructions like vsubecuq that work on quadwords: the
first operand is added to the one's complement of the second operand. (As
opposed to two's complement which I expected).

llvm-svn: 287795

7 years agoMake log(), error() and fatal() thread-safe.
Rui Ueyama [Wed, 23 Nov 2016 18:34:28 +0000 (18:34 +0000)]
Make log(), error() and fatal() thread-safe.

llvm-svn: 287794

7 years agoAdd dllexport default ctor closure PCH regression test for PR31121
Reid Kleckner [Wed, 23 Nov 2016 18:33:54 +0000 (18:33 +0000)]
Add dllexport default ctor closure PCH regression test for PR31121

Follow up to r287774

llvm-svn: 287793

7 years ago[X86] Allow folding of stack reloads when loading a subreg of the spilled reg
Michael Kuperstein [Wed, 23 Nov 2016 18:33:49 +0000 (18:33 +0000)]
[X86] Allow folding of stack reloads when loading a subreg of the spilled reg

We did not support subregs in InlineSpiller:foldMemoryOperand() because targets
may not deal with them correctly.

This adds a target hook to let the spiller know that a target can handle
subregs, and actually enables it for x86 for the case of stack slot reloads.
This fixes PR30832.

Differential Revision: https://reviews.llvm.org/D26521

llvm-svn: 287792

7 years ago[asan/win] Skip incremental linker padding during unregistration
Reid Kleckner [Wed, 23 Nov 2016 18:28:04 +0000 (18:28 +0000)]
[asan/win] Skip incremental linker padding during unregistration

Should fix issues that came up while testing Win64 ASan.

llvm-svn: 287791

7 years agoLimit default maximum number of errors to 20.
Rui Ueyama [Wed, 23 Nov 2016 18:15:37 +0000 (18:15 +0000)]
Limit default maximum number of errors to 20.

This is in the context of https://llvm.org/bugs/show_bug.cgi?id=31109.
When LLD prints out errors for relocations, it tends to print out
extremely large number of errors (like millions) because it would
print out one error per relocation.

This patch makes LLD bail out if it prints out more than 20 errors.
You can configure the limitation using -error-limit argument.
-error-limit=0 means no limit.

I chose the flag name because Clang has the same feature as -ferror-limit.
"f" doesn't make sense to us, so I omitted it.

Differential Revision: https://reviews.llvm.org/D26981

llvm-svn: 287789

7 years agoRe-commit r287727: Use SHA1::hash and MD5::hash functions.
Rui Ueyama [Wed, 23 Nov 2016 18:11:38 +0000 (18:11 +0000)]
Re-commit r287727: Use SHA1::hash and MD5::hash functions.

r287727 was not a change that broke buildbots; the other change
(r287726) that I made to LLVM broke them.

llvm-svn: 287788

7 years agoDefine toString() as a generic function to get a string for error message.
Rui Ueyama [Wed, 23 Nov 2016 18:07:33 +0000 (18:07 +0000)]
Define toString() as a generic function to get a string for error message.

We have different functions to stringize objects to construct
error messages. For InputFile, we have getFilename, and for
InputSection, we have getName. You had to memorize them.

I think this is the case where the function overloading comes in handy.

This patch defines toString() functions that are overloaded for all these
types, so that you just call it in error().

Differential Revision: https://reviews.llvm.org/D27030

llvm-svn: 287787

7 years agollvm-readobj: Use hash tables to print dynamic symbols.
Hemant Kulkarni [Wed, 23 Nov 2016 18:04:23 +0000 (18:04 +0000)]
llvm-readobj: Use hash tables to print dynamic symbols.

-symbols prints both .symtab and .dynsym symbols for GNU style in ELF.
-dyn-symbols prints symbols looking up through hash tables. This helps validate hash tables.

llvm-svn: 287786

7 years ago[asan/win] Check assumptions about the incremental linker more
Reid Kleckner [Wed, 23 Nov 2016 18:02:16 +0000 (18:02 +0000)]
[asan/win] Check assumptions about the incremental linker more

Remove a needless cast as well.

llvm-svn: 287785

7 years ago[PM] Change the static object whose address is used to uniquely identify
Chandler Carruth [Wed, 23 Nov 2016 17:53:26 +0000 (17:53 +0000)]
[PM] Change the static object whose address is used to uniquely identify
analyses to have a common type which is enforced rather than using
a char object and a `void *` type when used as an identifier.

This has a number of advantages. First, it at least helps some of the
confusion raised in Justin Lebar's code review of why `void *` was being
used everywhere by having a stronger type that connects to documentation
about this.

However, perhaps more importantly, it addresses a serious issue where
the alignment of these pointer-like identifiers was unknown. This made
it hard to use them in pointer-like data structures. We were already
dodging this in dangerous ways to create the "all analyses" entry. In
a subsequent patch I attempted to use these with TinyPtrVector and
things fell apart in a very bad way.

And it isn't just a compile time or type system issue. Worse than that,
the actual alignment of these pointer-like opaque identifiers wasn't
guaranteed to be a useful alignment as they were just characters.

This change introduces a type to use as the "key" object whose address
forms the opaque identifier. This both forces the objects to have proper
alignment, and provides type checking that we get it right everywhere.
It also makes the types somewhat less mysterious than `void *`.

We could go one step further and introduce a truly opaque pointer-like
type to return from the `ID()` static function rather than returning
`AnalysisKey *`, but that didn't seem to be a clear win so this is just
the initial change to get to a reliably typed and aligned object serving
is a key for all the analyses.

Thanks to Richard Smith and Justin Lebar for helping pick plausible
names and avoid making this refactoring many times. =] And thanks to
Sean for the super fast review!

While here, I've tried to move away from the "PassID" nomenclature
entirely as it wasn't really helping and is overloaded with old pass
manager constructs. Now we have IDs for analyses, and key objects whose
address can be used as IDs. Where possible and clear I've shortened this
to just "ID". In a few places I kept "AnalysisID" to make it clear what
was being identified.

Differential Revision: https://reviews.llvm.org/D27031

llvm-svn: 287783

7 years agolld: Default image base address to 0x200000 on x86-64
Ed Maste [Wed, 23 Nov 2016 17:44:02 +0000 (17:44 +0000)]
lld: Default image base address to 0x200000 on x86-64

Align to the large page size (known as a superpage or huge page).
FreeBSD automatically promotes large, superpage-aligned allocations.

Differential Revision: https://reviews.llvm.org/D27042

llvm-svn: 287782

7 years ago[LoadStoreVectorizer] Enable vectorization of stores in the presence of an aliasing...
Alina Sbirlea [Wed, 23 Nov 2016 17:43:15 +0000 (17:43 +0000)]
[LoadStoreVectorizer] Enable vectorization of stores in the presence of an aliasing load

Summary:
The "getVectorizablePrefix" method would give up if it found an aliasing load for a store chain.
In practice, the aliasing load can be treated as a memory barrier and all stores that precede it
are a valid vectorizable prefix.
Issue found by volkan in D26962. Testcase is a pruned version of the one in the original patch.

Reviewers: jlebar, arsenm, tstellarAMD

Subscribers: mzolotukhin, wdng, nhaehnle, anna, volkan, llvm-commits

Differential Revision: https://reviews.llvm.org/D27008

llvm-svn: 287781

7 years ago[asan/win] Fix incremental linking vs. global registration
Reid Kleckner [Wed, 23 Nov 2016 17:37:00 +0000 (17:37 +0000)]
[asan/win] Fix incremental linking vs. global registration

The MSVC incremental linker pads every global out to 256 bytes in case
it changes size after an incremental link. So, skip over null entries in
the DSO-wide asan globals array. This only works if the global padding
size is divisible by the size of the asan global object, so add some
defensive CHECKs.

llvm-svn: 287780

7 years agoReplace test instruction byte strings with {{.*}}
Ed Maste [Wed, 23 Nov 2016 17:09:38 +0000 (17:09 +0000)]
Replace test instruction byte strings with {{.*}}

An upcoming change to the image base address for x86-64 (D27042) will
will change some addresses and hence the instruction encodings. We care
about the disassembled instructions, not their encodings.

Differential Revision: https://reviews.llvm.org/D27056

llvm-svn: 287778

7 years ago[Sema][Atomics] Treat expected pointer in compare exchange atomics as _Nonnull
Alex Lorenz [Wed, 23 Nov 2016 16:57:03 +0000 (16:57 +0000)]
[Sema][Atomics] Treat expected pointer in compare exchange atomics as _Nonnull

This commit teaches clang that is has to emit a warning when NULL is passed
as the 'expected' pointer parameter into an atomic compare exchange call.

rdar://18926650

Differential Revision: https://reviews.llvm.org/D26978

llvm-svn: 287776

7 years ago[PPC] Reverting r287772
Ehsan Amiri [Wed, 23 Nov 2016 16:56:03 +0000 (16:56 +0000)]
[PPC] Reverting r287772

Due to buildbot failure, I revert. Will recommit after investigation.

llvm-svn: 287775

7 years agoRemove C++ default arg side table for MS ABI ctor closures
Reid Kleckner [Wed, 23 Nov 2016 16:51:30 +0000 (16:51 +0000)]
Remove C++ default arg side table for MS ABI ctor closures

Summary:
We don't need a side table in ASTContext to hold CXXDefaultArgExprs. The
important part of building the CXXDefaultArgExprs was to ODR use the
default argument expressions, not to make AST nodes. Refactor the code
to only check the default argument, and remove the side table in
ASTContext which wasn't being serialized.

Fixes PR31121

Reviewers: thakis, rsmith, majnemer

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D27007

llvm-svn: 287774

7 years ago[DAG] Improve loads-from-store forwarding to handle TokenFactor
Nirav Dave [Wed, 23 Nov 2016 16:48:35 +0000 (16:48 +0000)]
[DAG] Improve loads-from-store forwarding to handle TokenFactor

Forward store values to matching loads down through token
factors. Factored from D14834.

Reviewers: jyknight, hfinkel

Subscribers: hfinkel, nemanjai, llvm-commits

Differential Revision: https://reviews.llvm.org/D26080

llvm-svn: 287773

7 years ago[PPC] support for arithmetic builtins in the FE
Ehsan Amiri [Wed, 23 Nov 2016 16:32:05 +0000 (16:32 +0000)]
[PPC] support for arithmetic builtins in the FE

This adds various overloads of the following builtins to altivec.h:

    vec_neg
    vec_nabs
    vec_adde
    vec_addec
    vec_sube
    vec_subec
    vec_subc

Note that for vec_sub builtins on 32 bit integers, the semantics is similar to
what ISA describes for instructions like vsubecuq that work on quadwords: the
first operand is added to the one's complement of the second operand. (As
opposed to two's complement which I expected).

llvm-svn: 287772

7 years ago[CodeCompletion] Fix incorrect Objective-C block parameter formatting
Alex Lorenz [Wed, 23 Nov 2016 16:28:34 +0000 (16:28 +0000)]
[CodeCompletion] Fix incorrect Objective-C block parameter formatting

This commit fixes an incorrectly formatted Objective-C block parameter
placeholder in a code completion result. The incorrect parameter had a
redundant leading parenthesis.

rdar://25224416

llvm-svn: 287771

7 years agoRefactor LLDB's Windows process plugin (NFC)
Adrian McCarthy [Wed, 23 Nov 2016 16:26:37 +0000 (16:26 +0000)]
Refactor LLDB's Windows process plugin (NFC)

The Windows process plugin was broken up into multiple pieces a while back in
order to share code between debugging live processes and minidumps
(postmortem) debugging. The minidump portion was replaced by a cross-platform
solution. This left the plugin split into a formerly "common" base classes and
the derived classes for live debugging. This extra layer made the code harder
to understand and work with.

This patch simplifies these class hierarchies by rolling the live debugging
concrete classes up to the base classes. Last week I posted my intent to make
this change to lldb-dev, and I didn't hear any objections.

This involved moving code and changing references to classes like
ProcessWindowsLive to ProcessWindows. It still builds for both 32- and 64-bit,
and the tests still pass on 32-bit. (Tests on 64-bit weren't passing before
this refactor for unrelated reasons.)

llvm-svn: 287770

7 years agoFix doc of `llvm.bitreverse.iN`
Yichao Yu [Wed, 23 Nov 2016 16:25:31 +0000 (16:25 +0000)]
Fix doc of `llvm.bitreverse.iN`

Summary:
The return type is `iN` rather than always `i16`

Seems to be a typo in https://reviews.llvm.org/rL252878 .

Reviewers: jmolloy

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D27047

llvm-svn: 287769

7 years ago[libc++] Remove unneeded visibility pragmas
Shoaib Meenai [Wed, 23 Nov 2016 16:11:15 +0000 (16:11 +0000)]
[libc++] Remove unneeded visibility pragmas

The function definitions being guarded by the pragma were all static, so
they wouldn't be exported anyway. In any case, we should prefer the
visibility macros. No functional change.

Differential Revision: https://reviews.llvm.org/D26940

llvm-svn: 287768

7 years agoRevert "[ASan] Enable on SystemZ."
Marcin Koscielnicki [Wed, 23 Nov 2016 16:07:07 +0000 (16:07 +0000)]
Revert "[ASan] Enable on SystemZ."

This reverts commit r287764.

Two tests broke on the clang-s390x-linux buildbot:
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/1293.

llvm-svn: 287767

7 years ago[DAGCombiner] Fix infinite loop in vector mul/shl combining
John Brawn [Wed, 23 Nov 2016 16:05:51 +0000 (16:05 +0000)]
[DAGCombiner] Fix infinite loop in vector mul/shl combining

We have the following DAGCombiner transformations:
 (mul (shl X, c1), c2) -> (mul X, c2 << c1)
 (mul (shl X, C), Y) -> (shl (mul X, Y), C)
 (shl (mul x, c1), c2) -> (mul x, c1 << c2)
Usually the constant shift is optimised by SelectionDAG::getNode when it is
constructed, by SelectionDAG::FoldConstantArithmetic, but when we're dealing
with vectors and one of those vector constants contains an undef element
FoldConstantArithmetic does not fold and we enter an infinite loop.

Fix this by making FoldConstantArithmetic use getNode to decide how to fold each
vector element, the same as FoldConstantVectorArithmetic does, and rather than
adding the constant shift to the work list instead only apply the transformation
if it's already been folded into a constant, as if it's not we're going to loop
endlessly. Additionally add missing NoOpaques to one of those transformations,
which I noticed when writing the tests for this.

Differential Revision: https://reviews.llvm.org/D26605

llvm-svn: 287766

7 years ago[PowerPC] Remove InstAlias definitions that cause incorrect assembly
Nemanja Ivanovic [Wed, 23 Nov 2016 15:51:52 +0000 (15:51 +0000)]
[PowerPC] Remove InstAlias definitions that cause incorrect assembly

In rL283190, I added some InstAlias definitions to generate extended mnemonics
for some uses of the XXPERMDI instruction. However, when the assembler matches
these extended mnemonics, it matches the new instruction in situations where it
should match the old one.
This patch removes these definitions and accomplishes that by defining these
mnemonics with additional instructions that are isCodeGenOnly.

Fixes PR31127.

llvm-svn: 287765

7 years ago[ASan] Enable on SystemZ.
Marcin Koscielnicki [Wed, 23 Nov 2016 15:47:41 +0000 (15:47 +0000)]
[ASan] Enable on SystemZ.

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

llvm-svn: 287764

7 years ago[ASTImporter] Added ability to import AtomicType nodes
Gabor Horvath [Wed, 23 Nov 2016 15:24:23 +0000 (15:24 +0000)]
[ASTImporter] Added ability to import AtomicType nodes

Patch by: Kareem Khazem

Differential Revision: https://reviews.llvm.org/D26328

llvm-svn: 287763

7 years ago[X86][AVX512] Add support for v4i64 fptosi/fptoui/sitofp/uitofp on AVX512DQ-only...
Simon Pilgrim [Wed, 23 Nov 2016 14:01:18 +0000 (14:01 +0000)]
[X86][AVX512] Add support for v4i64 fptosi/fptoui/sitofp/uitofp on AVX512DQ-only targets

Use 512-bit instructions with subvector insertion/extraction like we do in a number of similar circumstances

llvm-svn: 287762

7 years agoType legalization for compressstore and expandload intrinsics.
Elena Demikhovsky [Wed, 23 Nov 2016 13:58:24 +0000 (13:58 +0000)]
Type legalization for compressstore and expandload intrinsics.

Implemented widening (v2f32) and splitting (v16f64).
On splitting, I use "popcnt" to calculate memory increment.
More type legalization work will come in the next patches.

llvm-svn: 287761

7 years ago[CostModel][X86] Add missing AVX512DQ v8i64 fptosi/sitofp costs
Simon Pilgrim [Wed, 23 Nov 2016 13:42:09 +0000 (13:42 +0000)]
[CostModel][X86] Add missing AVX512DQ v8i64 fptosi/sitofp costs

llvm-svn: 287760

7 years ago[clang-rename] Add test case for r287758.
Benjamin Kramer [Wed, 23 Nov 2016 13:14:19 +0000 (13:14 +0000)]
[clang-rename] Add test case for r287758.

llvm-svn: 287759

7 years ago[clang-rename] Fix non-functional offset check.
Benjamin Kramer [Wed, 23 Nov 2016 13:10:07 +0000 (13:10 +0000)]
[clang-rename] Fix non-functional offset check.

Adding something to a SourceLocation will only produce an invalid
SourceLocation in edge cases (overflow or adding 0 to an invalid one).
Check that the offset is inside the file instead and add a test case to
verify that the error message works.

llvm-svn: 287758

7 years ago[MD5] Use write32le instead of spelling it out with shifts.
Benjamin Kramer [Wed, 23 Nov 2016 11:49:28 +0000 (11:49 +0000)]
[MD5] Use write32le instead of spelling it out with shifts.

No functionality change intended.

llvm-svn: 287757

7 years ago[CostModel][X86] Add v2f32 -> v2i64 fptosi/fptoui cost tests
Simon Pilgrim [Wed, 23 Nov 2016 11:43:00 +0000 (11:43 +0000)]
[CostModel][X86] Add v2f32 -> v2i64 fptosi/fptoui cost tests

llvm-svn: 287756

7 years ago[X86][AVX512VL] Add missing _mm256_maskz_alignr_epi64 shufflevector check
Simon Pilgrim [Wed, 23 Nov 2016 11:38:52 +0000 (11:38 +0000)]
[X86][AVX512VL] Add missing _mm256_maskz_alignr_epi64 shufflevector check

Missed in rL287733

llvm-svn: 287755

7 years ago[CodeGen] Simplify code. No functionality change intended.
Benjamin Kramer [Wed, 23 Nov 2016 11:20:27 +0000 (11:20 +0000)]
[CodeGen] Simplify code. No functionality change intended.

llvm-svn: 287754

7 years ago[ELF] Refactor several error messages
Eugene Leviant [Wed, 23 Nov 2016 10:07:46 +0000 (10:07 +0000)]
[ELF] Refactor several error messages

Differential revision: https://reviews.llvm.org/D26970

llvm-svn: 287753

7 years ago[clang-move] Add some options allowing to add old/new.h to new/old.h respectively.
Haojian Wu [Wed, 23 Nov 2016 10:04:19 +0000 (10:04 +0000)]
[clang-move] Add some options allowing to add old/new.h to new/old.h respectively.

Summary:
* --new_depend_on_old: new header will include old header
* --old_depend_on_new: old header will include new header.

Reviewers: ioeric

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D26966

llvm-svn: 287752

7 years ago[ELF] Fixup buffer pointer when writing synthetic sections
Eugene Leviant [Wed, 23 Nov 2016 09:47:38 +0000 (09:47 +0000)]
[ELF] Fixup buffer pointer when writing synthetic sections

Differential revision: https://reviews.llvm.org/D26980

llvm-svn: 287751

7 years ago[ELF] Print error location in .eh_frame parser
Eugene Leviant [Wed, 23 Nov 2016 09:45:17 +0000 (09:45 +0000)]
[ELF] Print error location in .eh_frame parser

Differential revision: https://reviews.llvm.org/D26914

llvm-svn: 287750

7 years agoFix __hash_table::max_size() on 32 bit systems
Eric Fiselier [Wed, 23 Nov 2016 09:16:12 +0000 (09:16 +0000)]
Fix __hash_table::max_size() on 32 bit systems

llvm-svn: 287749

7 years ago[profile] Enable on SystemZ.
Marcin Koscielnicki [Wed, 23 Nov 2016 08:28:42 +0000 (08:28 +0000)]
[profile] Enable on SystemZ.

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

llvm-svn: 287748

7 years agoRemove one of SymbolTable::addRegular function that forwards other addRegular.
Rui Ueyama [Wed, 23 Nov 2016 06:59:47 +0000 (06:59 +0000)]
Remove one of SymbolTable::addRegular function that forwards other addRegular.

So that we have less number of overloaded functions.

llvm-svn: 287745

7 years ago[AVX-512] Remove intrinsics for valignd/q and autoupgrade them to native shuffles.
Craig Topper [Wed, 23 Nov 2016 06:54:55 +0000 (06:54 +0000)]
[AVX-512] Remove intrinsics for valignd/q and autoupgrade them to native shuffles.

llvm-svn: 287744

7 years ago[X86] Simplify lowerVectorShuffleAsBitMask to handle only integer VT's
Zvi Rackover [Wed, 23 Nov 2016 06:45:25 +0000 (06:45 +0000)]
[X86] Simplify lowerVectorShuffleAsBitMask to handle only integer VT's

Summary: This function is only called with integer VT arguments, so remove code that handles FP vectors.

Reviewers: RKSimon, craig.topper, delena, andreadb

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D26985

llvm-svn: 287743

7 years agoRemove a forwarding constructor that is used only once.
Rui Ueyama [Wed, 23 Nov 2016 06:31:23 +0000 (06:31 +0000)]
Remove a forwarding constructor that is used only once.

llvm-svn: 287742

7 years agoParse symbol versions in scanVersionScript() instead of insert().
Rui Ueyama [Wed, 23 Nov 2016 05:48:40 +0000 (05:48 +0000)]
Parse symbol versions in scanVersionScript() instead of insert().

There are two ways to set symbol versions. One way is to use symbol
definition file, and the other is to embed version names to symbol
names. In the latter way, symbol name is in the form of `foo@version1`
where `foo` is a real name and `version1` is a version.

We were parsing symbol names in insert(). That seems unnecessarily
too early. We can do it later after we resolve all symbols. Doing it
lazily is a good thing because it makes code easier to read
(because now we have a separate pass to parse symbol names). Also
it could slightly improve performance because if two identical symbols
have versions, we now parse them only once.

llvm-svn: 287741

7 years ago[ELF][MIPS] Turn Config->Threads off for MIPS targets
Simon Atanasyan [Wed, 23 Nov 2016 05:25:02 +0000 (05:25 +0000)]
[ELF][MIPS] Turn Config->Threads off for MIPS targets

For now MipsGotSection class is not ready for concurrent access from
multiple threads. The problem is in the getPageEntryOffset method. It
changes state of MipsGotSection object and might be called from
different threads at the same time. So turn Threads off for this target.

It's a temporary solution. The patch fixes MipsGotSection::getPageEntryOffset
is almost ready.

Differential revision: https://reviews.llvm.org/D27035

llvm-svn: 287740

7 years agoBetter formatting.
Rui Ueyama [Wed, 23 Nov 2016 05:14:01 +0000 (05:14 +0000)]
Better formatting.

If a line is too long, its error message becomes hard to read.

llvm-svn: 287739

7 years ago[ELF][MIPS] clang-format the code
Simon Atanasyan [Wed, 23 Nov 2016 05:09:36 +0000 (05:09 +0000)]
[ELF][MIPS] clang-format the code

llvm-svn: 287738

7 years agoAllow calling getName() on local symbols.
Rui Ueyama [Wed, 23 Nov 2016 04:57:25 +0000 (04:57 +0000)]
Allow calling getName() on local symbols.

Previously, we stored offsets in string tables to symbols, so
you needed to pass a string table to get a symbol name. This patch
stores const char pointers instead to eliminate the need to pass
a string table.

llvm-svn: 287737

7 years ago[XRay][compiler-rt] Add newlines to error messages (NFC).
Dean Michael Berris [Wed, 23 Nov 2016 04:47:41 +0000 (04:47 +0000)]
[XRay][compiler-rt] Add newlines to error messages (NFC).

This goes through all the calls to `Report(...)` to make sure that each
one would have a newline at the end of the message for readability.

llvm-svn: 287736

7 years agoFix builbots.
Rui Ueyama [Wed, 23 Nov 2016 03:58:12 +0000 (03:58 +0000)]
Fix builbots.

llvm-svn: 287735

7 years ago[xray] Add XRay support for Mach-O in CodeGen
Kuba Mracek [Wed, 23 Nov 2016 02:07:04 +0000 (02:07 +0000)]
[xray] Add XRay support for Mach-O in CodeGen

Currently, XRay only supports emitting the XRay table (xray_instr_map) on ELF binaries. Let's add Mach-O support.

Differential Revision: https://reviews.llvm.org/D26983

llvm-svn: 287734

7 years ago[X86] Replace valignd/q builtins with appropriate __builtin_shufflevector.
Craig Topper [Wed, 23 Nov 2016 01:47:12 +0000 (01:47 +0000)]
[X86] Replace valignd/q builtins with appropriate __builtin_shufflevector.

llvm-svn: 287733

7 years agoDon't "LIBCPP_ONLY(stuff;)" at namespace scope.
Casey Carter [Wed, 23 Nov 2016 01:44:53 +0000 (01:44 +0000)]
Don't "LIBCPP_ONLY(stuff;)" at namespace scope.

Differential review: https://reviews.llvm.org/D27029

llvm-svn: 287732

7 years ago[SCCP] Add a test for switches on undef.
Davide Italiano [Wed, 23 Nov 2016 01:42:39 +0000 (01:42 +0000)]
[SCCP] Add a test for switches on undef.

Without this test, you can just remove the code fixing the
switch to the first constant in ResolvedUndefs in and everything
pass. This test, instead, fails with an assertion if the code
is removed. Found while refactoring SCCP to integrate undef in
the solver.

llvm-svn: 287731

7 years agoRevert r287727: Use SHA1::hash and MD5::hash functions.
Rui Ueyama [Wed, 23 Nov 2016 01:19:13 +0000 (01:19 +0000)]
Revert r287727: Use SHA1::hash and MD5::hash functions.

It broke buildbots.

llvm-svn: 287730

7 years ago[libcxx] Fix max_size() across all containers
Eric Fiselier [Wed, 23 Nov 2016 01:18:56 +0000 (01:18 +0000)]
[libcxx] Fix max_size() across all containers

Summary: The `max_size()` method of containers should respect both the allocator's reported `max_size` and the range of the `difference_type`. This patch makes all containers choose the smallest of those two values.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D26885

llvm-svn: 287729

7 years agoAdd <variant> tests but disable them for libc++
Eric Fiselier [Wed, 23 Nov 2016 01:02:51 +0000 (01:02 +0000)]
Add <variant> tests but disable them for libc++

llvm-svn: 287728

7 years agoUse SHA1::hash and MD5::hash functions.
Rui Ueyama [Wed, 23 Nov 2016 00:52:28 +0000 (00:52 +0000)]
Use SHA1::hash and MD5::hash functions.

llvm-svn: 287727

7 years agoAdd convenient functions to compute hashes of byte vectors.
Rui Ueyama [Wed, 23 Nov 2016 00:46:09 +0000 (00:46 +0000)]
Add convenient functions to compute hashes of byte vectors.

In many sitautions, you just want to compute a hash for one chunk
of data. This patch adds convenient functions for that purpose.

Differential Revision: https://reviews.llvm.org/D26988

llvm-svn: 287726

7 years ago[ADT] Fix some Clang-tidy modernize-use-default and Include What You Use warnings...
Eugene Zelenko [Wed, 23 Nov 2016 00:30:24 +0000 (00:30 +0000)]
[ADT] Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes.

Differential revision: https://reviews.llvm.org/D27001

llvm-svn: 287725

7 years agoMake STL range adapter naming consistent.
Zachary Turner [Wed, 23 Nov 2016 00:27:23 +0000 (00:27 +0000)]
Make STL range adapter naming consistent.

Differential Revision: https://reviews.llvm.org/D27009

llvm-svn: 287724

7 years agoDump not only type records but symbol records.
Rui Ueyama [Tue, 22 Nov 2016 23:51:34 +0000 (23:51 +0000)]
Dump not only type records but symbol records.

llvm-svn: 287723

7 years agoAdd some searching functions for ArrayRef<T>.
Zachary Turner [Tue, 22 Nov 2016 23:22:19 +0000 (23:22 +0000)]
Add some searching functions for ArrayRef<T>.

Differential Revision: https://reviews.llvm.org/D26999

llvm-svn: 287722

7 years ago[StructurizeCFG] Refactor OrderNodes.
Justin Lebar [Tue, 22 Nov 2016 23:14:11 +0000 (23:14 +0000)]
[StructurizeCFG] Refactor OrderNodes.

Summary:
No need to copy the RPOT vector before using it.  Switch from std::map
to SmallDenseMap.  Get rid of an unused variable (TempVisited).  Get rid
of a typedef, RNVector, which is now used only once.

Differential Revision: https://reviews.llvm.org/D26997

llvm-svn: 287721