platform/upstream/llvm.git
7 years agorevert r284963
Michael Zuckerman [Mon, 24 Oct 2016 11:30:23 +0000 (11:30 +0000)]
revert r284963

because new test file is failing in some OS.
test/CodeGen/avx512-reduceIntrin.c

llvm-svn: 284967

7 years agoRemove TimeValue usage from llvm/Support
Pavel Labath [Mon, 24 Oct 2016 10:59:17 +0000 (10:59 +0000)]
Remove TimeValue usage from llvm/Support

Summary:
This is a follow-up to D25416. It removes all usages of TimeValue from
llvm/Support library (except for the actual TimeValue declaration), and replaces
them with appropriate usages of std::chrono. To facilitate this, I have added
small utility functions for converting time points and durations into appropriate
OS-specific types (FILETIME, struct timespec, ...).

Reviewers: zturner, mehdi_amini

Subscribers: llvm-commits

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

llvm-svn: 284966

7 years agoAdjust for TimePoint interface change in llvm: D25730. NFC
Pavel Labath [Mon, 24 Oct 2016 10:59:14 +0000 (10:59 +0000)]
Adjust for TimePoint interface change in llvm: D25730. NFC

llvm-svn: 284965

7 years agoAdjust for TimePoint interface change in llvm: D25730. NFC
Pavel Labath [Mon, 24 Oct 2016 10:59:13 +0000 (10:59 +0000)]
Adjust for TimePoint interface change in llvm: D25730. NFC

llvm-svn: 284964

7 years ago[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (Operators: +,*,&...
Michael Zuckerman [Mon, 24 Oct 2016 10:53:20 +0000 (10:53 +0000)]
[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (Operators: +,*,&&,||) intrinsics to Clang

Committed 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.

Used bisection method. At each step, we partition the vector with previous
step in half, and the operation is performed on its two halves.
This takes log2(n) steps where n is the number of elements in the vector.

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

llvm-svn: 284963

7 years ago[mips] synci microMIPS instruction definition.
Simon Dardis [Mon, 24 Oct 2016 10:23:59 +0000 (10:23 +0000)]
[mips] synci microMIPS instruction definition.

Add synci to the microMIPS instruction definitions, mark the MIPS sync & synci
as not being part of microMIPS. This does not cover the sync instruction alias,
as that will be handled with a different patch. Add sync to the valid tests for
microMIPS.

Reviewers: vkalintiris

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

llvm-svn: 284962

7 years ago[Sema] Formatting warnings should see through Objective-C message sends
Alex Lorenz [Mon, 24 Oct 2016 09:42:34 +0000 (09:42 +0000)]
[Sema] Formatting warnings should see through Objective-C message sends

This commit improves the '-Wformat' warnings by ensuring that the formatting
checker can see through Objective-C message sends when we are calling an
Objective-C method with an appropriate format_arg attribute.

rdar://23622446

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

llvm-svn: 284961

7 years ago[analyzer] Add StdLibraryFunctions checker.
Artem Dergachev [Mon, 24 Oct 2016 09:41:38 +0000 (09:41 +0000)]
[analyzer] Add StdLibraryFunctions checker.

This checker does not emit reports, however it influences the analysis
by providing complete summaries for, or otherwise improving modeling of,
various standard library functions.

This should reduce the number of infeasible paths explored during analysis.
The custom function summary format used in this checker is superior to
body farms by causing less unnecessary state splits,
which would result in better analysis performance.

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

llvm-svn: 284960

7 years ago[Sema][TreeTransform] Re-create DesignatedInitExpr when a field designator
Alex Lorenz [Mon, 24 Oct 2016 09:33:32 +0000 (09:33 +0000)]
[Sema][TreeTransform] Re-create DesignatedInitExpr when a field designator
has no field declaration.

This commit fixes an invalid Winitializer-overrides warning that's shown
when analyzing a second (or any after the first) instantiation of a designated
initializer. This invalid warning is fixed by making sure that a
DesignatedInitExpr is rebuilt by the tree transformer when it has a field
designator whose FieldDecl* hasn't been yet initialized. This ensures that a
different DesignatedInitExpr is processed by Sema for every instantiation, and
thus the invalid warning is avoided.

rdar://28768441

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

llvm-svn: 284959

7 years agoFix myriad test with CLANG_DEFAULT_CXX_STDLIB
Jonas Hahnfeld [Mon, 24 Oct 2016 08:04:17 +0000 (08:04 +0000)]
Fix myriad test with CLANG_DEFAULT_CXX_STDLIB

llvm-svn: 284958

7 years ago[llvm-opt-report] Fix unroll-count reporting
Hal Finkel [Mon, 24 Oct 2016 05:07:18 +0000 (05:07 +0000)]
[llvm-opt-report] Fix unroll-count reporting

Fix the implementation of OptReportLocationInfo's operator < so that contexts
with different unroll counts are reported separately.

llvm-svn: 284957

7 years ago[AVX-512] Replace 64-bit element and 512-bit vector pmin/pmax builtins with native...
Craig Topper [Mon, 24 Oct 2016 04:04:24 +0000 (04:04 +0000)]
[AVX-512] Replace 64-bit element and 512-bit vector pmin/pmax builtins with native IR like we do for 128/256-bit, but with the addition of masking.

llvm-svn: 284956

7 years ago[AVX-512] Remove masked pmin/pmax intrinsics and autoupgrade to native IR.
Craig Topper [Mon, 24 Oct 2016 04:04:16 +0000 (04:04 +0000)]
[AVX-512] Remove masked pmin/pmax intrinsics and autoupgrade to native IR.

Clang patch to replace 512-bit vector and 64-bit element versions with native IR will follow.

llvm-svn: 284955

7 years ago[AVX-512] Replace masked 128/256-bit byte, word, and dword min/max builtins with...
Craig Topper [Sun, 23 Oct 2016 23:57:30 +0000 (23:57 +0000)]
[AVX-512] Replace masked 128/256-bit byte, word, and dword min/max builtins with selects and the older unmasked builtins.

llvm-svn: 284954

7 years ago[DAG] enhance computeKnownBits to handle SRL/SRA with vector splat constant
Sanjay Patel [Sun, 23 Oct 2016 23:13:31 +0000 (23:13 +0000)]
[DAG] enhance computeKnownBits to handle SRL/SRA with vector splat constant

llvm-svn: 284953

7 years agoBackout enabling -Wshadow until I have time to fix the breakage
Eric Fiselier [Sun, 23 Oct 2016 22:24:11 +0000 (22:24 +0000)]
Backout enabling -Wshadow until I have time to fix the breakage

llvm-svn: 284952

7 years ago[libunwind] Add support for Fuchsia
Petr Hosek [Sun, 23 Oct 2016 21:48:47 +0000 (21:48 +0000)]
[libunwind] Add support for Fuchsia

Fuchsia is a new operating system which uses libunwind as unwinder.

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

llvm-svn: 284951

7 years ago[libcxx] Use C++14 when building libc++ with musl
Petr Hosek [Sun, 23 Oct 2016 21:48:27 +0000 (21:48 +0000)]
[libcxx] Use C++14 when building libc++ with musl

musl's pthread implementations use volatile types in their structs
which is not being constexpr in C++11 but is in C++14.

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

llvm-svn: 284950

7 years agoUse SDValue::getConstantOperandVal() helper. NFCI.
Simon Pilgrim [Sun, 23 Oct 2016 20:17:21 +0000 (20:17 +0000)]
Use SDValue::getConstantOperandVal() helper. NFCI.

llvm-svn: 284949

7 years agoRemove LLVM_CONSTEXPR.
Justin Lebar [Sun, 23 Oct 2016 19:39:16 +0000 (19:39 +0000)]
Remove LLVM_CONSTEXPR.

Summary: With MSVC 2013 and GCC < 4.8 gone, we can use the "constexpr" keyword.

Reviewers: bkramer, mehdi_amini

Subscribers: llvm-commits

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

llvm-svn: 284947

7 years agoFix breakage introduced by adding -Wshadow.
Eric Fiselier [Sun, 23 Oct 2016 19:26:39 +0000 (19:26 +0000)]
Fix breakage introduced by adding -Wshadow.

llvm-svn: 284946

7 years agoFix libc++ specific assertion in permissions(...) tests
Eric Fiselier [Sun, 23 Oct 2016 19:14:58 +0000 (19:14 +0000)]
Fix libc++ specific assertion in permissions(...) tests

llvm-svn: 284945

7 years agoTurn on -Wshadow so I find occurances before STL does
Eric Fiselier [Sun, 23 Oct 2016 19:01:10 +0000 (19:01 +0000)]
Turn on -Wshadow so I find occurances before STL does

llvm-svn: 284944

7 years agoMake make_from_tuple tests more portable. Patch from STL@microsoft.com
Eric Fiselier [Sun, 23 Oct 2016 18:55:51 +0000 (18:55 +0000)]
Make make_from_tuple tests more portable. Patch from STL@microsoft.com

llvm-svn: 284943

7 years agoFix unreferenced parameters. Patch from STL@microsoft.com
Eric Fiselier [Sun, 23 Oct 2016 18:52:58 +0000 (18:52 +0000)]
Fix unreferenced parameters. Patch from STL@microsoft.com

llvm-svn: 284942

7 years agoFix shadowing warning. Patch from STL@microsoft.com
Eric Fiselier [Sun, 23 Oct 2016 18:47:58 +0000 (18:47 +0000)]
Fix shadowing warning. Patch from STL@microsoft.com

llvm-svn: 284941

7 years ago[CostModel][X86] Added tests for current integer signed/unsigned remainder costs
Simon Pilgrim [Sun, 23 Oct 2016 18:35:02 +0000 (18:35 +0000)]
[CostModel][X86] Added tests for current integer signed/unsigned remainder costs

llvm-svn: 284940

7 years ago[X86][SSE] Add SSE41/AVX1 costs for vector shifts.
Simon Pilgrim [Sun, 23 Oct 2016 16:49:04 +0000 (16:49 +0000)]
[X86][SSE] Add SSE41/AVX1 costs for vector shifts.

We were defaulting to SSE2 costs which weren't taking into account the availability of PBLENDW/PBLENDVB to improve merging of per-element shift results.

llvm-svn: 284939

7 years ago[CostModel][X86] Added tests for current integer trunc costs
Simon Pilgrim [Sun, 23 Oct 2016 15:17:52 +0000 (15:17 +0000)]
[CostModel][X86] Added tests for current integer trunc costs

llvm-svn: 284938

7 years agoUse APInt::isAllOnesValue instead of popcnt. NFCI.
Simon Pilgrim [Sun, 23 Oct 2016 15:09:44 +0000 (15:09 +0000)]
Use APInt::isAllOnesValue instead of popcnt. NFCI.

More obvious implementation and faster too.

llvm-svn: 284937

7 years ago[AVX-512] Replace 512-bit pmovzx/sx builtins with native IR.
Craig Topper [Sun, 23 Oct 2016 07:35:47 +0000 (07:35 +0000)]
[AVX-512] Replace 512-bit pmovzx/sx builtins with native IR.

llvm-svn: 284936

7 years ago[AVX-512] Remove masked 128/256-bit packss/packus builtins and replace with selects...
Craig Topper [Sun, 23 Oct 2016 07:35:39 +0000 (07:35 +0000)]
[AVX-512] Remove masked 128/256-bit packss/packus builtins and replace with selects and the older unmasked builtins.

llvm-svn: 284935

7 years agoAdd more doxygen comments to emmintrin.h's intrinsics.
Ekaterina Romanova [Sun, 23 Oct 2016 07:30:50 +0000 (07:30 +0000)]
Add more doxygen comments to emmintrin.h's intrinsics.

With this patch, all intrinsics in this file (with an exception of a handful of a recently added ones) will be documented. I will send out a patch for 4 missining intrisics later.

The doxygen comments are automatically generated based on Sony's intrinsics document.

I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream. This patch was internally reviewed by Yunzhong Gao.

llvm-svn: 284934

7 years agoFix mangling numbers for varargs lambdas; varargs and non-varargs lambdas get
Richard Smith [Sun, 23 Oct 2016 04:53:03 +0000 (04:53 +0000)]
Fix mangling numbers for varargs lambdas; varargs and non-varargs lambdas get
different lambda-sigs, so they should have different counters.

llvm-svn: 284933

7 years ago[compiler-rt] Remove redundant --check-prefix=CHECK from test
Mandeep Singh Grang [Sun, 23 Oct 2016 00:55:12 +0000 (00:55 +0000)]
[compiler-rt] Remove redundant --check-prefix=CHECK from test

Reviewers: eugenis, rengolin

Subscribers: dberris

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

llvm-svn: 284932

7 years ago[clang] Limit clang test to ARM and AArch64 only
Mandeep Singh Grang [Sun, 23 Oct 2016 00:53:03 +0000 (00:53 +0000)]
[clang] Limit clang test to ARM and AArch64 only

Summary: Limit clang/test/Frontend/gnu-mcount.c to ARM and AArch64 only.

Reviewers: abdulras, honggyu.kim, rengolin

Subscribers: aemerson, rengolin, cfe-commits

Tags: #clang-c

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

llvm-svn: 284931

7 years ago[AVR] Add the machine code disassembler
Dylan McKay [Sat, 22 Oct 2016 23:57:59 +0000 (23:57 +0000)]
[AVR] Add the machine code disassembler

This adds a super basic implementation of a machine code disassembler.

It doesn't support any operands with custom encoding.

llvm-svn: 284930

7 years ago[AVX-512] Replace masked 128/256-bit pavg builtins and replace with select and older...
Craig Topper [Sat, 22 Oct 2016 21:24:56 +0000 (21:24 +0000)]
[AVX-512] Replace masked 128/256-bit pavg builtins and replace with select and older unmasked builtins.

llvm-svn: 284929

7 years ago[AVX-512] Replace masked 128/256-bit saturating add/sub builtins with select and...
Craig Topper [Sat, 22 Oct 2016 21:24:52 +0000 (21:24 +0000)]
[AVX-512] Replace masked 128/256-bit saturating add/sub builtins with select and older unmasked builtins.

llvm-svn: 284928

7 years ago[AVX-512] Replace masked 128/256-bit vpmovzx/vpmovsx builtins with native IR.
Craig Topper [Sat, 22 Oct 2016 21:24:48 +0000 (21:24 +0000)]
[AVX-512] Replace masked 128/256-bit vpmovzx/vpmovsx builtins with native IR.

llvm-svn: 284927

7 years ago[AVX-512] Remove duplicate test cases from the avx512vlbw intrinsic test. These tests...
Craig Topper [Sat, 22 Oct 2016 21:24:44 +0000 (21:24 +0000)]
[AVX-512] Remove duplicate test cases from the avx512vlbw intrinsic test. These tests already exist in the avx512vl test and represent avx512vl instructions.

llvm-svn: 284926

7 years ago[AVX-512] Remove masked 128/256-bit pshufb builtins. Replace with a select and the...
Craig Topper [Sat, 22 Oct 2016 21:24:42 +0000 (21:24 +0000)]
[AVX-512] Remove masked 128/256-bit pshufb builtins. Replace with a select and the older unmaksed builtins.

llvm-svn: 284925

7 years ago[AVX-512] Remove builtins for 128/256-bit pabsb/pabsw. We can use a select and the...
Craig Topper [Sat, 22 Oct 2016 21:24:38 +0000 (21:24 +0000)]
[AVX-512] Remove builtins for 128/256-bit pabsb/pabsw. We can use a select and the older non-masked versions instead.

llvm-svn: 284924

7 years ago[AVX-512] Add typecasts to alignr intrinsics that were modified in r284920.
Craig Topper [Sat, 22 Oct 2016 21:24:34 +0000 (21:24 +0000)]
[AVX-512] Add typecasts to alignr intrinsics that were modified in r284920.

llvm-svn: 284923

7 years ago[X86][AVX512VL] Added support for combining target 256-bit shuffles to AVX512VL VPERMV3
Simon Pilgrim [Sat, 22 Oct 2016 20:15:39 +0000 (20:15 +0000)]
[X86][AVX512VL] Added support for combining target 256-bit shuffles to AVX512VL VPERMV3

llvm-svn: 284922

7 years ago[X86][AVX512] Added support for combining target shuffles to AVX512 VPERMV3
Simon Pilgrim [Sat, 22 Oct 2016 19:53:59 +0000 (19:53 +0000)]
[X86][AVX512] Added support for combining target shuffles to AVX512 VPERMV3

llvm-svn: 284921

7 years ago[AVX-512] Remove masked 128/256-bit palignr builtins. We can just use a select in...
Craig Topper [Sat, 22 Oct 2016 18:32:33 +0000 (18:32 +0000)]
[AVX-512] Remove masked 128/256-bit palignr builtins. We can just use a select in the header file with the older unmasked versions instead.

llvm-svn: 284920

7 years ago[lit] Add more testing instructions to README
Brian Gesiak [Sat, 22 Oct 2016 17:27:31 +0000 (17:27 +0000)]
[lit] Add more testing instructions to README

Summary:
r283710 introduced two regressions, one to llvm-lit, and the other to
lit executables that were installed via setuptools. Add instructions on
how to test for these regressions in the future.

Reviewers: ddunbar, delcypher, beanz, chapuni, cmatthews, echristo

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 284919

7 years ago[ARM] Fix crash in ConstantIslands
James Molloy [Sat, 22 Oct 2016 09:58:37 +0000 (09:58 +0000)]
[ARM] Fix crash in ConstantIslands

tPCRelJT may not be the first instruction in a block. Check that instead of dereferencing a broken iterator.

llvm-svn: 284917

7 years ago[X86] Apply the Update LLC Test Checks tool on the mmx-bitcast test
Zvi Rackover [Sat, 22 Oct 2016 07:15:00 +0000 (07:15 +0000)]
[X86] Apply the Update LLC Test Checks tool on the mmx-bitcast test

llvm-svn: 284916

7 years ago[X86] Add support for printing shuffle comments for VALIGN instructions.
Craig Topper [Sat, 22 Oct 2016 06:51:56 +0000 (06:51 +0000)]
[X86] Add support for printing shuffle comments for VALIGN instructions.

llvm-svn: 284915

7 years ago[X86] Add support for lowering v4i64 and v8i64 shuffles directly to PALIGNR. I think...
Craig Topper [Sat, 22 Oct 2016 06:51:52 +0000 (06:51 +0000)]
[X86] Add support for lowering v4i64 and v8i64 shuffles directly to PALIGNR. I think shuffle combine can figure it out later, but we should try to get it right up front.

llvm-svn: 284914

7 years ago[X86] Remove unnecessary AVX2 check that was already covered by an assertion earlier...
Craig Topper [Sat, 22 Oct 2016 06:51:49 +0000 (06:51 +0000)]
[X86] Remove unnecessary AVX2 check that was already covered by an assertion earlier in the function. NFC

llvm-svn: 284913

7 years ago[X86] Remove 128-bit lane handling from the main loop of matchVectorShuffleAsByteRota...
Craig Topper [Sat, 22 Oct 2016 06:51:44 +0000 (06:51 +0000)]
[X86] Remove 128-bit lane handling from the main loop of matchVectorShuffleAsByteRotate. Instead check for is128LaneRepeatedSuffleMask before the loop and just loop over the repeated mask.

I plan to use the loop to support VALIGND/Q shuffles so this makes it easier to reuse.

llvm-svn: 284912

7 years ago[X86][SSE] Use getConstVector helper for VPERMV mask generation. NFCI.
Simon Pilgrim [Sat, 22 Oct 2016 06:18:36 +0000 (06:18 +0000)]
[X86][SSE] Use getConstVector helper for VPERMV mask generation. NFCI.

llvm-svn: 284911

7 years agoNow that VS2013 is gone, make a memoryssa structure an anonymous union again
Daniel Berlin [Sat, 22 Oct 2016 04:15:41 +0000 (04:15 +0000)]
Now that VS2013 is gone, make a memoryssa structure an anonymous union again

llvm-svn: 284910

7 years ago[libFuzzer] mutation: insert the size of the input in bytes as one of the ways to...
Kostya Serebryany [Sat, 22 Oct 2016 03:48:53 +0000 (03:48 +0000)]
[libFuzzer] mutation: insert the size of the input in bytes as one of the ways to mutate a binary integer

llvm-svn: 284909

7 years ago[BasicAA] Fix - missed alias in GEP expressions
Gerolf Hoflehner [Sat, 22 Oct 2016 02:41:39 +0000 (02:41 +0000)]
[BasicAA] Fix -  missed alias in GEP expressions

In BasicAA GEP operand values get adjusted ("wrap-around") based on the
pointersize. Otherwise, in non-64b modes, AA could report false negatives.
However, a wrap-around is valid only for a fully evaluated expression.
It had been introduced to fix an alias problem in
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160118/326163.html.
This commit restricts the wrap-around to constant gep operands only where the
value is known at compile-time.

llvm-svn: 284908

7 years agoMark P0012R1 as "Partial" since it's now substantially complete.
Richard Smith [Sat, 22 Oct 2016 01:35:34 +0000 (01:35 +0000)]
Mark P0012R1 as "Partial" since it's now substantially complete.

llvm-svn: 284907

7 years agoAdd another testcase missed from r284905.
Richard Smith [Sat, 22 Oct 2016 01:32:45 +0000 (01:32 +0000)]
Add another testcase missed from r284905.

llvm-svn: 284906

7 years ago[c++1z] P0012R1: Implement a few remaining pieces: downgrade diagnostic for
Richard Smith [Sat, 22 Oct 2016 01:32:19 +0000 (01:32 +0000)]
[c++1z] P0012R1: Implement a few remaining pieces: downgrade diagnostic for
mismatched dynamic exception specifications in expressions from an error to a
warning, since this is no longer ill-formed in C++1z.

Allow reference binding of a reference-to-non-noexcept function to a noexcept
function lvalue. As defect resolutions, also allow a conditional between
noexcept and non-noexcept function lvalues to produce a non-noexcept function
lvalue (rather than decaying to a function pointer), and allow function
template argument deduction to deduce a reference to non-noexcept function when
binding to a noexcept function type.

llvm-svn: 284905

7 years ago[CtorUtils] Modernize. No functional changes intended.
Davide Italiano [Sat, 22 Oct 2016 01:21:24 +0000 (01:21 +0000)]
[CtorUtils] Modernize. No functional changes intended.

llvm-svn: 284904

7 years ago[libFuzzer] typo in a test
Kostya Serebryany [Sat, 22 Oct 2016 01:07:38 +0000 (01:07 +0000)]
[libFuzzer] typo in a test

llvm-svn: 284903

7 years ago[libFuzzer] add a test for asan's strict_string_checks=1
Kostya Serebryany [Sat, 22 Oct 2016 00:05:44 +0000 (00:05 +0000)]
[libFuzzer] add a test for asan's strict_string_checks=1

llvm-svn: 284902

7 years ago[sanitizers] support strict_string_checks for strncmp
Kostya Serebryany [Fri, 21 Oct 2016 23:52:26 +0000 (23:52 +0000)]
[sanitizers] support strict_string_checks for strncmp

llvm-svn: 284901

7 years agoAdd some additional logging to
Jason Molenda [Fri, 21 Oct 2016 23:45:07 +0000 (23:45 +0000)]
Add some additional logging to
DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress to debug
corefiles that may not be correctly formed.

<rdar://problem/28884846>

llvm-svn: 284900

7 years agoModule: correctly set the module file kind when emitting file_modified.
Manman Ren [Fri, 21 Oct 2016 23:35:03 +0000 (23:35 +0000)]
Module: correctly set the module file kind when emitting file_modified.

rdar://28503343

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

llvm-svn: 284899

7 years agoFix map insertion that is elided in release build.
David L. Jones [Fri, 21 Oct 2016 23:30:39 +0000 (23:30 +0000)]
Fix map insertion that is elided in release build.

The assert() macro doesn't actually execute its body in Release builds, so using
it to check cache invariants requires that the insertion be outside of the
assert() statement. This change does that, and also makes sure to return the
actual map contents.

llvm-svn: 284898

7 years agoModule: improve the diagnostic message for include of non-modular header.
Manman Ren [Fri, 21 Oct 2016 23:27:37 +0000 (23:27 +0000)]
Module: improve the diagnostic message for include of non-modular header.

Emit the actual path to the non-modular include.

rdar://28897010

llvm-svn: 284897

7 years ago[x86] add test for missing vector SRA combine via computeKnownBits
Sanjay Patel [Fri, 21 Oct 2016 23:02:31 +0000 (23:02 +0000)]
[x86] add test for missing vector SRA combine via computeKnownBits

llvm-svn: 284896

7 years agoRemove unnecessary distinction between Ref_Compatible and
Richard Smith [Fri, 21 Oct 2016 23:01:55 +0000 (23:01 +0000)]
Remove unnecessary distinction between Ref_Compatible and
Ref_Compatible_With_Added_Qualification. We always treated these two values the
same way.

llvm-svn: 284895

7 years ago[Release notes] Mention removed Clang-tidy misc-pointer-and-integral-operation check
Eugene Zelenko [Fri, 21 Oct 2016 22:35:58 +0000 (22:35 +0000)]
[Release notes] Mention removed Clang-tidy misc-pointer-and-integral-operation check

llvm-svn: 284894

7 years ago[Test Suite] Allow overriding codesign identity
Chris Bieneman [Fri, 21 Oct 2016 22:13:55 +0000 (22:13 +0000)]
[Test Suite] Allow overriding codesign identity

Summary: Not everyone names their code sign identity "lldb_codesign", so it is nice to allow this to be overridden.

Reviewers: zturner, tfiala

Subscribers: labath, mgorny, lldb-commits

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

llvm-svn: 284893

7 years ago[ADT] Don't rely on string literals not being convertible to non-const char* in Cache...
Justin Lebar [Fri, 21 Oct 2016 22:10:23 +0000 (22:10 +0000)]
[ADT] Don't rely on string literals not being convertible to non-const char* in CachedHashString.

The build was breaking on some platforms because we assumed that
CachedHashString("foo") would match the CachedHashString(StringRef)
constructor rather than the CachedHashString(char*) constructor.

To fix this, provide a CachedHashString(const char*) constructor, and
add a dummy argument to the old CachedHashString(char*) constructor.

llvm-svn: 284892

7 years ago[AMDGPU] Perform uchar to float combine for ISD::SINT_TO_FP
Konstantin Zhuravlyov [Fri, 21 Oct 2016 22:10:03 +0000 (22:10 +0000)]
[AMDGPU] Perform uchar to float combine for ISD::SINT_TO_FP

This will prevent following regression when enabling i16 support (D18049):
  test/CodeGen/AMDGPU/cvt_f32_ubyte.ll

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

llvm-svn: 284891

7 years agoDR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.
Richard Smith [Fri, 21 Oct 2016 22:00:42 +0000 (22:00 +0000)]
DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.
This has two significant effects:

1) Direct relational comparisons between null pointer constants (0 and nullopt)
   and pointers are now ill-formed. This was always the case for C, and it
   appears that C++ only ever permitted by accident. For instance, cases like
     nullptr < &a
   are now rejected.

2) Comparisons and conditional operators between differently-cv-qualified
   pointer types now work, and produce a composite type that both source
   pointer types can convert to (when possible). For instance, comparison
   between 'int **' and 'const int **' is now valid, and uses an intermediate
   type of 'const int *const *'.

Clang previously supported #2 as an extension.

We do not accept the cases in #1 as an extension. I've tested a fair amount of
code to check that this doesn't break it, but if it turns out that someone is
relying on this, we can easily add it back as an extension.

This is a re-commit of r284800.

llvm-svn: 284890

7 years agoRemove 'misc-pointer-and-integral-operation' clang-tidy check. The only cases
Richard Smith [Fri, 21 Oct 2016 21:50:28 +0000 (21:50 +0000)]
Remove 'misc-pointer-and-integral-operation' clang-tidy check. The only cases
it detects are ill-formed (some per C++ core issue 1512, others always have
been).

llvm-svn: 284888

7 years agoSwitch SmallSetVector to use DenseSet when it overflows its inline space.
Justin Lebar [Fri, 21 Oct 2016 21:45:01 +0000 (21:45 +0000)]
Switch SmallSetVector to use DenseSet when it overflows its inline space.

Summary:
SetVector already used DenseSet, but SmallSetVector used std::set.  This
leads to surprising performance differences.  Moreover, it means that
the set of key types accepted by SetVector and SmallSetVector are
quite different!

In order to make this change, we had to convert some callsites that used
SmallSetVector<std::string, N> to use SmallSetVector<CachedHashString, N>
instead.

Reviewers: timshen

Subscribers: llvm-commits

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

llvm-svn: 284887

7 years agoFix typo (ordered comparison between pointer and 0).
Richard Smith [Fri, 21 Oct 2016 21:37:18 +0000 (21:37 +0000)]
Fix typo (ordered comparison between pointer and 0).

llvm-svn: 284886

7 years ago[Sema] Store a SourceRange for multi-token builtin types
Malcolm Parsons [Fri, 21 Oct 2016 21:13:56 +0000 (21:13 +0000)]
[Sema] Store a SourceRange for multi-token builtin types

Summary:
clang-tidy's modernize-use-auto check uses the SourceRange of a
TypeLoc when replacing the type with auto.
This was producing the wrong result for multi-token builtin types
like long long:

-long long *ll = new long long();
+auto long *ll = new long long();

Reviewers: alexfh, hokein, rsmith, Prazek, aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 284885

7 years agoSupport: Annotate Error and Expected<> with LLVM_NODISCARD
Justin Bogner [Fri, 21 Oct 2016 21:01:12 +0000 (21:01 +0000)]
Support: Annotate Error and Expected<> with LLVM_NODISCARD

It's always a mistake to ignore return values with Error or Expected
types.

llvm-svn: 284884

7 years ago[polly] Change SmallPtrSet which is being iterated to SmallSetVector in ScopInfo.h
Mandeep Singh Grang [Fri, 21 Oct 2016 21:00:11 +0000 (21:00 +0000)]
[polly] Change SmallPtrSet which is being iterated to SmallSetVector in ScopInfo.h

Summary: This will avoid non-deterministic iteration order.

Reviewers: grosser, jdoerfert, zinob, mgrang

Subscribers: #polly

Tags: #polly

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

llvm-svn: 284883

7 years ago[CUDA] Simplify some repeated diagnostic expectations in CUDA tests.
Justin Lebar [Fri, 21 Oct 2016 20:50:47 +0000 (20:50 +0000)]
[CUDA] Simplify some repeated diagnostic expectations in CUDA tests.

Instead of repeating the diagnostic, use "expected-note N".

Test-only change.

llvm-svn: 284882

7 years ago[libcxx] Support std::regex_constants::match_not_null
Tim Shen [Fri, 21 Oct 2016 20:41:47 +0000 (20:41 +0000)]
[libcxx] Support std::regex_constants::match_not_null

Summary: Fixes PR21597.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

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

llvm-svn: 284881

7 years agofixed typo in InstrProf.h; NFC
Bob Haarman [Fri, 21 Oct 2016 20:38:37 +0000 (20:38 +0000)]
fixed typo in InstrProf.h; NFC

llvm-svn: 284880

7 years agoDeclare H and H new/delete.
Artem Belevich [Fri, 21 Oct 2016 20:34:05 +0000 (20:34 +0000)]
Declare H and H new/delete.

llvm-svn: 284879

7 years agoCompact SymbolBody from 56 to 48 bytes.
Rafael Espindola [Fri, 21 Oct 2016 20:32:41 +0000 (20:32 +0000)]
Compact SymbolBody from 56 to 48 bytes.

llvm-svn: 284878

7 years agoRemove accidentally checked in assert.
Vassil Vassilev [Fri, 21 Oct 2016 20:30:30 +0000 (20:30 +0000)]
Remove accidentally checked in assert.

Thanks to Manman for spotting this.

llvm-svn: 284877

7 years ago[ADT] Get rid of use of LLVM_NOEXCEPT in CachedHashString.h.
Justin Lebar [Fri, 21 Oct 2016 20:28:00 +0000 (20:28 +0000)]
[ADT] Get rid of use of LLVM_NOEXCEPT in CachedHashString.h.

LLVM_NOEXCEPT is no longer necessary (yay).

llvm-svn: 284876

7 years agoAMDGPU/SI: Fix crash caused by r284267
Tom Stellard [Fri, 21 Oct 2016 20:25:11 +0000 (20:25 +0000)]
AMDGPU/SI: Fix crash caused by r284267

Reviewers: arsenm, nhaehnle

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

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

llvm-svn: 284875

7 years ago[DAG] enhance computeKnownBits to handle SHL with vector splat constant
Sanjay Patel [Fri, 21 Oct 2016 20:16:27 +0000 (20:16 +0000)]
[DAG] enhance computeKnownBits to handle SHL with vector splat constant

Also, use APInt to avoid crashing on types larger than vNi64.

llvm-svn: 284874

7 years ago[clang-tidy] Don't use a SmallSetVector of an enum.
Justin Lebar [Fri, 21 Oct 2016 20:13:39 +0000 (20:13 +0000)]
[clang-tidy] Don't use a SmallSetVector of an enum.

Summary:
This doesn't work after converting SmallSetVector to use DenseSet.

Instead we can just use a SmallVector.

Reviewers: timshen

Subscribers: nemanjai, cfe-commits

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

llvm-svn: 284873

7 years ago[ADT] Compare strings' hashes first before comparing their values.
Justin Lebar [Fri, 21 Oct 2016 20:10:51 +0000 (20:10 +0000)]
[ADT] Compare strings' hashes first before comparing their values.

Summary:
We already have the hashes in hand, and comparing hashes should be much
more discriminatory than comparing the StringRefs' sizes.

Reviewers: rafael

Subscribers: llvm-commits

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

llvm-svn: 284872

7 years ago[ADT] Add CachedHashString.
Justin Lebar [Fri, 21 Oct 2016 20:10:48 +0000 (20:10 +0000)]
[ADT] Add CachedHashString.

Summary:
This is like CachedHashStringRef, but owns its data.

This lets us use strings inside of DenseMaps.

Reviewers: timshen

Subscribers: llvm-commits

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

llvm-svn: 284871

7 years ago[IR] Add DenseMapInfo<CallSite>.
Justin Lebar [Fri, 21 Oct 2016 20:10:44 +0000 (20:10 +0000)]
[IR] Add DenseMapInfo<CallSite>.

Summary:
A CallSite is basically an Instruction*, and you can put Instruction*s
into DenseMaps, so you should be able to do the same with CallSites.

This is used in a later patch.

Reviewers: timshen

Subscribers: llvm-commits

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

llvm-svn: 284870

7 years ago[CUDA] Use FunctionDeclAndLoc for the Sema::LocsWithCUDACallDiags hashtable.
Justin Lebar [Fri, 21 Oct 2016 20:08:52 +0000 (20:08 +0000)]
[CUDA] Use FunctionDeclAndLoc for the Sema::LocsWithCUDACallDiags hashtable.

Summary: NFC

Reviewers: rnk

Subscribers: cfe-commits

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

llvm-svn: 284869

7 years ago[SCEV] Memoize visitMulExpr results in SCEVRewriteVisitor.
Li Huang [Fri, 21 Oct 2016 20:05:21 +0000 (20:05 +0000)]
[SCEV] Memoize visitMulExpr results in SCEVRewriteVisitor.

Summary:
When SCEVRewriteVisitor traverses the SCEV DAG, it may visit the same SCEV
multiple times if this SCEV is referenced by multiple other SCEVs. This has
exponential time complexity in the worst case. Memoizing the results will
avoid re-visiting the same SCEV. Add a map to save the results, and override
the visit function of SCEVVisitor. Now SCEVRewriteVisitor only visit each
SCEV once and thus returns the same result for the same input SCEV.

This patch fixes PR18606, PR18607.

Reviewers: Sanjoy Das, Mehdi Amini, Michael Zolotukhin

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

llvm-svn: 284868

7 years agoFix a bug in the code of llvm-cxxdump in dumpArchive() when
Kevin Enderby [Fri, 21 Oct 2016 20:03:14 +0000 (20:03 +0000)]
Fix a bug in the code of llvm-cxxdump in dumpArchive() when
iterating over an archive with object and non-object members that
would cause an Abort because to was not calling consumeError()
when the code was wanting to ignore a non-object file.

Found by Justin Bogner!

llvm-svn: 284867

7 years ago[libFuzzer] mention one more trophie
Kostya Serebryany [Fri, 21 Oct 2016 20:01:45 +0000 (20:01 +0000)]
[libFuzzer] mention one more trophie

llvm-svn: 284866

7 years agoAnalysis: Move llvm::getConstantRangeFromMetadata to IR library.
Peter Collingbourne [Fri, 21 Oct 2016 19:59:26 +0000 (19:59 +0000)]
Analysis: Move llvm::getConstantRangeFromMetadata to IR library.

We're about to start using it there.

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

llvm-svn: 284865