platform/upstream/llvm.git
8 years agoLangRef: Fix example code for cmpxchg
Duncan P. N. Exon Smith [Sun, 7 Feb 2016 05:06:35 +0000 (05:06 +0000)]
LangRef: Fix example code for cmpxchg

Patch by Daniel Robertson!

llvm-svn: 260018

8 years agoSema: handle typo correction on ARC'ed ivar
Saleem Abdulrasool [Sun, 7 Feb 2016 02:30:59 +0000 (02:30 +0000)]
Sema: handle typo correction on ARC'ed ivar

The ivar ref would be transformed by the Typo Correction TreeTransform, but not
be owned, resulting in the source location being invalid.  This would eventually
lead to an assertion in findCapturingExpr.  Prevent this assertion from
triggering.

Resolves PR25113.

llvm-svn: 260017

8 years agoSema: handle typo correction with ARC'ed objc properties
Saleem Abdulrasool [Sun, 7 Feb 2016 02:30:55 +0000 (02:30 +0000)]
Sema: handle typo correction with ARC'ed objc properties

We would previously assert in findCapturingExpr when performing a typo
correction resulting in an assignment of an ObjC property with a strong lifetype
specifier due to the expression not being rooted in the file (invalid SLoc)
during the retain cycle check on the typo-corrected expression.  Handle the
expression type appropriately during the TreeTransform to ensure that we have a
source location associated with the expression.

Fixes PR26486.

llvm-svn: 260016

8 years agoDon't use module context here. It's unnecessary and makes it harder to write unittests
Daniel Berlin [Sun, 7 Feb 2016 02:03:39 +0000 (02:03 +0000)]
Don't use module context here. It's unnecessary and makes it harder to write unittests

llvm-svn: 260015

8 years agoCompute live-in for MemorySSA
Daniel Berlin [Sun, 7 Feb 2016 01:52:19 +0000 (01:52 +0000)]
Compute live-in for MemorySSA

llvm-svn: 260014

8 years agoOnly insert into definingblocks once per block
Daniel Berlin [Sun, 7 Feb 2016 01:52:15 +0000 (01:52 +0000)]
Only insert into definingblocks once per block

llvm-svn: 260013

8 years agoCleanup node-type handling in the unordered containers
Eric Fiselier [Sun, 7 Feb 2016 00:36:33 +0000 (00:36 +0000)]
Cleanup node-type handling in the unordered containers

This patch is the first in a series of patches that's meant to better
support unordered_map. unordered_map has a special "value_type" that
differs from pair<const Key, Value>. In order to meet the EmplaceConstructible
and CopyInsertable requirements we need to teach __hash_table about this
special value_type.

This patch creates a "__hash_node_types" traits class that contains
all of the typedefs needed by the unordered containers and it's iterators.
These typedefs include ones for each node type and  node pointer type,
as well as special typedefs for "unordered_map"'s value type.

As a result of this change all of the unordered containers now all support
incomplete types.

As a drive-by fix I changed the difference_type in __hash_table to always
be ptrdiff_t. There is a corresponding change to size_type but it cannot
take affect until an ABI break.

This patch will be followed up shortly with fixes for various unordered_map
fixes.

llvm-svn: 260012

8 years agoIndex: provide adjustment thunk information for C++ manglings
Saleem Abdulrasool [Sat, 6 Feb 2016 22:36:34 +0000 (22:36 +0000)]
Index: provide adjustment thunk information for C++ manglings

Add support for exposing the adjustment thunk for virtual methods as
appropriate.

llvm-svn: 260011

8 years ago[X86][AVX2] Regenerated broadcast domain tests
Simon Pilgrim [Sat, 6 Feb 2016 22:09:25 +0000 (22:09 +0000)]
[X86][AVX2] Regenerated broadcast domain tests

llvm-svn: 260010

8 years agoIslNodeBuilder: Invariant load hoisting of elements with differing sizes
Tobias Grosser [Sat, 6 Feb 2016 21:23:39 +0000 (21:23 +0000)]
IslNodeBuilder: Invariant load hoisting of elements with differing sizes

Always use access-instruction pointer type to load the invariant values.
Otherwise mismatches between ScopArrayInfo element type and memory access
element type will result in invalid casts. These type mismatches are after
r259784 a lot more common and also arise with types of different size, which
have not been handled before.

Interestingly, this change actually simplifies the code, as we now have only
one code path that is always taken, rather then a standard code path for the
common case and a "fixup" code path that replaces the standard code path in
case of mismatching types.

llvm-svn: 260009

8 years ago[X86][SSE] Add tests for MOVHLPS/MOVLHPS shuffle lowering.
Simon Pilgrim [Sat, 6 Feb 2016 20:11:52 +0000 (20:11 +0000)]
[X86][SSE] Add tests for MOVHLPS/MOVLHPS shuffle lowering.

As raised in PR26491, we don't make use of these instructions at the moment.

llvm-svn: 260008

8 years ago[X86][AVX512] Added support for VPMOVZX shuffle decoding.
Simon Pilgrim [Sat, 6 Feb 2016 19:51:21 +0000 (19:51 +0000)]
[X86][AVX512] Added support for VPMOVZX shuffle decoding.

llvm-svn: 260007

8 years ago[docs] Warn against slow serial builds
Philip Reames [Sat, 6 Feb 2016 19:43:40 +0000 (19:43 +0000)]
[docs] Warn against slow serial builds

llvm-svn: 260006

8 years ago[NVPTX] Mark nvvm synchronizing intrinsics as convergent.
Justin Lebar [Sat, 6 Feb 2016 19:32:44 +0000 (19:32 +0000)]
[NVPTX] Mark nvvm synchronizing intrinsics as convergent.

Summary:
This is the attribute purpose-made for e.g. __syncthreads.  It appears
that NoDuplicate may not be sufficient to prevent Sink from touching a
call to __syncthreads.

Reviewers: jingyue, hfinkel

Subscribers: llvm-commits, jholewinski, jhen, rnk, tra, majnemer

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

llvm-svn: 260005

8 years ago[docs] Redirect new contributors to the right starting point
Philip Reames [Sat, 6 Feb 2016 19:29:23 +0000 (19:29 +0000)]
[docs] Redirect new contributors to the right starting point

llvm-svn: 260004

8 years ago[docs] Clarify a couple of getting started issues identified during Sprint
Philip Reames [Sat, 6 Feb 2016 19:20:26 +0000 (19:20 +0000)]
[docs] Clarify a couple of getting started issues identified during Sprint

llvm-svn: 260003

8 years agoAdd a missing call to MDNode::deleteTemporary().
Adrian Prantl [Sat, 6 Feb 2016 18:39:34 +0000 (18:39 +0000)]
Add a missing call to MDNode::deleteTemporary().
Follow-up to r259975. Kudos to the ASAN bots!

<rdar://problem/24493203>

llvm-svn: 260002

8 years agoIntroduce NetBSD support
Kamil Rytarowski [Sat, 6 Feb 2016 18:19:29 +0000 (18:19 +0000)]
Introduce NetBSD support

Current FreeBSD and NetBSD code is compatible.

llvm-svn: 260001

8 years ago[X86][AVX512] Fixed prefix ordering for lzcnt tests.
Simon Pilgrim [Sat, 6 Feb 2016 18:07:19 +0000 (18:07 +0000)]
[X86][AVX512] Fixed prefix ordering for lzcnt tests.

Let AVX512 targets share the same CHECKs.

llvm-svn: 260000

8 years ago[X86][SSE] Regenerate vector shift tests
Simon Pilgrim [Sat, 6 Feb 2016 17:57:15 +0000 (17:57 +0000)]
[X86][SSE] Regenerate vector shift tests

llvm-svn: 259999

8 years ago[analyzer] DeallocChecker: Don't warn on release of readonly assign property in dealloc.
Devin Coughlin [Sat, 6 Feb 2016 17:17:32 +0000 (17:17 +0000)]
[analyzer] DeallocChecker: Don't warn on release of readonly assign property in dealloc.

It is common for the ivars for read-only assign properties to always be stored retained,
so don't warn for a release in dealloc for the ivar backing these properties.

llvm-svn: 259998

8 years ago[X86][SSE] Moved shuffle decode CASE macros earlier. NFC.
Simon Pilgrim [Sat, 6 Feb 2016 17:02:15 +0000 (17:02 +0000)]
[X86][SSE] Moved shuffle decode CASE macros earlier. NFC.

To allow the helper functions to make use of them.

llvm-svn: 259997

8 years ago[X86][SSE] Refactored PMOVZX shuffle decoding to use scalar input types
Simon Pilgrim [Sat, 6 Feb 2016 16:33:42 +0000 (16:33 +0000)]
[X86][SSE] Refactored PMOVZX shuffle decoding to use scalar input types

First step towards being able to decode AVX512 PMOVZX instructions without a massive bloat in the shuffle decode switch statement.

This should also make it easier to decode X86ISD::VZEXT target shuffles in the future.

llvm-svn: 259995

8 years agoAdapt LLVM_CMAKE_PATH for recent cmake path changes
Kamil Rytarowski [Sat, 6 Feb 2016 16:23:18 +0000 (16:23 +0000)]
Adapt LLVM_CMAKE_PATH for recent cmake path changes

Current LLVM installs CMake files under lib/cmake/llvm.

llvm-svn: 259994

8 years ago[ThinLTO] Include linkage type in function summary
Teresa Johnson [Sat, 6 Feb 2016 16:07:35 +0000 (16:07 +0000)]
[ThinLTO] Include linkage type in function summary

Summary:
Adds the linkage type to both the per-module and combined function
summaries, which subsumes the current islocal bit. This will eventually
be used to optimized linkage types based on global summary-based
analysis.

Reviewers: joker.eph

Subscribers: joker.eph, davidxl, llvm-commits

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

llvm-svn: 259993

8 years agoline endings fix
Simon Pilgrim [Sat, 6 Feb 2016 15:38:25 +0000 (15:38 +0000)]
line endings fix

llvm-svn: 259992

8 years ago[X86][SSE] Don't replace an existing 32-bit load with its duplicate
Simon Pilgrim [Sat, 6 Feb 2016 15:37:09 +0000 (15:37 +0000)]
[X86][SSE] Don't replace an existing 32-bit load with its duplicate

If we are already loading a single 32-bit float/integer then just reuse it.

Fix for regression in D16729

llvm-svn: 259991

8 years agoComment fix
Simon Pilgrim [Sat, 6 Feb 2016 14:21:49 +0000 (14:21 +0000)]
Comment fix

llvm-svn: 259990

8 years agoCorrected tests for Loop Versioning LICM, by adding “REQUIRES: asserts”.
Ashutosh Nema [Sat, 6 Feb 2016 12:34:41 +0000 (12:34 +0000)]
Corrected tests for Loop Versioning LICM, by adding “REQUIRES: asserts”.
Earlier they were failing under no-assert build.

llvm-svn: 259989

8 years agoFixed short underline error in LangRef.rst for recently added
Ashutosh Nema [Sat, 6 Feb 2016 09:24:37 +0000 (09:24 +0000)]
Fixed short underline error in LangRef.rst for recently added
metadata 'llvm.loop.licm_versioning.disable' description.

llvm-svn: 259988

8 years agoFollow uses to create value MemoryAccesses
Michael Kruse [Sat, 6 Feb 2016 09:19:40 +0000 (09:19 +0000)]
Follow uses to create value MemoryAccesses

The previously implemented approach is to follow value definitions and
create write accesses ("push defs") while searching for uses. This
requires the same relatively validity- and requirement conditions to be
replicated at multiple locations (PHI instructions, other instructions,
uses by PHIs).

We replace this by iterating over the uses in a SCoP ("pull in
requirements"), and add writes only when at least one read has been
added. It turns out to be simpler code because each use is only iterated
over once and writes are added for the first access that reads it. We
need another iteration to identify escaping values (uses not in the
SCoP), which also makes the difference between such accesses more
obvious. As a side-effect, the order of scalar MemoryAccess can change.

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

llvm-svn: 259987

8 years agoNew Loop Versioning LICM Pass
Ashutosh Nema [Sat, 6 Feb 2016 07:47:48 +0000 (07:47 +0000)]
New Loop Versioning LICM Pass

Summary:
When alias analysis is uncertain about the aliasing between any two accesses,
it will return MayAlias. This uncertainty from alias analysis restricts LICM
from proceeding further. In cases where alias analysis is uncertain we might
use loop versioning as an alternative.

Loop Versioning will create a version of the loop with aggressive aliasing
assumptions in addition to the original with conservative (default) aliasing
assumptions. The version of the loop making aggressive aliasing assumptions
will have all the memory accesses marked as no-alias. These two versions of
loop will be preceded by a memory runtime check. This runtime check consists
of bound checks for all unique memory accessed in loop, and it ensures the
lack of memory aliasing. The result of the runtime check determines which of
the loop versions is executed: If the runtime check detects any memory
aliasing, then the original loop is executed. Otherwise, the version with
aggressive aliasing assumptions is used.

The pass is off by default and can be enabled with command line option
-enable-loop-versioning-licm.

Reviewers: hfinkel, anemet, chatur01, reames

Subscribers: MatzeB, grosser, joker.eph, sanjoy, javed.absar, sbaranga,
             llvm-commits

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

llvm-svn: 259986

8 years agoRe-apply r259977 - [OpenMP] Reorganize code to allow specialized code generation...
Samuel Antao [Sat, 6 Feb 2016 06:52:48 +0000 (06:52 +0000)]
Re-apply r259977 - [OpenMP] Reorganize code to allow specialized code generation for different devices.

This was reverted due to a failure in a buildbot, but it turned out the failure was unrelated.

llvm-svn: 259985

8 years agoRevert r259977 - [OpenMP] Reorganize code to allow specialized code generation for...
Samuel Antao [Sat, 6 Feb 2016 06:22:46 +0000 (06:22 +0000)]
Revert r259977 - [OpenMP] Reorganize code to allow specialized code generation for different devices.

It triggered some problem in the configuration related with zlib and exposed in the driver.

llvm-svn: 259984

8 years agoProcessMachCore scans through the core file pages looking for a
Jason Molenda [Sat, 6 Feb 2016 04:55:26 +0000 (04:55 +0000)]
ProcessMachCore scans through the core file pages looking for a
user process dyld binary and/or a mach kernel binary image.  By
default, it prefers the kernel if it finds both.

But if it finds two kernel binary images (which can happen when
random things are mapped into memory), it may pick the wrong
kernel image.

DynamicLoaderDarwinKernel has heuristics to find a kernel in memory;
once we've established that there is a kernel binary in memory,
call over to that class to see if it can find a kernel address via
its search methods.  If it does, use that.

Some minor cleanups to DynamicLoaderDarwinKernel while I was at it.

<rdar://problem/24446112>

llvm-svn: 259983

8 years ago[asan] trying to fix the non-x86 bots
Kostya Serebryany [Sat, 6 Feb 2016 04:50:30 +0000 (04:50 +0000)]
[asan] trying to fix the non-x86 bots

llvm-svn: 259981

8 years ago[asan] properly report an un-aligned global variable instead of just crashing
Kostya Serebryany [Sat, 6 Feb 2016 03:22:24 +0000 (03:22 +0000)]
[asan] properly report an un-aligned global variable instead of just crashing

llvm-svn: 259979

8 years ago[asan] disabled one subtest in scariness_score_test.cc that may fail when running...
Kostya Serebryany [Sat, 6 Feb 2016 02:37:39 +0000 (02:37 +0000)]
[asan] disabled one subtest in scariness_score_test.cc that may fail when running under GNU make. Add more subtests

llvm-svn: 259978

8 years ago[OpenMP] Reorganize code to allow specialized code generation for different devices.
Samuel Antao [Sat, 6 Feb 2016 02:12:34 +0000 (02:12 +0000)]
[OpenMP] Reorganize code to allow specialized code generation for different devices.

Summary:
Different devices may in some cases require different code generation schemes in order to implement OpenMP. This is required not only for performance reasons, but also because it may not be possible to have the current (default) implementation working for these devices. E.g. GPU's cannot implement the same scheme a target such as powerpc or x86b would use, in the sense that it does not have the ability to fork threads, instead all the threads are always executing and need to be managed by the implementation.

This patch proposes a reorganization of the code in the OpenMP code generation to pave the way to have specialized implementation of OpenMP support. More than a "real" patch this is more a request for comments in order to understand if what is proposed is acceptable or if there are better/easier ways to do it.

In this patch part of the common OpenMP codegen infrastructure is moved to a new file under a new namespace (CGOpenMPCommon) so it can be shared between the default implementation and the specialized one. When CGOpenMPRuntime is created, an attempt to select a specialized implementation is done.

In the patch a specialization for nvptx targets is done which currently checks if the target is an OpenMP device and trap if it is not.

Let me know comments suggestions you may have.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: Hahnfeld, cfe-commits, fraggamuffin, caomhin, jholewinski

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

llvm-svn: 259977

8 years ago[modules] Compress files embedded into a .pcm file, to reduce the disk usage of ...
Richard Smith [Sat, 6 Feb 2016 02:06:43 +0000 (02:06 +0000)]
[modules] Compress files embedded into a .pcm file, to reduce the disk usage of -fembed-all-files mode.

llvm-svn: 259976

8 years agoFix a crash when emitting dbeug info for forward-declared scoped enums.
Adrian Prantl [Sat, 6 Feb 2016 01:59:09 +0000 (01:59 +0000)]
Fix a crash when emitting dbeug info for forward-declared scoped enums.
It is possible for enums to be created as part of their own
declcontext. We need to cache a placeholder to avoid the type being
created twice before hitting the cache.

<rdar://problem/24493203>

llvm-svn: 259975

8 years agoRelax assertion in ReplaceableMetadataImpl::replaceAllUsesWith().
Adrian Prantl [Sat, 6 Feb 2016 01:56:55 +0000 (01:56 +0000)]
Relax assertion in ReplaceableMetadataImpl::replaceAllUsesWith().
There is a legitimate use-case in clang where we need to replace a
temporary placeholder node with the temporary node that may be a
forward declaration.

<rdar://problem/24493203>

llvm-svn: 259973

8 years agoPer Jim's suggestion, move checks that we're not mixing and matching Debuggers and...
Enrico Granata [Sat, 6 Feb 2016 01:36:07 +0000 (01:36 +0000)]
Per Jim's suggestion, move checks that we're not mixing and matching Debuggers and Commands deeper in the bowels of LLDB

NFC

llvm-svn: 259972

8 years ago[llvm-dwp] Merge cu_index from DWPs
David Blaikie [Sat, 6 Feb 2016 01:15:26 +0000 (01:15 +0000)]
[llvm-dwp] Merge cu_index from DWPs

This is almost feature complete - just missing tu_index merging now.

llvm-svn: 259971

8 years ago[www] Update analyzer release notes to correct the checker-278 build date.
Devin Coughlin [Sat, 6 Feb 2016 00:59:14 +0000 (00:59 +0000)]
[www] Update analyzer release notes to correct the checker-278 build date.

This is not the future.

llvm-svn: 259969

8 years ago[Orc] Slightly improve the x86-64 resolver block machine code.
Lang Hames [Sat, 6 Feb 2016 00:55:08 +0000 (00:55 +0000)]
[Orc] Slightly improve the x86-64 resolver block machine code.

Replace leaq + movq of a pointer with a single movabsq.

llvm-svn: 259968

8 years ago[www] Update analyzer website for checker-278.
Devin Coughlin [Sat, 6 Feb 2016 00:53:33 +0000 (00:53 +0000)]
[www] Update analyzer website for checker-278.

llvm-svn: 259967

8 years agoSet max segment protection level.
Pete Cooper [Sat, 6 Feb 2016 00:51:16 +0000 (00:51 +0000)]
Set max segment protection level.

The initial segment protection was also being used to set the maximum
segment protection level.  Instead, the maximum should be set according
to the architecture we are linking.  For example on Mac OS it should be
RWX on most pages, but on iOS is often on R_X.

rdar://problem/24515136

llvm-svn: 259966

8 years agollvm-bcanalyzer: Produce summary information for the BLOCKINFO block, it can be
Richard Smith [Sat, 6 Feb 2016 00:46:09 +0000 (00:46 +0000)]
llvm-bcanalyzer: Produce summary information for the BLOCKINFO block, it can be
a significant fraction of the file size (for files that otherwise have few
records). Also include an average size per record in the summary information.

llvm-svn: 259965

8 years agoFix an issue where certain CommandObjects (or Options thereof) were being created...
Enrico Granata [Sat, 6 Feb 2016 00:43:07 +0000 (00:43 +0000)]
Fix an issue where certain CommandObjects (or Options thereof) were being created once, bound to a specific CommandInterpreter (and hence a specific Debugger), and then cached for reuse across different Debugger instances

Obviously, if the original Debugger goes away, those commands are holding on to now stale memory, which has the potential to cause crashes

Fixes rdar://24460882

llvm-svn: 259964

8 years agoAdd note of suboptimal behavior in MemorySSA. NFC.
George Burgess IV [Sat, 6 Feb 2016 00:42:52 +0000 (00:42 +0000)]
Add note of suboptimal behavior in MemorySSA. NFC.

llvm-svn: 259963

8 years agoFix "thread backtrace -s": option was misparsed because of a missing break.
Jim Ingham [Sat, 6 Feb 2016 00:31:23 +0000 (00:31 +0000)]
Fix "thread backtrace -s": option was misparsed because of a missing break.

<rdar://problem/24525106>

llvm-svn: 259962

8 years ago[asan] add an experimental feature that prints the scariness score of the error messa...
Kostya Serebryany [Sat, 6 Feb 2016 00:29:44 +0000 (00:29 +0000)]
[asan] add an experimental feature that prints the scariness score of the error message. To enable it use ASAN_OPTIONS=print_scariness=1

llvm-svn: 259961

8 years agoMove creation of "__LINKEDIT" segment. NFC.
Pete Cooper [Sat, 6 Feb 2016 00:14:15 +0000 (00:14 +0000)]
Move creation of "__LINKEDIT" segment.  NFC.

We currently tag on a "__LINKEDIT" when we are emitting the segments.
However, an upcoming patch aims to set the initprot and maxprot segment members
to their correct values, and in order to share code, its better to create this
segment for real and handle it in buildFileOffsets the same way ld64 does.

The commit for segment protections will add a test for this all being correct so
no test here until that code is committed.

llvm-svn: 259960

8 years agoSort headers. NFC.
Rafael Espindola [Sat, 6 Feb 2016 00:06:26 +0000 (00:06 +0000)]
Sort headers. NFC.

llvm-svn: 259959

8 years ago[AArch64] Add the scheduling model for Exynos-M1
Evandro Menezes [Sat, 6 Feb 2016 00:01:41 +0000 (00:01 +0000)]
[AArch64] Add the scheduling model for Exynos-M1

Summary:
Add the core scheduling model for the Samsung Exynos-M1 (ARMv8-A).

Reviewers: jmolloy, rengolin, christof, MinSeongKIM, t.p.northover

Subscribers: aemerson, rengolin, MatzeB

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

llvm-svn: 259958

8 years ago[StatepointLower] Use None instead of Optional<int>()
Sanjoy Das [Fri, 5 Feb 2016 23:40:04 +0000 (23:40 +0000)]
[StatepointLower] Use None instead of Optional<int>()

llvm-svn: 259956

8 years ago[PGO] Test case update
Xinliang David Li [Fri, 5 Feb 2016 23:36:08 +0000 (23:36 +0000)]
[PGO] Test case update

  Temporarily relax check in test to avoid
  breakage for format change in LLVM side. Once that is
  done, the test case will be retightened.

llvm-svn: 259955

8 years agoMake the OCaml tests temporarily unsupported until they can be updated.
Eric Christopher [Fri, 5 Feb 2016 23:28:03 +0000 (23:28 +0000)]
Make the OCaml tests temporarily unsupported until they can be updated.

llvm-svn: 259954

8 years ago[Orc] Fix a typo in the comments for the x86_64 resolver block.
Lang Hames [Fri, 5 Feb 2016 23:27:48 +0000 (23:27 +0000)]
[Orc] Fix a typo in the comments for the x86_64 resolver block.

llvm-svn: 259953

8 years agoVariable naming style fix /nfc
Xinliang David Li [Fri, 5 Feb 2016 23:24:42 +0000 (23:24 +0000)]
Variable naming style fix /nfc

llvm-svn: 259952

8 years agoELF: Simplify readEntryLength.
Rui Ueyama [Fri, 5 Feb 2016 23:24:05 +0000 (23:24 +0000)]
ELF: Simplify readEntryLength.

I removed "CIE/FIE size is too large" error because that was not
checking for correct error conditions. [UINT_MAX - 4, UINT_MAX) is
a correct range as a size of a CIE/FDE record. It's just that the
size cannot be larger than the section size.

llvm-svn: 259951

8 years agoEliminate an unnecessary enum, use the LLVM version. NFC
Paul Robinson [Fri, 5 Feb 2016 23:23:25 +0000 (23:23 +0000)]
Eliminate an unnecessary enum, use the LLVM version. NFC

llvm-svn: 259950

8 years agoAdd qualifiers that are about to be necessary. NFC
Paul Robinson [Fri, 5 Feb 2016 23:20:02 +0000 (23:20 +0000)]
Add qualifiers that are about to be necessary. NFC

llvm-svn: 259949

8 years agoAttempt#2 to work around MSVC rejects-valid.
Richard Smith [Fri, 5 Feb 2016 23:05:09 +0000 (23:05 +0000)]
Attempt#2 to work around MSVC rejects-valid.

llvm-svn: 259948

8 years agoExempt char array initializers from -Wconstant-converion.
Richard Trieu [Fri, 5 Feb 2016 23:02:38 +0000 (23:02 +0000)]
Exempt char array initializers from -Wconstant-converion.

Sometimes, char arrays are used as bit storage, with no difference made between
signed and unsigned char.  Thus, it is reasonable to use 0 to 255 instead of
-128 to 127 and not trigger this warning.

llvm-svn: 259947

8 years agoELF: Make EHOutputSection::readEntryLength a non-member function.
Rui Ueyama [Fri, 5 Feb 2016 22:56:03 +0000 (22:56 +0000)]
ELF: Make EHOutputSection::readEntryLength a non-member function.

This function did not use any fields of the class.

llvm-svn: 259946

8 years agoFix PT_GNU_RELRO computation.
Rafael Espindola [Fri, 5 Feb 2016 22:55:06 +0000 (22:55 +0000)]
Fix PT_GNU_RELRO computation.

We were not including TLS sections.

llvm-svn: 259945

8 years ago[CUDA] Bug 26497 : Remove wrappers for variants provided by CUDA headers.
Artem Belevich [Fri, 5 Feb 2016 22:54:05 +0000 (22:54 +0000)]
[CUDA] Bug 26497 : Remove wrappers for variants provided by CUDA headers.

... and pull global-scope ones into std namespace with using-declaration.

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

llvm-svn: 259944

8 years agoAttempt to work around an MSVC rejects-valid. Apparently it gets the access
Richard Smith [Fri, 5 Feb 2016 22:48:19 +0000 (22:48 +0000)]
Attempt to work around an MSVC rejects-valid. Apparently it gets the access
check wrong when inheriting a member through two levels of private inheritance,
where the middle one is a class template specialization.

llvm-svn: 259943

8 years agoMore workarounds for undefined behavior exposed when compiling in C++14 with
Richard Smith [Fri, 5 Feb 2016 22:32:52 +0000 (22:32 +0000)]
More workarounds for undefined behavior exposed when compiling in C++14 with
-fsized-deallocation. Disable sized deallocation for all objects derived from
TrailingObjects, as we expect the storage allocated for these objects to be
larger than the size of their dynamic type.

llvm-svn: 259942

8 years ago[PGO] Speed up name tab reading
Xinliang David Li [Fri, 5 Feb 2016 22:32:01 +0000 (22:32 +0000)]
[PGO] Speed up name tab reading
 The change allows skipping duplicate strings
 early to avoid redundant md5 computation and
 string copying/swapping.

llvm-svn: 259941

8 years ago[llvm-nm] Prefer empty() over size() == 0.
Davide Italiano [Fri, 5 Feb 2016 22:10:42 +0000 (22:10 +0000)]
[llvm-nm] Prefer empty() over size() == 0.

Thanks to David Blaikie for pointing this out!

llvm-svn: 259938

8 years ago[llvm-nm] Transform a switch() statement in a pair of if(s).
Davide Italiano [Fri, 5 Feb 2016 22:07:09 +0000 (22:07 +0000)]
[llvm-nm] Transform a switch() statement in a pair of if(s).

This is more uniform wrt what other tools do and makes the code
a little bit more readable.

llvm-svn: 259937

8 years agoMove DebugInfoKind enum from Driver to Basic. NFC
Paul Robinson [Fri, 5 Feb 2016 21:54:42 +0000 (21:54 +0000)]
Move DebugInfoKind enum from Driver to Basic. NFC

llvm-svn: 259935

8 years agoAdd an ARC autoreleased-return-value caller marker on i386.
John McCall [Fri, 5 Feb 2016 21:37:38 +0000 (21:37 +0000)]
Add an ARC autoreleased-return-value caller marker on i386.

rdar://24531556

llvm-svn: 259932

8 years ago[SystemZ] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macros
Ulrich Weigand [Fri, 5 Feb 2016 21:34:28 +0000 (21:34 +0000)]
[SystemZ] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macros

Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_[1248] macros on SystemZ.

This fixes a miscompile of GCC C++11 standard library headers
due to use of those macros in an ABI-changing manner.

See e.g. /usr/include/c++/4.8.5/ext/concurrence.h:

  // Compile time constant that indicates prefered locking policy in
  // the current configuration.
  static const _Lock_policy __default_lock_policy =
#ifdef __GTHREADS
#if (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) \
     && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4))
  _S_atomic;
#else
  _S_mutex;
#endif
#else
  _S_single;
#endif

A different choice of __default_lock_policy causes different
sizes of several of the C++11 data structures, which are then
incompatible when inlined in clang-compiled code with what the
(GCC-compiled) external library expects.

This in turn leads to various crashes when using std::thread
in code compiled with clang, as see e.g. via the ThreadPool
unit tests.  See PR 26473 for an example.

llvm-svn: 259931

8 years ago[llvm-nm] Simplify code logic. NFCI.
Davide Italiano [Fri, 5 Feb 2016 21:10:48 +0000 (21:10 +0000)]
[llvm-nm] Simplify code logic. NFCI.

llvm-svn: 259917

8 years agoDo not honor explicit alignment attribute on fields for PS4.
Sunil Srivastava [Fri, 5 Feb 2016 20:50:02 +0000 (20:50 +0000)]
Do not honor explicit alignment attribute on fields for PS4.
This change reverts r257462 for PS4 triple.

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

llvm-svn: 259916

8 years agoCallAnalyzer::analyzeCall: change the condition back to "Cost < Threshold"
Hans Wennborg [Fri, 5 Feb 2016 20:32:42 +0000 (20:32 +0000)]
CallAnalyzer::analyzeCall: change the condition back to "Cost < Threshold"

In r252595, I inadvertently changed the condition to "Cost <= Threshold",
which caused a significant size regression in Chrome. This commit rectifies
that.

llvm-svn: 259915

8 years ago[AArch64] Refactoring aarch64-ldst-opt. NCF.
Jun Bum Lim [Fri, 5 Feb 2016 20:02:03 +0000 (20:02 +0000)]
[AArch64] Refactoring aarch64-ldst-opt. NCF.

Remove narrow load / store instructions from getMatchingPairOpcode(),
and add getMatchingWideOpcode().

llvm-svn: 259914

8 years agoTableGen: Add IsOptional field to AsmOperandClass
Tom Stellard [Fri, 5 Feb 2016 19:59:33 +0000 (19:59 +0000)]
TableGen: Add IsOptional field to AsmOperandClass

Summary:
This makes it possible to specify some operands as optional to the AsmMatcher.
Setting this field to true will prevent the AsmMatcher from emitting
'too few operands' errors when there are missing optional operands.

Reviewers: olista01, ab

Subscribers: nhaustov, arsenm, llvm-commits

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

llvm-svn: 259913

8 years agoAMDGPU: Account for LDS alignment
Matt Arsenault [Fri, 5 Feb 2016 19:47:29 +0000 (19:47 +0000)]
AMDGPU: Account for LDS alignment

The current situation isn't great, because the amount of padding
requires is determined by the inverse order of the first encountered
use. We should eventually somehow sort these to minimize wasted space.

Another problem is the alignment of kernel arguments isn't
respected. The group_segment_alignment is always emitted as
the default 16, and typed arguments with higher alignments
or an explicitly set alignment are also ignored.

llvm-svn: 259912

8 years agoAMDGPU: Preserve alignments on new created globals
Matt Arsenault [Fri, 5 Feb 2016 19:47:23 +0000 (19:47 +0000)]
AMDGPU: Preserve alignments on new created globals

Also switch to internal linkage, and include the name of the function in
the name.

llvm-svn: 259911

8 years ago[Parser] Perform CachedTokens update dependent on token consumption
Bruno Cardoso Lopes [Fri, 5 Feb 2016 19:36:39 +0000 (19:36 +0000)]
[Parser] Perform CachedTokens update dependent on token consumption

In the context where we break one tok::greatergreater into two
tok::greater in order to correctly update the cached tokens; update the
CachedTokens with two tok::greater only if ParseGreaterThanInTemplateList
clients asks to consume the last token. Otherwise we only need to add
one because the second is already added later on, as a not yet cached token.

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

rdar://problem/24488367

llvm-svn: 259910

8 years ago[codeview] Dump a missing field and change its signedness
Reid Kleckner [Fri, 5 Feb 2016 19:15:45 +0000 (19:15 +0000)]
[codeview] Dump a missing field and change its signedness

llvm-svn: 259904

8 years agoSimplify. NFC.
Rui Ueyama [Fri, 5 Feb 2016 19:13:18 +0000 (19:13 +0000)]
Simplify. NFC.

llvm-svn: 259903

8 years agoTake 2: Use an artifical namespace so that member vars do not hide local vars.
Siva Chandra [Fri, 5 Feb 2016 19:10:04 +0000 (19:10 +0000)]
Take 2: Use an artifical namespace so that member vars do not hide local vars.

Summary: This relands r259810 with fix for failures on Mac.

Reviewers: spyffe, tfiala

Subscribers: tfiala, lldb-commits

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

llvm-svn: 259902

8 years ago[modules] Separately track whether an identifier's preprocessor information and
Richard Smith [Fri, 5 Feb 2016 19:03:40 +0000 (19:03 +0000)]
[modules] Separately track whether an identifier's preprocessor information and
name lookup information have changed since deserialization. For a C++ modules
build, we do not need to re-emit the identifier into the serialized identifier
table if only the name lookup information has changed (and in all cases, we
don't need to re-emit the macro information if only the name lookup information
has changed).

llvm-svn: 259901

8 years agoAMDGPU: Remove some purely R600 functions from AMDGPUInstrInfo
Tom Stellard [Fri, 5 Feb 2016 18:44:57 +0000 (18:44 +0000)]
AMDGPU: Remove some purely R600 functions from AMDGPUInstrInfo

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 259900

8 years agoELF: Make Out<ELFT> initialization less error-prone.
Rui Ueyama [Fri, 5 Feb 2016 18:41:40 +0000 (18:41 +0000)]
ELF: Make Out<ELFT> initialization less error-prone.

Previously, it was easy to leave some Out<ELFT> fields uninitialized
because assignments to the fields are mixed with output section
instantiations. In this patch, I separate initializations from assignments
to improve readability.

http://reviews.llvm.org/D16864

llvm-svn: 259899

8 years ago[ASTMatchers] Allow hasName() to look through inline namespaces
Samuel Benzaquen [Fri, 5 Feb 2016 18:29:24 +0000 (18:29 +0000)]
[ASTMatchers] Allow hasName() to look through inline namespaces

Summary:
Allow hasName() to look through inline namespaces.
This will fix the interaction between some clang-tidy checks and libc++.

libc++ defines names in an inline namespace named std::<version_#>.
When we try to match a name using hasName("std::xxx") it fails to match and the clang-tidy check does not work.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 259898

8 years agoAMDGPU: Fix ordering of CPU and FS parameters in TargetMachine constructors
Tom Stellard [Fri, 5 Feb 2016 18:29:17 +0000 (18:29 +0000)]
AMDGPU: Fix ordering of CPU and FS parameters in TargetMachine constructors

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 259897

8 years agoFix echo.ll test failing due to DOS line endings
Reid Kleckner [Fri, 5 Feb 2016 18:21:28 +0000 (18:21 +0000)]
Fix echo.ll test failing due to DOS line endings

llvm-svn: 259896

8 years agoSome stackslots are allocated to vregs which have no real reference.
Wei Mi [Fri, 5 Feb 2016 18:14:24 +0000 (18:14 +0000)]
Some stackslots are allocated to vregs which have no real reference.

LiveRangeEdit::eliminateDeadDef is used to remove dead define instructions
after rematerialization. To remove a VNI for a vreg from its LiveInterval,
LiveIntervals::removeVRegDefAt is used. However, after non-PHI VNIs are all
removed, PHI VNI are still left in the LiveInterval. Such unused vregs will
be kept in RegsToSpill[] at the end of InlineSpiller::reMaterializeAll and
spiller will allocate stackslot for them.

The fix is to get rid of unused reg by checking whether it has non-dbg
reference instead of whether it has non-empty interval.

llvm-svn: 259895

8 years agoAMDGPU/SI: Correctly initialize SIInsertWaits pass
Tom Stellard [Fri, 5 Feb 2016 17:42:38 +0000 (17:42 +0000)]
AMDGPU/SI: Correctly initialize SIInsertWaits pass

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 259894

8 years ago[WebAssembly] Update the select instructions' operand orders to match the spec.
Dan Gohman [Fri, 5 Feb 2016 17:14:59 +0000 (17:14 +0000)]
[WebAssembly] Update the select instructions' operand orders to match the spec.

llvm-svn: 259893

8 years agoRename IsUsedInDynamicReloc to MustBeInDynSym.
Rafael Espindola [Fri, 5 Feb 2016 15:27:15 +0000 (15:27 +0000)]
Rename IsUsedInDynamicReloc to MustBeInDynSym.

The variable was marking various cases where a symbol must be included
in the dynamic symbol table. Being used by a dynamic relocation was only
one of them.

llvm-svn: 259889

8 years agoAdd the missing test case for PR26193
Nemanja Ivanovic [Fri, 5 Feb 2016 15:03:17 +0000 (15:03 +0000)]
Add the missing test case for PR26193

llvm-svn: 259888

8 years agoCentralize most calls to setUsedInDynamicReloc.
Rafael Espindola [Fri, 5 Feb 2016 15:03:10 +0000 (15:03 +0000)]
Centralize most calls to setUsedInDynamicReloc.

llvm-svn: 259887