platform/upstream/llvm.git
8 years ago[AArch64] Fix test triplet
Evandro Menezes [Tue, 18 Oct 2016 20:41:30 +0000 (20:41 +0000)]
[AArch64] Fix test triplet

llvm-svn: 284532

8 years ago[AArch64] Avoid materializing 0.0 when generating FP SELECT
Evandro Menezes [Tue, 18 Oct 2016 20:37:35 +0000 (20:37 +0000)]
[AArch64] Avoid materializing 0.0 when generating FP SELECT

Transform `a == 0.0 ? 0.0 : x` to `a == 0.0 ? a : x` and `a != 0.0 ? x : 0.0`
to `a != 0.0 ? x : a` to avoid materializing 0.0 for FCSEL, since it does not
have to be materialized beforehand for FCMP, as it has a form that has 0.0
as an implicit operand.

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

llvm-svn: 284531

8 years agoAdd missing warning for use of C++1z init-statements in C++14 and before.
Richard Smith [Tue, 18 Oct 2016 20:27:16 +0000 (20:27 +0000)]
Add missing warning for use of C++1z init-statements in C++14 and before.

llvm-svn: 284530

8 years agoOne more additional error check for invalid Mach-O files for a
Kevin Enderby [Tue, 18 Oct 2016 20:24:12 +0000 (20:24 +0000)]
One more additional error check for invalid Mach-O files for a
load command that use the MachO:: linkedit_data_command
type but is not used in llvm libObject code but used in llvm tool code.

This is for the LC_CODE_SIGNATURE load command.

llvm-svn: 284529

8 years ago[c++1z] Fix corner case where we could create a function type whose canonical type...
Richard Smith [Tue, 18 Oct 2016 20:13:25 +0000 (20:13 +0000)]
[c++1z] Fix corner case where we could create a function type whose canonical type is not actually canonical.

llvm-svn: 284528

8 years agoGlobalISel: translate the @llvm.objectsize intrinsic.
Tim Northover [Tue, 18 Oct 2016 20:03:51 +0000 (20:03 +0000)]
GlobalISel: translate the @llvm.objectsize intrinsic.

llvm-svn: 284527

8 years agoGlobalISel: select small binary operations on AArch64.
Tim Northover [Tue, 18 Oct 2016 20:03:48 +0000 (20:03 +0000)]
GlobalISel: select small binary operations on AArch64.

AArch64 actually supports many 8-bit operations under the definition used by
GlobalISel: the designated information-carrying bits of a GPR32 get the right
value if you just use the normal 32-bit instruction.

llvm-svn: 284526

8 years agoGlobalISel: translate memcpy intrinsics.
Tim Northover [Tue, 18 Oct 2016 20:03:45 +0000 (20:03 +0000)]
GlobalISel: translate memcpy intrinsics.

llvm-svn: 284525

8 years agoRemove unused typedef
Mandeep Singh Grang [Tue, 18 Oct 2016 20:01:12 +0000 (20:01 +0000)]
Remove unused typedef

Summary: Unused: typedef SmallSetVector<RegionT *, 4> RegionSet

Reviewers: MatzeB, grosser

Subscribers: zinob

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

llvm-svn: 284524

8 years agoGlobalISel: support floating-point constants on AArch64.
Tim Northover [Tue, 18 Oct 2016 19:47:57 +0000 (19:47 +0000)]
GlobalISel: support floating-point constants on AArch64.

Patch from Ahmed Bougacha.

llvm-svn: 284523

8 years ago[Hexagon] Handle block live-ins with lane masks in HexagonBlockRanges
Krzysztof Parzyszek [Tue, 18 Oct 2016 19:47:20 +0000 (19:47 +0000)]
[Hexagon] Handle block live-ins with lane masks in HexagonBlockRanges

llvm-svn: 284522

8 years agoReduce global namespace pollution. NFC.
Benjamin Kramer [Tue, 18 Oct 2016 19:39:31 +0000 (19:39 +0000)]
Reduce global namespace pollution. NFC.

llvm-svn: 284521

8 years ago[esan] Remove global variable.
Benjamin Kramer [Tue, 18 Oct 2016 19:39:23 +0000 (19:39 +0000)]
[esan] Remove global variable.

It's not thread safe and completely unnecessary.

llvm-svn: 284520

8 years agoWhen two function types have equivalent (but distinct) noexcept specifications, creat...
Richard Smith [Tue, 18 Oct 2016 19:29:18 +0000 (19:29 +0000)]
When two function types have equivalent (but distinct) noexcept specifications, create separate type sugar nodes. This is necessary so that substitution into the exception specification will substitute into the correct expression.

llvm-svn: 284519

8 years ago[X86][SSE] Added vector lshr/shl combine tests
Simon Pilgrim [Tue, 18 Oct 2016 19:28:12 +0000 (19:28 +0000)]
[X86][SSE] Added vector lshr/shl combine tests

This doesn't cover all combines in DAGCombiner::visitSRL/visitSHL yet, but identifies several cases where we fail to combine vectors (or non-splatted) vectors

llvm-svn: 284518

8 years agoFix clang tests
Mandeep Singh Grang [Tue, 18 Oct 2016 19:22:20 +0000 (19:22 +0000)]
Fix clang tests

Summary:
Add REQUIRES for target specific tests.

Patch by Azharuddin Mohammed.

Reviewers: apazos, weimingz, rsmith, ddunbar, spop, mgrang

Subscribers: sebpop, llvm-commits

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

llvm-svn: 284517

8 years ago[CodeGen][ObjC] Do not call objc_storeStrong when initializing a
Akira Hatanaka [Tue, 18 Oct 2016 19:05:41 +0000 (19:05 +0000)]
[CodeGen][ObjC] Do not call objc_storeStrong when initializing a
constexpr variable.

When compiling a constexpr NSString initialized with an objective-c
string literal, CodeGen emits objc_storeStrong on an uninitialized
alloca, which causes a crash.

This patch folds the code in EmitScalarInit into EmitStoreThroughLValue
and fixes the crash by calling objc_retain on the string instead of
using objc_storeStrong.

rdar://problem/28562009

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

llvm-svn: 284516

8 years ago[InterleavedAccessPass] Remove global variable.
Benjamin Kramer [Tue, 18 Oct 2016 18:59:58 +0000 (18:59 +0000)]
[InterleavedAccessPass] Remove global variable.

This is a threading hazard and rightfully complained about by tsan. No
functionality change.

llvm-svn: 284515

8 years ago[libFuzzer] detect leaks after every run when executing fixed inputs (./fuzzer -runs...
Kostya Serebryany [Tue, 18 Oct 2016 18:38:08 +0000 (18:38 +0000)]
[libFuzzer] detect leaks after every run when executing fixed inputs (./fuzzer -runs=1000000 my-file)

llvm-svn: 284514

8 years agorevert r284495: [Target] remove TargetRecip class
Sanjay Patel [Tue, 18 Oct 2016 18:36:49 +0000 (18:36 +0000)]
revert r284495: [Target] remove TargetRecip class

There's something wrong with the StringRef usage while parsing the attribute string.

llvm-svn: 284513

8 years ago[tsan] Always use -std=c++11 in TSan tests
Kuba Brecka [Tue, 18 Oct 2016 18:33:42 +0000 (18:33 +0000)]
[tsan] Always use -std=c++11 in TSan tests

We currently only pass -std=c++11 when we have an instrumented libcxx.

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

llvm-svn: 284512

8 years agoDrop a redundant ".get()" call (NFC)
Vedant Kumar [Tue, 18 Oct 2016 18:19:02 +0000 (18:19 +0000)]
Drop a redundant ".get()" call (NFC)

Pointed out by Malcolm Parsons.

llvm-svn: 284510

8 years ago[sancov] add __sanitizer_cov_trace_pc_guard to the supported coverage points
Kostya Serebryany [Tue, 18 Oct 2016 18:11:42 +0000 (18:11 +0000)]
[sancov] add __sanitizer_cov_trace_pc_guard to the supported coverage points

llvm-svn: 284509

8 years ago[libFuzzer] reshuffle the code for -exit_on_src_pos and -exit_on_item
Kostya Serebryany [Tue, 18 Oct 2016 18:06:05 +0000 (18:06 +0000)]
[libFuzzer] reshuffle the code for -exit_on_src_pos and -exit_on_item

llvm-svn: 284508

8 years ago[asan] Rename test file as the poisoning is not "experimental"
Vitaly Buka [Tue, 18 Oct 2016 18:05:06 +0000 (18:05 +0000)]
[asan] Rename test file as the poisoning is not "experimental"

Reviewers: eugenis

Subscribers: llvm-commits

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

llvm-svn: 284507

8 years ago[asan] Combine check-prefixes in stack-poisoning test
Vitaly Buka [Tue, 18 Oct 2016 18:05:04 +0000 (18:05 +0000)]
[asan] Combine check-prefixes in stack-poisoning test

Reviewers: eugenis

Subscribers: llvm-commits

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

llvm-svn: 284506

8 years ago[asan] Make -asan-experimental-poisoning the only behavior
Vitaly Buka [Tue, 18 Oct 2016 18:04:59 +0000 (18:04 +0000)]
[asan] Make -asan-experimental-poisoning the only behavior

Reviewers: eugenis

Subscribers: llvm-commits

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

llvm-svn: 284505

8 years agoNext set of additional error checks for invalid Mach-O files for the
Kevin Enderby [Tue, 18 Oct 2016 17:54:17 +0000 (17:54 +0000)]
Next set of additional error checks for invalid Mach-O files for the
load commands that use the MachO::routines_command and
and MachO::routines_command_64 types but are not used in llvm
libObject code but used in llvm tool code.

This includes the LC_ROUTINES and LC_ROUTINES_64
load commands.

llvm-svn: 284504

8 years ago[ADT] Remove CachedHash<T>.
Justin Lebar [Tue, 18 Oct 2016 17:50:39 +0000 (17:50 +0000)]
[ADT] Remove CachedHash<T>.

Nobody is using it.

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

llvm-svn: 284503

8 years agoUse CachedHashStringRef instead of CachedHash<StringRef>.
Justin Lebar [Tue, 18 Oct 2016 17:50:36 +0000 (17:50 +0000)]
Use CachedHashStringRef instead of CachedHash<StringRef>.

Summary:
This uses one less word on 64-bit platforms, so should be a strict
improvement.  This change also lets us get rid of llvm::CachedHash.

Reviewers: rafael, timshen

Subscribers: llvm-commits

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

llvm-svn: 284502

8 years ago[SCEV] Make CompareValueComplexity a little bit smarter
Sanjoy Das [Tue, 18 Oct 2016 17:45:16 +0000 (17:45 +0000)]
[SCEV] Make CompareValueComplexity a little bit smarter

This helps canonicalization in some cases.

Thanks to Pankaj Chawla for the investigation and the test case!

llvm-svn: 284501

8 years ago[SCEV] Extract out a helper function; NFC
Sanjoy Das [Tue, 18 Oct 2016 17:45:13 +0000 (17:45 +0000)]
[SCEV] Extract out a helper function; NFC

llvm-svn: 284500

8 years agoFix OpenMP 4.0 library build
Jonathan Peyton [Tue, 18 Oct 2016 17:39:06 +0000 (17:39 +0000)]
Fix OpenMP 4.0 library build

Patch by Andrey Churbanov

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

llvm-svn: 284499

8 years ago[X86][SSE] Added vector ashr combine tests
Simon Pilgrim [Tue, 18 Oct 2016 17:31:07 +0000 (17:31 +0000)]
[X86][SSE] Added vector ashr combine tests

This doesn't cover all combines in DAGCombiner::visitSRA yet, but identifies several cases where we fail to combine vectors (or non-splatted) vectors

llvm-svn: 284498

8 years ago[docs] Increase minimum supported GCC version for building LLVM to 4.8
Teresa Johnson [Tue, 18 Oct 2016 17:17:37 +0000 (17:17 +0000)]
[docs] Increase minimum supported GCC version for building LLVM to 4.8

Summary:
The RFC proposal sent to increase the minimum required GCC version
to 4.8 received a lot of support. See the following thread:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105955.html,

This patch implements that by updating the docs. I believe the
references to libstdc++ 4.7 issues can be removed as well, please
let me know if that is not the case or if they should be updated
a different way.

Reviewers: rengolin

Subscribers: llvm-commits

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

llvm-svn: 284497

8 years ago[cmake] Update lit search to match the one in LLVM
Michal Gorny [Tue, 18 Oct 2016 17:07:30 +0000 (17:07 +0000)]
[cmake] Update lit search to match the one in LLVM

Update the lit search logic to support all names supported in LLVM
(since r283029). The search order (i.e. PATHS vs HINTS) does no really
matter since the established path is not used, except for determining
whether lit is available.

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

llvm-svn: 284496

8 years ago[Target] remove TargetRecip class; move reciprocal estimate isel functionality to...
Sanjay Patel [Tue, 18 Oct 2016 17:05:05 +0000 (17:05 +0000)]
[Target] remove TargetRecip class; move reciprocal estimate isel functionality to TargetLowering

This is a follow-up to D24816 - where we changed reciprocal estimates to be function attributes
rather than TargetOptions.

This patch is intended to be a structural, but not functional change. By moving all of the
TargetRecip functionality into TargetLowering, we can remove all of the reciprocal estimate
state, shield the callers from the string format implementation, and simplify/localize the
logic needed for a target to enable this.

If a function has a "reciprocal-estimates" attribute, those settings may override the target's
default reciprocal preferences for whatever operation and data type we're trying to optimize.
If there's no attribute string or specific setting for the op/type pair, just use the target
default settings.

As noted earlier, a better solution would be to move the reciprocal estimate settings to IR
instructions and SDNodes rather than function attributes, but that's a multi-step job that
requires infrastructure improvements. I intend to work on that, but it's not clear how long
it will take to get all the pieces in place.

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

llvm-svn: 284495

8 years ago[solaris] Convert the support library to C++ to fix -std=c++11 build
Michal Gorny [Tue, 18 Oct 2016 16:54:59 +0000 (16:54 +0000)]
[solaris] Convert the support library to C++ to fix -std=c++11 build

Convert the Solaris xlocale.c compatibility library from plain C to C++
in order to fix the build failures caused by the addition of -std=c++11
to LIBCXX_COMPILE_FLAGS. The additional flag got propagated to the C
file, resulting in error with strict compilers.

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

llvm-svn: 284494

8 years ago[solaris] Fix iswxdigit_l() support function prototype
Michal Gorny [Tue, 18 Oct 2016 16:54:54 +0000 (16:54 +0000)]
[solaris] Fix iswxdigit_l() support function prototype

Fix the iswxdigit_l() function prototype to take wint_t parameter
instead of incorrect wchar_t.

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

llvm-svn: 284493

8 years agoFix a compile error on musl-libc due to strerror_r() prototype
Michal Gorny [Tue, 18 Oct 2016 16:38:44 +0000 (16:38 +0000)]
Fix a compile error on musl-libc due to strerror_r() prototype

Function strerror_r() has different signatures in different
implementations of libc: glibc's version returns a char*, while BSDs
and musl return a int. libomp unconditionally assumes glibc on Linux
and thus fails to compile against musl-libc. This patch addresses this
issue.

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

llvm-svn: 284492

8 years ago[DAGCombiner] Add splatted vector support to (udiv x, (shl pow2, y)) -> x >>u (log2...
Simon Pilgrim [Tue, 18 Oct 2016 16:36:00 +0000 (16:36 +0000)]
[DAGCombiner] Add splatted vector support to (udiv x, (shl pow2, y)) -> x >>u (log2(pow2)+y)

llvm-svn: 284491

8 years agoDisable fatal errors in the Verifier instantiated by bugpoint's crash
Adrian Prantl [Tue, 18 Oct 2016 16:24:43 +0000 (16:24 +0000)]
Disable fatal errors in the Verifier instantiated by bugpoint's crash
debugger.

When bugpoint hacks at a testcase it may at one point create illegal
debug info metadata that won't even pass the Verifier. A bugpoint
*driver* built with assertions should not assert on it, but reject the
malformed intermediate step and continue to do its job.

llvm-svn: 284490

8 years agoMixed type atomic routines added for capture and update/capture reverse.
Jonathan Peyton [Tue, 18 Oct 2016 16:20:55 +0000 (16:20 +0000)]
Mixed type atomic routines added for capture and update/capture reverse.

New mixed type atomic routines added for regular capture operations as well as
reverse update/capture operations.  LHS - all integer and float types (no
complex so far), RHS - float16.

Patch by Olga Malysheva

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

llvm-svn: 284489

8 years ago[X86][AVX512] Add mask/maskz writemask support to constant pool shuffle decode commentx
Simon Pilgrim [Tue, 18 Oct 2016 15:45:37 +0000 (15:45 +0000)]
[X86][AVX512] Add mask/maskz writemask support to constant pool shuffle decode commentx

llvm-svn: 284488

8 years agoUse reserve instead of grow.
Rafael Espindola [Tue, 18 Oct 2016 15:31:23 +0000 (15:31 +0000)]
Use reserve instead of grow.

The table was still being resized as grow doesn't account for the fact
that the table needs to remain 3/4 full.

llvm-svn: 284487

8 years agoRevert r284265 "[Sema] Refactor context checking for availability diagnostics"
Erik Pilkington [Tue, 18 Oct 2016 15:26:43 +0000 (15:26 +0000)]
Revert r284265 "[Sema] Refactor context checking for availability diagnostics"

This has a bug in it, pointed out by Bob Wilson!

llvm-svn: 284486

8 years ago[mips][ias] Handle more complicated expressions for memory operands
Simon Dardis [Tue, 18 Oct 2016 15:17:17 +0000 (15:17 +0000)]
[mips][ias] Handle more complicated expressions for memory operands

This patch teaches ias for mips to handle expressions such as
(8*4)+(8*31)($sp). Such expression typically occur from the expansion
of multiple macro definitions.

This partially resolves PR/30383.

Thanks to Sean Bruno for reporting the issue!

Reviewers: zoran.jovanovic, vkalintiris

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

llvm-svn: 284485

8 years agoxfail TestMiSyntax.py's test_lldbmi_output_grammar on macOS
Todd Fiala [Tue, 18 Oct 2016 15:15:24 +0000 (15:15 +0000)]
xfail TestMiSyntax.py's test_lldbmi_output_grammar on macOS

Needs to be investigated.  This is failing locally and on the
Xcode CI.

rdar://28805064

llvm-svn: 284484

8 years ago[mips] Fix sync instruction definition
Simon Dardis [Tue, 18 Oct 2016 14:42:13 +0000 (14:42 +0000)]
[mips] Fix sync instruction definition

The 'sync' instruction for MIPS was defined in MIPS-II as taking no operands.
MIPS32 extended the define of 'sync' as taking an optional unsigned 5 bit
immediate.

This patch correct the definition of sync so that it is accepted with an
operand of 0 or no operand for MIPS-II to MIPS-V, and a 5 bit unsigned
immediate for MIPS32 and later revisions.

Additionally a clear error is given when the MIPS32 version of sync is
used when targeting pre MIPS32.

This partially resolves PR/30714.

Thanks to Daniel Sanders for reporting this issue!

Reveiwers: vkalintiris

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

llvm-svn: 284483

8 years agoDebugInfo: change alignment type from uint64_t to uint32_t to save space.
Victor Leschuk [Tue, 18 Oct 2016 14:31:22 +0000 (14:31 +0000)]
DebugInfo: change alignment type from uint64_t to uint32_t to save space.
In futher patches we shall have alignment field added to DIVariable family
and switching from uint64_t to uint32_t will save 4 bytes per variable.

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

llvm-svn: 284482

8 years ago[mips] Macro expansion for ld, sd for O32
Simon Dardis [Tue, 18 Oct 2016 14:28:00 +0000 (14:28 +0000)]
[mips] Macro expansion for ld, sd for O32

ld and sd when assembled for the O32 ABI expand to a pair of 32 bit word loads
or stores using the specified source or destination register and the next
register.

This patch does not add support for the cases where the offset is greater than
a 16 bit signed immediate as that would lead to a wrong/misleading error
message as the assembler would report "instruction requires a CPU feature
not currently enabled" for ld & sd for MIPS64 when their offset is not a signed
16 bit number.

This fixes PR/29159.

Thanks to Sean Bruno for reporting this issue!

Reviewers: vkalintiris, seanbruno, zoran.jovanovic

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

llvm-svn: 284481

8 years ago[x86][inline-asm][avx512] allow swapping of '{k<num>}' & '{z}' marks
Michael Zuckerman [Tue, 18 Oct 2016 13:52:39 +0000 (13:52 +0000)]
[x86][inline-asm][avx512] allow swapping of '{k<num>}' & '{z}' marks

Committing on behalf of Coby Tayree: After check-all and LGTM

Desc:

AVX512 allows dest operand to be followed by an op-mask register specifier ('{k<num>}', which in turn may be followed by a merging/zeroing specifier ('{z}')
 Currently, the following forms are allowed:
 {k<num>}
 {k<num>}{z}

This patch allows the following forms:
 {z}{k<num>}

and ignores the next form:
 {z}

Justification would be quite simple - GCC

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

llvm-svn: 284479

8 years agoStrip trailing whitespace (NFCI)
Simon Pilgrim [Tue, 18 Oct 2016 13:44:00 +0000 (13:44 +0000)]
Strip trailing whitespace (NFCI)

llvm-svn: 284478

8 years agoalpha.core.UnreachableCode - don't warn about unreachable code inside macro
Daniel Marjamaki [Tue, 18 Oct 2016 13:16:53 +0000 (13:16 +0000)]
alpha.core.UnreachableCode - don't warn about unreachable code inside macro

In macros, 'do {...} while (0)' is often used. Don't warn about the condition 0 when it is unreachable.

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

llvm-svn: 284477

8 years agoFix signed/unsigned comparison warnings
Simon Pilgrim [Tue, 18 Oct 2016 13:15:31 +0000 (13:15 +0000)]
Fix signed/unsigned comparison warnings

llvm-svn: 284476

8 years ago[mips][FastISel] Instantiate the MipsFastISel class only for targets that support...
Vasileios Kalintiris [Tue, 18 Oct 2016 13:05:42 +0000 (13:05 +0000)]
[mips][FastISel] Instantiate the MipsFastISel class only for targets that support FastISel.

Summary:
Instead of instantiating the MipsFastISel class and checking if the
target is supported in the overriden methods, we should perform that
check before creating the class. This allows us to enable FastISel *only*
for targets that truly support it, ie. MIPS32 to MIPS32R5.

Reviewers: sdardis

Subscribers: ehostunreach, llvm-commits

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

llvm-svn: 284475

8 years ago[ELF] - Update testcases after llvm change.
George Rimar [Tue, 18 Oct 2016 11:11:03 +0000 (11:11 +0000)]
[ELF] - Update testcases after llvm change.

llvm-svn: 284474

8 years ago[analyzer] Add NumberObjectConversion checker.
Artem Dergachev [Tue, 18 Oct 2016 11:06:28 +0000 (11:06 +0000)]
[analyzer] Add NumberObjectConversion checker.

When dealing with objects that represent numbers, such as Objective-C NSNumber,
the language provides little protection from accidentally interpreting
the value of a pointer to such object as the value of the number represented
by the object. Results of such mis-interpretation may be unexpected.

The checker attempts to fill this gap in cases when the code is obviously
incorrect.

With "Pedantic" option enabled, this checker enforces a coding style to
completely prevent errors of this kind (off by default).

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

llvm-svn: 284473

8 years ago[CodeCompletion] Add a block property setter completion result
Alex Lorenz [Tue, 18 Oct 2016 10:55:01 +0000 (10:55 +0000)]
[CodeCompletion] Add a block property setter completion result

This commit changes code completion results for Objective-C block properties:
clang now suggests an additional completion result that displays the block
property together with '=' and the block literal placeholder for the appropriate
readwrite block properties.

This commit uses a simple heuristic to determine when it's appropriate to
suggest a setter completion for block properties: the additional block setter
completion is provided iff the member access that's being completed is a
standalone statement.

rdar://28481726

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

llvm-svn: 284472

8 years ago[llvm-readobj] - Teach readobj to print PT_OPENBSD_RANDOMIZE/PT_OPENBSD_WXNEEDED...
George Rimar [Tue, 18 Oct 2016 10:54:56 +0000 (10:54 +0000)]
[llvm-readobj] - Teach readobj to print PT_OPENBSD_RANDOMIZE/PT_OPENBSD_WXNEEDED headers.

These are OpenBSD specific program headers and
currently we support them in LLD.

Description of headers (just in case) available here:
http://man.openbsd.org/OpenBSD-current/man5/elf.5

OpenBSD commits were:
For PT_OPENBSD_RANDOMIZE:
https://github.com/openbsd/src/commit/c494713c450d98da3f2e1451ee8c7fb675a7c461
For PT_OPENBSD_WXNEEDED:
https://github.com/openbsd/src/commit/2a5a8fc7e30928c2cff57cfe5fb491c90d8478ad

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

llvm-svn: 284471

8 years ago[ELF] - Linkerscript: accept integer values for PHDRS types.
George Rimar [Tue, 18 Oct 2016 10:49:50 +0000 (10:49 +0000)]
[ELF] - Linkerscript: accept integer values for PHDRS types.

Both gold and ld accepts integers instead of named constants
for PHDRS.
Patch adds support for that.

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

llvm-svn: 284470

8 years agoFixup r284466 - try to unbreak NetBSD
Pavel Labath [Tue, 18 Oct 2016 10:46:45 +0000 (10:46 +0000)]
Fixup r284466 - try to unbreak NetBSD

NetBSD does not have getopt as well - we need to apply the workaround there too.
FreeBSD seems to be fine though.

llvm-svn: 284469

8 years ago[CodeCompletion][NFC] Extract a function that formats block placeholders.
Alex Lorenz [Tue, 18 Oct 2016 10:38:58 +0000 (10:38 +0000)]
[CodeCompletion][NFC] Extract a function that formats block placeholders.

This commit extracts a new function named `formatBlockPlaceholder` from
the function `FormatFunctionParameter` so that it can be reused in follow-up
commits that improve code completion for block property setters.

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

llvm-svn: 284468

8 years ago[CodeCompletion][NFC] Extract a function that looks for block decl type locs.
Alex Lorenz [Tue, 18 Oct 2016 10:35:27 +0000 (10:35 +0000)]
[CodeCompletion][NFC] Extract a function that looks for block decl type locs.

This commit extracts a new function named `findTypeLocationForBlockDecl` from
the function `FormatFunctionParameter` so that it can be reused in follow-up
commits that improve code completion for block property setters.

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

llvm-svn: 284467

8 years ago[cmake] Make dependencies of lldb libraries private, take 2
Pavel Labath [Tue, 18 Oct 2016 10:26:57 +0000 (10:26 +0000)]
[cmake] Make dependencies of lldb libraries private, take 2

Summary:
The dependencies of our libraries (only liblldb, really) we marked as public, which caused all
their dependencies to be repeated when linking any executables to them. This is a problem because
then all the .a files could end up being linked twice, once to liblldb and once
again to to the executable linking against liblldb (lldb, lldb-mi). As it turns out,
our build actually depends on this behavior:
- on windows, lldb does not have getopt, so it pulls it from inside liblldb, even
  though getopt is not a part of the exported interface of liblldb (maybe some of
  the bsd variants have this problem as well)
- lldb-mi uses llvm, which again is not exported by liblldb

This change does not actually fix these problems (that is going to be a hard
one), but it does make them explicit by moving this magic from add_lldb_library
to the places the executable targets are defined. That way, I can link the
additional .a files only on targets that really need it, and the other targets
can build cleanly and make sure we don't regress further. It also fixes the
LLVM_LINK_LLVM_DYLIB build on linux.

Reviewers: zturner, beanz

Subscribers: ki.stfu, lldb-commits, mgorny

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

llvm-svn: 284466

8 years ago[SCEV] More accurate calculation of max backedge count of some less-than loops
John Brawn [Tue, 18 Oct 2016 10:10:53 +0000 (10:10 +0000)]
[SCEV] More accurate calculation of max backedge count of some less-than loops

In loops that look something like
 i = n;
 do {
  ...
 } while(i++ < n+k);
where k is a constant, the maximum backedge count is k (in fact the backedge
count will be either 0 or k, depending on whether n+k wraps). More generally
for LHS < RHS if RHS-(LHS of first comparison) is a constant then the loop will
iterate either 0 or that constant number of times.

This allows for more loop unrolling with the recent upper bound loop unrolling
changes, and I'm working on a patch that will let loop unrolling additionally
make use of the loop being executed either 0 or k times (we need to retain the
loop comparison only on the first unrolled iteration).

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

llvm-svn: 284465

8 years ago[libclang] Add missing cursor kinds to python bindings.
Igor Kudrin [Tue, 18 Oct 2016 09:42:03 +0000 (09:42 +0000)]
[libclang] Add missing cursor kinds to python bindings.

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

llvm-svn: 284464

8 years ago[libclang] Fix a failure in a test for python bindings on CursorKind.OVERLOAD_CANDIDATE.
Igor Kudrin [Tue, 18 Oct 2016 09:30:33 +0000 (09:30 +0000)]
[libclang] Fix a failure in a test for python bindings on CursorKind.OVERLOAD_CANDIDATE.

The test fails because the value does not lay in any existing group.

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

llvm-svn: 284463

8 years agoRevert "Resubmit "Add support for advanced number formatting.""
Renato Golin [Tue, 18 Oct 2016 09:30:18 +0000 (09:30 +0000)]
Revert "Resubmit "Add support for advanced number formatting.""

This reverts commits 284436 and 284437 because they still break AArch64 bots:

Value of: format_number(-10, IntegerStyle::Integer, 1)
  Actual: "-0"
  Expected: "-10"

llvm-svn: 284462

8 years ago[X86][SSE] Added extra (mul x, (1 << c)) -> x << c style vector tests
Simon Pilgrim [Tue, 18 Oct 2016 09:29:13 +0000 (09:29 +0000)]
[X86][SSE] Added extra (mul x, (1 << c)) -> x << c style vector tests

vXi64 will benefit more from lowering to shifts than multiplies

llvm-svn: 284461

8 years ago[ARM] Assign cost of scaling for Cortex-R52
Javed Absar [Tue, 18 Oct 2016 09:08:54 +0000 (09:08 +0000)]
[ARM] Assign cost of scaling for Cortex-R52

This patch assigns cost of the scaling used in addressing for Cortex-R52.

On Cortex-R52 a negated register offset takes longer than a non-negated
register offset, in a register-offset addressing mode.

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

Reviewer: jmolloy
llvm-svn: 284460

8 years ago[X86][SSE] Add lowering to cvttpd2dq/cvttps2dq for sitofp v2f64/2f32 to 2i32
Simon Pilgrim [Tue, 18 Oct 2016 07:42:15 +0000 (07:42 +0000)]
[X86][SSE] Add lowering to cvttpd2dq/cvttps2dq for sitofp v2f64/2f32 to 2i32

As discussed on PR28461 we currently miss the chance to lower "fptosi <2 x double> %arg to <2 x i32>" to cvttpd2dq due to its use of illegal types.

This patch adds support for fptosi to 2i32 from both 2f64 and 2f32.

It also recognises that cvttpd2dq zeroes the upper 64-bits of the xmm result (similar to D23797) - we still don't do this for the cvttpd2dq/cvttps2dq intrinsics - this can be done in a future patch.

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

llvm-svn: 284459

8 years ago[c++1z] Include "noexcept" in builtin function types where appropriate. Fixes
Richard Smith [Tue, 18 Oct 2016 07:13:55 +0000 (07:13 +0000)]
[c++1z] Include "noexcept" in builtin function types where appropriate. Fixes
an assertion failure looking up a matching ::operator delete for
__builtin_operator_delete.

llvm-svn: 284458

8 years ago[c++1z] Use canonical expression equivalence to determine whether two different
Richard Smith [Tue, 18 Oct 2016 06:47:03 +0000 (06:47 +0000)]
[c++1z] Use canonical expression equivalence to determine whether two different
dependent noexcept specifications result in the same canonical function type.

We still use non-canonical hashing when deduplicating type sugar so that
diagnostics will point to the right place.

llvm-svn: 284457

8 years ago[XRay] Support for for tail calls for ARM no-Thumb
Dean Michael Berris [Tue, 18 Oct 2016 05:54:15 +0000 (05:54 +0000)]
[XRay] Support for for tail calls for ARM no-Thumb

This patch adds simplified support for tail calls on ARM with XRay instrumentation.

Known issue: compiled with generic flags: `-O3 -g -fxray-instrument -Wall
-std=c++14  -ffunction-sections -fdata-sections` (this list doesn't include my
specific flags like --target=armv7-linux-gnueabihf etc.), the following program

    #include <cstdio>
    #include <cassert>
    #include <xray/xray_interface.h>

    [[clang::xray_always_instrument]] void __attribute__ ((noinline)) fC() {
      std::printf("In fC()\n");
    }

    [[clang::xray_always_instrument]] void __attribute__ ((noinline)) fB() {
      std::printf("In fB()\n");
      fC();
    }

    [[clang::xray_always_instrument]] void __attribute__ ((noinline)) fA() {
      std::printf("In fA()\n");
      fB();
    }

    // Avoid infinite recursion in case the logging function is instrumented (so calls logging
    //   function again).
    [[clang::xray_never_instrument]] void simplyPrint(int32_t functionId, XRayEntryType xret)
    {
      printf("XRay: functionId=%d type=%d.\n", int(functionId), int(xret));
    }

    int main(int argc, char* argv[]) {
      __xray_set_handler(simplyPrint);

      printf("Patching...\n");
      __xray_patch();
      fA();

      printf("Unpatching...\n");
      __xray_unpatch();
      fA();

      return 0;
    }

gives the following output:

    Patching...
    XRay: functionId=3 type=0.
    In fA()
    XRay: functionId=3 type=1.
    XRay: functionId=2 type=0.
    In fB()
    XRay: functionId=2 type=1.
    XRay: functionId=1 type=0.
    XRay: functionId=1 type=1.
    In fC()
    Unpatching...
    In fA()
    In fB()
    In fC()

So for function fC() the exit sled seems to be called too much before function
exit: before printing In fC().

Debugging shows that the above happens because printf from fC is also called as
a tail call. So first the exit sled of fC is executed, and only then printf is
jumped into. So it seems we can't do anything about this with the current
approach (i.e. within the simplification described in
https://reviews.llvm.org/D23988 ).

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

llvm-svn: 284456

8 years ago[AVX-512] Add test case to check shuffle decoding for masked vpermilps for r284450.
Craig Topper [Tue, 18 Oct 2016 05:44:04 +0000 (05:44 +0000)]
[AVX-512] Add test case to check shuffle decoding for masked vpermilps for r284450.

This is harder to do for vpermilpd as shuffle combining turns the constant vector into an immediate since all vpermilpd's inputs with constant vector can also be encoded with the immediate form.

llvm-svn: 284455

8 years agoObject: Add a missing return in ObjectFile::createObjectFile
Justin Bogner [Tue, 18 Oct 2016 05:17:23 +0000 (05:17 +0000)]
Object: Add a missing return in ObjectFile::createObjectFile

When Error was threaded through these APIs back in r265606 the
"return" was missed here, which triggers a warning if/when I add
LLVM_NODISCARD to the Error type.

llvm-svn: 284454

8 years ago[X86] Fix DecodeVPERMVMask to handle cases where the constant pool entry has a differ...
Craig Topper [Tue, 18 Oct 2016 04:48:33 +0000 (04:48 +0000)]
[X86] Fix DecodeVPERMVMask to handle cases where the constant pool entry has a different type than the shuffle itself.

This is especially important for 32-bit targets with 64-bit shuffle elements.

llvm-svn: 284453

8 years agoImprove tablegen gen-subtarget diagnostics for missing machine models.
Andrew Trick [Tue, 18 Oct 2016 04:17:44 +0000 (04:17 +0000)]
Improve tablegen gen-subtarget diagnostics for missing machine models.

-debug-only=subtarget-emitter prints a lot of machine model diagnostics.
This prunes the output so that the "No machine model for XXX on processor YYY"
only appears when there is definitely no machine model for that opcode.
Previously it was printing that error even if the opcode was covered by
a more general scheduling class.

<rdar://problem/15919845> [TableGen][CodeGenSchedule] Debug output does not help spotting the missing scheduling classes

llvm-svn: 284452

8 years ago[AVX-512] Fix DecodeVPERMV3Mask to handle cases where the constant pool entry has...
Craig Topper [Tue, 18 Oct 2016 04:00:32 +0000 (04:00 +0000)]
[AVX-512] Fix DecodeVPERMV3Mask to handle cases where the constant pool entry has a different type than the shuffle itself.

Summary: This is especially important for 32-bit targets with 64-bit shuffle elements.This is similar to how PSHUFB and VPERMIL handle the same problem.

Reviewers: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 284451

8 years ago[AVX-512] Add support for decoding shuffle mask from constant pool for masked VPERMIL...
Craig Topper [Tue, 18 Oct 2016 03:36:52 +0000 (03:36 +0000)]
[AVX-512] Add support for decoding shuffle mask from constant pool for masked VPERMILPS/PD.

llvm-svn: 284450

8 years agoRemove a debug print statement.
Jim Ingham [Tue, 18 Oct 2016 01:52:32 +0000 (01:52 +0000)]
Remove a debug print statement.

llvm-svn: 284448

8 years agoMore testsuite xfail markings cleanup.
Jim Ingham [Tue, 18 Oct 2016 01:43:22 +0000 (01:43 +0000)]
More testsuite xfail markings cleanup.

llvm-svn: 284446

8 years ago[analyzer] Update alpha and potential checker documentation, esp. alpha.valist
Dominic Chen [Tue, 18 Oct 2016 01:15:19 +0000 (01:15 +0000)]
[analyzer] Update alpha and potential checker documentation, esp. alpha.valist

Summary:
Move alpha.valist from potential to alpha since it was implemented in D15227

Cleanup some HTML comments, add a missing link

Reviewers: jordan_rose, zaks.anna

Subscribers: cfe-commits, xazax.hun

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

llvm-svn: 284445

8 years ago[CMake] Add missing dependency on intrinsics_gen
Chris Bieneman [Tue, 18 Oct 2016 00:50:39 +0000 (00:50 +0000)]
[CMake] Add missing dependency on intrinsics_gen

COFF/InputFiles.h includes LTOModule.h which transitively relies on Attributes.inc.

llvm-svn: 284444

8 years ago[CMake] Add a few default passthrough variables for bootstrap builds
Chris Bieneman [Tue, 18 Oct 2016 00:50:20 +0000 (00:50 +0000)]
[CMake] Add a few default passthrough variables for bootstrap builds

This just passes through a few missing CMake variables for multi-stage builds.

llvm-svn: 284443

8 years ago[Basic] unique_ptr-ify SourceManager::MacroArgsCacheMap (NFC)
Vedant Kumar [Tue, 18 Oct 2016 00:23:27 +0000 (00:23 +0000)]
[Basic] unique_ptr-ify SourceManager::MacroArgsCacheMap (NFC)

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

llvm-svn: 284442

8 years agoFix differences in codegen between Linux and Windows toolchains
Mandeep Singh Grang [Tue, 18 Oct 2016 00:11:19 +0000 (00:11 +0000)]
Fix differences in codegen between Linux and Windows toolchains

Summary:
    There are differences in codegen between Linux and Windows due to:
    1. Using std::sort which uses quicksort which is a non-stable sort.

    2. Iterating over Set data structure where the iteration order is
       non deterministic.

Reviewers: arsenm, grosbach, junbuml, zinob, MatzeB

Subscribers: MatzeB, wdng

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

llvm-svn: 284441

8 years ago[profile] Mark lprofCurFilename as COMPILER_RT_WEAK
Vedant Kumar [Tue, 18 Oct 2016 00:02:28 +0000 (00:02 +0000)]
[profile] Mark lprofCurFilename as COMPILER_RT_WEAK

This makes __llvm_profile_set_filename() work across dylib boundaries on
Darwin.

This functionality was originally meant to work on all platforms, but
was moved to a Linux-only directory with r272404. The root cause of the
test failure on Darwin was that lprofCurFilename was not marked weak.
Each dylib maintained its own copy of the variable due to the two-level
namespace.

Tested with check-profile (on Darwin). I don't expect this to regress
other platforms.

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

llvm-svn: 284440

8 years agoFix a crash in expressions with fixits in the dummy target.
Jim Ingham [Mon, 17 Oct 2016 23:59:41 +0000 (23:59 +0000)]
Fix a crash in expressions with fixits in the dummy target.

In the expression command, if the target is NULL, you have to use the dummy
target.

<rdar://problem/28811687>

llvm-svn: 284439

8 years agoRename HexStyle -> HexFormatStyle, and remove a constexpr.
Zachary Turner [Mon, 17 Oct 2016 23:08:47 +0000 (23:08 +0000)]
Rename HexStyle -> HexFormatStyle, and remove a constexpr.

This should fix the remaining broken builds.

llvm-svn: 284437

8 years agoResubmit "Add support for advanced number formatting."
Zachary Turner [Mon, 17 Oct 2016 22:49:24 +0000 (22:49 +0000)]
Resubmit "Add support for advanced number formatting."

This resubmits commits 284425 and r284428, which were reverted
in r284429 due to some infinite recursion caused by an incorrect
selection of function overloads.  Reproduced the failure on Linux
using GCC 4.8.4, and confirmed that with the new patch the tests
path on GCC as well as MSVC.  So hopefully this fixes everything.

llvm-svn: 284436

8 years ago[AMDGPU] Mark .note section SHF_ALLOC so lld creates a segment for it
Konstantin Zhuravlyov [Mon, 17 Oct 2016 22:40:15 +0000 (22:40 +0000)]
[AMDGPU] Mark .note section SHF_ALLOC so lld creates a segment for it

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

llvm-svn: 284435

8 years ago[ADT] Move CachedHashString to its own header in ADT, and rename to CachedHashStringRef.
Justin Lebar [Mon, 17 Oct 2016 22:24:36 +0000 (22:24 +0000)]
[ADT] Move CachedHashString to its own header in ADT, and rename to CachedHashStringRef.

Summary:
Reclaiming the name 'CachedHashString' will let us add a type with that
name that owns its value.

Reviewers: timshen

Subscribers: llvm-commits

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

llvm-svn: 284434

8 years ago[ADT] Add an initializer_list constructor to {Small,}DenseSet.
Justin Lebar [Mon, 17 Oct 2016 22:24:32 +0000 (22:24 +0000)]
[ADT] Add an initializer_list constructor to {Small,}DenseSet.

Reviewers: timshen

Subscribers: llvm-commits

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

llvm-svn: 284433

8 years ago[ADT] Add SmallDenseSet.
Justin Lebar [Mon, 17 Oct 2016 22:24:28 +0000 (22:24 +0000)]
[ADT] Add SmallDenseSet.

Summary: This matches SmallDenseMap.

Reviewers: timshen

Subscribers: llvm-commits

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

llvm-svn: 284432

8 years agoNext set of additional error checks for invalid Mach-O files for the
Kevin Enderby [Mon, 17 Oct 2016 22:09:25 +0000 (22:09 +0000)]
Next set of additional error checks for invalid Mach-O files for the
load commands that use the MachO::sub_framework_command,
MachO::sub_umbrella_command, MachO::sub_library_command
and MachO::sub_client_command types but are not used in llvm
libObject code but used in llvm tool code.

This includes the LC_SUB_FRAMEWORK, LC_SUB_UMBRELLA,
LC_SUB_LIBRARY and LC_SUB_CLIENT load commands.

llvm-svn: 284431

8 years ago[Driver] Use stem rather than filename for executable name
Petr Hosek [Mon, 17 Oct 2016 22:02:53 +0000 (22:02 +0000)]
[Driver] Use stem rather than filename for executable name

When comparing the linker name in Fuchsia driver, use stem rather
than filename to get the name of the linker becase on Windows, the
filename will have an extension.

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

llvm-svn: 284430

8 years agoRevert formatting changes.
Zachary Turner [Mon, 17 Oct 2016 21:25:41 +0000 (21:25 +0000)]
Revert formatting changes.

This reverts r288425 and r284428 as they are causing test crashes
on some systems.

llvm-svn: 284429

8 years agoTry to fix build after invalid pointer conversion.
Zachary Turner [Mon, 17 Oct 2016 21:14:27 +0000 (21:14 +0000)]
Try to fix build after invalid pointer conversion.

llvm-svn: 284428