platform/upstream/llvm.git
7 years ago[unittests] Remove a redundant test fixture (NFC)
Vedant Kumar [Thu, 13 Oct 2016 17:22:44 +0000 (17:22 +0000)]
[unittests] Remove a redundant test fixture (NFC)

llvm-svn: 284135

7 years ago[X86][AVX512] Fix sext v32i1 -> v32i8 lowering.
Igor Breger [Thu, 13 Oct 2016 17:20:38 +0000 (17:20 +0000)]
[X86][AVX512] Fix sext v32i1 -> v32i8 lowering.
Fix PR30600.

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

llvm-svn: 284134

7 years agoAdd more 64bit swiftcall convention tests
Arnold Schwaighofer [Thu, 13 Oct 2016 17:17:36 +0000 (17:17 +0000)]
Add more 64bit swiftcall convention tests

llvm-svn: 284133

7 years ago[libFuzzer] reapply r283946: refactoring to speed things up, NFC. Now with a fix...
Kostya Serebryany [Thu, 13 Oct 2016 16:19:09 +0000 (16:19 +0000)]
[libFuzzer] reapply r283946: refactoring to speed things up, NFC. Now with a fix for gcc build

llvm-svn: 284132

7 years agoImplement MS _ReturnAddress and _AddressOfReturnAddress intrinsics
Albert Gutowski [Thu, 13 Oct 2016 16:03:42 +0000 (16:03 +0000)]
Implement MS _ReturnAddress and _AddressOfReturnAddress intrinsics

Reviewers: rnk, thakis, majnemer, hans

Subscribers: cfe-commits

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

llvm-svn: 284131

7 years agoFix for PR30687. Avoid dereferencing MBB.end().
Reid Kleckner [Thu, 13 Oct 2016 15:48:48 +0000 (15:48 +0000)]
Fix for PR30687. Avoid dereferencing MBB.end().

We don't need to return a MachineInstr* from these stack probe insertion
calls anyway. If we ever need to add it back, we can return an iterator
instead.

Based on a patch by David Kreitzer

This bug is a consequence of

r279314 | dexonsmith | 2016-08-19 13:40:12 -0700 (Fri, 19 Aug 2016) | 110 lines

We hit the "Assertion `!NodePtr->isKnownSentinel()' failed" assertion,
but only when inserting a stack probe call at the end of an MBB, which
isn't necessarily a common situation.

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

llvm-svn: 284130

7 years agoDo not delete leading ../ in remove_dots.
Eric Liu [Thu, 13 Oct 2016 15:07:14 +0000 (15:07 +0000)]
Do not delete leading ../ in remove_dots.

Reviewers: bkramer

Subscribers: llvm-commits

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

llvm-svn: 284129

7 years ago[libcxxabi] Refactor pthread usage into a separate API
Asiri Rathnayake [Thu, 13 Oct 2016 15:05:19 +0000 (15:05 +0000)]
[libcxxabi] Refactor pthread usage into a separate API

This patch refactors all pthread uses of libc++abi into a separate API. This
is the first step towards supporting an externlly-threaded libc++abi library.

I've followed the conventions already used in the libc++ library for the same
purpose.

Patch from: Saleem Abdulrasool and Asiri Rathnayake

Reviewed by: compnerd, EricWF

Differential revisions:
  https://reviews.llvm.org/D18482 (original)
  https://reviews.llvm.org/D24864 (final)

llvm-svn: 284128

7 years ago[ARM]: Assign cost of scaling used in addressing mode for ARM cores
Javed Absar [Thu, 13 Oct 2016 14:57:43 +0000 (14:57 +0000)]
[ARM]: Assign cost of scaling used in addressing mode for ARM cores

This patch assigns cost of the scaling used in addressing.
On many ARM cores, a negated register offset takes longer than a
non-negated register offset, in a register-offset addressing mode.

For instance:

LDR R0, [R1, R2 LSL #2]
LDR R0, [R1, -R2 LSL #2]

Above, (1) takes less cycles than (2).

By assigning appropriate scaling factor cost, we enable the LLVM
to make the right trade-offs in the optimization and code-selection phase.

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

Reviewers: jmolloy, rengolin
llvm-svn: 284127

7 years ago[LV] Account for predicated stores in instruction costs
Matthew Simpson [Thu, 13 Oct 2016 14:54:31 +0000 (14:54 +0000)]
[LV] Account for predicated stores in instruction costs

This patch ensures that we scale the estimated cost of predicated stores by
block probability. This is a follow-on patch for r284123.

llvm-svn: 284126

7 years ago[libunwind] Add missing <stdint.h> include. NFC.
Asiri Rathnayake [Thu, 13 Oct 2016 14:32:24 +0000 (14:32 +0000)]
[libunwind] Add missing <stdint.h> include. NFC.

This missing include seems to cause compilation failures on older MacOS
versions (< 10.9). This is because r270692 has introduced uint64_t into
config.h without including this header.

Patch from: Jeremy Huddleston Sequoia (jeremyhu@apple.com)

llvm-svn: 284125

7 years ago[x86] add negate-i1 run for 32-bit target
Sanjay Patel [Thu, 13 Oct 2016 14:27:08 +0000 (14:27 +0000)]
[x86] add negate-i1 run for 32-bit target

llvm-svn: 284124

7 years ago[LV] Avoid rounding errors for predicated instruction costs
Matthew Simpson [Thu, 13 Oct 2016 14:19:48 +0000 (14:19 +0000)]
[LV] Avoid rounding errors for predicated instruction costs

This patch modifies the cost calculation of predicated instructions (div and
rem) to avoid the accumulation of rounding errors due to multiple truncating
integer divisions. The calculation for predicated stores will be addressed in a
follow-on patch since we currently don't scale the cost of predicated stores by
block probability.

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

llvm-svn: 284123

7 years ago[DAGCombiner] Add vector support to (mul (shl X, Y), Z) -> (shl (mul X, Z), Y) style...
Simon Pilgrim [Thu, 13 Oct 2016 14:04:35 +0000 (14:04 +0000)]
[DAGCombiner] Add vector support to (mul (shl X, Y), Z) -> (shl (mul X, Z), Y) style combines

llvm-svn: 284122

7 years agoGuard flag –fdenormal-fp-math with –fno-fast-math.
Sjoerd Meijer [Thu, 13 Oct 2016 13:22:01 +0000 (13:22 +0000)]
Guard flag –fdenormal-fp-math with –fno-fast-math.
This allows disabling the FP options with just one flag (-fno-fast-math).

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

llvm-svn: 284121

7 years agoAdd missing include in test; NFC. Thanks to Jonathan Wakely for the report.
Marshall Clow [Thu, 13 Oct 2016 13:21:38 +0000 (13:21 +0000)]
Add missing include in test; NFC. Thanks to Jonathan Wakely for the report.

llvm-svn: 284120

7 years agoAMDGPU: Assume spilling will occur at -O0
Matt Arsenault [Thu, 13 Oct 2016 13:10:00 +0000 (13:10 +0000)]
AMDGPU: Assume spilling will occur at -O0

Because everything live is spilled at the end of a
block by fast regalloc, assume this will happen and
avoid the copies of the resource descriptor.

llvm-svn: 284119

7 years agoCopy+pasts typo in comment describing combine test
Simon Pilgrim [Thu, 13 Oct 2016 12:54:32 +0000 (12:54 +0000)]
Copy+pasts typo in comment describing combine test

Repeated the "fold (mul x, 0) -> 0" instead of "fold (mul x, 1) -> x"

llvm-svn: 284118

7 years ago[DAGCombiner] Add vector support to C2-(A+C1) -> (C2-C1)-A folding
Simon Pilgrim [Thu, 13 Oct 2016 12:49:31 +0000 (12:49 +0000)]
[DAGCombiner] Add vector support to C2-(A+C1) -> (C2-C1)-A folding

llvm-svn: 284117

7 years agoAMDGPU: Fix truncate to bool warnings
Matt Arsenault [Thu, 13 Oct 2016 12:45:16 +0000 (12:45 +0000)]
AMDGPU: Fix truncate to bool warnings

llvm-svn: 284116

7 years ago[mips] Add IAS support for dvp, evp
Simon Dardis [Thu, 13 Oct 2016 12:12:56 +0000 (12:12 +0000)]
[mips] Add IAS support for dvp, evp

These instructions were only defined for microMIPSR6 previously. Add
definitions for MIPSR6, correct definitions for microMIPSR6, flag these
instructions as having unmodelled side effects (they disable/enable
virtual processors) and add missing disassember tests for microMIPSR6.

Reviewers: vkalintiris

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

llvm-svn: 284115

7 years ago[lldb] Improve identification of Linux core dumps. Fix for bug #30485.
Richard Chamberlain [Thu, 13 Oct 2016 12:11:00 +0000 (12:11 +0000)]
[lldb] Improve identification of Linux core dumps. Fix for bug #30485.

Summary:
ObjectFileELF::RefineModuleDetailsFromNote() identifies Linux core dumps by searching for
 library paths starting with /lib/x86_64-linux-gnu or /lib/i386-linux-gnu. This change widens the
test to allow for linux installations which have addition directories in the path.

Reviewers: ted, hhellyer, clayborg

Subscribers: lldb-commits

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

llvm-svn: 284114

7 years ago[DAGCombiner] Add vector support to (sub -1, x) -> (xor x, -1) canonicalization
Simon Pilgrim [Thu, 13 Oct 2016 12:05:20 +0000 (12:05 +0000)]
[DAGCombiner] Add vector support to (sub -1, x) -> (xor x, -1) canonicalization

Improves commutation potential

llvm-svn: 284113

7 years ago[analyzer] Link libStaticAnalyzerCheckers to libASTMatchers.
Artem Dergachev [Thu, 13 Oct 2016 11:41:12 +0000 (11:41 +0000)]
[analyzer] Link libStaticAnalyzerCheckers to libASTMatchers.

AST matchers are useful for the analyzer's checkers.
More patches on particular checkers shall follow.

This is the first time clang binary gets linked to ASTMatchers.
The binary size increase for the clang executable would be
+0.5% in release mode, +2% in debug mode.

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

llvm-svn: 284112

7 years ago[clang-move] Better support enclosing class.
Haojian Wu [Thu, 13 Oct 2016 10:31:00 +0000 (10:31 +0000)]
[clang-move] Better support enclosing class.

Summary:
* When moving an outermost enclosing class, all its nested classes should also
  be moved together.
* Add a test for not moving nested class.

Reviewers: ioeric

Subscribers: cfe-commits

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

llvm-svn: 284111

7 years agoFix for PR30639: CGDebugInfo Null dereference with OpenMP array
Alexey Bataev [Thu, 13 Oct 2016 09:52:46 +0000 (09:52 +0000)]
Fix for PR30639: CGDebugInfo Null dereference with OpenMP array
access, by Erich Keane

OpenMP creates a variable array type with a a null size-expr. The Debug
generation failed to due to this. This patch corrects the openmp
implementation, updates the tests, and adds a new one for this
condition.

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

llvm-svn: 284110

7 years agoRecommit r283538 "[clang-move] Support moving multiple classes in one run."
Haojian Wu [Thu, 13 Oct 2016 08:48:42 +0000 (08:48 +0000)]
Recommit r283538 "[clang-move] Support moving multiple classes in one run."

llvm-svn: 284109

7 years ago[X86] Basic additions to support RegCall Calling Convention.
Oren Ben Simhon [Thu, 13 Oct 2016 07:53:43 +0000 (07:53 +0000)]
[X86] Basic additions to support RegCall Calling Convention.

The Register Calling Convention (RegCall) was introduced by Intel to optimize parameter transfer on function call.
This calling convention ensures that as many values as possible are passed or returned in registers.
This commit presents the basic additions to LLVM CodeGen in order to support RegCall in X86.

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

llvm-svn: 284108

7 years agoSilence unused warning in non-assert builds.
Daniel Jasper [Thu, 13 Oct 2016 06:39:44 +0000 (06:39 +0000)]
Silence unused warning in non-assert builds.

llvm-svn: 284107

7 years ago[AVX-512] Fix v16i32 zero extending shuffle test case so it's really zero extend.
Craig Topper [Thu, 13 Oct 2016 05:41:01 +0000 (05:41 +0000)]
[AVX-512] Fix v16i32 zero extending shuffle test case so it's really zero extend.

llvm-svn: 284106

7 years ago[AVX-512] Teach shuffle lowering to recognize 512-bit zero extends.
Craig Topper [Thu, 13 Oct 2016 05:29:41 +0000 (05:29 +0000)]
[AVX-512] Teach shuffle lowering to recognize 512-bit zero extends.

llvm-svn: 284105

7 years ago[AVX-512] Add tests for basic 512-bit zero extending shuffle patterns. Code will...
Craig Topper [Thu, 13 Oct 2016 05:29:37 +0000 (05:29 +0000)]
[AVX-512] Add tests for basic 512-bit zero extending shuffle patterns. Code will be improved in a future commit.

llvm-svn: 284104

7 years agoRemove a FIXME that I forgot about. NFC.
Diana Picus [Thu, 13 Oct 2016 05:28:55 +0000 (05:28 +0000)]
Remove a FIXME that I forgot about. NFC.

Sorry about the noise.

llvm-svn: 284103

7 years ago[X86] Simplify the lowering code for extracting and inserting subvectors.
Craig Topper [Thu, 13 Oct 2016 04:14:47 +0000 (04:14 +0000)]
[X86] Simplify the lowering code for extracting and inserting subvectors.

We don't need to check if AVX is enabled. It's implied by the operation action being set to Custom.
We don't need to check both the input and output type widths. We only need to check the type that's being inserted or extracted. The other type is known to be a legal type and we can assume its a different width.

llvm-svn: 284102

7 years agoRevert r282345 - Use __attribute__((internal_linkage)) when available.
Eric Fiselier [Thu, 13 Oct 2016 04:07:58 +0000 (04:07 +0000)]
Revert r282345 - Use __attribute__((internal_linkage)) when available.

llvm-svn: 284101

7 years agoFix Python binding generation build step on Windows
Vadim Macagon [Thu, 13 Oct 2016 04:07:22 +0000 (04:07 +0000)]
Fix Python binding generation build step on Windows

Summary:
If Python is installed to a location that contains spaces
(e.g. "C:\Program Files\Python3") then the build fails while attempting
to run the modify-python-lldb.py script because the path to the Python
executable is not double-quoted before being passed to the shell. The
fix consists of letting Python handle the formatting of the command
line, since subprocess.Popen() is perfectly capable of handling paths
containing spaces if it's given the command and arguments as a list
instead of a single pre-formatted string.

Reviewers: zturner, clayborg

Subscribers: lldb-commits

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

llvm-svn: 284100

7 years agoMemory-SSA: strengthen defClobbersUseOrDef interface
Sebastian Pop [Thu, 13 Oct 2016 03:23:33 +0000 (03:23 +0000)]
Memory-SSA: strengthen defClobbersUseOrDef interface

As Danny pointed out, defClobbersUseOrDef should use MemoryLocOrCall to make
sure fences are properly handled.

llvm-svn: 284099

7 years agocommit back "GVN-hoist: fix store past load dependence analysis (PR30216, PR30499)"
Sebastian Pop [Thu, 13 Oct 2016 01:39:10 +0000 (01:39 +0000)]
commit back "GVN-hoist: fix store past load dependence analysis (PR30216, PR30499)"

This is with an extra change to avoid calling MemoryLocation::get() on a call instruction.

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

llvm-svn: 284098

7 years ago[AArch64][RegisterBankInfo] Provide alternative mappings for 64-bit load
Quentin Colombet [Thu, 13 Oct 2016 01:01:23 +0000 (01:01 +0000)]
[AArch64][RegisterBankInfo] Provide alternative mappings for 64-bit load

This allows RegBankSelect in greedy mode to get rid some of the cross
register bank copies when loads are involved in the chain of
computation.

llvm-svn: 284097

7 years agoCorrect PrivateLinkage for COFF
Reid Kleckner [Thu, 13 Oct 2016 00:55:24 +0000 (00:55 +0000)]
Correct PrivateLinkage for COFF

- Use storage class C_STAT for 'PrivateLinkage' The storage class for
  PrivateLinkage should equal to the Internal Linkage.

- Set 'PrivateGlobalPrefix' from "L" to ".L" for MM_WinCOFF (includes
  x86_64) MM_WinCOFF has empty GlobalPrefix '\0' so PrivateGlobalPrefix
  "L" may conflict to the normal symbol name starting with 'L'.

Based on a patch by Han Sangjin! Manually updated test cases.

llvm-svn: 284096

7 years agoAdd "opt" to the list of test dependencies.
Peter Collingbourne [Thu, 13 Oct 2016 00:49:21 +0000 (00:49 +0000)]
Add "opt" to the list of test dependencies.

We've started using it in the ThinLTO tests.

Also remove a repeated dependency on llvm-nm.

llvm-svn: 284095

7 years ago[AArch64][RegisterBankInfo] Provide alternative mappings for G_BITCASTs.
Quentin Colombet [Thu, 13 Oct 2016 00:34:48 +0000 (00:34 +0000)]
[AArch64][RegisterBankInfo] Provide alternative mappings for G_BITCASTs.

Thanks to this patch, RegBankSelect is able to get rid of some register
bank copies as demonstrated in the test case.

llvm-svn: 284094

7 years agoRevert "GVN-hoist: fix store past load dependence analysis (PR30216, PR30499)"
Reid Kleckner [Thu, 13 Oct 2016 00:18:26 +0000 (00:18 +0000)]
Revert "GVN-hoist: fix store past load dependence analysis (PR30216, PR30499)"

This CL didn't actually address the test case in PR30499, and clang
still crashes.

Also revert dependent change "Memory-SSA cleanup of clobbers interface, NFC"

Reverts r283965 and r283967.

llvm-svn: 284093

7 years agoMove a utility function to Strings.cpp.
Rui Ueyama [Thu, 13 Oct 2016 00:13:15 +0000 (00:13 +0000)]
Move a utility function to Strings.cpp.

So that we can use the function from anywhere.

llvm-svn: 284092

7 years ago[AArch64][RegisterBankInfo] Describe cross regbank copies statically.
Quentin Colombet [Thu, 13 Oct 2016 00:12:06 +0000 (00:12 +0000)]
[AArch64][RegisterBankInfo] Describe cross regbank copies statically.

NFC.

llvm-svn: 284091

7 years ago[AArch64][RegisterBankInfo] Use static mapping for same bank G_BITCAST.
Quentin Colombet [Thu, 13 Oct 2016 00:12:04 +0000 (00:12 +0000)]
[AArch64][RegisterBankInfo] Use static mapping for same bank G_BITCAST.

NFC.

llvm-svn: 284090

7 years ago[AArch64][MachineLegalizer] Mark more G_BITCAST as legal.
Quentin Colombet [Thu, 13 Oct 2016 00:12:01 +0000 (00:12 +0000)]
[AArch64][MachineLegalizer] Mark more G_BITCAST as legal.

Basically any vector types that fits in a 32-bit register is also valid
as far as copies are concerned.

llvm-svn: 284089

7 years ago[AArch64][RegisterBankInfo] Bump the cost of vector loads.
Quentin Colombet [Thu, 13 Oct 2016 00:11:59 +0000 (00:11 +0000)]
[AArch64][RegisterBankInfo] Bump the cost of vector loads.

This does not change anything yet, because we do not offer any
alternative mapping.

llvm-svn: 284088

7 years ago[AArch64][RegisterBankInfo] Use a proper cost for cross regbank G_BITCASTs.
Quentin Colombet [Thu, 13 Oct 2016 00:11:57 +0000 (00:11 +0000)]
[AArch64][RegisterBankInfo] Use a proper cost for cross regbank G_BITCASTs.

This does not change anything yet, because we do not offer any
alternative mapping.

llvm-svn: 284087

7 years ago[AArch64][RegisterBankInfo] Provide more realistic copy costs.
Quentin Colombet [Thu, 13 Oct 2016 00:11:55 +0000 (00:11 +0000)]
[AArch64][RegisterBankInfo] Provide more realistic copy costs.

llvm-svn: 284086

7 years agofix function label name in addressofreturnaddress test
Albert Gutowski [Wed, 12 Oct 2016 23:58:45 +0000 (23:58 +0000)]
fix function label name in addressofreturnaddress test

llvm-svn: 284085

7 years ago[analyzer] DeallocChecker: Don't warn about directly-set IBOutlet ivars on macOS
Devin Coughlin [Wed, 12 Oct 2016 23:57:05 +0000 (23:57 +0000)]
[analyzer] DeallocChecker: Don't warn about directly-set IBOutlet ivars on macOS

On macOS (but not iOS), if an ObjC property has no setter, the nib-loading code
for an IBOutlet is documented as directly setting the backing ivar without
retaining the value -- even if the property is 'retain'.

This resulted in false positives from the DeallocChecker for code that did not
release such ivars in -dealloc.

To avoid these false positives, treat IBOutlet ivars that back a property
without a setter as having an unknown release requirement in macOS.

rdar://problem/28507353

llvm-svn: 284084

7 years agofix ms-intrinsics labels code to work with builds with assertions
Albert Gutowski [Wed, 12 Oct 2016 23:52:38 +0000 (23:52 +0000)]
fix ms-intrinsics labels code to work with builds with assertions

llvm-svn: 284083

7 years ago[GitHubMove Doc] Properly nest a subsection in the proposal
Mehdi Amini [Wed, 12 Oct 2016 23:36:11 +0000 (23:36 +0000)]
[GitHubMove Doc] Properly nest a subsection in the proposal

llvm-svn: 284082

7 years agoRevert r284008. This is us to fail to instantiate static data members in some
Richard Smith [Wed, 12 Oct 2016 23:29:02 +0000 (23:29 +0000)]
Revert r284008. This is us to fail to instantiate static data members in some
cases. I'm working on reducing a testcase.

llvm-svn: 284081

7 years ago[NFC] Fixing the description for _mm_store_ps and _mm_store_ps1.
Yunzhong Gao [Wed, 12 Oct 2016 23:27:27 +0000 (23:27 +0000)]
[NFC] Fixing the description for _mm_store_ps and _mm_store_ps1.

It seems that the doxygen description of these two intrinsics were swapped by
mistake.

llvm-svn: 284080

7 years agoFix variable name. NFC.
Rui Ueyama [Wed, 12 Oct 2016 23:22:59 +0000 (23:22 +0000)]
Fix variable name. NFC.

llvm-svn: 284079

7 years agofix title underline length
Albert Gutowski [Wed, 12 Oct 2016 23:10:02 +0000 (23:10 +0000)]
fix title underline length

llvm-svn: 284078

7 years agoMoving to GitHub - Unified Proposal
Mehdi Amini [Wed, 12 Oct 2016 23:02:02 +0000 (23:02 +0000)]
Moving to GitHub - Unified Proposal

This document describes the proposal to move to GitHub, and
compare the two proposals through various workflow examples,
presenting the current set of commands following by the ones
involved in each of the two proposals.

It is intended to supersede the previous "submodule proposal"
document entirely, and drive the discussion at the BoF during
the next Dev Meeting.

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

llvm-svn: 284077

7 years agoHandle lane masks in LivePhysRegs when adding live-ins
Krzysztof Parzyszek [Wed, 12 Oct 2016 22:53:41 +0000 (22:53 +0000)]
Handle lane masks in LivePhysRegs when adding live-ins

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

llvm-svn: 284076

7 years agoGlobalISel: support G_TRUNC selection on AArch64.
Tim Northover [Wed, 12 Oct 2016 22:49:15 +0000 (22:49 +0000)]
GlobalISel: support G_TRUNC selection on AArch64.

Ahmed's patch again.

llvm-svn: 284075

7 years agoGlobalISel: support int <-> float conversions on AArch64.
Tim Northover [Wed, 12 Oct 2016 22:49:11 +0000 (22:49 +0000)]
GlobalISel: support int <-> float conversions on AArch64.

More of Ahmed's work.

llvm-svn: 284074

7 years agoGlobalISel: select G_FCMP instructions on AArch64.
Tim Northover [Wed, 12 Oct 2016 22:49:07 +0000 (22:49 +0000)]
GlobalISel: select G_FCMP instructions on AArch64.

Another of Ahmed's patches.

llvm-svn: 284073

7 years agoGlobalISel: support selection of G_ICMP on AArch64.
Tim Northover [Wed, 12 Oct 2016 22:49:04 +0000 (22:49 +0000)]
GlobalISel: support selection of G_ICMP on AArch64.

Patch from Ahmed Bougaca again.

llvm-svn: 284072

7 years agoGlobalISel: select G_BRCOND instructions on AArch64.
Tim Northover [Wed, 12 Oct 2016 22:49:01 +0000 (22:49 +0000)]
GlobalISel: select G_BRCOND instructions on AArch64.

llvm-svn: 284071

7 years agoGlobalISel: mark G_BRCOND on s1 as legal.
Tim Northover [Wed, 12 Oct 2016 22:48:36 +0000 (22:48 +0000)]
GlobalISel: mark G_BRCOND on s1 as legal.

It's going to be a TBNZ (at -O0) anyway, so the high bits don't matter.

llvm-svn: 284070

7 years ago[unittests] Delete even more copy constructors (NFC)
Vedant Kumar [Wed, 12 Oct 2016 22:44:50 +0000 (22:44 +0000)]
[unittests] Delete even more copy constructors (NFC)

llvm-svn: 284069

7 years agoSupport GNU-style ZLIB-compressed input sections.
Rui Ueyama [Wed, 12 Oct 2016 22:36:31 +0000 (22:36 +0000)]
Support GNU-style ZLIB-compressed input sections.

Previously, we supported only SHF_COMPRESSED sections because it's
new and it's the ELF standard. But there are object files compressed
in the GNU style out there, so we had to support it.

Sections compressed in the GNU style start with ".zdebug_" and
contain different headers than the ELF standard's one. In this
patch, getRawCompressedData is responsible to handle it.

A tricky thing about GNU-style compressed sections is that we have
to rename them when creating output sections. ".zdebug_" prefix
implies the section is compressed. We need to rename ".zdebug_"
".debug" because our output sections are not compressed.
We do that in this patch.

llvm-svn: 284068

7 years agoMake __asan_handle_no_return a no-op during initialization
Reid Kleckner [Wed, 12 Oct 2016 22:33:57 +0000 (22:33 +0000)]
Make __asan_handle_no_return a no-op during initialization

Some of our existing tests hang on the new Windows bot with this stack:

770, clang_rt.asan_dynamic-i386.dll!__asan::AsanTSDGet+0x3e
771, clang_rt.asan_dynamic-i386.dll!__asan::GetCurrentThread+0x9
772, clang_rt.asan_dynamic-i386.dll!__asan_handle_no_return+0xe
773, clang_rt.asan_dynamic-i386.dll!__asan_wrap__except_handler4_common+0x12
774, ntdll.dll!wcstombs+0xb0 (No unwind info)
775, ntdll.dll!ZwWow64CallFunction64+0x2001 (No unwind info)
776, ntdll.dll!ZwWow64CallFunction64+0x1fd3 (No unwind info)
777, ntdll.dll!KiUserExceptionDispatcher+0xf (No unwind info)
778, clang_rt.asan_dynamic-i386.dll!destroy_fls+0x13
779, ntdll.dll!RtlLockHeap+0xea (No unwind info)
780, ntdll.dll!LdrShutdownProcess+0x7f (No unwind info)
781, ntdll.dll!RtlExitUserProcess+0x81 (No unwind info)
782, kernel32.dll!ExitProcess+0x13 (No unwind info)
783, clang_rt.asan_dynamic-i386.dll!__sanitizer::internal__exit+0xc
784, clang_rt.asan_dynamic-i386.dll!__sanitizer::Die+0x3d
785, clang_rt.asan_dynamic-i386.dll!__asan::AsanInitInternal+0x50b
786, clang_rt.asan_dynamic-i386.dll!__asan::Allocator::Allocate+0x1c
787, clang_rt.asan_dynamic-i386.dll!__asan::Allocator::Calloc+0x43

We hang because AsanDie tries to defend against multi-threaded death by
infinite looping if someone is already exiting. We might want to
reconsider that, but one easy way to avoid getting here is not to let
our noreturn interceptors call back into fragile parts of ASan.

llvm-svn: 284067

7 years ago[unittests] Delete some copy constructors (NFC)
Vedant Kumar [Wed, 12 Oct 2016 22:27:54 +0000 (22:27 +0000)]
[unittests] Delete some copy constructors (NFC)

llvm-svn: 284066

7 years ago[unittest] Pass a reference instead of making a copy (NFC)
Vedant Kumar [Wed, 12 Oct 2016 22:27:52 +0000 (22:27 +0000)]
[unittest] Pass a reference instead of making a copy (NFC)

llvm-svn: 284065

7 years ago[Coverage] Delete some copy constructors (NFC)
Vedant Kumar [Wed, 12 Oct 2016 22:27:49 +0000 (22:27 +0000)]
[Coverage] Delete some copy constructors (NFC)

llvm-svn: 284064

7 years ago[Coverage] Factor out logic to create FunctionRecords (NFC)
Vedant Kumar [Wed, 12 Oct 2016 22:27:45 +0000 (22:27 +0000)]
[Coverage] Factor out logic to create FunctionRecords (NFC)

llvm-svn: 284063

7 years agofix regexes for label names in ms-intrinsics test
Albert Gutowski [Wed, 12 Oct 2016 22:22:34 +0000 (22:22 +0000)]
fix regexes for label names in ms-intrinsics test

llvm-svn: 284062

7 years agoCreate llvm.addressofreturnaddress intrinsic
Albert Gutowski [Wed, 12 Oct 2016 22:13:19 +0000 (22:13 +0000)]
Create llvm.addressofreturnaddress intrinsic

Summary: We need a new LLVM intrinsic to implement MS _AddressOfReturnAddress builtin on 64-bit Windows.

Reviewers: majnemer, rnk

Subscribers: llvm-commits

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

llvm-svn: 284061

7 years agoImplement MS _BitScan intrinsics
Albert Gutowski [Wed, 12 Oct 2016 22:01:05 +0000 (22:01 +0000)]
Implement MS _BitScan intrinsics

Summary: _BitScan intrinsics (and some others, for example _Interlocked and _bittest) are supposed to work on both ARM and x86. This is an attempt to isolate them, avoiding repeating their code or writing separate function for each builtin.

Reviewers: hans, thakis, rnk, majnemer

Subscribers: RKSimon, cfe-commits, aemerson

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

llvm-svn: 284060

7 years agoFollow up to r283955: add _recalloc_base dll thunk
Reid Kleckner [Wed, 12 Oct 2016 21:59:56 +0000 (21:59 +0000)]
Follow up to r283955: add _recalloc_base dll thunk

llvm-svn: 284059

7 years agoUpdate _MSC_VER equality checks for msdiaNNN.dll
Reid Kleckner [Wed, 12 Oct 2016 21:51:14 +0000 (21:51 +0000)]
Update _MSC_VER equality checks for msdiaNNN.dll

Use inequality instead of equality to defend against minor version
increases in _MSC_VER. An _MSC_VER value of 1901 should still use
msdia140.dll, as described in this blog post:
https://blogs.msdn.microsoft.com/vcblog/2016/10/05/visual-c-compiler-version/

llvm-svn: 284058

7 years ago[lit] Fix test shtest-timeout.py for modern output
Michal Gorny [Wed, 12 Oct 2016 21:40:08 +0000 (21:40 +0000)]
[lit] Fix test shtest-timeout.py for modern output

Update the CHECK lines in the shtest-timeout.py lit test to account for
the current output. The output has been changed in r271610 without
adjusting the tests.

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

llvm-svn: 284057

7 years ago[lit] Fix FormatError on individual test timeout
Michal Gorny [Wed, 12 Oct 2016 21:40:04 +0000 (21:40 +0000)]
[lit] Fix FormatError on individual test timeout

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

llvm-svn: 284056

7 years agoRemove basic block label in test case
Arnold Schwaighofer [Wed, 12 Oct 2016 21:36:15 +0000 (21:36 +0000)]
Remove basic block label in test case

Another attempt to make a bot happy

llvm-svn: 284055

7 years agoReapply "[LoopUnroll] Use the upper bound of the loop trip count to fullly unroll...
Haicheng Wu [Wed, 12 Oct 2016 21:29:38 +0000 (21:29 +0000)]
Reapply "[LoopUnroll] Use the upper bound of the loop trip count to fullly unroll a loop"

Reappy r284044 after revert in r284051. Krzysztof fixed the error in r284049.

The original summary:

This patch tries to fully unroll loops having break statement like this

for (int i = 0; i < 8; i++) {
    if (a[i] == value) {
        found = true;
        break;
    }
}

GCC can fully unroll such loops, but currently LLVM cannot because LLVM only
supports loops having exact constant trip counts.

The upper bound of the trip count can be obtained from calling
ScalarEvolution::getMaxBackedgeTakenCount(). Part of the patch is the
refactoring work in SCEV to prevent duplicating code.

The feature of using the upper bound is enabled under the same circumstance
when runtime unrolling is enabled since both are used to unroll loops without
knowing the exact constant trip count.

llvm-svn: 284053

7 years ago[MIRParser] Parse lane masks for register live-ins
Krzysztof Parzyszek [Wed, 12 Oct 2016 21:06:45 +0000 (21:06 +0000)]
[MIRParser] Parse lane masks for register live-ins

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

llvm-svn: 284052

7 years agoRevert "[LoopUnroll] Use the upper bound of the loop trip count to fullly unroll...
Haicheng Wu [Wed, 12 Oct 2016 21:02:22 +0000 (21:02 +0000)]
Revert "[LoopUnroll] Use the upper bound of the loop trip count to fullly unroll a loop"

This reverts commit r284044.

llvm-svn: 284051

7 years ago[ThinLTO] Test we handle collisions correctly in presence of --whole-archive.
Davide Italiano [Wed, 12 Oct 2016 20:52:52 +0000 (20:52 +0000)]
[ThinLTO] Test we handle collisions correctly in presence of --whole-archive.

llvm-svn: 284050

7 years agoFix testcases failing after r284036
Krzysztof Parzyszek [Wed, 12 Oct 2016 20:39:33 +0000 (20:39 +0000)]
Fix testcases failing after r284036

The codegen has changed slightly between my tests and the commit.

llvm-svn: 284049

7 years agoSpecify a target cpu in test case
Arnold Schwaighofer [Wed, 12 Oct 2016 20:30:24 +0000 (20:30 +0000)]
Specify a target cpu in test case

Hopefully, this makes the bots happy

llvm-svn: 284048

7 years agoDisable trivial pair copy/move tests when unsupported
Dimitry Andric [Wed, 12 Oct 2016 20:26:47 +0000 (20:26 +0000)]
Disable trivial pair copy/move tests when unsupported

Summary:
On FreeBSD, for ABI compatibility reasons, the pair trivial copy
constructor is disabled, using the aptly-named
`_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR` define.

Disable the related tests when this define is on, so they don't fail
unexpectedly.

Reviewers: emaste, rsmith, theraven, EricWF

Subscribers: cfe-commits

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

llvm-svn: 284047

7 years ago[CMake] Cleanup check-lldb targets
Chris Bieneman [Wed, 12 Oct 2016 20:26:13 +0000 (20:26 +0000)]
[CMake] Cleanup check-lldb targets

Summary:
This patch adds the following fixes to the check-lldb targets:

* Adds missing dependencies on lldb tools so they get built before tests execute
* Adds Ninja USES_TERMINAL to the target so that the output streams to stdout as it executes
* Uses a generator expression to find the lldb executable, this is more robust than constructing the path manually

Reviewers: tfiala, zturner

Subscribers: mgorny, lldb-commits

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

llvm-svn: 284046

7 years agoUse LLDB_SRC for relative paths
Chris Bieneman [Wed, 12 Oct 2016 20:24:42 +0000 (20:24 +0000)]
Use LLDB_SRC for relative paths

Summary:
Going from LLDB_SRC instead of the file path is safer when looking for compiler-rt. Also need to add support for looking inside the LLVM runtimes subdirectory.

Eventually we should just get CMake to provide these paths during configuration.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

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

llvm-svn: 284045

7 years ago[LoopUnroll] Use the upper bound of the loop trip count to fullly unroll a loop
Haicheng Wu [Wed, 12 Oct 2016 20:24:32 +0000 (20:24 +0000)]
[LoopUnroll] Use the upper bound of the loop trip count to fullly unroll a loop

This patch tries to fully unroll loops having break statement like this

for (int i = 0; i < 8; i++) {
    if (a[i] == value) {
        found = true;
        break;
    }
}

GCC can fully unroll such loops, but currently LLVM cannot because LLVM only
supports loops having exact constant trip counts.

The upper bound of the trip count can be obtained from calling
ScalarEvolution::getMaxBackedgeTakenCount(). Part of the patch is the
refactoring work in SCEV to prevent duplicating code.

The feature of using the upper bound is enabled under the same circumstance
when runtime unrolling is enabled since both are used to unroll loops without
knowing the exact constant trip count.

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

llvm-svn: 284044

7 years agoFix test suite lookup path for LLDB.h
Chris Bieneman [Wed, 12 Oct 2016 20:22:02 +0000 (20:22 +0000)]
Fix test suite lookup path for LLDB.h

Summary:
When running on Darwin, the test suite assumes a specific directory structure for the build directory. This works for the Xcode project builds, but fails for CMake builds regardless of whether or not you are generating the LLDB framework.

This patch allows the Darwin code path to fall back to the more generic code path used by other platforms in the event that LLDB.h isn't where the test suite expects it.

This allows API tests to run on Darwin when building with CMake with the framework build enabled or disabled.

Reviewers: tfiala, zturner

Subscribers: labath, lldb-commits

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

llvm-svn: 284043

7 years agoFix building tests without system headers on Darwin
Chris Bieneman [Wed, 12 Oct 2016 20:19:19 +0000 (20:19 +0000)]
Fix building tests without system headers on Darwin

Summary: Default installations of OS X do not have system headers installed at /usr/include. This patch allows the LLDB test executables to properly compile when built on a system without headers at /usr/include by specifying a default value for the apple-sdk flag as "macosx".

Reviewers: tfiala, zturner

Subscribers: lldb-commits

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

llvm-svn: 284042

7 years agoFix lookup path for lldb-mi
Chris Bieneman [Wed, 12 Oct 2016 20:15:46 +0000 (20:15 +0000)]
Fix lookup path for lldb-mi

Summary:
The test suite calls realpath on the lldb executable then append "-mi" to it to find the path of the lldb-mi executable. This does not work when using CMake builds on *nix platforms. On *nix platforms when a version number is set on executables CMake generates the binary as ${name}-${version} with a symlink named ${name} pointing to it.

This results in the lldb executable being named lldb-4.0.0, and since lldb-4.0.0-mi doesn't ever match the lldb-mi executable these tests are always disabled.

This patch looks for lldb-mi in the same directory as lldb.

Reviewers: zturner, tfiala

Subscribers: ki.stfu, enlight, lldb-commits

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

llvm-svn: 284041

7 years agoLTO: Use the correct mangler function in LTOCodeGenerator::applyScopeRestrictions().
Peter Collingbourne [Wed, 12 Oct 2016 20:12:19 +0000 (20:12 +0000)]
LTO: Use the correct mangler function in LTOCodeGenerator::applyScopeRestrictions().

We need to use the overload of Mangler::getNameWithPrefix that takes a
GlobalValue in order to mangle in the stdcall stack byte count for Windows
targets.

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

llvm-svn: 284040

7 years ago[ThinLTO] Fix bot failure due to unused variable with NDEBUG
Teresa Johnson [Wed, 12 Oct 2016 20:06:02 +0000 (20:06 +0000)]
[ThinLTO] Fix bot failure due to unused variable with NDEBUG

Put variable only used in assert under #ifndef NDEBUG.

This should fix bot failure at
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/28537

llvm-svn: 284039

7 years agoRevert "[ADT] Zip range adapter"
Mehdi Amini [Wed, 12 Oct 2016 19:54:08 +0000 (19:54 +0000)]
Revert "[ADT] Zip range adapter"

This reverts commit r284035, which breaks with MSVC 2013.

llvm-svn: 284037

7 years agoDo not remove implicit defs in BranchFolder
Krzysztof Parzyszek [Wed, 12 Oct 2016 19:50:57 +0000 (19:50 +0000)]
Do not remove implicit defs in BranchFolder

Branch folder removes implicit defs if they are the only non-branching
instructions in a block, and the branches do not use the defined registers.
The problem is that in some cases these implicit defs are required for
the liveness information to be correct.

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

llvm-svn: 284036

7 years ago[ADT] Zip range adapter
Mehdi Amini [Wed, 12 Oct 2016 19:43:02 +0000 (19:43 +0000)]
[ADT] Zip range adapter

This augments the STLExtras toolset with a zip iterator and range
adapter. Zip comes in two varieties: `zip`, which will zip to the
shortest of the input ranges, and `zip_first`, which limits its
`begin() == end()` checks to just the first krange.

Patch by: Bryant Wong <github.com/bryant>

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

llvm-svn: 284035

7 years ago[ThinLTO] Avoid archive member collisions.
Davide Italiano [Wed, 12 Oct 2016 19:35:54 +0000 (19:35 +0000)]
[ThinLTO] Avoid archive member collisions.

This fixes PR30665.

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

llvm-svn: 284034