platform/upstream/llvm.git
8 years agoclang-format: [JS] Fix missing space after 'yield'.
Daniel Jasper [Mon, 31 Oct 2016 13:18:25 +0000 (13:18 +0000)]
clang-format: [JS] Fix missing space after 'yield'.

Before:
  class X {
    delete(val) {
      return null;
    }
    * gen() {
      yield[1, 2];
    }
    * gen() {
      yield{a: 1};
    }
  };

After:
  class X {
    delete(val) {
      return null;
    }
    * gen() {
      yield [1, 2];
    }
    * gen() {
      yield {a: 1};
    }
  };

llvm-svn: 285569

8 years agoSecond attempt at r285517.
Dorit Nuzman [Mon, 31 Oct 2016 13:17:31 +0000 (13:17 +0000)]
Second attempt at r285517.

llvm-svn: 285568

8 years agoCorrectly merge visibility of linkerscript created symbols.
Rafael Espindola [Mon, 31 Oct 2016 13:14:53 +0000 (13:14 +0000)]
Correctly merge visibility of linkerscript created symbols.

llvm-svn: 285567

8 years ago[SystemZ] Model 2 VBU units (not 1) in SystemZScheduleZ13.td.
Jonas Paulsson [Mon, 31 Oct 2016 13:05:48 +0000 (13:05 +0000)]
[SystemZ] Model 2 VBU units (not 1) in SystemZScheduleZ13.td.

NFC.

Review: Ulrich Weigand.
llvm-svn: 285566

8 years agorevert r285563 fail in test CodeGen/avx512-inline-asm-kregisters-basics.c
Michael Zuckerman [Mon, 31 Oct 2016 12:49:36 +0000 (12:49 +0000)]
revert r285563 fail in test CodeGen/avx512-inline-asm-kregisters-basics.c

llvm-svn: 285565

8 years agoImproved cost model for FDIV and FSQRT, by Andrew Tischenko
Alexey Bataev [Mon, 31 Oct 2016 12:10:53 +0000 (12:10 +0000)]
Improved cost model for FDIV and FSQRT, by Andrew Tischenko

There is a bug describing poor cost model for floating point operations:
Bug 29083 - [X86][SSE] Improve costs for floating point operations. This
patch is the second one in series of patches dealing with cost model.

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

llvm-svn: 285564

8 years ago [x86][inline-asm] Introducing (AVX512) k0-k7 registers for inline-asm usage
Michael Zuckerman [Mon, 31 Oct 2016 12:05:41 +0000 (12:05 +0000)]
 [x86][inline-asm] Introducing (AVX512) k0-k7 registers for inline-asm usage

 Commit on behalf of mharoush

 After LGTM and check all:
 This patch enables usage of k registers in inline assembly syntax.
 Adding triple

 Reviewer: 1. rnk
           2. delena

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

llvm-svn: 285563

8 years agoUse the right dwarf attributes for parsing location list entries (fixup for r285441)
Pavel Labath [Mon, 31 Oct 2016 11:53:13 +0000 (11:53 +0000)]
Use the right dwarf attributes for parsing location list entries (fixup for r285441)

Note that the parsing code here is still incorrect wrt. the new draft of the
dwarf 5 spec (seconds arguments to DW_LLE_startx_length should be uleb128, not
u32). Once we have compilers actually emitting dwarf conformant with the new
spec, we'll need to revisit this and figure out the proper behavior there.

This should unbreak the linux bot.

llvm-svn: 285562

8 years agoFix this test when we have clang-offload-bundler.exe.
Rafael Espindola [Mon, 31 Oct 2016 11:47:37 +0000 (11:47 +0000)]
Fix this test when we have clang-offload-bundler.exe.

llvm-svn: 285561

8 years agoAdd triple to test so it does not fail on windows.
Manuel Klimek [Mon, 31 Oct 2016 11:40:14 +0000 (11:40 +0000)]
Add triple to test so it does not fail on windows.

llvm-svn: 285560

8 years agoDelete .s file that did not test anything, and check in test that works.
Manuel Klimek [Mon, 31 Oct 2016 11:18:39 +0000 (11:18 +0000)]
Delete .s file that did not test anything, and check in test that works.

In D26098, Davide Italiano submitted a .s file instead of the .ll file
that was the last stage of the review.

llvm-svn: 285559

8 years agoAdd getOffset to ELFSectionRef
Eugene Leviant [Mon, 31 Oct 2016 11:03:01 +0000 (11:03 +0000)]
Add getOffset to ELFSectionRef

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

llvm-svn: 285558

8 years ago[OpenCL] Setting constant address space for array initializers
Alexey Bader [Mon, 31 Oct 2016 10:26:31 +0000 (10:26 +0000)]
[OpenCL] Setting constant address space for array initializers

Summary: Setting constant address space for global constants used for memcpy-initialization of arrays.

Patch by Alexey Sotkin.

Reviewers: bader, yaxunl, Anastasia

Subscribers: cfe-commits, AlexeySotkin

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

llvm-svn: 285557

8 years agoRevert reviosion 285555
Michael Zuckerman [Mon, 31 Oct 2016 10:12:36 +0000 (10:12 +0000)]
Revert reviosion 285555

llvm-svn: 285556

8 years ago[x86][inline-asm] Introducing (AVX512) k0-k7 registers for inline-asm usage
Michael Zuckerman [Mon, 31 Oct 2016 09:37:59 +0000 (09:37 +0000)]
[x86][inline-asm] Introducing (AVX512) k0-k7 registers for inline-asm usage

Commit on behalf of mharoush

After LGTM and check all:
This patch enables usage of k registers in inline assembly syntax.

Reviewer: 1. rnk
          2. delena

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

llvm-svn: 285555

8 years agoChange from "XFAIL: libcpp-no-exceptions" to "UNSUPPORTED: libcpp-no-exceptions"...
Roger Ferrer Ibanez [Mon, 31 Oct 2016 08:47:53 +0000 (08:47 +0000)]
Change from "XFAIL: libcpp-no-exceptions" to "UNSUPPORTED: libcpp-no-exceptions" tests that only check exceptions and nothing else

This is a follow up of D24562.

These tests do not check anything but exceptions, so it makes sense to mark
them as UNSUPPORTED under a library built without exceptions.

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

llvm-svn: 285550

8 years ago[change-namespace] fix namespace specifiers of template arguments.
Eric Liu [Mon, 31 Oct 2016 08:28:29 +0000 (08:28 +0000)]
[change-namespace] fix namespace specifiers of template arguments.

llvm-svn: 285549

8 years ago[Modules] Add a command line option for loading the clang builtins modulemap.
Elad Cohen [Mon, 31 Oct 2016 08:21:54 +0000 (08:21 +0000)]
[Modules] Add a command line option for loading the clang builtins modulemap.

-fbuiltin-module-map loads the clang builtins modulemap file. (This is
equivalent to -fmodule-map-file=<resource dir>/include/module.modulemap)

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

llvm-svn: 285548

8 years ago[AVX-512] Add a regular expression to a test that was missed in r285540.
Craig Topper [Mon, 31 Oct 2016 06:24:00 +0000 (06:24 +0000)]
[AVX-512] Add a regular expression to a test that was missed in r285540.

llvm-svn: 285547

8 years ago[AVX-512] Add missing patterns for selecting masked vector extracts that started...
Craig Topper [Mon, 31 Oct 2016 05:55:57 +0000 (05:55 +0000)]
[AVX-512] Add missing patterns for selecting masked vector extracts that started from shuffles.

llvm-svn: 285546

8 years ago[AVX-512] Use selectd instead of selectps for _mm256_mask_extracti32x4_epi32.
Craig Topper [Mon, 31 Oct 2016 05:49:11 +0000 (05:49 +0000)]
[AVX-512] Use selectd instead of selectps for _mm256_mask_extracti32x4_epi32.

llvm-svn: 285545

8 years agoAdd support for __builtin_alloca_with_align
David Majnemer [Mon, 31 Oct 2016 05:37:48 +0000 (05:37 +0000)]
Add support for __builtin_alloca_with_align

__builtin_alloca always uses __BIGGEST_ALIGNMENT__ for the alignment of
the allocation.  __builtin_alloca_with_align allows the programmer to
specify the alignment of the allocation.

This fixes PR30658.

llvm-svn: 285544

8 years agoMake output of ast-print closer to C++ code
Serge Pavlov [Mon, 31 Oct 2016 05:11:12 +0000 (05:11 +0000)]
Make output of ast-print closer to C++ code

Put semicolon after non-defining method declaration and a class
specialization body.

llvm-svn: 285543

8 years ago[Test Suite] Pull generateSource into lldbtest
Chris Bieneman [Mon, 31 Oct 2016 04:48:19 +0000 (04:48 +0000)]
[Test Suite] Pull generateSource into lldbtest

Summary:
Convert tests using LLDB headers to use generateSource to put the right include paths in place regardless of whether or not you're building a framework.

This also abstracted generateSource out of TestPublicAPIHeaders.py into lldbtest.py.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

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

llvm-svn: 285542

8 years ago[Test Suite] Properly respect --framework option
Chris Bieneman [Mon, 31 Oct 2016 04:48:10 +0000 (04:48 +0000)]
[Test Suite] Properly respect --framework option

Summary:
dotest.py has a framework option that is not respected. This patch makes the framework path properly configurable via the --framework option.

This patch also adds a function to the lldbtest.Base class named "hasDarwinFramework" which allows us to not rely on the host platform to determine if a framework is present. If running on Darwin, and not building a framework, this will follow the *nix code paths which are appropriate for Darwin.

Reviewers: tfiala

Subscribers: lldb-commits, mgorny

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

llvm-svn: 285541

8 years ago[AVX-512] Remove masked vector extract builtins and replace with native shufflevector...
Craig Topper [Mon, 31 Oct 2016 04:30:56 +0000 (04:30 +0000)]
[AVX-512] Remove masked vector extract builtins and replace with native shufflevectors and selects.

Unfortunately, the backend currently doesn't fold masks into the instructions correctly when they come from these shufflevectors. I'll work on that in a future commit.

llvm-svn: 285540

8 years ago[AVX-512] Remove many of the masked 128/256-bit shift builtins and replace them with...
Craig Topper [Mon, 31 Oct 2016 04:30:51 +0000 (04:30 +0000)]
[AVX-512] Remove many of the masked 128/256-bit shift builtins and replace them with unmasked builtins and selects.

llvm-svn: 285539

8 years agoAdd 'inline' but not 'always_inline' to std::strings destructor.
Eric Fiselier [Mon, 31 Oct 2016 03:42:50 +0000 (03:42 +0000)]
Add 'inline' but not 'always_inline' to std::strings destructor.

Adding both 'inline' and 'always_inline' to the destructor has been contentious.
However most of the performance benefits can be gained by only adding 'inline',
and there is no reason to hold up that change while discussing the other.

llvm-svn: 285538

8 years agoRemove additional function template definitions from the dylib
Eric Fiselier [Mon, 31 Oct 2016 03:40:29 +0000 (03:40 +0000)]
Remove additional function template definitions from the dylib

llvm-svn: 285537

8 years agoMake a test case more rigorous; NFC
Sanjoy Das [Mon, 31 Oct 2016 03:32:45 +0000 (03:32 +0000)]
Make a test case more rigorous; NFC

llvm-svn: 285536

8 years ago[SCEV] Try to order n-ary expressions in CompareValueComplexity
Sanjoy Das [Mon, 31 Oct 2016 03:32:43 +0000 (03:32 +0000)]
[SCEV] Try to order n-ary expressions in CompareValueComplexity

llvm-svn: 285535

8 years ago[SCEV] Reduce boilerplate in unit tests
Sanjoy Das [Mon, 31 Oct 2016 03:32:39 +0000 (03:32 +0000)]
[SCEV] Reduce boilerplate in unit tests

llvm-svn: 285534

8 years ago[analyzer] NumberObjectConversion: support more types, misc updates.
Artem Dergachev [Mon, 31 Oct 2016 03:08:48 +0000 (03:08 +0000)]
[analyzer] NumberObjectConversion: support more types, misc updates.

Support CFNumberRef and OSNumber objects, which may also be accidentally
converted to plain integers or booleans.

Enable explicit boolean casts by default in non-pedantic mode.

Improve handling for warnings inside macros.

Improve error messages.

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

llvm-svn: 285533

8 years agoOptimize filesystem::path by providing weaker exception guarantees.
Eric Fiselier [Mon, 31 Oct 2016 02:46:25 +0000 (02:46 +0000)]
Optimize filesystem::path by providing weaker exception guarantees.

path uses string::append to construct, append, and concatenate paths. Unfortunatly
string::append has a strong exception safety guaranteed and if it can't prove
that the iterator operations don't throw then it will allocate a temporary
string copy to append to. However this extra allocation and copy is very
undesirable for path which doesn't have the same exception guarantees.

To work around this this patch adds string::__append_forward_unsafe which exposes
the std::string::append interface for forward iterators without enforcing
that the iterator is noexcept.

llvm-svn: 285532

8 years agoFix _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY to always have default visibility.
Eric Fiselier [Mon, 31 Oct 2016 02:07:23 +0000 (02:07 +0000)]
Fix _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY to always have default visibility.

This prevent the symbols from being both externally available and hidden, which
causes them to be linked incorrectly. This is only a problem when the address
of the function is explicitly taken since it will always be inlined otherwise.

This patch fixes the issues that caused r285456 to be reverted, and can
now be reapplied.

llvm-svn: 285531

8 years agoImprove performance of constructing filesystem::path from strings.
Eric Fiselier [Sun, 30 Oct 2016 23:53:50 +0000 (23:53 +0000)]
Improve performance of constructing filesystem::path from strings.

This patch fixes a performance bug when constructing or appending to a path
from a string or c-string. Previously we called 'push_back' to append every
single character. This caused multiple re-allocation and copies when at most
one reallocation is necessary. The new behavior is to simply call
`string::append` so it can correctly handle reallocation.

For large strings this change is a ~4x improvement. This also makes our path
faster to construct than libstdc++'s.

llvm-svn: 285530

8 years ago[SCEV] In CompareValueComplexity, order global values by their name
Sanjoy Das [Sun, 30 Oct 2016 23:52:56 +0000 (23:52 +0000)]
[SCEV] In CompareValueComplexity, order global values by their name

llvm-svn: 285529

8 years ago[SCEV] Use auto for consistency with an upcoming change; NFC
Sanjoy Das [Sun, 30 Oct 2016 23:52:53 +0000 (23:52 +0000)]
[SCEV] Use auto for consistency with an upcoming change; NFC

llvm-svn: 285528

8 years agoClean up test a little bit; NFC
Sanjoy Das [Sun, 30 Oct 2016 23:52:50 +0000 (23:52 +0000)]
Clean up test a little bit; NFC

llvm-svn: 285527

8 years agoRewrite std::filesystem::path iterators and parser
Eric Fiselier [Sun, 30 Oct 2016 23:30:38 +0000 (23:30 +0000)]
Rewrite std::filesystem::path iterators and parser

This patch entirely rewrites the parsing logic for paths. Unlike the previous
implementation this one stores information about the current state; For example
if we are in a trailing separator or a root separator. This avoids the need for
extra lookahead (and extra work) when incrementing or decrementing an iterator.
Roughly this gives us a 15% speedup over the previous implementation.

Unfortunately this implementation is still a lot slower than libstdc++'s.
Because libstdc++ pre-parses and splits the path upon construction their
iterators are trivial to increment/decrement. This makes libc++ lazy parsing
100x slower than libstdc++. However the pre-parsing libstdc++ causes a ton
of extra and unneeded allocations when constructing the string. For example
`path("/foo/bar/")` would require at least 5 allocations with libstdc++
whereas libc++ uses only one. The non-allocating behavior is much preferable
when you consider filesystem usages like 'exists("/foo/bar/")'.

Even then libc++'s path seems to be twice as slow to simply construct compared
to libstdc++. More investigation is needed about this.

llvm-svn: 285526

8 years agoFix clang installed path to handle case where clang is invoked through a symlink
Mehdi Amini [Sun, 30 Oct 2016 23:26:13 +0000 (23:26 +0000)]
Fix clang installed path to handle case where clang is invoked through a symlink

This code path is used when generating the path to libLTO.dylib, which
is passed to the linker as `-lto_library'.
Without this, if clang is invoked through a symlink, libLTO is
searched in a path relative to where the symlink is instead of
where clang is actually installed.

Fix PR30811.

Patch by: Jack Howarth

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

llvm-svn: 285525

8 years agoAdd start of filesystem benchmarks
Eric Fiselier [Sun, 30 Oct 2016 22:53:00 +0000 (22:53 +0000)]
Add start of filesystem benchmarks

llvm-svn: 285524

8 years agoMark thread exit test as unsupported w/o threads
Eric Fiselier [Sun, 30 Oct 2016 20:05:52 +0000 (20:05 +0000)]
Mark thread exit test as unsupported w/o threads

llvm-svn: 285523

8 years ago[DAG] x | x --> x
Sanjay Patel [Sun, 30 Oct 2016 18:19:35 +0000 (18:19 +0000)]
[DAG] x | x --> x

llvm-svn: 285522

8 years ago[DAG] x & x --> x
Sanjay Patel [Sun, 30 Oct 2016 18:13:30 +0000 (18:13 +0000)]
[DAG] x & x --> x

llvm-svn: 285521

8 years ago[x86] add tests for basic logic op folds
Sanjay Patel [Sun, 30 Oct 2016 18:04:19 +0000 (18:04 +0000)]
[x86] add tests for basic logic op folds

llvm-svn: 285520

8 years agoFixing "type" issue for (epi32)
Michael Zuckerman [Sun, 30 Oct 2016 14:54:05 +0000 (14:54 +0000)]
Fixing "type" issue for (epi32)
and replaceing hardcoded inf with clang builtin inf "__builtin_inff()" for float ({max|min}_{pd|ps})

llvm-svn: 285519

8 years agoRevert r285517 due to build failures.
Dorit Nuzman [Sun, 30 Oct 2016 14:34:57 +0000 (14:34 +0000)]
Revert r285517 due to build failures.

llvm-svn: 285518

8 years ago[LoopVectorize] Make interleaved-accesses analysis less conservative about
Dorit Nuzman [Sun, 30 Oct 2016 12:23:26 +0000 (12:23 +0000)]
[LoopVectorize] Make interleaved-accesses analysis less conservative about
possible pointer-wrap-around concerns, in some cases.

Before this patch, collectConstStridedAccesses (part of interleaved-accesses
analysis) called getPtrStride with [Assume=false, ShouldCheckWrap=true] when
examining all candidate pointers. This is too conservative. Instead, this
patch makes collectConstStridedAccesses use an optimistic approach, calling
getPtrStride with [Assume=true, ShouldCheckWrap=false], and then, once the
candidate interleave groups have been formed, revisits the pointer-wrapping
analysis but only where it matters: namely, in groups that have gaps, and where
the gaps are not at the very end of the group (in which case the loop is
peeled). This second time getPtrStride is called with [Assume=false,
ShouldCheckWrap=true], but this could further be improved to using Assume=true,
once we also add the logic to track that we are not going to meet the scev
runtime checks threshold.

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

llvm-svn: 285517

8 years ago[AVX-512] Remove masked 128/256-bit builtins for vpmaddwd and vpmaddubsw. Replace...
Craig Topper [Sun, 30 Oct 2016 07:11:34 +0000 (07:11 +0000)]
[AVX-512] Remove masked 128/256-bit builtins for vpmaddwd and vpmaddubsw. Replace with unmasked builtins and select.

llvm-svn: 285516

8 years ago[X86] Use intrinsics table for PMADDUBSW and PMADDWD so that we can use the legacy...
Craig Topper [Sun, 30 Oct 2016 06:56:16 +0000 (06:56 +0000)]
[X86] Use intrinsics table for PMADDUBSW and PMADDWD so that we can use the legacy intrinsics to select EVEX encoded instructions when available.

This removes a couple tablegen classes that become unused after this change. Another class gained an additional parameter to allow PMADDUBSW to specify a different result type from its input type.

llvm-svn: 285515

8 years ago [Polly] Remove the unused POLLY_LINK_LIBS for linking polly into
Hongbin Zheng [Sun, 30 Oct 2016 06:07:59 +0000 (06:07 +0000)]
[Polly] Remove the unused POLLY_LINK_LIBS for linking polly into
tools

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

llvm-svn: 285514

8 years ago[ThinLTO] Use per-summary flag to prevent exporting locals used in inline asm
Teresa Johnson [Sun, 30 Oct 2016 05:40:44 +0000 (05:40 +0000)]
[ThinLTO] Use per-summary flag to prevent exporting locals used in inline asm

Summary:
Instead of using the workaround of suppressing the entire index for
modules that call inline asm that may reference locals, use the
NoRename flag on the summary for any locals in the llvm.used set, and
add a reference edge from any functions containing inline asm.

This avoids issues from having no summaries despite the module defining
global values, which was preventing more aggressive index-based
optimization. It will be followed by a subsequent patch to make a
similar fix for local references in module level asm (to fix PR30610).

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

llvm-svn: 285513

8 years ago[ThinLTO] Correctly resolve linkonce when importing aliasee
Teresa Johnson [Sun, 30 Oct 2016 05:15:23 +0000 (05:15 +0000)]
[ThinLTO] Correctly resolve linkonce when importing aliasee

Summary:
When we have an aliasee that is linkonce, while we can't convert
the non-prevailing copies to available_externally, we still need to
convert the prevailing copy to weak. If a reference to the aliasee
is exported, not converting a copy to weak will result in undefined
references when the linkonce is removed in its original module.

Add a new test and update existing tests.

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

llvm-svn: 285512

8 years agoclang/test/Driver/openmp-offload.c: Relax expressions if "ld.exe" exists, like mingw.
NAKAMURA Takumi [Sun, 30 Oct 2016 02:58:48 +0000 (02:58 +0000)]
clang/test/Driver/openmp-offload.c: Relax expressions if "ld.exe" exists, like mingw.

llvm-svn: 285511

8 years ago[X86] Don't use loadv2i64 on SSE version of PMULHRSW. Use memopv2i64 instead.
Craig Topper [Sun, 30 Oct 2016 00:02:55 +0000 (00:02 +0000)]
[X86] Don't use loadv2i64 on SSE version of PMULHRSW. Use memopv2i64 instead.

This bug was introduced in r285501.

llvm-svn: 285510

8 years agoNativeFormatting.cpp: Fix build for mingw. Where would writePadding() be?
NAKAMURA Takumi [Sat, 29 Oct 2016 23:14:18 +0000 (23:14 +0000)]
NativeFormatting.cpp: Fix build for mingw. Where would writePadding() be?

llvm-svn: 285509

8 years ago[ThinLTO] Rename doPromoteLocalToGlobal to shouldPromoteLocalToGlobal (NFC)
Teresa Johnson [Sat, 29 Oct 2016 21:52:23 +0000 (21:52 +0000)]
[ThinLTO] Rename doPromoteLocalToGlobal to shouldPromoteLocalToGlobal (NFC)

Rename as suggested in code review for D26063.

llvm-svn: 285508

8 years ago[ThinLTO] Use NoPromote flag in summary during promotion
Teresa Johnson [Sat, 29 Oct 2016 21:31:48 +0000 (21:31 +0000)]
[ThinLTO] Use NoPromote flag in summary during promotion

Summary:
Replace the check of whether a GV has a section with the flag check
in the summary. This is in preparation for using the NoPromote flag
to convey other situations when we can't promote (e.g. locals used in
inline asm).

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

llvm-svn: 285507

8 years agoIR: Remove a no longer needed assert.
Peter Collingbourne [Sat, 29 Oct 2016 20:57:12 +0000 (20:57 +0000)]
IR: Remove a no longer needed assert.

This assert was checking for a miscompile in a version of GCC that
we no longer support.

llvm-svn: 285506

8 years ago[AVX-512] Remove 128/256-bit masked pmulhrsw/pmulhuw/pmulhw builtins and use unmasked...
Craig Topper [Sat, 29 Oct 2016 19:02:14 +0000 (19:02 +0000)]
[AVX-512] Remove 128/256-bit masked pmulhrsw/pmulhuw/pmulhw builtins and use unmasked builtins and select instead.

llvm-svn: 285505

8 years ago[AVX-512] Remove masked 128/256-bit sqrt builtins and replace them with unmasked...
Craig Topper [Sat, 29 Oct 2016 19:02:10 +0000 (19:02 +0000)]
[AVX-512] Remove masked 128/256-bit sqrt builtins and replace them with unmasked builtins and a select.

llvm-svn: 285504

8 years ago[AVX-512] Remove masked 128/256-bit pmuludq/pmuldq builtins and replace them with...
Craig Topper [Sat, 29 Oct 2016 19:02:07 +0000 (19:02 +0000)]
[AVX-512] Remove masked 128/256-bit pmuludq/pmuldq builtins and replace them with unmasked builtins and a select.

llvm-svn: 285503

8 years ago[AVX-512] Remove masked 128/256-bit floating point max/min builtins. Use unmasked...
Craig Topper [Sat, 29 Oct 2016 19:02:03 +0000 (19:02 +0000)]
[AVX-512] Remove masked 128/256-bit floating point max/min builtins. Use unmasked builtins with select instead.

llvm-svn: 285502

8 years ago[X86] Use intrinsics table for VPMULHRSW intrincis so that the legacy intrinsics...
Craig Topper [Sat, 29 Oct 2016 18:41:45 +0000 (18:41 +0000)]
[X86] Use intrinsics table for VPMULHRSW intrincis so that the legacy intrinsics can select EVEX encoded instructions when available.

This requires a minor rename of the instructions due to the use of different tablegen classes and how the names are concatenated.

llvm-svn: 285501

8 years agoFactor finding of libc++ include path out of building -cc1 arguments.
Richard Smith [Sat, 29 Oct 2016 17:28:48 +0000 (17:28 +0000)]
Factor finding of libc++ include path out of building -cc1 arguments.

llvm-svn: 285500

8 years ago[ValueTracking] recognize more variants of smin/smax
Sanjay Patel [Sat, 29 Oct 2016 16:21:19 +0000 (16:21 +0000)]
[ValueTracking] recognize more variants of smin/smax

Try harder to detect obfuscated min/max patterns: the initial pattern was added with D9352 / rL236202.
There was a bug fix for PR27137 at rL264996, but I think we can do better by folding the corresponding
smax pattern and commuted variants.

The codegen tests demonstrate the effect of ValueTracking on the backend via SelectionDAGBuilder. We
can't expose these differences minimally in IR because we don't have smin/smax intrinsics for IR.

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

llvm-svn: 285499

8 years ago[x86] add tests for smin/smax matchSelPattern (D26091)
Sanjay Patel [Sat, 29 Oct 2016 16:02:57 +0000 (16:02 +0000)]
[x86] add tests for smin/smax matchSelPattern (D26091)

llvm-svn: 285498

8 years ago[Devirtualization] Decorate vfunction load with invariant.load
Piotr Padlewski [Sat, 29 Oct 2016 15:28:30 +0000 (15:28 +0000)]
[Devirtualization] Decorate vfunction load with invariant.load

Summary:
This patch was introduced one year ago, but because my google account
was disabled, I didn't get email with failing buildbot and I missed
revert of this commit. There was small but in test regex.
I am back.

Reviewers: rsmith, rengolin

Subscribers: nlewycky, rjmccall, cfe-commits

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

llvm-svn: 285497

8 years agoNFC small format
Piotr Padlewski [Sat, 29 Oct 2016 15:28:25 +0000 (15:28 +0000)]
NFC small format

llvm-svn: 285496

8 years ago[InstCombine] re-use bitcasted compare operands in selects (PR28001)
Sanjay Patel [Sat, 29 Oct 2016 15:22:04 +0000 (15:22 +0000)]
[InstCombine] re-use bitcasted compare operands in selects (PR28001)

These mixed bitcast patterns show up with SSE/AVX intrinsics because we bitcast function parameters to <2 x i64>.

The bitcasts obfuscate the expected min/max forms as shown in PR28001:
https://llvm.org/bugs/show_bug.cgi?id=28001#c6

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

llvm-svn: 285495

8 years ago[DAGCombiner] (REAPPLIED) Add vector demanded elements support to computeKnownBits
Simon Pilgrim [Sat, 29 Oct 2016 11:29:39 +0000 (11:29 +0000)]
[DAGCombiner] (REAPPLIED) Add vector demanded elements support to computeKnownBits

Currently computeKnownBits returns the common known zero/one bits for all elements of vector data, when we may only be interested in one/some of the elements.

This patch adds a DemandedElts argument that allows us to specify the elements we actually care about. The original computeKnownBits implementation calls with a DemandedElts demanding all elements to match current behaviour. Scalar types set this to 1.

The approach was found to be easier than trying to add a per-element known bits solution, for a similar usefulness given the combines where computeKnownBits is typically used.

I've only added support for a few opcodes so far (the ones that have proven straightforward to test), all others will default to demanding all elements but can be updated in due course.

DemandedElts support could similarly be added to computeKnownBitsForTargetNode in a future commit.

This looked like this had caused compile time regressions on some buildbots (and was reverted in rL285381), but appears to have just been a harmless bystander!

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

llvm-svn: 285494

8 years ago[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (max|min) intrinsics...
Michael Zuckerman [Sat, 29 Oct 2016 10:29:20 +0000 (10:29 +0000)]
[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (max|min) intrinsics to Clang .

After LGTM and Check-all

Vector-reduction arithmetic accepts vectors as inputs and produces
scalars as outputs.This class of vector operation forms the basis
of many scientific computations. In vector-reduction arithmetic,
the evaluation off is independent of the order of the input elements of V.

Reviewer: 1. craig.topper
          2. igorb

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

llvm-svn: 285493

8 years agoFixed FMA + FNEG combine.
Elena Demikhovsky [Sat, 29 Oct 2016 08:44:46 +0000 (08:44 +0000)]
Fixed FMA + FNEG combine.
Masked form of FMA should be omitted in this optimization.

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

llvm-svn: 285492

8 years ago[ScopDetect] Use SCEVRewriteVisitor to simplify SCEVRemoveSMax rewriter
Tobias Grosser [Sat, 29 Oct 2016 06:19:34 +0000 (06:19 +0000)]
[ScopDetect] Use SCEVRewriteVisitor to simplify SCEVRemoveSMax rewriter

ScalarEvolution got at some pointer a SCEVRewriteVisitor. Use it to simplify
our SCEVRemoveSMax visitor.

llvm-svn: 285491

8 years agoAMDGPU: Use 1/2pi inline imm on VI
Matt Arsenault [Sat, 29 Oct 2016 04:05:06 +0000 (04:05 +0000)]
AMDGPU: Use 1/2pi inline imm on VI

I'm guessing at how it is supposed to be printed

llvm-svn: 285490

8 years agoAttempt to fix a buildbot really this time.
Rui Ueyama [Sat, 29 Oct 2016 01:28:06 +0000 (01:28 +0000)]
Attempt to fix a buildbot really this time.

llvm-svn: 285489

8 years agoAArch64DeadRegisterDefinitionsPass: Cleanup; NFC
Matthias Braun [Sat, 29 Oct 2016 01:03:41 +0000 (01:03 +0000)]
AArch64DeadRegisterDefinitionsPass: Cleanup; NFC

- Fix doxygen file comment
- reduce indentation in loop
- Factor out some common subexpressions
- Move independent helper function out of class
- Fix Changed flag (this is not strictly NFC but a bugfix, but the flag
  seems ignored anyway)

llvm-svn: 285488

8 years agoDefine calculateDbgStreamSize for consistency.
Rui Ueyama [Sat, 29 Oct 2016 00:56:44 +0000 (00:56 +0000)]
Define calculateDbgStreamSize for consistency.

llvm-svn: 285487

8 years ago[APFloat] Remove the redundent function body of uninitialized ctor, which should...
Tim Shen [Sat, 29 Oct 2016 00:51:41 +0000 (00:51 +0000)]
[APFloat] Remove the redundent function body of uninitialized ctor, which should be done in r285468

llvm-svn: 285486

8 years agoRevert "Added 'inline' attribute to basic_string's destructor"
Mehdi Amini [Sat, 29 Oct 2016 00:50:02 +0000 (00:50 +0000)]
Revert "Added 'inline' attribute to basic_string's destructor"

This reverts commit r285456, which broke LTO bootstrap on Darwin.

llvm-svn: 285485

8 years agoLimit LLDB_EXPORT_ALL_SYMBOLS to lldb symbols
Todd Fiala [Sat, 29 Oct 2016 00:29:15 +0000 (00:29 +0000)]
Limit LLDB_EXPORT_ALL_SYMBOLS to lldb symbols

LLDB_EXPORT_ALL_SYMBOLS used to instruct the build to export all
the symbols in liblldb on CMake builds.  This change limits the
CMake define to only add in the lldb_private namespace to the
symbols that normally get exported, such that we export all the
symbols in the public lldb namespace and the lldb_private namespace.

This is a fix for:
https://llvm.org/bugs/show_bug.cgi?id=30822

Reviewers: labath, beanz

Subscribers: lldb-commits

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

llvm-svn: 285484

8 years agoResubmit "Add support for advanced number formatting."
Zachary Turner [Sat, 29 Oct 2016 00:27:22 +0000 (00:27 +0000)]
Resubmit "Add support for advanced number formatting."

This resubmits r284436 and r284437, which were reverted in
r284462 as they were breaking the AArch64 buildbot.

The breakage on AArch64 turned out to be a miscompile which is
still not fixed, but is actively tracked at llvm.org/pr30748.

This resubmission re-writes the code in a way so as to make the
miscompile not happen.

llvm-svn: 285483

8 years ago[asan] Set the darwin deployment target for the dead-strip test
Anna Zaks [Sat, 29 Oct 2016 00:27:07 +0000 (00:27 +0000)]
[asan] Set the darwin deployment target for the dead-strip test

ASan dead-strip support relies on a linker option that only exists
in 10.11 and later, so the LLVM instrumentation checks for the deployment
target. This test does not pass when clang is built to choose lower
deployment target by default but runs on newer host.

(Note, the REQUIRES: osx-ld64-live_support clause only checks the host
and not the target OS.)

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

llvm-svn: 285482

8 years agoDo not print out Flags field twice.
Rui Ueyama [Fri, 28 Oct 2016 23:57:37 +0000 (23:57 +0000)]
Do not print out Flags field twice.

llvm-svn: 285481

8 years ago[DAGCombiner] Fix a crash visiting `AND` nodes.
Davide Italiano [Fri, 28 Oct 2016 23:55:32 +0000 (23:55 +0000)]
[DAGCombiner] Fix a crash visiting `AND` nodes.

Instead of asserting that the shift count is != 0 we just bail out
as it's not profitable trying to optimize a node which will be
removed anyway.

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

llvm-svn: 285480

8 years agoAMDGPU/SI: Don't use non-0 waitcnt values when waiting on Flat instructions
Tom Stellard [Fri, 28 Oct 2016 23:53:48 +0000 (23:53 +0000)]
AMDGPU/SI: Don't use non-0 waitcnt values when waiting on Flat instructions

Summary:
Flat instruction can return out of order, so we need always need to wait
for all the outstanding flat operations.

Reviewers: tony-tye, arsenm

Subscribers: kzhuravl, wdng, nhaehnle, llvm-commits, yaxunl

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

llvm-svn: 285479

8 years agobuild: give aliases the same visibility
Saleem Abdulrasool [Fri, 28 Oct 2016 23:37:50 +0000 (23:37 +0000)]
build: give aliases the same visibility

ARM EABI also uses function aliases.  Ensure that those aliased functions are
given proper visibility annotations.

llvm-svn: 285478

8 years agobuiltins: ensure that VISIBILITY_HIDDEN is defined properly
Saleem Abdulrasool [Fri, 28 Oct 2016 23:19:03 +0000 (23:19 +0000)]
builtins: ensure that VISIBILITY_HIDDEN is defined properly

The CMake build system had missed this macro as part of the build of the
builtins.  This would result in the builtins exporting symbols which are
implemented in assembly with global visibility.  Ensure that the assembly
optimized routines are given the same visibility as the C routines.

llvm-svn: 285477

8 years agoAMDGPU: Fix instruction flags for s_endpgm
Matt Arsenault [Fri, 28 Oct 2016 23:00:38 +0000 (23:00 +0000)]
AMDGPU: Fix instruction flags for s_endpgm

Set isReturn, remove hasSideEffects. Also remove
hasCtrlDep, I'm not really sure what that does.

llvm-svn: 285476

8 years agoRefactor DW_LNE_* into Dwarf.def
Adrian Prantl [Fri, 28 Oct 2016 22:57:02 +0000 (22:57 +0000)]
Refactor DW_LNE_* into Dwarf.def

llvm-svn: 285475

8 years agoRefactor DW_LNS_* into Dwarf.def
Adrian Prantl [Fri, 28 Oct 2016 22:56:59 +0000 (22:56 +0000)]
Refactor DW_LNS_* into Dwarf.def

llvm-svn: 285474

8 years agoRefactor DW_APPLE_PROPERTY_* into Dwarf.def
Adrian Prantl [Fri, 28 Oct 2016 22:56:56 +0000 (22:56 +0000)]
Refactor DW_APPLE_PROPERTY_* into Dwarf.def

llvm-svn: 285473

8 years agoRefactor DW_CFA_* into Dwarf.def
Adrian Prantl [Fri, 28 Oct 2016 22:56:53 +0000 (22:56 +0000)]
Refactor DW_CFA_* into Dwarf.def

llvm-svn: 285472

8 years agoRemove whitespace
Adrian Prantl [Fri, 28 Oct 2016 22:56:50 +0000 (22:56 +0000)]
Remove whitespace

llvm-svn: 285471

8 years agoRefactor all DW_FORM_* constants into Dwarf.def
Adrian Prantl [Fri, 28 Oct 2016 22:56:45 +0000 (22:56 +0000)]
Refactor all DW_FORM_* constants into Dwarf.def

llvm-svn: 285470

8 years agoRemove files missed in r285466
Eric Fiselier [Fri, 28 Oct 2016 22:54:24 +0000 (22:54 +0000)]
Remove files missed in r285466

llvm-svn: 285469

8 years ago[APFloat] Fix memory bugs revealed by MSan
Tim Shen [Fri, 28 Oct 2016 22:45:33 +0000 (22:45 +0000)]
[APFloat] Fix memory bugs revealed by MSan

Reviewers: eugenis, hfinkel, kbarton, iteratee, echristo

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 285468

8 years agoSDAG: Make sure we use an allocatable reg class when we create this vreg
Justin Bogner [Fri, 28 Oct 2016 22:42:54 +0000 (22:42 +0000)]
SDAG: Make sure we use an allocatable reg class when we create this vreg

As per the discussion on r280783, if constrainRegClass fails we need
to call getAllocatableClass like we did before that commit.

llvm-svn: 285467

8 years agoRevert addition of __libcpp_library_version
Eric Fiselier [Fri, 28 Oct 2016 22:37:24 +0000 (22:37 +0000)]
Revert addition of __libcpp_library_version

llvm-svn: 285466