platform/upstream/llvm.git
7 years ago[X86][AVX] Fixed v16i16/v32i8 ADD/SUB costs on AVX1 subtargets
Simon Pilgrim [Mon, 14 Nov 2016 14:45:16 +0000 (14:45 +0000)]
[X86][AVX] Fixed v16i16/v32i8 ADD/SUB costs on AVX1 subtargets

Add explicit v16i16/v32i8 ADD/SUB costs, matching the costs of v4i64/v8i32 - they were missing for some reason.

This has side effects on the LV max bandwidth tests (AVX1 now prefers 128-bit vectors vs AVX2 which still prefers 256-bit)

llvm-svn: 286832

7 years ago[ELF] - Ignore -Map,-M and --cref options.
George Rimar [Mon, 14 Nov 2016 14:45:11 +0000 (14:45 +0000)]
[ELF] - Ignore -Map,-M and --cref options.

-M, --print-map Write map file on standard output
-Map MAPFILENAME Write map file
--cref Output cross reference table

This is relative to PR30973.

Next FreeBSD ports were atm failing because of
lack of -Map, -M and --cref:

sysutils/openipmi
emulators/adamem
devel/jwasm
net/pimd
devel/k8048
textproc/libcrm114
lang/micropython
net/mrouted
print/openprinting

After this patch all of them can be link fine.

llvm-svn: 286831

7 years ago[PPC] add extract sig/exp test data class for vec float and vec double.
Sean Fertile [Mon, 14 Nov 2016 14:43:27 +0000 (14:43 +0000)]
[PPC] add extract sig/exp test data class for vec float and vec double.

 Add vector extract exponent/significand functions to altivec.h, as well as
 functions (and related constants) to test the data class of vector float
 and vector double.

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

llvm-svn: 286830

7 years ago[PPC] add intrinsics for vec extract exp/significand and vec test data class.
Sean Fertile [Mon, 14 Nov 2016 14:42:37 +0000 (14:42 +0000)]
[PPC] add intrinsics for vec extract exp/significand and vec test data class.

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

llvm-svn: 286829

7 years agoUpdate C++1z status with C++17 issues from Issaquah. Still to come: LFTS issues and...
Marshall Clow [Mon, 14 Nov 2016 14:41:33 +0000 (14:41 +0000)]
Update C++1z status with C++17 issues from Issaquah. Still to come: LFTS issues and papers

llvm-svn: 286828

7 years agoDelay removing empty section commands. NFC.
Rafael Espindola [Mon, 14 Nov 2016 14:33:49 +0000 (14:33 +0000)]
Delay removing empty section commands. NFC.

To fix pr30997 we will have to keep them a bit longer, this just
splits that part of the diff.

llvm-svn: 286827

7 years agoFactor out removeEmptyCommands. NFC.
Rafael Espindola [Mon, 14 Nov 2016 14:23:35 +0000 (14:23 +0000)]
Factor out removeEmptyCommands. NFC.

llvm-svn: 286826

7 years ago[clang-move] Abstract a ClassMather for matching class declarations.
Haojian Wu [Mon, 14 Nov 2016 14:15:44 +0000 (14:15 +0000)]
[clang-move] Abstract a ClassMather for matching class declarations.

Summary:
No functionality change.

This is a refactoring patch, which makes the code more readable and easy
to extend it to support more types.

Reviewers: ioeric

Subscribers: cfe-commits

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

llvm-svn: 286825

7 years agoFactor out placeOrphanSections. NFC.
Rafael Espindola [Mon, 14 Nov 2016 14:13:32 +0000 (14:13 +0000)]
Factor out placeOrphanSections. NFC.

llvm-svn: 286824

7 years agoProtect std::ios tests under libcpp-no-exceptions
Roger Ferrer Ibanez [Mon, 14 Nov 2016 13:44:50 +0000 (13:44 +0000)]
Protect std::ios tests under libcpp-no-exceptions

Skip tests that expect an exception be thrown. Also add
some missing asserts in the original test.

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

llvm-svn: 286823

7 years agoReverting r285406, which was a temporary workaround to get one of the documentation...
Aaron Ballman [Mon, 14 Nov 2016 13:33:51 +0000 (13:33 +0000)]
Reverting r285406, which was a temporary workaround to get one of the documentation bots upgraded to something newer than GCC 4.7. This restores the check for GCC 4.8.

llvm-svn: 286822

7 years agoFix r286819 (accidentally patched multiple times.
Pekka Jaaskelainen [Mon, 14 Nov 2016 13:14:38 +0000 (13:14 +0000)]
Fix r286819 (accidentally patched multiple times.

llvm-svn: 286821

7 years agoRevert "llvm-strings: support printing the filename"
Renato Golin [Mon, 14 Nov 2016 13:09:24 +0000 (13:09 +0000)]
Revert "llvm-strings: support printing the filename"

Also,

Revert "test: remove the archive before modifying it"
Revert "test: explicitly use gnu format"

This reverts commits r286778, r286729 and r286767, as they are randomly failing
on many bots (AArch64, x86_64).

llvm-svn: 286820

7 years ago[OpenCL] always use SPIR address spaces for kernel_arg_addr_space MD
Pekka Jaaskelainen [Mon, 14 Nov 2016 13:08:30 +0000 (13:08 +0000)]
[OpenCL] always use SPIR address spaces for kernel_arg_addr_space MD

It doesn't make sense to use the target's address space ids in this context as
this is metadata that should be referring to the "logical" OpenCL address spaces.
For flat AS machines like all "CPUs" in general, the logical AS info gets lost as
there's only one address space (0).

This commit changes the logic such that we always use the SPIR address space
ids for the argument metadata. It thus allows implementing the clGetKernelArgInfo()
and the other detection needs.

https://reviews.llvm.org/D26157

llvm-svn: 286819

7 years agoRevert "Improve handling of floating point literals in OpenCL to only use double...
Renato Golin [Mon, 14 Nov 2016 12:19:18 +0000 (12:19 +0000)]
Revert "Improve handling of floating point literals in OpenCL to only use double precision if the target supports fp64."

This reverts commit r286815, as it broke all ARM and AArch64 bots.

llvm-svn: 286818

7 years agoRemove redundant condition (PR28352) NFCI.
Simon Pilgrim [Mon, 14 Nov 2016 12:00:46 +0000 (12:00 +0000)]
Remove redundant condition (PR28352) NFCI.

We were already testing is the op was not a leaf, so need to then test if it was a leaf (added it to the assert instead).

llvm-svn: 286817

7 years ago[lsan] [aarch64] Fix printing of pointers in make check tests - update
Strahinja Petrovic [Mon, 14 Nov 2016 11:40:56 +0000 (11:40 +0000)]
[lsan] [aarch64] Fix printing of pointers in make check tests - update

This patch replaces fprintf with print_address function in LSAN
tests. This is necessary because of different printing of pointers
in fprintf and sanitizer's print function.
Differential Revision: https://reviews.llvm.org/D26084.

llvm-svn: 286816

7 years agoImprove handling of floating point literals in OpenCL to only use double precision...
Neil Hickey [Mon, 14 Nov 2016 11:15:51 +0000 (11:15 +0000)]
Improve handling of floating point literals in OpenCL to only use double precision if the target supports fp64.

This change makes sure single-precision floating point types are used if the
cl_fp64 extension is not supported by the target.

Also removed the check to see whether the OpenCL version is >= 1.2, as this has
been incorporated into the extension setting code.

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

llvm-svn: 286815

7 years ago[InlineCost] Remove skew when calculating call costs
James Molloy [Mon, 14 Nov 2016 11:14:41 +0000 (11:14 +0000)]
[InlineCost] Remove skew when calculating call costs

When calculating the cost of a call instruction we were applying a heuristic penalty as well as the cost of the instruction itself.

However, when calculating the benefit from inlining we weren't discounting the equivalent penalty for the call instruction that would be removed! This caused skew in the calculation and meant we wouldn't inline in the following, trivial case:

  int g() {
    h();
  }
  int f() {
    g();
  }

llvm-svn: 286814

7 years agoProtect nested-exceptions tests under no-exceptions
Roger Ferrer Ibanez [Mon, 14 Nov 2016 11:00:28 +0000 (11:00 +0000)]
Protect nested-exceptions tests under no-exceptions

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

llvm-svn: 286813

7 years agoUpdate tests for strings conversions under libcpp-no-exceptions
Roger Ferrer Ibanez [Mon, 14 Nov 2016 10:44:26 +0000 (10:44 +0000)]
Update tests for strings conversions under libcpp-no-exceptions

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

llvm-svn: 286812

7 years agoRemove redundant condition (PR28800) NFCI.
Simon Pilgrim [Mon, 14 Nov 2016 10:40:23 +0000 (10:40 +0000)]
Remove redundant condition (PR28800) NFCI.

'A || (!A && B)' is equivalent to 'A || B':

(LoopCycle > DefCycle) || (LoopCycle <= DefCycle && LoopStage <= DefStage)
-->
(LoopCycle > DefCycle) || (LoopStage <= DefStage)

llvm-svn: 286811

7 years ago[ELF] - Simplify edata-etext.s test. NFC.
George Rimar [Mon, 14 Nov 2016 10:33:53 +0000 (10:33 +0000)]
[ELF] - Simplify edata-etext.s test. NFC.

llvm-svn: 286810

7 years agoProtect smart-pointer tests under no exceptions
Roger Ferrer Ibanez [Mon, 14 Nov 2016 10:27:56 +0000 (10:27 +0000)]
Protect smart-pointer tests under no exceptions

Skip tests that expect an exception be thrown under no-exceptions.

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

llvm-svn: 286809

7 years agoGlobalISel: Fix indentation. NFC
Diana Picus [Mon, 14 Nov 2016 10:25:43 +0000 (10:25 +0000)]
GlobalISel: Fix indentation. NFC

llvm-svn: 286808

7 years ago[JumpThreading] Prevent non-deterministic use lists
Pablo Barrio [Mon, 14 Nov 2016 10:24:26 +0000 (10:24 +0000)]
[JumpThreading] Prevent non-deterministic use lists

Summary:
Unfolding selects was previously done with the help of a vector
of pointers that was then sorted to be able to remove duplicates.
As this sorting depends on the memory addresses, it was
non-deterministic. A SetVector is used now so that duplicates are
removed without the need of sorting first.

Reviewers: mgrang, efriedma

Subscribers: llvm-commits

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

llvm-svn: 286807

7 years agoGlobalISel: Fix typos. NFC
Diana Picus [Mon, 14 Nov 2016 10:22:18 +0000 (10:22 +0000)]
GlobalISel: Fix typos. NFC

llvm-svn: 286806

7 years ago[ELF] - format. NFC.
George Rimar [Mon, 14 Nov 2016 10:14:18 +0000 (10:14 +0000)]
[ELF] - format. NFC.

llvm-svn: 286805

7 years ago[ELF] - format. NFC.
George Rimar [Mon, 14 Nov 2016 10:05:53 +0000 (10:05 +0000)]
[ELF] - format. NFC.

llvm-svn: 286804

7 years ago[ELF] - Removed trailing whitespace. NFC.
George Rimar [Mon, 14 Nov 2016 10:04:45 +0000 (10:04 +0000)]
[ELF] - Removed trailing whitespace. NFC.

llvm-svn: 286803

7 years ago[ELF] - Removed unused code. NFC.
George Rimar [Mon, 14 Nov 2016 10:03:54 +0000 (10:03 +0000)]
[ELF] - Removed unused code. NFC.

This branch was unused I believe,
as Tok can never be empty.

llvm-svn: 286802

7 years ago[ELF] - Fix mistype. NFC.
George Rimar [Mon, 14 Nov 2016 09:56:35 +0000 (09:56 +0000)]
[ELF] - Fix mistype. NFC.

llvm-svn: 286801

7 years ago[ELF] - Untabify. NFC.
George Rimar [Mon, 14 Nov 2016 09:33:38 +0000 (09:33 +0000)]
[ELF] - Untabify. NFC.

llvm-svn: 286800

7 years ago[ELF] Convert StringTableSection to input section
Eugene Leviant [Mon, 14 Nov 2016 09:16:00 +0000 (09:16 +0000)]
[ELF] Convert StringTableSection to input section

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

llvm-svn: 286799

7 years agoRemove some false positives when taking the address of packed members
Roger Ferrer Ibanez [Mon, 14 Nov 2016 08:53:27 +0000 (08:53 +0000)]
Remove some false positives when taking the address of packed members

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

llvm-svn: 286798

7 years agoAdd explicit (void) cast to unused unique_ptr::release() results
Eric Fiselier [Mon, 14 Nov 2016 07:26:17 +0000 (07:26 +0000)]
Add explicit (void) cast to unused unique_ptr::release() results

Summary:
This patch adds explicit `(void)` casts to discarded `release()` calls to suppress -Wunused-result.

This patch fixes *all* warnings are generated as a result of [applying `[[nodiscard]]`  within libc++](https://reviews.llvm.org/D26596).
Similar fixes were applied to Clang in r286796.

Reviewers: chandlerc, dberris

Subscribers: llvm-commits

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

llvm-svn: 286797

7 years agoAdd explicit (void) cast to result of unique_ptr::release()
Eric Fiselier [Mon, 14 Nov 2016 07:03:50 +0000 (07:03 +0000)]
Add explicit (void) cast to result of unique_ptr::release()

llvm-svn: 286796

7 years agoDemangle: only demangle mangled symbols
Saleem Abdulrasool [Mon, 14 Nov 2016 04:54:47 +0000 (04:54 +0000)]
Demangle: only demangle mangled symbols

Only attempt to demangle symbols which have the itanium C++ prefix of `_Z`.
This ensures that we do not treat any symbol name as a managled named.  We would
previously treat a C function `f` as a mangled name and decode that to `float`
incorrectly.

While it is easy to add tests for this, Mehdi recommended against introducing
tests for the demangler as libc++abi should cover the testing.

llvm-svn: 286795

7 years ago__cxa_demangle: allow demangling invocation blocks
Saleem Abdulrasool [Mon, 14 Nov 2016 03:07:47 +0000 (03:07 +0000)]
__cxa_demangle: allow demangling invocation blocks

The block invocation function uses an extension where the prefix is ___Z
as opposed to _Z.  This should make the tests pass again.

Disable a negative test which was testing a crasher.  The symbol being
demangled is not a valid mangled symbol and will return a nullptr.

Adjust the type info decoding test to be a valid symbol name.

llvm-svn: 286793

7 years agoFix ABI configuration detection on OS X
Eric Fiselier [Mon, 14 Nov 2016 03:03:13 +0000 (03:03 +0000)]
Fix ABI configuration detection on OS X

llvm-svn: 286792

7 years agoFix CMake set syntax
Eric Fiselier [Mon, 14 Nov 2016 02:51:30 +0000 (02:51 +0000)]
Fix CMake set syntax

llvm-svn: 286791

7 years ago[AVX-512] Add suffixless aliases for EVEX encoded vcvtsi2ss/vcvtsi2sd/vcvtusi2ss...
Craig Topper [Mon, 14 Nov 2016 02:46:58 +0000 (02:46 +0000)]
[AVX-512] Add suffixless aliases for EVEX encoded vcvtsi2ss/vcvtsi2sd/vcvtusi2ss/vcvtusi2sd. This matches the VEX behavior.

Fixes another problem from PR28850.

llvm-svn: 286790

7 years agoAdd check-cxx-abilist target when supported.
Eric Fiselier [Mon, 14 Nov 2016 02:43:12 +0000 (02:43 +0000)]
Add check-cxx-abilist target when supported.

This patch adds a `check-cxx-abilist` target which verifies the libc++.so ABI
when the current build configuration matches the configuration used to generate
the ABI lists.

In order to make this change `HandleOutOfTreeLLVM.cmake` needed to be modified
to include `LLVMConfig.cmake` so that `TARGET_TRIPLE` is defined. Hopefully
the changes needed to accommodate this won't break existing build
configurations.

llvm-svn: 286789

7 years ago__cxa_demangle: ensure that we have a mangled symbol
Saleem Abdulrasool [Mon, 14 Nov 2016 01:55:54 +0000 (01:55 +0000)]
__cxa_demangle: ensure that we have a mangled symbol

Ensure that we have a mangled symbol before attempting to demangle it.  We would
previously treat any input as a mangled symbol rather than checking that the
symbol has the initial C++ Itanium v3 mangling prefix of `_Z`.  This changes the
behaviour from the previous case which would undecorate `f` to `float` rather
than nullptr as it should.

Unfortunately, we do not have any negative testing for the demangler.

llvm-svn: 286788

7 years ago[X86] Cleanup 'x' and 'y' mnemonic suffixes for vcvtpd2dq/vcvttpd2dq/vcvtpd2ps and...
Craig Topper [Mon, 14 Nov 2016 01:53:29 +0000 (01:53 +0000)]
[X86] Cleanup 'x' and 'y' mnemonic suffixes for vcvtpd2dq/vcvttpd2dq/vcvtpd2ps and similar instructions.

-Don't print the 'x' suffix for the 128-bit reg/mem VEX encoded instructions in Intel syntax. This is consistent with the EVEX versions.
-Don't print the 'y' suffix for the 256-bit reg/reg VEX encoded instructions in Intel or AT&T syntax. This is consistent with the EVEX versions.
-Allow the 'x' and 'y' suffixes to be used for the reg/mem forms when we're assembling using Intel syntax.
-Allow the 'x' and 'y' suffixes on the reg/reg EVEX encoded instructions in Intel or AT&T syntax. This is consistent with what VEX was already allowing.

This should fix at least some of PR28850.

llvm-svn: 286787

7 years ago[AVX-512] Remove and autoupgrade masked dword/qword variable shift intrinsics to...
Craig Topper [Mon, 14 Nov 2016 01:53:22 +0000 (01:53 +0000)]
[AVX-512] Remove and autoupgrade masked dword/qword variable shift intrinsics to the new unmasked versions and selects.

llvm-svn: 286786

7 years ago[LangRef] Drop misleading anecdote
Sanjoy Das [Sun, 13 Nov 2016 23:40:40 +0000 (23:40 +0000)]
[LangRef] Drop misleading anecdote

`shl nsw i8 1, i8 8` is poison, but `mul i8 1, i8 128` is not.

This was discussed previously here:
http://lists.llvm.org/pipermail/llvm-dev/2015-April/084195.html.  From
the discussion, it was not clear which semantics we want for `shl`, but
for now at least make the language reference more accurate.

llvm-svn: 286785

7 years agoAdd docs for use-configurable libc++ features
Eric Fiselier [Sun, 13 Nov 2016 23:00:30 +0000 (23:00 +0000)]
Add docs for use-configurable libc++ features

llvm-svn: 286784

7 years agoFix GCC libc++abi build
Eric Fiselier [Sun, 13 Nov 2016 22:27:00 +0000 (22:27 +0000)]
Fix GCC libc++abi build

llvm-svn: 286783

7 years agoI am leaving Apple in a few weeks; switch over to my personal email address
Enrico Granata [Sun, 13 Nov 2016 21:30:54 +0000 (21:30 +0000)]
I am leaving Apple in a few weeks; switch over to my personal email address

llvm-svn: 286782

7 years ago[ScopBuilder] Drop unnecessary namespace identifiers [NFC]
Tobias Grosser [Sun, 13 Nov 2016 21:28:13 +0000 (21:28 +0000)]
[ScopBuilder] Drop unnecessary namespace identifiers [NFC]

llvm-svn: 286781

7 years ago[SCEVAffinator] Do not scan redundantly for parameters
Tobias Grosser [Sun, 13 Nov 2016 21:28:07 +0000 (21:28 +0000)]
[SCEVAffinator] Do not scan redundantly for parameters

In r286430 "SCEVValidator: add new parameters resulting from constant
extraction" we added functionality to scan for parameters after constant
extraction has taken place to ensure newly created parameters are correctly
registered. This addition made the already existing registration of parameters
redundant. Hence, we remove the corresponding call in this commit.

An alternative solution would have been to also perform constant extraction when
validating SCEV expressions and to then scan for parameters when validating
a SCEV expression. However, as SCEV validation is used during SCoP detection
where we want to be especially fast, adding additional functionality on this
hot path should be avoided if good alternatives exist. In this case, we can
choose to continue to only transform SCEV expression when actually modeling
them. As all transformations we perform are expected to not change the validity
of the SCEV expressions, this solution seems preferable.

Suggested-by: Eli Friedman <efriedma@codeaurora.org>
llvm-svn: 286780

7 years agoImplement LWG 2770 - Make tuple_size<T> defined for all T
Eric Fiselier [Sun, 13 Nov 2016 20:43:50 +0000 (20:43 +0000)]
Implement LWG 2770 - Make tuple_size<T> defined for all T

llvm-svn: 286779

7 years agotest: remove the archive before modifying it
Saleem Abdulrasool [Sun, 13 Nov 2016 20:43:41 +0000 (20:43 +0000)]
test: remove the archive before modifying it

The archive may already exist when not doing a clean test run.  The dirty state
can cause a test failure.  Remove the archive first.

llvm-svn: 286778

7 years agollvm-cxxfilt: support reading from stdin
Saleem Abdulrasool [Sun, 13 Nov 2016 20:43:38 +0000 (20:43 +0000)]
llvm-cxxfilt: support reading from stdin

`c++filt` when given no arguments runs as a REPL, decoding each line as a
decorated name.  Unify the test structure to be more uniform, with the tests for
llvm-cxxfilt living under test/tools/llvm-cxxfilt.

llvm-svn: 286777

7 years ago[ValueTracking] recognize even more variants of smin/smax
Sanjay Patel [Sun, 13 Nov 2016 20:04:52 +0000 (20:04 +0000)]
[ValueTracking] recognize even more variants of smin/smax

Similar to:
https://reviews.llvm.org/rL285499
https://reviews.llvm.org/rL286318

We can't minimally expose this in IR tests because we don't have min/max intrinsics,
but the difference is visible in codegen because SelectionDAGBuilder::visitSelect()
uses matchSelectPattern().

We're not canonicalizing these patterns in IR (yet), so I don't expect there to be any
regressions as noted here:
http://lists.llvm.org/pipermail/llvm-dev/2016-November/106868.html

llvm-svn: 286776

7 years ago[AVX-512] Fix a disassembler failure for AVX-512 vcmpss/vcmpsd with an immediate...
Craig Topper [Sun, 13 Nov 2016 19:58:18 +0000 (19:58 +0000)]
[AVX-512] Fix a disassembler failure for AVX-512 vcmpss/vcmpsd with an immediate larger than 32. Fix the same bug with VLX vcmpps/vcmppd.

Fixes PR24941.

llvm-svn: 286775

7 years agoFix PR30979 - tuple<move_only> is constructible from move_only const&
Eric Fiselier [Sun, 13 Nov 2016 19:54:31 +0000 (19:54 +0000)]
Fix PR30979 - tuple<move_only> is constructible from move_only const&

llvm-svn: 286774

7 years agotest: synchronise lit substitutions
Saleem Abdulrasool [Sun, 13 Nov 2016 19:37:00 +0000 (19:37 +0000)]
test: synchronise lit substitutions

llvm-strings was added to the test dependencies without updating the lit
substitutions.  Synchronise the list.

llvm-svn: 286773

7 years ago[ValueTracking] move min/max matching to helper function; NFCI
Sanjay Patel [Sun, 13 Nov 2016 19:30:19 +0000 (19:30 +0000)]
[ValueTracking] move min/max matching to helper function; NFCI

llvm-svn: 286772

7 years ago[ScopDetect] Conservatively handle inaccessible memory alias attributes
Tobias Grosser [Sun, 13 Nov 2016 19:27:24 +0000 (19:27 +0000)]
[ScopDetect] Conservatively handle inaccessible memory alias attributes

Commit r286294 introduced support for inaccessiblememonly and
inaccessiblemem_or_argmemonly attributes to BasicAA, which we need to
support to avoid undefined behavior. This change just refuses all calls
which are annotated with these attributes, which is conservatively correct.
In the future we may consider to model and support such function calls
in Polly.

llvm-svn: 286771

7 years ago[tests] Adjust test output to recent changed SCEV canonocalization [NFC]
Tobias Grosser [Sun, 13 Nov 2016 19:27:17 +0000 (19:27 +0000)]
[tests] Adjust test output to recent changed SCEV canonocalization [NFC]

LLVM recently changed the SCEV canonicalization which changed the output of
one of our GPGPU test cases.

llvm-svn: 286770

7 years ago[ScopDetect] Evaluate and verify branches at branch condition, not icmp
Tobias Grosser [Sun, 13 Nov 2016 19:27:04 +0000 (19:27 +0000)]
[ScopDetect] Evaluate and verify branches at branch condition, not icmp

The validity of a branch condition must be verified at the location of the
branch (the branch instruction), not the location of the icmp that is
used in the branch instruction. When verifying at the wrong location, we
may accept an icmp that is defined within a loop which itself dominates, but
does not contain the branch instruction. Such loops cannot be modeled as
we only introduce domain dimensions for surrounding loops. To address this
problem we change the scop detection to evaluate and verify SCEV expressions at
the right location.

This issue has been around since at least r179148 "scop detection: properly
instantiate SCEVs to the place where they are used", where we explicitly
set the scope to the wrong location. Before this commit the scope
was not explicitly set, which probably also resulted in the scope around the
ICmp to be choosen.

This resolves http://llvm.org/PR30989

Reported-by: Eli Friedman <efriedma@codeaurora.org>
llvm-svn: 286769

7 years ago[X86][IR] Reduce the number of full string comparisons in the code that autoupgrades...
Craig Topper [Sun, 13 Nov 2016 19:09:56 +0000 (19:09 +0000)]
[X86][IR] Reduce the number of full string comparisons in the code that autoupgrades masked shift intrinsics.

llvm-svn: 286768

7 years agollvm-strings: support printing the filename
Saleem Abdulrasool [Sun, 13 Nov 2016 19:07:48 +0000 (19:07 +0000)]
llvm-strings: support printing the filename

This adds support for the `-f` or `--print-file-name` option for strings.

llvm-svn: 286767

7 years agoAMDGPU: Implement SGPR spilling with scalar stores
Matt Arsenault [Sun, 13 Nov 2016 18:20:54 +0000 (18:20 +0000)]
AMDGPU: Implement SGPR spilling with scalar stores

nThis avoids the nasty problems caused by using
memory instructions that read the exec mask while
spilling / restoring registers used for control flow
masking, but only for VI when these were added.

This always uses the scalar stores when enabled currently,
but it may be better to still try to spill to a VGPR
and use this on the fallback memory path.

The cache also needs to be flushed before wave termination
if a scalar store is used.

llvm-svn: 286766

7 years agorevert commit r286761, some builds failed on Win platforms
Igor Breger [Sun, 13 Nov 2016 15:48:11 +0000 (15:48 +0000)]
revert commit r286761, some builds failed on Win platforms

llvm-svn: 286765

7 years ago[X86][SSE] Add zero lower 32-bits test case for PR30845
Simon Pilgrim [Sun, 13 Nov 2016 15:32:11 +0000 (15:32 +0000)]
[X86][SSE] Add zero lower 32-bits test case for PR30845

llvm-svn: 286764

7 years ago[X86][AVX512] Add masked VPMOZX test case for PR26762
Simon Pilgrim [Sun, 13 Nov 2016 15:16:43 +0000 (15:16 +0000)]
[X86][AVX512] Add masked VPMOZX test case for PR26762

llvm-svn: 286763

7 years ago[X86][SSE] Add additional test case for PR30845
Simon Pilgrim [Sun, 13 Nov 2016 14:57:52 +0000 (14:57 +0000)]
[X86][SSE] Add additional test case for PR30845

llvm-svn: 286762

7 years ago[X86][AVX512] Removing llvm x86 intrinsics for _mm_mask_move_{ss|sd} intrinsics.
Ayman Musa [Sun, 13 Nov 2016 14:51:25 +0000 (14:51 +0000)]
[X86][AVX512] Removing llvm x86 intrinsics for _mm_mask_move_{ss|sd} intrinsics.

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

llvm-svn: 286761

7 years agoarm: Fix ttype encoding assertion failure.
Logan Chien [Sun, 13 Nov 2016 14:44:41 +0000 (14:44 +0000)]
arm: Fix ttype encoding assertion failure.

GCC 4.7 or newer emits 0x90 (indirect | pcrel) as the ttype encoding.
This would hit an assertion in cxa_personality.cpp.  This commit fixes
the problem by relaxing the assertion.

llvm-svn: 286760

7 years ago[CMake] Fix libc++abi arm build w/o libunwind.
Logan Chien [Sun, 13 Nov 2016 14:42:15 +0000 (14:42 +0000)]
[CMake] Fix libc++abi arm build w/o libunwind.

This commit fixes libc++abi build when LLVM unwinder (libunwind_llvm) is
not enabled.

This commit fixes the problem by removing "LLVM_NATIVE_ARCH MATCHES ARM"
from CMakeLists.txt so that LIBCXXABI_USE_LLVM_UNWINDER will only be
defined when LLVM unwinder is enabled.

We need LIBCXXABI_USE_LLVM_UNWINDER becase there is a subtle difference
between the unwinder from libgcc and the one from libunwind_llvm.  For
the unwinder from libgcc, we have to initialize register r12 with the
address of _Unwind_Control_Block; otherwise,
_Unwind_GetLanguageSpecificData() and _Unwind_GetRegionStart() won't
work properly.  Consequently, there is an extra _Unwind_SetGR() when
LLVM unwinder is disabled.  Check cxa_personality.cpp for details.

llvm-svn: 286759

7 years ago[X86][AVX512] Add patterns for all variants of VMOVSS/VMOVSD instructions.
Ayman Musa [Sun, 13 Nov 2016 14:29:32 +0000 (14:29 +0000)]
[X86][AVX512] Add patterns for all variants of VMOVSS/VMOVSD instructions.

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

llvm-svn: 286758

7 years ago[AVX-512] Replace masked dword and qword variable shift builtins with unmasked builti...
Craig Topper [Sun, 13 Nov 2016 07:26:34 +0000 (07:26 +0000)]
[AVX-512] Replace masked dword and qword variable shift builtins with unmasked builtins and a select.

This is part of a set of changes to allow InstCombine in the backend to optimize variable shifts without having to know about masking.

llvm-svn: 286757

7 years ago[X86] Remove extra escaped new lines in intrinsic headers left over from an earlier...
Craig Topper [Sun, 13 Nov 2016 07:26:31 +0000 (07:26 +0000)]
[X86] Remove extra escaped new lines in intrinsic headers left over from an earlier conversion away from a macro. NFC

llvm-svn: 286756

7 years ago[InstCombine][AVX-512] Teach InstCombineCalls to handle the new unmasked AVX-512...
Craig Topper [Sun, 13 Nov 2016 07:26:19 +0000 (07:26 +0000)]
[InstCombine][AVX-512] Teach InstCombineCalls to handle the new unmasked AVX-512 variable shift intrinsics.

llvm-svn: 286755

7 years ago[AVX-512] Add unmasked intrinsics for variable shifts of dwords and qwords.
Craig Topper [Sun, 13 Nov 2016 07:26:15 +0000 (07:26 +0000)]
[AVX-512] Add unmasked intrinsics for variable shifts of dwords and qwords.

These will be used to replace the masked intrinsics so that InstCombineCalls can optimize the AVX-512 variable shifts the same way it does for AVX2.

llvm-svn: 286754

7 years ago[AMDGPU] Add f16 support (VI+)
Konstantin Zhuravlyov [Sun, 13 Nov 2016 07:01:11 +0000 (07:01 +0000)]
[AMDGPU] Add f16 support (VI+)

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

llvm-svn: 286753

7 years agoBitcode: Change module reader functions to return an llvm::Expected.
Peter Collingbourne [Sun, 13 Nov 2016 07:00:17 +0000 (07:00 +0000)]
Bitcode: Change module reader functions to return an llvm::Expected.

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

llvm-svn: 286752

7 years agoAnalysis: Simplify the ScalarEvolution::getGEPExpr() interface. NFCI.
Peter Collingbourne [Sun, 13 Nov 2016 06:59:50 +0000 (06:59 +0000)]
Analysis: Simplify the ScalarEvolution::getGEPExpr() interface. NFCI.

All existing callers were manually extracting information out of an existing
GEP instruction and passing it to getGEPExpr(). Simplify the interface by
changing it to take a GEPOperator instead.

llvm-svn: 286751

7 years agoBitcode: More precise casting. NFCI.
Peter Collingbourne [Sun, 13 Nov 2016 06:59:28 +0000 (06:59 +0000)]
Bitcode: More precise casting. NFCI.

llvm-svn: 286750

7 years agoIR: Change the Type::get{Array,Vector,Pointer}ElementType() functions to perform...
Peter Collingbourne [Sun, 13 Nov 2016 06:58:45 +0000 (06:58 +0000)]
IR: Change the Type::get{Array,Vector,Pointer}ElementType() functions to perform the correct type assertion.

Previously we were only asserting that the type was a sequential type.

llvm-svn: 286749

7 years agoFix PR28366: Handle variables from enclosing local scopes more gracefully during...
Faisal Vali [Sun, 13 Nov 2016 06:09:16 +0000 (06:09 +0000)]
Fix PR28366: Handle variables from enclosing local scopes more gracefully during constant expression evaluation.

Only look for a variable's value in the constant expression evaluation activation frame, if the variable was indeed declared in that frame, otherwise it might be a constant expression and be usable within a nested local scope or emit an error.

void f(char c) {
  struct X {
    static constexpr char f() {
      return c; // error gracefully here as opposed to crashing.
    }
  };
  int I = X::f();
}

llvm-svn: 286748

7 years agoMake OptionParser::Parse() take StringRef.
Zachary Turner [Sun, 13 Nov 2016 04:24:38 +0000 (04:24 +0000)]
Make OptionParser::Parse() take StringRef.

llvm-svn: 286747

7 years ago[AVX-512] Move masked shift intrinsics tests to the autoupgrade test file. These...
Craig Topper [Sun, 13 Nov 2016 03:42:27 +0000 (03:42 +0000)]
[AVX-512] Move masked shift intrinsics tests to the autoupgrade test file. These missed being moved in r286725.

llvm-svn: 286746

7 years agoFix some use-after-frees that my last CL introduced.
Zachary Turner [Sun, 13 Nov 2016 03:36:01 +0000 (03:36 +0000)]
Fix some use-after-frees that my last CL introduced.

llvm-svn: 286745

7 years agoChange ValueObject creation functions to take StringRefs.
Zachary Turner [Sun, 13 Nov 2016 03:29:46 +0000 (03:29 +0000)]
Change ValueObject creation functions to take StringRefs.

llvm-svn: 286744

7 years agoChange IOHandlerConfirm to use StringRefs.
Zachary Turner [Sun, 13 Nov 2016 03:05:58 +0000 (03:05 +0000)]
Change IOHandlerConfirm to use StringRefs.

llvm-svn: 286743

7 years agoChange some more CommandObject functions to StringRef.
Zachary Turner [Sun, 13 Nov 2016 02:50:32 +0000 (02:50 +0000)]
Change some more CommandObject functions to StringRef.

llvm-svn: 286742

7 years ago[AMDGPU] Add f16 builtin functions (VI+)
Konstantin Zhuravlyov [Sun, 13 Nov 2016 02:37:05 +0000 (02:37 +0000)]
[AMDGPU] Add f16 builtin functions (VI+)

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

llvm-svn: 286741

7 years agoChange ArgumentHelpCallbackFunction to return a StringRef.
Zachary Turner [Sun, 13 Nov 2016 02:08:22 +0000 (02:08 +0000)]
Change ArgumentHelpCallbackFunction to return a StringRef.

llvm-svn: 286740

7 years ago[InstCombine][AVX-512] Expand vector shift handling to work on the AVX-512 shift...
Craig Topper [Sun, 13 Nov 2016 01:51:55 +0000 (01:51 +0000)]
[InstCombine][AVX-512] Expand vector shift handling to work on the AVX-512 shift by immediate and shift by single value.

This does not include support for the AVX-512 variable shifts. That will be coming in a future patch.

llvm-svn: 286739

7 years ago[AVX-512] Add returns to shift intrinsics that converted from macros in r286714.
Craig Topper [Sun, 13 Nov 2016 00:35:01 +0000 (00:35 +0000)]
[AVX-512] Add returns to shift intrinsics that converted from macros in r286714.

llvm-svn: 286738

7 years ago[x86] add smin/smax with zero tests
Sanjay Patel [Sun, 13 Nov 2016 00:32:39 +0000 (00:32 +0000)]
[x86] add smin/smax with zero tests

These are vector tests corresponding to the discussion at:
http://lists.llvm.org/pipermail/llvm-dev/2016-November/106868.html

Apart from the lack of min/max matching, the and/andn difference
shows a lack of DAG-level canonicalization.

llvm-svn: 286737

7 years agoRevert r286735 due to test failure
Brad Smith [Sun, 13 Nov 2016 00:16:21 +0000 (00:16 +0000)]
Revert r286735 due to test failure

llvm-svn: 286736

7 years agoLink static PIE programs against rcrt0.o on OpenBSD
Brad Smith [Sat, 12 Nov 2016 23:52:03 +0000 (23:52 +0000)]
Link static PIE programs against rcrt0.o on OpenBSD

Patch by Stefan Kempf.

llvm-svn: 286735

7 years ago[X86][SSE] Add test case for PR30845
Simon Pilgrim [Sat, 12 Nov 2016 23:44:58 +0000 (23:44 +0000)]
[X86][SSE] Add test case for PR30845

llvm-svn: 286734

7 years ago[AVX-512] Use scalar vfmsub/vfnmsub mask3 intrinsics instead of inverting the mask...
Craig Topper [Sat, 12 Nov 2016 23:24:34 +0000 (23:24 +0000)]
[AVX-512] Use scalar vfmsub/vfnmsub mask3 intrinsics instead of inverting the mask argument of a vfmadd intrinsic.

Summary: Inverting the mask argument does not reflect the intended semantics of the intrinsic.

Reviewers: igorb, delena

Subscribers: cfe-commits

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

llvm-svn: 286733

7 years ago[ORC] Remove the 'const' qualifier from the member function wrapper, make the
Lang Hames [Sat, 12 Nov 2016 23:12:41 +0000 (23:12 +0000)]
[ORC] Remove the 'const' qualifier from the member function wrapper, make the
lambda in wrapHandler mutable to allow it to pass the handler through as a
non-const value.

llvm-svn: 286732