platform/upstream/llvm.git
8 years ago[Driver] Make -print-libgcc-file-name print compiler-rt lib when used
Michal Gorny [Mon, 10 Oct 2016 12:23:40 +0000 (12:23 +0000)]
[Driver] Make -print-libgcc-file-name print compiler-rt lib when used

Make the -print-libgcc-file-name option print an appropriate compiler
runtime library, that is libgcc.a if gcc runtime is used
and an appropriate compiler-rt library if that runtime is used.

The main use for this is to allow linking executables built with
-nodefaultlibs (e.g. to avoid linking to the standard C++ library) to
the compiler runtime library, e.g. using:

  clang++ ... -nodefaultlibs $(clang++ ... -print-libgcc-file-name)

in which case currently a program built like this linked to the gcc
runtime unconditionally. The patch fixes it to use compiler-rt libraries
instead when compiler-rt is the active runtime.

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

llvm-svn: 283746

8 years ago[DepInfo] Print -debug output outside of max-operations scope.
Michael Kruse [Mon, 10 Oct 2016 11:45:59 +0000 (11:45 +0000)]
[DepInfo] Print -debug output outside of max-operations scope.

ISL tries to simplify the polyhedral operations before printing its objects.
This increases the operations counter and therefore can contribute to hitting
the operations limit. Therefore the result could be different when -debug output
is enabled, making debugging harder.

llvm-svn: 283745

8 years ago[Support/DepInfo] Introduce IslMaxOperationsGuard and make DepInfo use it. NFC.
Michael Kruse [Mon, 10 Oct 2016 11:45:54 +0000 (11:45 +0000)]
[Support/DepInfo] Introduce IslMaxOperationsGuard and make DepInfo use it. NFC.

IslMaxOperationsGuard defines a scope where ISL may abort operations because if
it takes too many operations. Replace the call to the raw ISL interface by a
use of the guard.

IslMaxOperationsGuard provides a uniform way to define a maximal computation
time for a code region in C++ using RAII.

llvm-svn: 283744

8 years agoRevert "[x86][inline-asm][clang] accept 'v' constraint"
Daniel Jasper [Mon, 10 Oct 2016 11:40:28 +0000 (11:40 +0000)]
Revert "[x86][inline-asm][clang] accept 'v' constraint"

This reverts commit r283716.

Breaks buildbot:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/9155/testReport/junit/Clang/CodeGen/x86_inline_asm_v_constraint_c/

llvm-svn: 283743

8 years ago[ELF] Change argument type for findSections. NFC
Eugene Leviant [Mon, 10 Oct 2016 11:23:12 +0000 (11:23 +0000)]
[ELF] Change argument type for findSections. NFC

llvm-svn: 283742

8 years agoFixed windows stdout/stderr redirection in inline asm constraint tests
Simon Pilgrim [Mon, 10 Oct 2016 11:11:27 +0000 (11:11 +0000)]
Fixed windows stdout/stderr redirection in inline asm constraint tests

llvm-svn: 283741

8 years ago[Object/ELF] - Do not crash on invalid Header->e_shoff value.
George Rimar [Mon, 10 Oct 2016 10:51:38 +0000 (10:51 +0000)]
[Object/ELF] - Do not crash on invalid Header->e_shoff value.

sections_begin() may return unalignment pointer when Header->e_shoff isinvalid.
That may result in a crash in clients, for example we have one in LLD:

assert((PtrWord & ~PointerBitMask) == 0 &&
       "Pointer is not sufficiently aligned");
fails when trying to push_back Elf_Shdr* (unaligned) into TinyPtrVector.

Patch forces check for alignment of Header->e_shoff.

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

llvm-svn: 283740

8 years ago[LLDB][MIPS] All tests get errors in dotest after this test.
Nitesh Jain [Mon, 10 Oct 2016 10:47:53 +0000 (10:47 +0000)]
[LLDB][MIPS] All tests get errors in dotest after this test.

Subscribers: jaydeep, bhushan, slthakur, llvm-commits
llvm-svn: 283739

8 years agoRecommit r283733 "[ELF] - Do not crash if common symbol alignment set to value greate...
George Rimar [Mon, 10 Oct 2016 10:31:03 +0000 (10:31 +0000)]
Recommit r283733 "[ELF] - Do not crash if common symbol alignment set to value greater than UINT32_MAX.

With fix: commit changes from InputFiles.cpp too.

Original commit message:
We have following code in lld, that truncates the alignment value to 32 bit. Big alignment in this case
may give result 0 and crash later.

template <class ELFT>
CommonInputSection<ELFT>::CommonInputSection(std::vector<DefinedCommon *> Syms)
    : InputSection<ELFT>(nullptr, &Hdr, "") {
....
  for (DefinedCommon *Sym : Syms) {
    this->Alignment = std::max<uintX_t>(this->Alignment, Sym->Alignment);
...
  }
}

Patch fixes the issue.

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

llvm-svn: 283738

8 years agoRevert r283733 "[ELF] - Do not crash if common symbol alignment set to value greater...
George Rimar [Mon, 10 Oct 2016 10:27:38 +0000 (10:27 +0000)]
Revert r283733 "[ELF] - Do not crash if common symbol alignment set to value greater than UINT32_MAX."

Broke BB because forgot to commit source file.

llvm-svn: 283737

8 years agoUse `let' instead of `let*' in one place where `let*' isn't necessary
Manuel Klimek [Mon, 10 Oct 2016 10:22:40 +0000 (10:22 +0000)]
Use `let' instead of `let*' in one place where `let*' isn't necessary

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

Patch by Philipp Stephani.

llvm-svn: 283736

8 years ago[ELF][ARM] Fix formatting mistake, removed extra space before ) NFC.
Peter Smith [Mon, 10 Oct 2016 10:18:58 +0000 (10:18 +0000)]
[ELF][ARM] Fix formatting mistake, removed extra space before ) NFC.

llvm-svn: 283735

8 years ago[ELF][ARM] Garbage collection support for .ARM.exidx sections
Peter Smith [Mon, 10 Oct 2016 10:10:27 +0000 (10:10 +0000)]
[ELF][ARM] Garbage collection support for .ARM.exidx sections

.ARM.exidx sections have a reverse dependency on the section they have
a SHF_LINK_ORDER dependency on. In other words a .ARM.exidx section is
live only if the executable section it describes is live. We implement
this with a reverse dependency field in InputSection.

Adding the dependency to InputSection is the simplest implementation
but it could be moved out to a separate map if it were found to decrease
performance for non ARM targets.

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

llvm-svn: 283734

8 years ago[ELF] - Do not crash if common symbol alignment set to value greater than UINT32_MAX.
George Rimar [Mon, 10 Oct 2016 10:10:09 +0000 (10:10 +0000)]
[ELF] - Do not crash if common symbol alignment set to value greater than UINT32_MAX.

We have following code in lld, that truncates the alignment value to 32 bit. Big alignment in this case
may give result 0 and crash later.

template <class ELFT>
CommonInputSection<ELFT>::CommonInputSection(std::vector<DefinedCommon *> Syms)
    : InputSection<ELFT>(nullptr, &Hdr, "") {
....
  for (DefinedCommon *Sym : Syms) {
    this->Alignment = std::max<uintX_t>(this->Alignment, Sym->Alignment);
...
  }
}

Patch fixes the issue.

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

llvm-svn: 283733

8 years ago[LLDB][MIPS] Skip some test case which were causing LLDB to go into infinite loop
Nitesh Jain [Mon, 10 Oct 2016 10:02:09 +0000 (10:02 +0000)]
[LLDB][MIPS] Skip some test case which were causing LLDB to go into infinite loop

Reviewers: clayborg, labath

Subscribers: jaydeep, bhushan, slthakur, llvm-commits

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

llvm-svn: 283732

8 years ago[ELF] - Do not crash on absolute local symbol starting from ".L".
George Rimar [Mon, 10 Oct 2016 09:59:34 +0000 (09:59 +0000)]
[ELF] - Do not crash on absolute local symbol starting from ".L".

Absolute local symbols with name staring from ".L" were reason of crash.
The same could happen when using some broken inputs found by AFL.

Patch fixes that.

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

llvm-svn: 283731

8 years ago[ELF][ARM] Initial implentation of ARM exceptions support
Peter Smith [Mon, 10 Oct 2016 09:39:26 +0000 (09:39 +0000)]
[ELF][ARM] Initial implentation of ARM exceptions support

The .ARM.exidx sections contain a table. Each entry has two fields:
- PREL31 offset to the function the table entry describes
- Action to take, either cantunwind, inline unwind, or PREL31 offset to
  .ARM.extab section

The table entries must be sorted in order of the virtual addresses the
first entry of the table describes. Traditionally this is implemented by
the SHF_LINK_ORDER dependency. Instead of implementing this directly we
sort the table entries post relocation.

The .ARM.exidx OutputSection is described by the PT_ARM_EXIDX program
header

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

llvm-svn: 283730

8 years ago[LLDB][MIPS] Fix TestReturnValue failure for MIPS
Nitesh Jain [Mon, 10 Oct 2016 09:16:20 +0000 (09:16 +0000)]
[LLDB][MIPS] Fix TestReturnValue failure for MIPS

Reviewers: clayborg, labath, bhushan

Subscribers: jaydeep, slthakur, llvm-commits

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

llvm-svn: 283729

8 years ago[LLDB][MIPS] Fix register read/write for 32 bit big endian system
Nitesh Jain [Mon, 10 Oct 2016 09:02:41 +0000 (09:02 +0000)]
[LLDB][MIPS] Fix register read/write for 32 bit big endian system

Reviewers: clayborg, labath

Subscribers: jaydeep, bhushan, mohit.bhakkad, slthakur, llvm-commits

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

llvm-svn: 283728

8 years agoThis pass, fixing an erratum in some LEON 2 processors ensures that the SDIV instruct...
Chris Dewhurst [Mon, 10 Oct 2016 08:53:06 +0000 (08:53 +0000)]
This pass, fixing an erratum in some LEON 2 processors ensures that the SDIV instruction is not issued, but replaced by SDIVcc instead, which does not exhibit the error. Unit test included.

Differential Review: https://reviews.llvm.org/D24660

llvm-svn: 283727

8 years ago[libcxx] Add the missing limits.h header
Asiri Rathnayake [Mon, 10 Oct 2016 08:38:51 +0000 (08:38 +0000)]
[libcxx] Add the missing limits.h header

The implementation of [depr.c.headers] in D12747 introduced the necessary
C headers into libc++. This patch adds one more missing headers: limits.h

We spotted this due to a failing C++03 test [limits_h.pass.cpp] in our libc++
configuration; when the limits.h header is included from a C++ program, it now
bypassed the __config header and went directly into the underlying C library's
limits.h header, which is problematic for us because we use __config header to
configure the underlying C library's behaviour when used from a C++ context.

Reviewers: mclow.lists, rsmith

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

llvm-svn: 283726

8 years agoFix style issue. Spaces in argument list.
Daniel Marjamaki [Mon, 10 Oct 2016 07:39:39 +0000 (07:39 +0000)]
Fix style issue. Spaces in argument list.

llvm-svn: 283725

8 years agoMark aligned allocation as done.
Richard Smith [Mon, 10 Oct 2016 06:55:42 +0000 (06:55 +0000)]
Mark aligned allocation as done.

llvm-svn: 283724

8 years agoFix WebAssembly build after r283702.
Daniel Jasper [Mon, 10 Oct 2016 06:49:55 +0000 (06:49 +0000)]
Fix WebAssembly build after r283702.

llvm-svn: 283723

8 years agoP0035R4: Semantic analysis and code generation for C++17 overaligned
Richard Smith [Mon, 10 Oct 2016 06:42:31 +0000 (06:42 +0000)]
P0035R4: Semantic analysis and code generation for C++17 overaligned
allocation.

llvm-svn: 283722

8 years agoCleanup CMake status output
Eric Fiselier [Mon, 10 Oct 2016 06:31:00 +0000 (06:31 +0000)]
Cleanup CMake status output

llvm-svn: 283721

8 years ago[AVX-512] Add missing pattern sext or zext from bytes to quad words with a 128-bit...
Craig Topper [Mon, 10 Oct 2016 06:25:48 +0000 (06:25 +0000)]
[AVX-512] Add missing pattern sext or zext from bytes to quad words with a 128-bit load as input.

llvm-svn: 283720

8 years ago[AVX-512] Add test cases for AVX512 sign/zero extend instructions derived from the...
Craig Topper [Mon, 10 Oct 2016 06:25:45 +0000 (06:25 +0000)]
[AVX-512] Add test cases for AVX512 sign/zero extend instructions derived from the sse41 and avx2 test cases. Code will be improved in future commits.

llvm-svn: 283719

8 years ago[AVX-512] Add an AVX512VL/BW command line to sse41-pmovxrm.ll and avx2-pmovxrm.ll...
Craig Topper [Mon, 10 Oct 2016 06:25:42 +0000 (06:25 +0000)]
[AVX-512] Add an AVX512VL/BW command line to sse41-pmovxrm.ll and avx2-pmovxrm.ll. Also disable peephole so we really test pattern matching.

llvm-svn: 283718

8 years ago[x86][inline-asm][llvm] accept 'v' constraint
Michael Zuckerman [Mon, 10 Oct 2016 05:48:56 +0000 (05:48 +0000)]
[x86][inline-asm][llvm] accept 'v' constraint

Commit in the name of:Coby Tayree
1.'v' constraint for (x86) non-avx arch imitates the already implemented 'x' constraint, i.e. allows XMM{0-15} & YMM{0-15} depending on the apparent arch & mode (32/64).
2.for the avx512 arch it allows [X,Y,Z]MM{0-31} (mode dependent)

This patch applies the needed changes to clang
 clang patch: https://reviews.llvm.org/D25004

Differential Revision: D25005

llvm-svn: 283717

8 years ago[x86][inline-asm][clang] accept 'v' constraint
Michael Zuckerman [Mon, 10 Oct 2016 05:45:54 +0000 (05:45 +0000)]
[x86][inline-asm][clang] accept 'v' constraint

Commit in the name of: Coby Tayree

1.'v' constraint for (x86) non-avx arch imitates the already implemented 'x' constraint, i.e. allows XMM{0-15} & YMM{0-15} depending on the apparent arch & mode (32/64).
2.for the avx512 arch it allows [X,Y,Z]MM{0-31} (mode dependent)

This patch applies the needed changes to clang
 LLVM patch: https://reviews.llvm.org/D25005

Differential Revision: D25004

llvm-svn: 283716

8 years agoProvide a constexpr addressof with GCC 7.
Eric Fiselier [Mon, 10 Oct 2016 05:34:18 +0000 (05:34 +0000)]
Provide a constexpr addressof with GCC 7.

__builtin_addressof was added to the GCC trunk in the past week. This patch
teaches libc++ about it so it can correctly provide constexpr addressof.

Unfortunately this patch will break users of earlier GCC 7 builds, since
we expect __builtin_addressof but one won't be provided. One option would be
to only use __builtin_addressof for GCC 7.1 and above, but that means
waiting for another release.

Instead I've specifically chosen to break older GCC 7 versions. Since GCC 7
has yet to be released, and the 7.0 release is a development release, I
believe that anybody currently using GCC 7.0 will have no issue upgrading.

llvm-svn: 283715

8 years agoWorkaround missing C++14 constexpr semantics in filesystem
Eric Fiselier [Mon, 10 Oct 2016 05:19:59 +0000 (05:19 +0000)]
Workaround missing C++14 constexpr semantics in filesystem

llvm-svn: 283714

8 years agoRemove use of int128_t inside the filesystem implementation
Eric Fiselier [Mon, 10 Oct 2016 04:22:58 +0000 (04:22 +0000)]
Remove use of int128_t inside the filesystem implementation

llvm-svn: 283712

8 years ago[AVR] Enable generation of the TableGen assembly writer tables
Dylan McKay [Mon, 10 Oct 2016 01:28:45 +0000 (01:28 +0000)]
[AVR] Enable generation of the TableGen assembly writer tables

This also changes the order of the statements in CMakeLists.txt to be
alphabetical.

llvm-svn: 283711

8 years ago[lit] Remove (or allow specific) unused imports
Brian Gesiak [Mon, 10 Oct 2016 01:22:06 +0000 (01:22 +0000)]
[lit] Remove (or allow specific) unused imports

Summary:
Using Python linter flake8 on the utils/lit reveals several linter
warnings designated "F401: Unused import". Fix or silence these
warnings.

Some of these unused imports are legitimate, while some are part of lit's API.
For example, users of lit expect to be able to access `lit.formats.ShTest` in
their `lit.cfg`, despite the module hierarchy for that symbol actually being
`lit.formats.shtest.ShTest`. To silence linter errors for these lines,
include a "noqa" directive.

Reviewers: echristo, delcypher, beanz, ddunbar

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 283710

8 years ago[lit] Remove unused TestingProgressDisplay attr
Brian Gesiak [Mon, 10 Oct 2016 01:20:43 +0000 (01:20 +0000)]
[lit] Remove unused TestingProgressDisplay attr

Summary:
`TestingProgressDisplay` initializes its `current` attribute to `None`, but
never reads or writes the value again. Remove it.

Reviewers: echristo, delcypher, beanz, ddunbar

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 283709

8 years ago[lit] Fix undefined symbol ArgumentError
Brian Gesiak [Mon, 10 Oct 2016 01:19:27 +0000 (01:19 +0000)]
[lit] Fix undefined symbol ArgumentError

Summary:
`ArgumentError` is not defined by the Python standard library.
Executing this line of code would throw a exception, but not the
intended one. It would throw a `NameError` exception, since `ArgumentError`
is undefined.

Use `ValueError` instead, which is defined by the Python standard
library.

Reviewers: echristo, delcypher, beanz, ddunbar

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 283708

8 years ago[lit] Remove semicolons in Python code
Brian Gesiak [Mon, 10 Oct 2016 01:18:14 +0000 (01:18 +0000)]
[lit] Remove semicolons in Python code

Summary:
Semicolons aren't necessary as statement terminators in Python, and
each of these uses are superfluous as they appear at the end of a line.
The convention is to not use semicolons where not needed, so remove them.

Reviewers: echristo, delcypher, beanz, ddunbar

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 283707

8 years ago[lit] Remove unused variable in googletest format
Brian Gesiak [Mon, 10 Oct 2016 01:15:33 +0000 (01:15 +0000)]
[lit] Remove unused variable in googletest format

Summary: `prefix` is written to but never read.

Reviewers: echristo, delcypher, beanz, ddunbar

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 283706

8 years ago[lit] Remove Python 2.6 and below exec workaround
Brian Gesiak [Mon, 10 Oct 2016 01:11:52 +0000 (01:11 +0000)]
[lit] Remove Python 2.6 and below exec workaround

Summary:
The minimum version of Python required to run LLVM's test suite is 2.7.
Remove a workaround for older Python versions.

Reviewers: echristo, delcypher, beanz, ddunbar

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 283705

8 years ago[AVX-512] Port 128 and 256-bit memory->register sign/zero extend patterns from SSE...
Craig Topper [Sun, 9 Oct 2016 23:08:39 +0000 (23:08 +0000)]
[AVX-512] Port 128 and 256-bit memory->register sign/zero extend patterns from SSE file. Also add a minimal set for 512-bit.

llvm-svn: 283704

8 years ago[X86] Remove redundant patterns. The same pattern appears a few lines up.
Craig Topper [Sun, 9 Oct 2016 23:08:33 +0000 (23:08 +0000)]
[X86] Remove redundant patterns. The same pattern appears a few lines up.

llvm-svn: 283703

8 years agoMove the global variables representing each Target behind accessor function
Mehdi Amini [Sun, 9 Oct 2016 23:00:34 +0000 (23:00 +0000)]
Move the global variables representing each Target behind accessor function

This avoids "static initialization order fiasco"

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

llvm-svn: 283702

8 years agoRemove debug output from gen_linker_script.py
Eric Fiselier [Sun, 9 Oct 2016 21:43:30 +0000 (21:43 +0000)]
Remove debug output from gen_linker_script.py

llvm-svn: 283701

8 years agoFix linker script generation for in-tree builds
Eric Fiselier [Sun, 9 Oct 2016 21:34:03 +0000 (21:34 +0000)]
Fix linker script generation for in-tree builds

llvm-svn: 283700

8 years ago[libc++abi] Fix bug which cased the static libunwind to always be chosen
Eric Fiselier [Sun, 9 Oct 2016 20:44:48 +0000 (20:44 +0000)]
[libc++abi] Fix bug which cased the static libunwind to always be chosen

llvm-svn: 283699

8 years ago[CMake] Correct configuration order of the sub-projects based on ther dependancies
Eric Fiselier [Sun, 9 Oct 2016 20:38:29 +0000 (20:38 +0000)]
[CMake] Correct configuration order of the sub-projects based on ther dependancies

llvm-svn: 283698

8 years ago[llvm-link] Fix description of -disable-lazy-loading option
Davide Italiano [Sun, 9 Oct 2016 17:15:04 +0000 (17:15 +0000)]
[llvm-link] Fix description of -disable-lazy-loading option

Patch by Will Dietz!

llvm-svn: 283697

8 years ago[X86] Adding the 'nounwind' attribute to test functions for cleaner generated code
Zvi Rackover [Sun, 9 Oct 2016 13:33:51 +0000 (13:33 +0000)]
[X86] Adding the 'nounwind' attribute to test functions for cleaner generated code

Thanks to RKSimon for the suggestion.

llvm-svn: 283696

8 years ago[X86] Improve the rotate ISel test
Zvi Rackover [Sun, 9 Oct 2016 13:07:25 +0000 (13:07 +0000)]
[X86] Improve the rotate ISel test

Summary:
- Added 64-bit target testing.
- Added 64-bit operand test cases.
- Added cases that demonstrate pr30644

Reviewers: RKSimon, craig.topper, igorb

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

llvm-svn: 283695

8 years agoDAG: Setting Masked-Expand-Load as a variant of Masked-Load node
Elena Demikhovsky [Sun, 9 Oct 2016 10:48:52 +0000 (10:48 +0000)]
DAG: Setting Masked-Expand-Load as a variant of Masked-Load node

Masked-expand-load node represents load operation that loads a variable amount of elements from memory according to amount of "true" bits in the mask and expands the loaded elements according to their position in the mask vector.
Right now, the node is used in intrinsics for VEXPAND* instructions.
The work is done towards implementation of masked.expandload and masked.compressstore intrinsics.

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

llvm-svn: 283694

8 years agoFix formatting after recent cl:: changes
Tobias Grosser [Sun, 9 Oct 2016 08:31:35 +0000 (08:31 +0000)]
Fix formatting after recent cl:: changes

This fixes 'make check-polly'

llvm-svn: 283693

8 years ago[AVX-512] Fix execution domain for EVEX encoded VINSERTPS.
Craig Topper [Sun, 9 Oct 2016 06:41:47 +0000 (06:41 +0000)]
[AVX-512] Fix execution domain for EVEX encoded VINSERTPS.

llvm-svn: 283692

8 years agoMC: Remove unused entities.
Peter Collingbourne [Sun, 9 Oct 2016 04:39:13 +0000 (04:39 +0000)]
MC: Remove unused entities.

llvm-svn: 283691

8 years agoTarget: Remove unused entities.
Peter Collingbourne [Sun, 9 Oct 2016 04:38:57 +0000 (04:38 +0000)]
Target: Remove unused entities.

llvm-svn: 283690

8 years ago[AVX-512] Add subvector insert and extract to load/store folding tables.
Craig Topper [Sun, 9 Oct 2016 03:54:13 +0000 (03:54 +0000)]
[AVX-512] Add subvector insert and extract to load/store folding tables.

llvm-svn: 283689

8 years ago[AVX-512] Add avx512dq to the fp stack folding test.
Craig Topper [Sun, 9 Oct 2016 03:54:09 +0000 (03:54 +0000)]
[AVX-512] Add avx512dq to the fp stack folding test.

llvm-svn: 283688

8 years ago[AVX-512] Add the vector down convert instructions to the store folding tables.
Craig Topper [Sun, 9 Oct 2016 03:54:05 +0000 (03:54 +0000)]
[AVX-512] Add the vector down convert instructions to the store folding tables.

llvm-svn: 283687

8 years ago[libFuzzer] make a test less flaky
Kostya Serebryany [Sun, 9 Oct 2016 03:45:38 +0000 (03:45 +0000)]
[libFuzzer] make a test less flaky

llvm-svn: 283686

8 years agoWhen optimizing for size, enable loop rerolling by default
Hal Finkel [Sun, 9 Oct 2016 03:06:31 +0000 (03:06 +0000)]
When optimizing for size, enable loop rerolling by default

We have a loop-rerolling optimization which can be enabled by using
-freroll-loops. While sometimes loops are hand-unrolled for performance
reasons, when optimizing for size, we should always undo this manual
optimization to produce smaller code (our optimizer's unroller will still
unroll the rerolled loops if it thinks that is a good idea).

llvm-svn: 283685

8 years ago[CMake] Fix in-tree libcxxabi build support after r283659
Hal Finkel [Sun, 9 Oct 2016 02:49:31 +0000 (02:49 +0000)]
[CMake] Fix in-tree libcxxabi build support after r283659

r283659 changed the argument to gen_link_script.py from SCRIPT_ABI_LIBNAME to
LIBCXX_LIBRARIES_PUBLIC, assuming that all of the items in the
LIBCXX_LIBRARIES_PUBLIC list were library names. This is not right, however,
for in-tree libcxxabi builds, we might have the target name in this list. There
was special logic to fixup SCRIPT_ABI_LIBNAME for this situation; change it to
apply a similar fixup for LIBCXX_LIBRARIES_PUBLIC.

llvm-svn: 283684

8 years ago[CUDA] Don't install cuda_wrappers/{algorithm,complex} into the main include dir.
Justin Lebar [Sun, 9 Oct 2016 00:27:39 +0000 (00:27 +0000)]
[CUDA] Don't install cuda_wrappers/{algorithm,complex} into the main include dir.

This is obviously wrong -- if we do this, then all compiles will pick up
these wrappers, which is not what we want.

llvm-svn: 283683

8 years ago[libFuzzer] when shrinking the corpus, delete evicted files previously created by...
Kostya Serebryany [Sat, 8 Oct 2016 23:24:45 +0000 (23:24 +0000)]
[libFuzzer] when shrinking the corpus, delete evicted files previously created by the current process

llvm-svn: 283682

8 years agoThinLTO: Fix Gold test after caching fix in r283655
Mehdi Amini [Sat, 8 Oct 2016 22:49:28 +0000 (22:49 +0000)]
ThinLTO: Fix Gold test after caching fix in r283655

(I don't have Gold available, so this is speculative)

llvm-svn: 283681

8 years ago[CUDA] Support <complex> and std::min/max on the device.
Justin Lebar [Sat, 8 Oct 2016 22:16:12 +0000 (22:16 +0000)]
[CUDA] Support <complex> and std::min/max on the device.

Summary:
We do this by wrapping <complex> and <algorithm>.

Tests are in the test-suite.

Reviewers: tra

Subscribers: jhen, beanz, cfe-commits, mgorny

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

llvm-svn: 283680

8 years ago[CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h.
Justin Lebar [Sat, 8 Oct 2016 22:16:08 +0000 (22:16 +0000)]
[CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h.

Summary: This matches the idiom we use for our other CUDA wrapper headers.

Reviewers: tra

Subscribers: beanz, mgorny, cfe-commits

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

llvm-svn: 283679

8 years ago[CUDA] Declare our __device__ math functions in the same inline namespace as our...
Justin Lebar [Sat, 8 Oct 2016 22:16:03 +0000 (22:16 +0000)]
[CUDA] Declare our __device__ math functions in the same inline namespace as our standard library.

Summary:
Currently we declare our inline __device__ math functions in namespace
std.  But libstdc++ and libc++ declare these functions in an inline
namespace inside namespace std.  We need to match this because, in a
later patch, we want to get e.g. <complex> to use our device overloads,
and it only will if those overloads are in the right inline namespace.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

llvm-svn: 283678

8 years ago[CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas.
Justin Lebar [Sat, 8 Oct 2016 22:15:58 +0000 (22:15 +0000)]
[CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas.

Summary:
These cause us to consider all functions in-between to be __host__
__device__.

You can nest these pragmas; you just can't have more 'end's than
'begin's.

Reviewers: rsmith

Subscribers: tra, jhen, cfe-commits

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

llvm-svn: 283677

8 years ago[libFuzzer] control the reload interval by a flag, make it 10 seconds by default
Kostya Serebryany [Sat, 8 Oct 2016 22:12:14 +0000 (22:12 +0000)]
[libFuzzer] control the reload interval by a flag, make it 10 seconds by default

llvm-svn: 283676

8 years ago[libFuzzer] fix use-after-free in libFuzzer found by ... fuzzing.
Kostya Serebryany [Sat, 8 Oct 2016 21:57:48 +0000 (21:57 +0000)]
[libFuzzer] fix use-after-free in libFuzzer found by ... fuzzing.

llvm-svn: 283675

8 years ago[X86][SSE] Regenerate select tests
Simon Pilgrim [Sat, 8 Oct 2016 21:17:44 +0000 (21:17 +0000)]
[X86][SSE] Regenerate select tests

llvm-svn: 283674

8 years agoRevert "[X86] Apply the Update LLC Test Checks tool on the rotate tests."
Zvi Rackover [Sat, 8 Oct 2016 20:54:20 +0000 (20:54 +0000)]
Revert "[X86] Apply the Update LLC Test Checks tool on the rotate tests."

This reverts commit 283667.

llvm-svn: 283673

8 years ago[X86][SSE] Regenerate and add 32-bit tests to widening tests
Simon Pilgrim [Sat, 8 Oct 2016 19:54:28 +0000 (19:54 +0000)]
[X86][SSE] Regenerate and add 32-bit tests to widening tests

llvm-svn: 283672

8 years agoTurn cl::values() (for enum) from a vararg function to using C++ variadic template
Mehdi Amini [Sat, 8 Oct 2016 19:41:06 +0000 (19:41 +0000)]
Turn cl::values() (for enum) from a vararg function to using C++ variadic template

The core of the change is supposed to be NFC, however it also fixes
what I believe was an undefined behavior when calling:

 va_start(ValueArgs, Desc);

with Desc being a StringRef.

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

llvm-svn: 283671

8 years agoFix comment typos - full update script path in assertions note
Simon Pilgrim [Sat, 8 Oct 2016 18:51:55 +0000 (18:51 +0000)]
Fix comment typos - full update script path in assertions note

llvm-svn: 283670

8 years ago[AVX-512] Add test case for PR30430 that I should have added in r281959.
Craig Topper [Sat, 8 Oct 2016 18:50:00 +0000 (18:50 +0000)]
[AVX-512] Add test case for PR30430 that I should have added in r281959.

llvm-svn: 283669

8 years ago[AVX-512] Fix a bug in getLargestLegalSuperClass where we inflated to VR128X/VR256X...
Craig Topper [Sat, 8 Oct 2016 18:49:57 +0000 (18:49 +0000)]
[AVX-512] Fix a bug in getLargestLegalSuperClass where we inflated to VR128X/VR256X even when VLX isn't supported.

This seems to have been responsible for the XMM16-31 spills observed in PR29112. With this fixed the test case has been modified to no longer have a spill of XMM16.

llvm-svn: 283668

8 years ago[X86] Apply the Update LLC Test Checks tool on the rotate tests.
Zvi Rackover [Sat, 8 Oct 2016 18:44:47 +0000 (18:44 +0000)]
[X86] Apply the Update LLC Test Checks tool on the rotate tests.

Also added cases demonstrating pr30644.

llvm-svn: 283667

8 years ago[X86][AVX2] Regenerate and add 32-bit tests to core tests
Simon Pilgrim [Sat, 8 Oct 2016 18:36:57 +0000 (18:36 +0000)]
[X86][AVX2] Regenerate and add 32-bit tests to core tests

llvm-svn: 283666

8 years ago[Hexagon] Adding change of flow max 1 (cofMax1) TS flag for marking this restriction...
Colin LeMahieu [Sat, 8 Oct 2016 17:18:51 +0000 (17:18 +0000)]
[Hexagon] Adding change of flow max 1 (cofMax1) TS flag for marking this restriction rather than implying it from TypeJR.

llvm-svn: 283665

8 years ago[ThinLTO] Record calls to aliases
Teresa Johnson [Sat, 8 Oct 2016 16:11:42 +0000 (16:11 +0000)]
[ThinLTO] Record calls to aliases

Summary:
When there is a call to an alias in the same module, we were not
adding a call edge. So we could incorrectly think that the alias
was dead if it was inlined in that function, despite having a
reference imported elsewhere. This resulted in unsats at link time.

Add a call edge when the call is to an alias.

Reviewers: davide, mehdi_amini

Subscribers: llvm-commits

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

llvm-svn: 283664

8 years ago[AArch64] Avoid generating indexed vector instructions for Exynos
Sebastian Pop [Sat, 8 Oct 2016 12:30:07 +0000 (12:30 +0000)]
[AArch64] Avoid generating indexed vector instructions for Exynos

Avoid generating indexed vector instructions for Exynos. This is needed for
fmla/fmls/fmul/fmulx. For example, the instruction

  fmla v0.4s, v1.4s, v2.s[1]

is less efficient than the instructions

  dup v2.4s, v2.s[1]
  fmla v0.4s, v1.4s, v2.4s

Patch written by Abderrazek Zaafrani.

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

llvm-svn: 283663

8 years ago[analyzer] Fix build error after r283660 - remove constexpr strings.
Artem Dergachev [Sat, 8 Oct 2016 11:07:21 +0000 (11:07 +0000)]
[analyzer] Fix build error after r283660 - remove constexpr strings.

llvm-svn: 283662

8 years ago[analyzer] Re-apply r283094 "Improve CloneChecker diagnostics"
Artem Dergachev [Sat, 8 Oct 2016 10:54:30 +0000 (10:54 +0000)]
[analyzer] Re-apply r283094 "Improve CloneChecker diagnostics"

The parent commit (r283092) was reverted before and now finally landed.

llvm-svn: 283661

8 years ago[analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker"
Artem Dergachev [Sat, 8 Oct 2016 10:53:00 +0000 (10:53 +0000)]
[analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker"

The parent commit (r283092) was reverted before and now finally landed.

llvm-svn: 283660

8 years ago[cmake] Split linked libraries into private & public, for linker script
Michal Gorny [Sat, 8 Oct 2016 10:27:45 +0000 (10:27 +0000)]
[cmake] Split linked libraries into private & public, for linker script

Introduce LIBCXX_LIBRARIES_PUBLIC in addition to LIBCXX_LIBRARIES that
holds 'public' interface libraries -- that is, libraries that both
libc++ links to and programs linked against it need to link to.

Currently this includes the ABI library and optionally -lunwind (when
LIBCXXABI_USE_LLVM_UNWINDER is on). The libraries are included in the
linker script, in order to make it possible to link C++ programs using
clang with compiler-rt runtime out-of-the-box.

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

llvm-svn: 283659

8 years ago[compiler-rt] Exclude compiler-rt from using -fmodules when LLVM_ENABLE_MODULES=On
Kuba Brecka [Sat, 8 Oct 2016 09:01:27 +0000 (09:01 +0000)]
[compiler-rt] Exclude compiler-rt from using -fmodules when LLVM_ENABLE_MODULES=On

Sanitizers are intentionally not including system headers and often declare slightly different function prototypes, which is incompatible with -fmodules and -fcxx-modules. Let’s simply exclude compiler-rt from using -fmodules.

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

llvm-svn: 283658

8 years agoUn-tabify source files, NFC.
Yaron Keren [Sat, 8 Oct 2016 06:45:10 +0000 (06:45 +0000)]
Un-tabify source files, NFC.

llvm-svn: 283657

8 years ago[OptRemarks] Remove non-printable chars from function name
Adam Nemet [Sat, 8 Oct 2016 04:47:20 +0000 (04:47 +0000)]
[OptRemarks] Remove non-printable chars from function name

Value names may be prefixed with a binary '1' to indicate that the
backend should not modify the symbols due to any platform naming
convention.

This should not show up in the YAML opt record file because it breaks
the YAML parser.

llvm-svn: 283656

8 years agoThinLTO: don't perform incremental LTO on module without a hash
Mehdi Amini [Sat, 8 Oct 2016 04:44:23 +0000 (04:44 +0000)]
ThinLTO: don't perform incremental LTO on module without a hash

Clang always emit a hash for ThinLTO, but as other frontend are
starting to use ThinLTO, this could be a serious bug.

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

llvm-svn: 283655

8 years agoThinLTO: handles modules with empty summaries
Mehdi Amini [Sat, 8 Oct 2016 04:44:18 +0000 (04:44 +0000)]
ThinLTO: handles modules with empty summaries

We need to add an entry in the combined-index for modules that have
a hash but otherwise empty summary, this is needed so that we can
get the hash for the module.

Also, if no entry is present in the combined index for a module, we
need to skip it when trying to compute a cache entry.

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

llvm-svn: 283654

8 years agoRequires the AVR backend for running test/CodeGen/AVR
Mehdi Amini [Sat, 8 Oct 2016 04:39:34 +0000 (04:39 +0000)]
Requires the AVR backend for running test/CodeGen/AVR

llvm-svn: 283653

8 years agoFix compiler warnings in TestClangASTContext.cpp
Pavel Labath [Sat, 8 Oct 2016 04:03:19 +0000 (04:03 +0000)]
Fix compiler warnings in TestClangASTContext.cpp

llvm-svn: 283652

8 years agoFix compiler warnings in PlatformDarwinTest.cpp
Pavel Labath [Sat, 8 Oct 2016 04:03:15 +0000 (04:03 +0000)]
Fix compiler warnings in PlatformDarwinTest.cpp

llvm-svn: 283651

8 years agoRevert "Codegen: Tail-duplicate during placement."
Kyle Butt [Sat, 8 Oct 2016 01:47:05 +0000 (01:47 +0000)]
Revert "Codegen: Tail-duplicate during placement."

This reverts commit 71c312652c10f1855b28d06697c08d47e7a243e4.

llvm-svn: 283647

8 years agoUse StringRef in Command::printArg() instead of raw pointer (NFC)
Mehdi Amini [Sat, 8 Oct 2016 01:38:43 +0000 (01:38 +0000)]
Use StringRef in Command::printArg() instead of raw pointer (NFC)

llvm-svn: 283645

8 years agoRemove all _LIBCPP_VERSION tests from under test/std
Eric Fiselier [Sat, 8 Oct 2016 01:32:56 +0000 (01:32 +0000)]
Remove all _LIBCPP_VERSION tests from under test/std

llvm-svn: 283644

8 years agoPurge all usages of _LIBCPP_STD_VER under test/std/algorithm
Eric Fiselier [Sat, 8 Oct 2016 01:25:23 +0000 (01:25 +0000)]
Purge all usages of _LIBCPP_STD_VER under test/std/algorithm

llvm-svn: 283643

8 years ago[AVR] Add backend dependencies to MCTargetDesc/LLVMBuild.txt
Dylan McKay [Sat, 8 Oct 2016 01:14:23 +0000 (01:14 +0000)]
[AVR] Add backend dependencies to MCTargetDesc/LLVMBuild.txt

llvm-svn: 283642