platform/upstream/llvm.git
8 years ago[OpenCL] Fix bug in __builtin_astype causing invalid LLVM cast instructions
Yaxun Liu [Mon, 3 Oct 2016 14:41:50 +0000 (14:41 +0000)]
[OpenCL] Fix bug in __builtin_astype causing invalid LLVM cast instructions

__builtin_astype is used to cast OpenCL opaque types to other types, as such, it needs to be able to handle casting from and to pointer types correctly.

Current it cannot handle 1) casting between pointers of different addr spaces 2) casting between pointer type and non-pointer types.

This patch fixes that.

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

llvm-svn: 283114

8 years agoChange titie of page from Oulu to Issaquah
Marshall Clow [Mon, 3 Oct 2016 14:24:21 +0000 (14:24 +0000)]
Change titie of page from Oulu to Issaquah

llvm-svn: 283113

8 years agoList tentatively ready issues for Issaquah
Marshall Clow [Mon, 3 Oct 2016 14:23:04 +0000 (14:23 +0000)]
List tentatively ready issues for Issaquah

llvm-svn: 283112

8 years agoPrevent out of order HashDirective lexing in AsmLexer.
Nirav Dave [Mon, 3 Oct 2016 13:48:27 +0000 (13:48 +0000)]
Prevent out of order HashDirective lexing in AsmLexer.

Retrying after buildbot reset.

To lex hash directives we peek ahead to find component tokens, create a
unified token, and unlex the peeked tokens so the parser does not need
to parse the tokens then. Make sure we do not to lex another hash
directive during peek operation.

This fixes PR28921.

Reviewers: rnk, loladiro

Subscribers: llvm-commits

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

llvm-svn: 283111

8 years agoThis adds a separate file for the fp denormal regression tests. NFC.
Sjoerd Meijer [Mon, 3 Oct 2016 13:13:50 +0000 (13:13 +0000)]
This adds a separate file for the fp denormal regression tests. NFC.
I forgot to svn add the new file in my previous commit.

llvm-svn: 283110

8 years agoThis adds a separate file for the fp denormal regression tests. NFC.
Sjoerd Meijer [Mon, 3 Oct 2016 13:12:20 +0000 (13:12 +0000)]
This adds a separate file for the fp denormal regression tests. NFC.

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

llvm-svn: 283109

8 years agoAMDGPU: Fix typo
Matt Arsenault [Mon, 3 Oct 2016 13:06:58 +0000 (13:06 +0000)]
AMDGPU: Fix typo

llvm-svn: 283108

8 years agoAMDGPU: Fix missing -verify-machineinstrs in test
Matt Arsenault [Mon, 3 Oct 2016 12:58:59 +0000 (12:58 +0000)]
AMDGPU: Fix missing -verify-machineinstrs in test

llvm-svn: 283107

8 years agoWdocumentation fix
Simon Pilgrim [Mon, 3 Oct 2016 12:37:08 +0000 (12:37 +0000)]
Wdocumentation fix

llvm-svn: 283106

8 years agoFix PR 28885: Fix AST Printer output for the inherited constructor using
Alex Lorenz [Mon, 3 Oct 2016 12:22:17 +0000 (12:22 +0000)]
Fix PR 28885: Fix AST Printer output for the inherited constructor using
declarations.

This commit ensures that the correct record type is printed out for the
using declarations that represent C++ inherited constructors.
It fixes a regression introduced in r274049 which changed the name that's
stored in the using declarations that correspond to inherited constructors.

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

llvm-svn: 283105

8 years agoRevert r283102 (Typo in the phabricator link)
Alex Lorenz [Mon, 3 Oct 2016 12:17:56 +0000 (12:17 +0000)]
Revert r283102 (Typo in the phabricator link)

llvm-svn: 283104

8 years ago[X86][SSE] Add PR30371 (shuffle constant folding) test case
Simon Pilgrim [Mon, 3 Oct 2016 12:16:39 +0000 (12:16 +0000)]
[X86][SSE] Add PR30371 (shuffle constant folding) test case

llvm-svn: 283103

8 years agoFix PR 28885: Fix AST Printer output for the inherited constructor using
Alex Lorenz [Mon, 3 Oct 2016 12:12:03 +0000 (12:12 +0000)]
Fix PR 28885: Fix AST Printer output for the inherited constructor using
declarations.

This commit ensures that the correct record type is printed out for the
using declarations that represent C++ inherited constructors.
It fixes a regression introduced in r274049 which changed the name that's
stored in the using declarations that correspond to inherited constructors.

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

llvm-svn: 283102

8 years ago[ELF] - Apply clang-format. NFC.
George Rimar [Mon, 3 Oct 2016 11:13:55 +0000 (11:13 +0000)]
[ELF] - Apply clang-format. NFC.

llvm-svn: 283101

8 years ago[CMake] Fix libc++abi standalone cmake build.
Logan Chien [Mon, 3 Oct 2016 11:08:17 +0000 (11:08 +0000)]
[CMake] Fix libc++abi standalone cmake build.

The cmake files install directory has been changed to
${prefix}/lib/cmake/llvm since r259821.  Searching cmake modules in
${prefix}/share/llvm/cmake will result in fatal errors.

This commit fixes the out-of-tree build by changing the CMake module
search path to: "$(llvm-config --obj-root)/lib/cmake/llvm"

llvm-svn: 283100

8 years agoAdd new target hooks for LoadStoreVectorizer
Volkan Keles [Mon, 3 Oct 2016 10:31:34 +0000 (10:31 +0000)]
Add new target hooks for LoadStoreVectorizer

Summary: Added 6 new target hooks for the vectorizer in order to filter types, handle size constraints and decide how to split chains.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm, mzolotukhin, wdng, llvm-commits, nhaehnle

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

llvm-svn: 283099

8 years ago[ARM] Code size optimisation to lower udiv+urem to udiv+mls instead of a
Sjoerd Meijer [Mon, 3 Oct 2016 10:12:32 +0000 (10:12 +0000)]
[ARM] Code size optimisation to lower udiv+urem to udiv+mls instead of a
library call to __aeabi_uidivmod. This is an improved implementation of
r280808, see also D24133, that got reverted because isel was stuck in a loop.
That was caused by the optimisation incorrectly triggering on i64 ints, which
shouldn't happen because there is no 64bit hwdiv support; that put isel's type
legalization and this optimisation in a loop. A native ARM compiler and testing
now shows that this is fixed.

Patch mostly by Pablo Barrio.

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

llvm-svn: 283098

8 years ago[ELF] - Do not crash on invalid section alignment.
George Rimar [Mon, 3 Oct 2016 10:04:38 +0000 (10:04 +0000)]
[ELF] - Do not crash on invalid section alignment.

Case was revealed by id_000010,sig_08,src_000000,op_havoc,rep_4 from PR30540.

Out implementation uses uint32 for storing section alignment value,
what seems reasonable, though if value exceeds 32 bits bounds we have
truncation and final value of 0.

Patch fixes the issue.

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

llvm-svn: 283097

8 years ago[StaticAnalyser] Add test case to ensure that unreachable code is found.
Daniel Marjamaki [Mon, 3 Oct 2016 09:45:35 +0000 (09:45 +0000)]
[StaticAnalyser] Add test case to ensure that unreachable code is found.

https://reviews.llvm.org/D24905

llvm-svn: 283096

8 years ago[StaticAnalyzer] Fix UnreachableCode false positives.
Daniel Marjamaki [Mon, 3 Oct 2016 08:28:51 +0000 (08:28 +0000)]
[StaticAnalyzer] Fix UnreachableCode false positives.

When there is 'do { } while (0);' in the code the ExplodedGraph and UnoptimizedCFG did not match.

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

llvm-svn: 283095

8 years ago[analyzer] Improve CloneChecker diagnostics
Artem Dergachev [Mon, 3 Oct 2016 08:11:50 +0000 (08:11 +0000)]
[analyzer] Improve CloneChecker diagnostics

Highlight code clones referenced by the warning message with the help of
the extra notes feature recently introduced in r283092.

Change warning text to more clang-ish. Remove suggestions from the copy-paste
error checker diagnostics, because currently our suggestions are strictly 50%
wrong (we do not know which of the two code clones contains the error), and
for that reason we should not sound as if we're actually suggesting this.
Hopefully a better solution would bring them back.

Make sure the suspicious clone pair structure always mentions
the correct variable for the second clone.

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

llvm-svn: 283094

8 years ago[analyzer] Add extra notes to ObjCDeallocChecker
Artem Dergachev [Mon, 3 Oct 2016 08:03:51 +0000 (08:03 +0000)]
[analyzer] Add extra notes to ObjCDeallocChecker

The report is now highlighting instance variables and properties
referenced by the warning message with the help of the
extra notes feature recently introduced in r283092.

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

llvm-svn: 283093

8 years ago[analyzer] Extend bug reports with extra notes
Artem Dergachev [Mon, 3 Oct 2016 07:58:26 +0000 (07:58 +0000)]
[analyzer] Extend bug reports with extra notes

These diagnostics are separate from the path-sensitive engine's path notes,
and can be added manually on top of path-sensitive or path-insensitive reports.

The new note diagnostics would appear as note:-diagnostic on console and
as blue bubbles in scan-build. In plist files they currently do not appear,
because format needs to be discussed with plist file users.

The analyzer option "-analyzer-config notes-as-events=true" would convert
notes to normal path notes, and put them at the beginning of the path.
This is a temporary hack to show the new notes in plist files.

A few checkers would be updated in subsequent commits,
including tests for this new feature.

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

llvm-svn: 283092

8 years ago[CodeGen] Adding a test showing the current state of poor code gen of
Alexey Bataev [Mon, 3 Oct 2016 07:47:01 +0000 (07:47 +0000)]
[CodeGen] Adding a test showing the current state of poor code gen of
search loop, by Andrey Tischenko

PR27136 shows failure to hoist constant out of loop. This test is used
as start point to fix the failure: it shows the current state of codegen
and discovers what should be fixed

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

llvm-svn: 283091

8 years ago[lit] Throw in unimplemented method (NFC)
Chris Bieneman [Mon, 3 Oct 2016 04:48:22 +0000 (04:48 +0000)]
[lit] Throw in unimplemented method (NFC)

Summary:
lit's `OneCommandFileTest` class implements an abstract method that
raises if called. However, it raises by referencing an undefined
symbol. Instead, raise explicitly by throwing a `NotImplementedError`.
This is clearer, and appeases Python linters.

Patch By Brian Gesiak!

Reviewers: ddunbar, echristo, beanz

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 283090

8 years ago[lit] Remove unused imports (NFC)
Chris Bieneman [Mon, 3 Oct 2016 04:48:18 +0000 (04:48 +0000)]
[lit] Remove unused imports (NFC)

Reviewers: ddunbar, echristo, beanz

Patch by Brian Gesiak!

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 283089

8 years ago[lit] Compare to None using identity, not equality
Chris Bieneman [Mon, 3 Oct 2016 04:48:13 +0000 (04:48 +0000)]
[lit] Compare to None using identity, not equality

Summary:
In Python, `None` is a singleton, so checking whether a variable is
`None` may be done with `is` or `is not`. This has a slight advantage
over equiality comparisons `== None` and `!= None`, since `__eq__` may
be overridden in Python to produce sometimes unexpected results.

Using `is None` and `is not None` is also recommended practice in
https://www.python.org/dev/peps/pep-0008:

> Comparisons to singletons like `None` should always be done with `is` or
> `is not`, never the equality operators.

Patch by Brian Gesiak!

Reviewers: ddunbar, echristo, beanz

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 283088

8 years ago[AMDGPU] Remove unused variables from SIOptimizeExecMasking
Konstantin Zhuravlyov [Mon, 3 Oct 2016 04:43:22 +0000 (04:43 +0000)]
[AMDGPU] Remove unused variables from SIOptimizeExecMasking

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

llvm-svn: 283087

8 years ago[PowerPC] Account for the ELFv2 function prologue during branch selection
Hal Finkel [Mon, 3 Oct 2016 04:06:44 +0000 (04:06 +0000)]
[PowerPC] Account for the ELFv2 function prologue during branch selection

The PPC branch-selection pass, which performs branch relaxation, needs to
account for the padding that might be introduced to satisfy block alignment
requirements. We were assuming that the first block was at offset zero (i.e.
had the alignment of the function itself), but under the ELFv2 ABI, a global
entry function prologue is added to the first block, and it is a
two-instruction sequence (i.e. eight-bytes long). If the function has 16-byte
alignment, the fact that the first block is eight bytes offset from the start
of the function is relevant to calculating where padding will be added in
between later blocks.

Unfortunately, I don't have a small test case.

llvm-svn: 283086

8 years agoKeep the test only for Itanium abi
Aditya Kumar [Mon, 3 Oct 2016 02:36:33 +0000 (02:36 +0000)]
Keep the test only for Itanium abi

llvm-svn: 283085

8 years ago[AVX-512] Remove isCheapAsAMove flag from VMOVAPSZ128rm_NOVLX and friends.
Craig Topper [Mon, 3 Oct 2016 02:22:33 +0000 (02:22 +0000)]
[AVX-512] Remove isCheapAsAMove flag from VMOVAPSZ128rm_NOVLX and friends.

This was accidentally copy and pasted from other Pseudos in the file.

llvm-svn: 283084

8 years ago[X86] Mark all sizes of (V)MOVUPD as trivially rematerializable.
Craig Topper [Mon, 3 Oct 2016 02:00:29 +0000 (02:00 +0000)]
[X86] Mark all sizes of (V)MOVUPD as trivially rematerializable.

I don't know for sure that we truly needs this, but its the only vector load that isn't rematerializable. Making it consistent allows it to not be a special case in the td files.

llvm-svn: 283083

8 years agoFix regex in lldb lit test TestCallStopAndContinue
Tim Hammerquist [Mon, 3 Oct 2016 00:07:24 +0000 (00:07 +0000)]
Fix regex in lldb lit test TestCallStopAndContinue

https://reviews.llvm.org/D25167

llvm-svn: 283082

8 years ago[CMake] Fixing a few missing dependencies on intrinsics_gen
Chris Bieneman [Mon, 3 Oct 2016 00:03:43 +0000 (00:03 +0000)]
[CMake] Fixing a few missing dependencies on intrinsics_gen

These are missing dependencies that have been exposed in builds as a result of my change to make lldb libraries depend on CLANG_TABLEGEN_TARGETS instead of libclang.

llvm-svn: 283081

8 years ago[X86][AVX2] Add support for combining target shuffles to VPERMD/VPERMPS
Simon Pilgrim [Sun, 2 Oct 2016 21:07:58 +0000 (21:07 +0000)]
[X86][AVX2] Add support for combining target shuffles to VPERMD/VPERMPS

llvm-svn: 283080

8 years ago[SCEV] Rely on ConstantRange instead of custom logic; NFCI
Sanjoy Das [Sun, 2 Oct 2016 20:59:10 +0000 (20:59 +0000)]
[SCEV] Rely on ConstantRange instead of custom logic; NFCI

This was first landed in rL283058 and subsequenlty reverted since a
change this depends on (rL283057) was buggy and had to be reverted.

llvm-svn: 283079

8 years ago[ConstantRange] Make getEquivalentICmp smarter
Sanjoy Das [Sun, 2 Oct 2016 20:59:05 +0000 (20:59 +0000)]
[ConstantRange] Make getEquivalentICmp smarter

This change teaches getEquivalentICmp to be smarter about generating
ICMP_NE and ICMP_EQ predicates.

An earlier version of this change was landed as rL283057 which had a
use-after-free bug.  This new version has a fix for that bug, and a (C++
unittests/) test case that would have triggered it rL283057.

llvm-svn: 283078

8 years ago[X86][AVX2] Missed opportunities to combine to VPERMD/VPERMPS
Simon Pilgrim [Sun, 2 Oct 2016 20:43:02 +0000 (20:43 +0000)]
[X86][AVX2] Missed opportunities to combine to VPERMD/VPERMPS

llvm-svn: 283077

8 years ago[X86][AVX2] Fix typo in test names
Simon Pilgrim [Sun, 2 Oct 2016 19:31:58 +0000 (19:31 +0000)]
[X86][AVX2] Fix typo in test names

We are testing vpermps not vpermd

llvm-svn: 283076

8 years ago[cmake] Install 'clang-cpp' symlink
Michal Gorny [Sun, 2 Oct 2016 19:28:57 +0000 (19:28 +0000)]
[cmake] Install 'clang-cpp' symlink

Install the 'clang-cpp' symlink used to spawn the preprocessor. The code
handling this suffix is already included in Driver. FreeBSD is already
creating such a symlink in ports, and a similar one was requested
by Gentoo/FreeBSD team. The goal is to handle software that takes a C
preprocessor via a variable but does not handle passing options
correctly (i.e. 'clang -E' does not work).

Bug: https://bugs.gentoo.org/478810

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

llvm-svn: 283075

8 years agoRangify for loops.
Yaron Keren [Sun, 2 Oct 2016 19:21:41 +0000 (19:21 +0000)]
Rangify for loops.

llvm-svn: 283074

8 years ago[AVX-512] Use native IR for masked 512-bit add/sub/mul/div ps/pd intrinsics when...
Craig Topper [Sun, 2 Oct 2016 17:43:00 +0000 (17:43 +0000)]
[AVX-512] Use native IR for masked 512-bit add/sub/mul/div ps/pd intrinsics when rounding mode isn't used.

llvm-svn: 283073

8 years ago[x86] remove 'nan' strings from copysign assertions; NFC
Sanjay Patel [Sun, 2 Oct 2016 17:07:24 +0000 (17:07 +0000)]
[x86] remove 'nan' strings from copysign assertions; NFC

Preemptively scrubbing these to avoid a bot fail as in PR30443:
https://llvm.org/bugs/show_bug.cgi?id=30443

I'm nearly done with a patch to fix these cases, so not trying very
hard to do better for the temporary win.

I plan to use better checks than what the script produces for the vectorized cases.

llvm-svn: 283072

8 years ago[x86] add test to show unnecessary scalarization of copysign intrinsics (PR30433)
Sanjay Patel [Sun, 2 Oct 2016 16:31:35 +0000 (16:31 +0000)]
[x86] add test to show unnecessary scalarization of copysign intrinsics (PR30433)

llvm-svn: 283071

8 years ago[X86][AVX] Ensure broadcast loads respect dependencies
Simon Pilgrim [Sun, 2 Oct 2016 15:59:15 +0000 (15:59 +0000)]
[X86][AVX] Ensure broadcast loads respect dependencies

To allow broadcast loads of a non-zero'th vector element, lowerVectorShuffleAsBroadcast can replace a load with a new load with an adjusted address, but unfortunately we weren't ensuring that the new load respected the same dependencies.

This patch adds a TokenFactor and updates all dependencies of the old load to reference the new load instead.

Bug found during internal testing.

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

llvm-svn: 283070

8 years agoRevert "XFAIL TestSBData for gcc-4.9 i386"
Pavel Labath [Sun, 2 Oct 2016 15:56:33 +0000 (15:56 +0000)]
Revert "XFAIL TestSBData for gcc-4.9 i386"

Test fixed.

llvm-svn: 283069

8 years ago[CUDA] Allow extern __shared__ on empty-length arrays.
Justin Lebar [Sun, 2 Oct 2016 15:24:50 +0000 (15:24 +0000)]
[CUDA] Allow extern __shared__ on empty-length arrays.

"extern __shared__ int x[]" is OK.

llvm-svn: 283068

8 years ago[clang-rename] Overhaul clang-rename.el.
Kirill Bobyrev [Sun, 2 Oct 2016 14:51:33 +0000 (14:51 +0000)]
[clang-rename] Overhaul clang-rename.el.

* Use lexical binding, as recommended for new libraries.
* Fix customization variable (set correct group and type).
* Create a new customization group for the library.
* Autoload the main clang-rename command so that users don't have to explicitly load the library.
* Correctly translate between file and buffer positions using bufferpos-to-filepos (if available) or a fallback.
* Don't invoke the shell, it's not necessary and adds complexity.
* Save clang-rename output in a buffer and display that on failure.
* Save all buffers before calling clang-rename. This is required anyway and prevents data loss when the buffer is later reverted.
* In revert-buffer, use keywords instead of t for Boolean arguments to improve readability.
* Don't reset buffer modes when reverting.
* Emacs treats the character after a symbol as part of the symbol, while clang-rename doesn't; resolve this inconsistency.
* Formatting.

Patch by Philipp Stephani!

Reviewers: omtcyfz

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

llvm-svn: 283067

8 years ago[X86] Don't set i64 ADDC/ADDE/SUBC/SUBE as Custom if the target isn't 64-bit. This...
Craig Topper [Sun, 2 Oct 2016 06:13:43 +0000 (06:13 +0000)]
[X86] Don't set i64 ADDC/ADDE/SUBC/SUBE as Custom if the target isn't 64-bit. This way we don't have to catch them and do nothing with them in ReplaceNodeResults.

llvm-svn: 283066

8 years ago[X86] Fix indentation. NFC
Craig Topper [Sun, 2 Oct 2016 06:13:40 +0000 (06:13 +0000)]
[X86] Fix indentation. NFC

llvm-svn: 283065

8 years ago[coroutines] Rename driver flag -fcoroutines to -fcoroutines-ts
Gor Nishanov [Sun, 2 Oct 2016 03:31:58 +0000 (03:31 +0000)]
[coroutines] Rename driver flag -fcoroutines to -fcoroutines-ts

Summary:
Also makes -fcoroutines_ts to be both a Driver and CC1 flag.

Patch mostly by EricWF.

Reviewers: rnk, cfe-commits, rsmith, EricWF

Subscribers: mehdi_amini

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

llvm-svn: 283064

8 years agoAlias must point to a definition
Aditya Kumar [Sun, 2 Oct 2016 03:06:36 +0000 (03:06 +0000)]
Alias must point to a definition

Reapplying the patch after modifying the test case.

Inlining the destructor caused the compiler to generate bad IR which failed the Verifier in the backend.
https://llvm.org/bugs/show_bug.cgi?id=30341

This patch disables alias to available_externally definitions.

Reviewers: eugenis, rsmith

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

llvm-svn: 283063

8 years agoRevert r283057 and r283058
Sanjoy Das [Sun, 2 Oct 2016 02:40:27 +0000 (02:40 +0000)]
Revert r283057 and r283058

They've broken the sanitizer-bootstrap bots.  Reverting while I investigate.

Original commit messages:

r283057: "[ConstantRange] Make getEquivalentICmp smarter"

r283058: "[SCEV] Rely on ConstantRange instead of custom logic; NFCI"
llvm-svn: 283062

8 years ago[PowerPC] Enable soft-float for PPC64, and +soft-float -> -hard-float
Hal Finkel [Sun, 2 Oct 2016 02:10:45 +0000 (02:10 +0000)]
[PowerPC] Enable soft-float for PPC64, and +soft-float -> -hard-float

Enable soft-float support on PPC64, as the backend now supports it. Also, the
backend now uses -hard-float instead of +soft-float, so set the target features
accordingly.

Fixes PR26970.

llvm-svn: 283061

8 years ago[PowerPC] Refactor soft-float support, and enable PPC64 soft float
Hal Finkel [Sun, 2 Oct 2016 02:10:20 +0000 (02:10 +0000)]
[PowerPC] Refactor soft-float support, and enable PPC64 soft float

This change enables soft-float for PowerPC64, and also makes soft-float disable
all vector instruction sets for both 32-bit and 64-bit modes. This latter part
is necessary because the PPC backend canonicalizes many Altivec vector types to
floating-point types, and so soft-float breaks scalarization support for many
operations. Both for embedded targets and for operating-system kernels desiring
soft-float support, it seems reasonable that disabling hardware floating-point
also disables vector instructions (embedded targets without hardware floating
point support are unlikely to have Altivec, etc. and operating system kernels
desiring not to use floating-point registers to lower syscall cost are unlikely
to want to use vector registers either). If someone needs this to work, we'll
need to change the fact that we promote many Altivec operations to act on
v4f32. To make it possible to disable Altivec when soft-float is enabled,
hardware floating-point support needs to be expressed as a positive feature,
like the others, and not a negative feature, because target features cannot
have dependencies on the disabling of some other feature. So +soft-float has
now become -hard-float.

Fixes PR26970.

llvm-svn: 283060

8 years agoRemove duplicated code; NFC
Sanjoy Das [Sun, 2 Oct 2016 00:09:57 +0000 (00:09 +0000)]
Remove duplicated code; NFC

ICmpInst::makeConstantRange does exactly the same thing as
ConstantRange::makeExactICmpRegion.

llvm-svn: 283059

8 years ago[SCEV] Rely on ConstantRange instead of custom logic; NFCI
Sanjoy Das [Sun, 2 Oct 2016 00:09:52 +0000 (00:09 +0000)]
[SCEV] Rely on ConstantRange instead of custom logic; NFCI

llvm-svn: 283058

8 years ago[ConstantRange] Make getEquivalentICmp smarter
Sanjoy Das [Sun, 2 Oct 2016 00:09:49 +0000 (00:09 +0000)]
[ConstantRange] Make getEquivalentICmp smarter

This change teaches getEquivalentICmp to be smarter about generating
ICMP_NE and ICMP_EQ predicates.

llvm-svn: 283057

8 years ago[SCEV] Remove commented out code; NFC
Sanjoy Das [Sun, 2 Oct 2016 00:09:45 +0000 (00:09 +0000)]
[SCEV] Remove commented out code; NFC

llvm-svn: 283056

8 years agoCOFF: Fix short import lib import name type bitshift
Martell Malone [Sat, 1 Oct 2016 23:10:20 +0000 (23:10 +0000)]
COFF: Fix short import lib import name type bitshift

As per the PE COFF spec (section 8.3, Import Name Type)
Offset: 18 Size 2 bits Name: Type
Offset: 20 Size 3 bits Name: Name Type

Offset: 20 added based on 18+2

Partially commited as rL279069

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

llvm-svn: 283055

8 years ago[AVX-512] Check rounding mode for builtins that take one. Rounding mode should be...
Craig Topper [Sat, 1 Oct 2016 21:03:50 +0000 (21:03 +0000)]
[AVX-512] Check rounding mode for builtins that take one. Rounding mode should be either _MM_FROUND_CUR_DIRECTION or a 2-bit rounding mode ORed with _MM_FROUND_NO_EXC.

llvm-svn: 283054

8 years ago[AVX-512] Add _MM_FROUND_NO_EXC to test cases that pass a rounding mode intrinsics...
Craig Topper [Sat, 1 Oct 2016 21:03:46 +0000 (21:03 +0000)]
[AVX-512] Add _MM_FROUND_NO_EXC to test cases that pass a rounding mode intrinsics. This is preparation for a follow up commit that will check validity of rounding mode argument.

llvm-svn: 283053

8 years agoRemove some additional unnecessary std:: in cmath
Hal Finkel [Sat, 1 Oct 2016 20:38:44 +0000 (20:38 +0000)]
Remove some additional unnecessary std:: in cmath

Unlike in math.h, as Eric pointed out in the review of D18639, we don't need
the std:: in cmath.

llvm-svn: 283052

8 years agoUse __builtin_isnan/isinf/isfinite in complex
Hal Finkel [Sat, 1 Oct 2016 20:38:31 +0000 (20:38 +0000)]
Use __builtin_isnan/isinf/isfinite in complex

The libc-provided isnan/isinf/isfinite macro implementations are specifically
designed to function correctly, even in the presence of -ffast-math (or, more
specifically, -ffinite-math-only). As such, on most implementation, these
either always turn into external function calls (e.g. glibc) or are
specifically function calls when FINITE_MATH_ONLY is defined (e.g. Darwin).

Our implementation of complex arithmetic makes heavy use of isnan/isinf/isfinite
to deal with corner cases involving non-finite quantities. This was problematic
in two respects:

  1. On systems where these are always function calls (e.g. Linux/glibc), there was a
     performance penalty
  2. When compiling with -ffast-math, there was a significant performance
     penalty (in fact, on Darwin and systems with similar implementations, the code
     may in fact be slower than not using -ffast-math, because the inline
     definitions provided by libc become unavailable to prevent the checks from
     being optimized out).

Eliding these inf/nan checks in -ffast-math mode is consistent with what
happens with libstdc++, and in my experience, what users expect. This is
critical to getting high-performance code when using complex<T>. This change
replaces uses of those functions on basic floating-point types with calls to
__builtin_isnan/isinf/isfinite, which Clang will always expand inline. When
using -ffast-math (or -ffinite-math-only), the optimizer will remove the checks
as expected.

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

llvm-svn: 283051

8 years ago[X86][SSE] Cleaned up shuffle decode assertion messages
Simon Pilgrim [Sat, 1 Oct 2016 20:12:56 +0000 (20:12 +0000)]
[X86][SSE] Cleaned up shuffle decode assertion messages

llvm-svn: 283050

8 years agoisl: update to isl-0.17.1-233-gc911e6a
Tobias Grosser [Sat, 1 Oct 2016 19:46:51 +0000 (19:46 +0000)]
isl: update to isl-0.17.1-233-gc911e6a

llvm-svn: 283049

8 years ago[SLPVectorizer][X86] Added fptosi/fptoui tests
Simon Pilgrim [Sat, 1 Oct 2016 19:35:59 +0000 (19:35 +0000)]
[SLPVectorizer][X86] Added fptosi/fptoui tests

llvm-svn: 283048

8 years ago[CostModel][X86] Added tests for current fptosi/fptoui costs
Simon Pilgrim [Sat, 1 Oct 2016 19:09:59 +0000 (19:09 +0000)]
[CostModel][X86] Added tests for current fptosi/fptoui costs

llvm-svn: 283047

8 years ago[SLPVectorizer][X86] Added fcopysign tests
Simon Pilgrim [Sat, 1 Oct 2016 17:00:26 +0000 (17:00 +0000)]
[SLPVectorizer][X86] Added fcopysign tests

llvm-svn: 283046

8 years ago[SLPVectorizer][X86] Added fabs tests
Simon Pilgrim [Sat, 1 Oct 2016 16:54:01 +0000 (16:54 +0000)]
[SLPVectorizer][X86] Added fabs tests

llvm-svn: 283045

8 years ago[CostModel][X86] Added fcopysign costs
Simon Pilgrim [Sat, 1 Oct 2016 16:41:52 +0000 (16:41 +0000)]
[CostModel][X86] Added fcopysign costs

llvm-svn: 283044

8 years agoUse StringRef for MemoryBuffer identifier API (NFC)
Mehdi Amini [Sat, 1 Oct 2016 16:38:28 +0000 (16:38 +0000)]
Use StringRef for MemoryBuffer identifier API (NFC)

llvm-svn: 283043

8 years ago[CostModel][X86] Added fabs costs
Simon Pilgrim [Sat, 1 Oct 2016 16:30:13 +0000 (16:30 +0000)]
[CostModel][X86] Added fabs costs

llvm-svn: 283042

8 years agoFix signed/unsigned warning
Simon Pilgrim [Sat, 1 Oct 2016 16:14:57 +0000 (16:14 +0000)]
Fix signed/unsigned warning

llvm-svn: 283041

8 years ago[X86][SSE] Add support for combining target shuffles to binary BLEND
Simon Pilgrim [Sat, 1 Oct 2016 16:04:28 +0000 (16:04 +0000)]
[X86][SSE] Add support for combining target shuffles to binary BLEND

We already had support for 1-input BLEND with zero - this adds support for 2-input BLEND as well.

llvm-svn: 283040

8 years agoUse StringRef in Registry API (NFC)
Mehdi Amini [Sat, 1 Oct 2016 15:44:54 +0000 (15:44 +0000)]
Use StringRef in Registry API (NFC)

llvm-svn: 283039

8 years ago[X86][SSE] Always combine target shuffles to MOVSD/MOVSS
Simon Pilgrim [Sat, 1 Oct 2016 15:33:01 +0000 (15:33 +0000)]
[X86][SSE] Always combine target shuffles to MOVSD/MOVSS

Now we can commute to BLENDPD/BLENDPS on SSE41+ targets if necessary, so simplify the combine matching where we can.

This required me to add a couple of scalar math movsd/moss fold patterns that hadn't been needed in the past.

llvm-svn: 283038

8 years ago[X86][SSE] Enable commutation from MOVSD/MOVSS to BLENDPD/BLENDPS on SSE41+ targets
Simon Pilgrim [Sat, 1 Oct 2016 14:26:11 +0000 (14:26 +0000)]
[X86][SSE] Enable commutation from MOVSD/MOVSS to BLENDPD/BLENDPS on SSE41+ targets

Instead of selecting between MOVSD/MOVSS and BLENDPD/BLENDPS at shuffle lowering by subtarget this will help us select the instruction based on actual commutation requirements.

We could possibly add BLENDPD/BLENDPS -> MOVSD/MOVSS commutation and MOVSD/MOVSS memory folding using a similar approach if it proves useful

I avoided adding AVX512 handling as I'm not sure when we should be making use of VBLENDPD/VBLENDPS on EVEX targets

llvm-svn: 283037

8 years agoRevert r283029 - [cmake] Make LIT_COMMAND configurable and improve fallback support
Michal Gorny [Sat, 1 Oct 2016 13:15:56 +0000 (13:15 +0000)]
Revert r283029 - [cmake] Make LIT_COMMAND configurable and improve fallback support

Revert the change in r283029 (and the fixup in r283033) due to buildbot
breakage. The fixup is ineffective for the bots that do not force clean
build since the wrong value is already cached in CMakeCache.txt.

Reverting it should result in the cache variable being removed
and therefore it should be possible to re-introduce it after all
buildbots build this revision.

llvm-svn: 283036

8 years ago[X86][SSE] Regenerate vselect tests and improve AVX1/AVX2 coverage
Simon Pilgrim [Sat, 1 Oct 2016 13:10:14 +0000 (13:10 +0000)]
[X86][SSE] Regenerate vselect tests and improve AVX1/AVX2 coverage

llvm-svn: 283035

8 years agoRevert "[MC] Prevent out of order HashDirective lexing in AsmLexer."
Nirav Dave [Sat, 1 Oct 2016 10:57:55 +0000 (10:57 +0000)]
Revert "[MC] Prevent out of order HashDirective lexing in AsmLexer."

This reverts commit r282992 which appears to be causing an LTO test failure.

llvm-svn: 283034

8 years ago[cmake] Fix incorrect default for LIT_COMMAND, from r283029
Michal Gorny [Sat, 1 Oct 2016 10:56:58 +0000 (10:56 +0000)]
[cmake] Fix incorrect default for LIT_COMMAND, from r283029

llvm-svn: 283033

8 years agoRemove all instances of _LIBCPP_HAS_NO_RVALUE_REFERENCES from test/std/utilities
Eric Fiselier [Sat, 1 Oct 2016 10:46:01 +0000 (10:46 +0000)]
Remove all instances of _LIBCPP_HAS_NO_RVALUE_REFERENCES from test/std/utilities

llvm-svn: 283032

8 years ago[lldb-mi] Fix prompt which can get inserted in the middle of program output in lldb-mi
Dawn Perchik [Sat, 1 Oct 2016 10:37:56 +0000 (10:37 +0000)]
[lldb-mi] Fix prompt which can get inserted in the middle of program output in lldb-mi

Summary: The code added in svn r264332 causes "(lldb) " to be printed in the
middle of program console output. This fix restores the behavior for non-Windows
platforms to before the patch.

Reviewers: ted, zturner, clayborg
Subscribers: amccarth, lldb-commits
Differential Revision: http://reviews.llvm.org/D25137

llvm-svn: 283031

8 years agoReplace test_throw.h header with a single test macro
Eric Fiselier [Sat, 1 Oct 2016 10:34:13 +0000 (10:34 +0000)]
Replace test_throw.h header with a single test macro

llvm-svn: 283030

8 years ago[cmake] Make LIT_COMMAND configurable and improve fallback support
Michal Gorny [Sat, 1 Oct 2016 09:28:05 +0000 (09:28 +0000)]
[cmake] Make LIT_COMMAND configurable and improve fallback support

Make LIT_COMMAND configurable, use source tree only when actually
available and extend the default search to other common executable names
'lit.py' and 'lit', in order to increase uniformity between all LLVM
projects and support using installed lit.

Changing the conditional used to determine whether in-tree or external
lit is being used covers the case when LLVM_MAIN_SRC_DIR is defined but
does not exist (anymore). In this case, the functions falls back to
looking for installed lit rather than attempting to use a non-existing
path. The same conditional is used in clang already.

Making LIT_COMMAND a cache variable in case the source tree variant is
used serves two purposes. Firstly, it increases uniformity between
the two branches since find_program() implicitly makes LIT_COMMAND
a cache variable. Secondly, it allows overriding the lit executable used
to run the tests when the LLVM source tree is provided. Gentoo is
planning to use this to use installed (and byte-compiled) lit instead of
re-compiling it in every LLVM project.

Extending default search is meant to increase uniformity between
different LLVM projects. The 'lit.py' name is already used by a few of
them, and 'lit' is the name used by utils/lit/setup.py when installing.

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

llvm-svn: 283029

8 years ago[OCaml] Install .mli (interface) files
Michal Gorny [Sat, 1 Oct 2016 09:26:23 +0000 (09:26 +0000)]
[OCaml] Install .mli (interface) files

Install the OCaml interface .mli files. Those files were most likely
omitted because they are input files for the compiled .cmi files.
However, installing them is reasonable since -- unlike .cmi files --
they are human-readable.

The issue was originally spotted by @jpdeplaix.

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

llvm-svn: 283028

8 years agoSplit a comment into generic description and note about the specific
Joerg Sonnenberger [Sat, 1 Oct 2016 08:05:50 +0000 (08:05 +0000)]
Split a comment into generic description and note about the specific
cmake use.

llvm-svn: 283027

8 years agoRetire LLVM_BINDIR and friends. They haven't been provided with actual
Joerg Sonnenberger [Sat, 1 Oct 2016 08:03:55 +0000 (08:03 +0000)]
Retire LLVM_BINDIR and friends. They haven't been provided with actual
values since the switch to cmake.

llvm-svn: 283026

8 years ago[libFuzzer] add fuzzer test for libxml2, finds https://bugzilla.gnome.org/show_bug...
Kostya Serebryany [Sat, 1 Oct 2016 07:37:40 +0000 (07:37 +0000)]
[libFuzzer] add fuzzer test for libxml2, finds https://bugzilla.gnome.org/show_bug.cgi?id=751631

llvm-svn: 283024

8 years agoGC HAVE_STRTOQ
Joerg Sonnenberger [Sat, 1 Oct 2016 07:35:08 +0000 (07:35 +0000)]
GC HAVE_STRTOQ

llvm-svn: 283023

8 years agoRetire bugpoint's -R. hack.
Joerg Sonnenberger [Sat, 1 Oct 2016 07:34:18 +0000 (07:34 +0000)]
Retire bugpoint's -R. hack.

It got disconnected during the cmake conversion. For Miscompilation.cpp,
it was purely advisory for the user and the ToolRunner.cpp version was
trying to compensate for libs and bins in the same directory, which
hasn't been the case for a very long time.

llvm-svn: 283022

8 years ago[libFuzzer] fix a recent bugs (buffer overflow)
Kostya Serebryany [Sat, 1 Oct 2016 07:13:25 +0000 (07:13 +0000)]
[libFuzzer] fix a recent bugs (buffer overflow)

llvm-svn: 283021

8 years ago[X86] Cleanup patterns for using VMOVDDUP for broadcasts.
Craig Topper [Sat, 1 Oct 2016 07:11:24 +0000 (07:11 +0000)]
[X86] Cleanup patterns for using VMOVDDUP for broadcasts.

-Remove OptForSize. Not all of the backend follows the same rules for creating broadcasts and there is no conflicting pattern.
-Don't stop selecting VEX VMOVDDUP when AVX512 is supported. We need VLX for EVEX VMOVDDUP.
-Only use VMOVDDUP for v2i64 broadcasts if AVX2 is not supported.

llvm-svn: 283020

8 years agoRevert "Use StringRef instead of raw pointer in TargetRegistry API (NFC)"
Mehdi Amini [Sat, 1 Oct 2016 07:08:23 +0000 (07:08 +0000)]
Revert "Use StringRef instead of raw pointer in TargetRegistry API (NFC)"

This reverts commit r283017. Creates an infinite loop somehow.

llvm-svn: 283019

8 years agoUse StringRef instead of raw pointers in MCAsmInfo/MCInstrInfo APIs (NFC)
Mehdi Amini [Sat, 1 Oct 2016 06:46:33 +0000 (06:46 +0000)]
Use StringRef instead of raw pointers in MCAsmInfo/MCInstrInfo APIs (NFC)

llvm-svn: 283018

8 years agoUse StringRef instead of raw pointer in TargetRegistry API (NFC)
Mehdi Amini [Sat, 1 Oct 2016 06:25:30 +0000 (06:25 +0000)]
Use StringRef instead of raw pointer in TargetRegistry API (NFC)

llvm-svn: 283017

8 years agoUse StringRef instead of raw pointer in ExecutionEngine
Mehdi Amini [Sat, 1 Oct 2016 06:22:04 +0000 (06:22 +0000)]
Use StringRef instead of raw pointer in ExecutionEngine

llvm-svn: 283016

8 years ago[AVX-512] Add EVEX versions of VPBROADCASTW patterns with truncated i32 loads.
Craig Topper [Sat, 1 Oct 2016 06:01:23 +0000 (06:01 +0000)]
[AVX-512] Add EVEX versions of VPBROADCASTW patterns with truncated i32 loads.

llvm-svn: 283015

8 years ago[AVX-512] Add VLX command lines to 128 and 256-bit shufffle tests.
Craig Topper [Sat, 1 Oct 2016 06:01:18 +0000 (06:01 +0000)]
[AVX-512] Add VLX command lines to 128 and 256-bit shufffle tests.

llvm-svn: 283014