platform/upstream/llvm.git
7 years ago[tests] Adjust test output to recent changed SCEV canonocalization [NFC]
Tobias Grosser [Sun, 13 Nov 2016 19:27:17 +0000 (19:27 +0000)]
[tests] Adjust test output to recent changed SCEV canonocalization [NFC]

LLVM recently changed the SCEV canonicalization which changed the output of
one of our GPGPU test cases.

llvm-svn: 286770

7 years ago[ScopDetect] Evaluate and verify branches at branch condition, not icmp
Tobias Grosser [Sun, 13 Nov 2016 19:27:04 +0000 (19:27 +0000)]
[ScopDetect] Evaluate and verify branches at branch condition, not icmp

The validity of a branch condition must be verified at the location of the
branch (the branch instruction), not the location of the icmp that is
used in the branch instruction. When verifying at the wrong location, we
may accept an icmp that is defined within a loop which itself dominates, but
does not contain the branch instruction. Such loops cannot be modeled as
we only introduce domain dimensions for surrounding loops. To address this
problem we change the scop detection to evaluate and verify SCEV expressions at
the right location.

This issue has been around since at least r179148 "scop detection: properly
instantiate SCEVs to the place where they are used", where we explicitly
set the scope to the wrong location. Before this commit the scope
was not explicitly set, which probably also resulted in the scope around the
ICmp to be choosen.

This resolves http://llvm.org/PR30989

Reported-by: Eli Friedman <efriedma@codeaurora.org>
llvm-svn: 286769

7 years ago[X86][IR] Reduce the number of full string comparisons in the code that autoupgrades...
Craig Topper [Sun, 13 Nov 2016 19:09:56 +0000 (19:09 +0000)]
[X86][IR] Reduce the number of full string comparisons in the code that autoupgrades masked shift intrinsics.

llvm-svn: 286768

7 years agollvm-strings: support printing the filename
Saleem Abdulrasool [Sun, 13 Nov 2016 19:07:48 +0000 (19:07 +0000)]
llvm-strings: support printing the filename

This adds support for the `-f` or `--print-file-name` option for strings.

llvm-svn: 286767

7 years agoAMDGPU: Implement SGPR spilling with scalar stores
Matt Arsenault [Sun, 13 Nov 2016 18:20:54 +0000 (18:20 +0000)]
AMDGPU: Implement SGPR spilling with scalar stores

nThis avoids the nasty problems caused by using
memory instructions that read the exec mask while
spilling / restoring registers used for control flow
masking, but only for VI when these were added.

This always uses the scalar stores when enabled currently,
but it may be better to still try to spill to a VGPR
and use this on the fallback memory path.

The cache also needs to be flushed before wave termination
if a scalar store is used.

llvm-svn: 286766

7 years agorevert commit r286761, some builds failed on Win platforms
Igor Breger [Sun, 13 Nov 2016 15:48:11 +0000 (15:48 +0000)]
revert commit r286761, some builds failed on Win platforms

llvm-svn: 286765

7 years ago[X86][SSE] Add zero lower 32-bits test case for PR30845
Simon Pilgrim [Sun, 13 Nov 2016 15:32:11 +0000 (15:32 +0000)]
[X86][SSE] Add zero lower 32-bits test case for PR30845

llvm-svn: 286764

7 years ago[X86][AVX512] Add masked VPMOZX test case for PR26762
Simon Pilgrim [Sun, 13 Nov 2016 15:16:43 +0000 (15:16 +0000)]
[X86][AVX512] Add masked VPMOZX test case for PR26762

llvm-svn: 286763

7 years ago[X86][SSE] Add additional test case for PR30845
Simon Pilgrim [Sun, 13 Nov 2016 14:57:52 +0000 (14:57 +0000)]
[X86][SSE] Add additional test case for PR30845

llvm-svn: 286762

7 years ago[X86][AVX512] Removing llvm x86 intrinsics for _mm_mask_move_{ss|sd} intrinsics.
Ayman Musa [Sun, 13 Nov 2016 14:51:25 +0000 (14:51 +0000)]
[X86][AVX512] Removing llvm x86 intrinsics for _mm_mask_move_{ss|sd} intrinsics.

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

llvm-svn: 286761

7 years agoarm: Fix ttype encoding assertion failure.
Logan Chien [Sun, 13 Nov 2016 14:44:41 +0000 (14:44 +0000)]
arm: Fix ttype encoding assertion failure.

GCC 4.7 or newer emits 0x90 (indirect | pcrel) as the ttype encoding.
This would hit an assertion in cxa_personality.cpp.  This commit fixes
the problem by relaxing the assertion.

llvm-svn: 286760

7 years ago[CMake] Fix libc++abi arm build w/o libunwind.
Logan Chien [Sun, 13 Nov 2016 14:42:15 +0000 (14:42 +0000)]
[CMake] Fix libc++abi arm build w/o libunwind.

This commit fixes libc++abi build when LLVM unwinder (libunwind_llvm) is
not enabled.

This commit fixes the problem by removing "LLVM_NATIVE_ARCH MATCHES ARM"
from CMakeLists.txt so that LIBCXXABI_USE_LLVM_UNWINDER will only be
defined when LLVM unwinder is enabled.

We need LIBCXXABI_USE_LLVM_UNWINDER becase there is a subtle difference
between the unwinder from libgcc and the one from libunwind_llvm.  For
the unwinder from libgcc, we have to initialize register r12 with the
address of _Unwind_Control_Block; otherwise,
_Unwind_GetLanguageSpecificData() and _Unwind_GetRegionStart() won't
work properly.  Consequently, there is an extra _Unwind_SetGR() when
LLVM unwinder is disabled.  Check cxa_personality.cpp for details.

llvm-svn: 286759

7 years ago[X86][AVX512] Add patterns for all variants of VMOVSS/VMOVSD instructions.
Ayman Musa [Sun, 13 Nov 2016 14:29:32 +0000 (14:29 +0000)]
[X86][AVX512] Add patterns for all variants of VMOVSS/VMOVSD instructions.

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

llvm-svn: 286758

7 years ago[AVX-512] Replace masked dword and qword variable shift builtins with unmasked builti...
Craig Topper [Sun, 13 Nov 2016 07:26:34 +0000 (07:26 +0000)]
[AVX-512] Replace masked dword and qword variable shift builtins with unmasked builtins and a select.

This is part of a set of changes to allow InstCombine in the backend to optimize variable shifts without having to know about masking.

llvm-svn: 286757

7 years ago[X86] Remove extra escaped new lines in intrinsic headers left over from an earlier...
Craig Topper [Sun, 13 Nov 2016 07:26:31 +0000 (07:26 +0000)]
[X86] Remove extra escaped new lines in intrinsic headers left over from an earlier conversion away from a macro. NFC

llvm-svn: 286756

7 years ago[InstCombine][AVX-512] Teach InstCombineCalls to handle the new unmasked AVX-512...
Craig Topper [Sun, 13 Nov 2016 07:26:19 +0000 (07:26 +0000)]
[InstCombine][AVX-512] Teach InstCombineCalls to handle the new unmasked AVX-512 variable shift intrinsics.

llvm-svn: 286755

7 years ago[AVX-512] Add unmasked intrinsics for variable shifts of dwords and qwords.
Craig Topper [Sun, 13 Nov 2016 07:26:15 +0000 (07:26 +0000)]
[AVX-512] Add unmasked intrinsics for variable shifts of dwords and qwords.

These will be used to replace the masked intrinsics so that InstCombineCalls can optimize the AVX-512 variable shifts the same way it does for AVX2.

llvm-svn: 286754

7 years ago[AMDGPU] Add f16 support (VI+)
Konstantin Zhuravlyov [Sun, 13 Nov 2016 07:01:11 +0000 (07:01 +0000)]
[AMDGPU] Add f16 support (VI+)

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

llvm-svn: 286753

7 years agoBitcode: Change module reader functions to return an llvm::Expected.
Peter Collingbourne [Sun, 13 Nov 2016 07:00:17 +0000 (07:00 +0000)]
Bitcode: Change module reader functions to return an llvm::Expected.

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

llvm-svn: 286752

7 years agoAnalysis: Simplify the ScalarEvolution::getGEPExpr() interface. NFCI.
Peter Collingbourne [Sun, 13 Nov 2016 06:59:50 +0000 (06:59 +0000)]
Analysis: Simplify the ScalarEvolution::getGEPExpr() interface. NFCI.

All existing callers were manually extracting information out of an existing
GEP instruction and passing it to getGEPExpr(). Simplify the interface by
changing it to take a GEPOperator instead.

llvm-svn: 286751

7 years agoBitcode: More precise casting. NFCI.
Peter Collingbourne [Sun, 13 Nov 2016 06:59:28 +0000 (06:59 +0000)]
Bitcode: More precise casting. NFCI.

llvm-svn: 286750

7 years agoIR: Change the Type::get{Array,Vector,Pointer}ElementType() functions to perform...
Peter Collingbourne [Sun, 13 Nov 2016 06:58:45 +0000 (06:58 +0000)]
IR: Change the Type::get{Array,Vector,Pointer}ElementType() functions to perform the correct type assertion.

Previously we were only asserting that the type was a sequential type.

llvm-svn: 286749

7 years agoFix PR28366: Handle variables from enclosing local scopes more gracefully during...
Faisal Vali [Sun, 13 Nov 2016 06:09:16 +0000 (06:09 +0000)]
Fix PR28366: Handle variables from enclosing local scopes more gracefully during constant expression evaluation.

Only look for a variable's value in the constant expression evaluation activation frame, if the variable was indeed declared in that frame, otherwise it might be a constant expression and be usable within a nested local scope or emit an error.

void f(char c) {
  struct X {
    static constexpr char f() {
      return c; // error gracefully here as opposed to crashing.
    }
  };
  int I = X::f();
}

llvm-svn: 286748

7 years agoMake OptionParser::Parse() take StringRef.
Zachary Turner [Sun, 13 Nov 2016 04:24:38 +0000 (04:24 +0000)]
Make OptionParser::Parse() take StringRef.

llvm-svn: 286747

7 years ago[AVX-512] Move masked shift intrinsics tests to the autoupgrade test file. These...
Craig Topper [Sun, 13 Nov 2016 03:42:27 +0000 (03:42 +0000)]
[AVX-512] Move masked shift intrinsics tests to the autoupgrade test file. These missed being moved in r286725.

llvm-svn: 286746

7 years agoFix some use-after-frees that my last CL introduced.
Zachary Turner [Sun, 13 Nov 2016 03:36:01 +0000 (03:36 +0000)]
Fix some use-after-frees that my last CL introduced.

llvm-svn: 286745

7 years agoChange ValueObject creation functions to take StringRefs.
Zachary Turner [Sun, 13 Nov 2016 03:29:46 +0000 (03:29 +0000)]
Change ValueObject creation functions to take StringRefs.

llvm-svn: 286744

7 years agoChange IOHandlerConfirm to use StringRefs.
Zachary Turner [Sun, 13 Nov 2016 03:05:58 +0000 (03:05 +0000)]
Change IOHandlerConfirm to use StringRefs.

llvm-svn: 286743

7 years agoChange some more CommandObject functions to StringRef.
Zachary Turner [Sun, 13 Nov 2016 02:50:32 +0000 (02:50 +0000)]
Change some more CommandObject functions to StringRef.

llvm-svn: 286742

7 years ago[AMDGPU] Add f16 builtin functions (VI+)
Konstantin Zhuravlyov [Sun, 13 Nov 2016 02:37:05 +0000 (02:37 +0000)]
[AMDGPU] Add f16 builtin functions (VI+)

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

llvm-svn: 286741

7 years agoChange ArgumentHelpCallbackFunction to return a StringRef.
Zachary Turner [Sun, 13 Nov 2016 02:08:22 +0000 (02:08 +0000)]
Change ArgumentHelpCallbackFunction to return a StringRef.

llvm-svn: 286740

7 years ago[InstCombine][AVX-512] Expand vector shift handling to work on the AVX-512 shift...
Craig Topper [Sun, 13 Nov 2016 01:51:55 +0000 (01:51 +0000)]
[InstCombine][AVX-512] Expand vector shift handling to work on the AVX-512 shift by immediate and shift by single value.

This does not include support for the AVX-512 variable shifts. That will be coming in a future patch.

llvm-svn: 286739

7 years ago[AVX-512] Add returns to shift intrinsics that converted from macros in r286714.
Craig Topper [Sun, 13 Nov 2016 00:35:01 +0000 (00:35 +0000)]
[AVX-512] Add returns to shift intrinsics that converted from macros in r286714.

llvm-svn: 286738

7 years ago[x86] add smin/smax with zero tests
Sanjay Patel [Sun, 13 Nov 2016 00:32:39 +0000 (00:32 +0000)]
[x86] add smin/smax with zero tests

These are vector tests corresponding to the discussion at:
http://lists.llvm.org/pipermail/llvm-dev/2016-November/106868.html

Apart from the lack of min/max matching, the and/andn difference
shows a lack of DAG-level canonicalization.

llvm-svn: 286737

7 years agoRevert r286735 due to test failure
Brad Smith [Sun, 13 Nov 2016 00:16:21 +0000 (00:16 +0000)]
Revert r286735 due to test failure

llvm-svn: 286736

7 years agoLink static PIE programs against rcrt0.o on OpenBSD
Brad Smith [Sat, 12 Nov 2016 23:52:03 +0000 (23:52 +0000)]
Link static PIE programs against rcrt0.o on OpenBSD

Patch by Stefan Kempf.

llvm-svn: 286735

7 years ago[X86][SSE] Add test case for PR30845
Simon Pilgrim [Sat, 12 Nov 2016 23:44:58 +0000 (23:44 +0000)]
[X86][SSE] Add test case for PR30845

llvm-svn: 286734

7 years ago[AVX-512] Use scalar vfmsub/vfnmsub mask3 intrinsics instead of inverting the mask...
Craig Topper [Sat, 12 Nov 2016 23:24:34 +0000 (23:24 +0000)]
[AVX-512] Use scalar vfmsub/vfnmsub mask3 intrinsics instead of inverting the mask argument of a vfmadd intrinsic.

Summary: Inverting the mask argument does not reflect the intended semantics of the intrinsic.

Reviewers: igorb, delena

Subscribers: cfe-commits

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

llvm-svn: 286733

7 years ago[ORC] Remove the 'const' qualifier from the member function wrapper, make the
Lang Hames [Sat, 12 Nov 2016 23:12:41 +0000 (23:12 +0000)]
[ORC] Remove the 'const' qualifier from the member function wrapper, make the
lambda in wrapHandler mutable to allow it to pass the handler through as a
non-const value.

llvm-svn: 286732

7 years agoMake CommandObject help getters/setters use StringRef.
Zachary Turner [Sat, 12 Nov 2016 20:41:02 +0000 (20:41 +0000)]
Make CommandObject help getters/setters use StringRef.

llvm-svn: 286731

7 years agoMake DiagnosticsManager functions take StringRefs.
Zachary Turner [Sat, 12 Nov 2016 19:12:56 +0000 (19:12 +0000)]
Make DiagnosticsManager functions take StringRefs.

llvm-svn: 286730

7 years agotest: explicitly use gnu format
Saleem Abdulrasool [Sat, 12 Nov 2016 19:03:08 +0000 (19:03 +0000)]
test: explicitly use gnu format

This should fix the Darwin buildbots.

llvm-svn: 286729

7 years agoMake CommandReturnObject methods accept StringRefs.
Zachary Turner [Sat, 12 Nov 2016 18:47:11 +0000 (18:47 +0000)]
Make CommandReturnObject methods accept StringRefs.

llvm-svn: 286728

7 years agollvm-strings: trivialise logic until we support more options
Saleem Abdulrasool [Sat, 12 Nov 2016 18:37:04 +0000 (18:37 +0000)]
llvm-strings: trivialise logic until we support more options

Until we have handling for ignoring unloaded sections, simplify the logic to
the point of triviality.  This fixes the scanning of archives, particularly when
embedded in archives.

llvm-svn: 286727

7 years agoMake ValueObjectMemory::Create accept StringRefs.
Zachary Turner [Sat, 12 Nov 2016 18:17:36 +0000 (18:17 +0000)]
Make ValueObjectMemory::Create accept StringRefs.

llvm-svn: 286726

7 years ago[AVX-512] Remove the remaining masked shift by immediate or by single value. Autoupgr...
Craig Topper [Sat, 12 Nov 2016 18:04:46 +0000 (18:04 +0000)]
[AVX-512] Remove the remaining masked shift by immediate or by single value. Autoupgrade them to recently introduced unmasked versions and a select.

After this I'll add the unmasked intrinsics to InstCombineCalls to finish making our handling of these types of shuffles consistent between AVX-512 and the legacy intrinsics.

llvm-svn: 286725

7 years ago[Support] Add StringRef::find_lower and contains_lower.
Zachary Turner [Sat, 12 Nov 2016 17:17:12 +0000 (17:17 +0000)]
[Support] Add StringRef::find_lower and contains_lower.

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

llvm-svn: 286724

7 years agoMake Options::SetOptionValue take a StringRef.
Zachary Turner [Sat, 12 Nov 2016 16:56:47 +0000 (16:56 +0000)]
Make Options::SetOptionValue take a StringRef.

llvm-svn: 286723

7 years agoDisable sanitizer tests on Windows.
Zachary Turner [Sat, 12 Nov 2016 16:56:13 +0000 (16:56 +0000)]
Disable sanitizer tests on Windows.

llvm-svn: 286722

7 years agoUse descriptive message if list initializer is incorrectly parenthesized.
Serge Pavlov [Sat, 12 Nov 2016 15:38:55 +0000 (15:38 +0000)]
Use descriptive message if list initializer is incorrectly parenthesized.

If initializer contains parentheses around braced list where it is not allowed,
as in construct int({0}), clang issued message like `functional-style cast
from 'void' to 'int' is not allowed`, which does not help much. Both gcc and
msvc issue message `list-initializer for non-class type must not be
parenthesized`, which is more descriptive. This change implements similar
message for clang.

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

llvm-svn: 286721

7 years ago[OCaml] Clear cross-target test deps when building out-of-tree
Michal Gorny [Sat, 12 Nov 2016 14:58:30 +0000 (14:58 +0000)]
[OCaml] Clear cross-target test deps when building out-of-tree

Clear cross-target test dependencies when using LLVM_OCAML_OUT_OF_TREE,
in order to make it possible to run check-llvm-bindings-ocaml without
rebuilding the whole LLVM.

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

llvm-svn: 286720

7 years agoAs we released 3.9, from the 4.0 release notes, points to version 3.9 instead of 3.8
Sylvestre Ledru [Sat, 12 Nov 2016 10:39:09 +0000 (10:39 +0000)]
As we released 3.9, from the 4.0 release notes, points to version 3.9 instead of 3.8

llvm-svn: 286719

7 years agoAs we released 3.9, from the 4.0 release notes, points to version 3.9 instead of 3.8
Sylvestre Ledru [Sat, 12 Nov 2016 10:38:18 +0000 (10:38 +0000)]
As we released 3.9, from the 4.0 release notes, points to version 3.9 instead of 3.8

llvm-svn: 286718

7 years agoAdd the new option -Og in the release notes. See r286602 for more information
Sylvestre Ledru [Sat, 12 Nov 2016 10:37:17 +0000 (10:37 +0000)]
Add the new option -Og in the release notes. See r286602 for more information

llvm-svn: 286717

7 years agoAdd support of the next Ubuntu (17.04 - Zesty Zapus)
Sylvestre Ledru [Sat, 12 Nov 2016 09:26:30 +0000 (09:26 +0000)]
Add support of the next Ubuntu (17.04 - Zesty Zapus)

llvm-svn: 286716

7 years agoclang-format: Support ObjC selectors with unnamed parameters.
Daniel Jasper [Sat, 12 Nov 2016 07:38:22 +0000 (07:38 +0000)]
clang-format: Support ObjC selectors with unnamed parameters.

This fixes llvm.org/PR28063.

llvm-svn: 286715

7 years ago[AVX-512] Convert the rest of the masked shift by immediate and by single element...
Craig Topper [Sat, 12 Nov 2016 07:16:59 +0000 (07:16 +0000)]
[AVX-512] Convert the rest of the masked shift by immediate and by single element builtins over to the newly added unmasked builtins and a select.

This should also fix PR30691 since the new builtins are handled like the legacy builtins in the backend.

llvm-svn: 286714

7 years ago[ELF] - Add support for locals list in version script.
George Rimar [Sat, 12 Nov 2016 07:04:15 +0000 (07:04 +0000)]
[ELF] - Add support for locals list in version script.

Previously we did not support anything except "local: *", patch changes that.

Actually GNU rules of proccessing wildcards are more complex than that (http://www.airs.com/blog/archives/300):
There are 2 iteration for wildcards, at first iteration "*" wildcards are ignored and handled at second iteration.

Since we previously decided not to implement such complex rules,
I suggest solution that is implemented in this patch. So for "local: *" case nothing changes,
but if we have wildcarded locals,
they are processed before wildcarded globals.

This should fix several FreeBSD ports, one of them is jpeg-turbo-1.5.1 and
currently blocks about 5k of ports.

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

llvm-svn: 286713

7 years ago[ELF] - Fixed comment. NFC.
George Rimar [Sat, 12 Nov 2016 06:27:42 +0000 (06:27 +0000)]
[ELF] - Fixed comment. NFC.

llvm-svn: 286712

7 years ago[AVX-512] Add unmasked version of shift by immediate and shift by single element...
Craig Topper [Sat, 12 Nov 2016 05:28:24 +0000 (05:28 +0000)]
[AVX-512] Add unmasked version of shift by immediate and shift by single element in XMM.

Summary:
This is the first step towards being able to add the avx512 shift by immediate intrinsics to InstCombineCalls where we aleady support the sse2 and avx2 intrinsics. We need to the unmasked versions so we can avoid having to teach InstCombineCalls that it would need to insert selects sometimes. Instead we'll just add the selects around the new instrinsics in the frontend.

This change should also enable the shift by i32 intrinsics to take a non-constant shift value just like the avx2 and sse intrinsics. This will enable us to fix PR30691 once we update clang.

Next I'll switch clang to use the new builtins. Then we'll come back to the backend and remove/autoupgrade the old intrinsics. Then I'll work on the same series for variable shifts.

Reviewers: RKSimon, zvi, delena

Subscribers: llvm-commits

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

llvm-svn: 286711

7 years agoCODE_OWNERS: Take ownership of the X86 backend.
Craig Topper [Sat, 12 Nov 2016 05:16:06 +0000 (05:16 +0000)]
CODE_OWNERS: Take ownership of the X86 backend.

llvm-svn: 286710

7 years ago[AVX-512] Add support for lowering shuffles to VALIGND/VALIGNQ
Craig Topper [Sat, 12 Nov 2016 05:05:27 +0000 (05:05 +0000)]
[AVX-512] Add support for lowering shuffles to VALIGND/VALIGNQ

Summary: VALIGND and VALIGNQ are similar to PALIGNR but instead of working on a 128-bit lane they work on the entire vector register. This change leverages the shuffle rotate detection code used for PALIGNR to detect these cases.

Reviewers: delena, RKSimon

Subscribers: Farhana, llvm-commits

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

llvm-svn: 286709

7 years ago[asan] Fix strncmp and strncasecmp interceptors
Vitaly Buka [Sat, 12 Nov 2016 04:32:31 +0000 (04:32 +0000)]
[asan] Fix strncmp and strncasecmp interceptors

Summary:
In non-strict mode we will check memory access for both strings from beginning
to either:
  1. 0-char
  2. size
  3. different chars

In strict mode we will check from beginning to either:
  1. 0-char
  2. size

Previously in strict mode we always checked up to the 0-char.

Reviewers: kcc, eugenis

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 286708

7 years agobuild: add a dependency on llvm-strings
Saleem Abdulrasool [Sat, 12 Nov 2016 03:45:21 +0000 (03:45 +0000)]
build: add a dependency on llvm-strings

Since we now have tests for llvm-strings, add a dependency on the tool.

llvm-svn: 286707

7 years agollvm-strings: ensure that the last string is correctly printed
Saleem Abdulrasool [Sat, 12 Nov 2016 03:39:21 +0000 (03:39 +0000)]
llvm-strings: ensure that the last string is correctly printed

We would ignore the last string that appeared if the file ended with a printable
character.  Ensure that we get the last string.

llvm-svn: 286706

7 years ago[OCaml] Adapt to the new attribute C API.
whitequark [Sat, 12 Nov 2016 03:38:30 +0000 (03:38 +0000)]
[OCaml] Adapt to the new attribute C API.

llvm-svn: 286705

7 years ago[C API] Fix several null pointer dereferences.
whitequark [Sat, 12 Nov 2016 03:38:23 +0000 (03:38 +0000)]
[C API] Fix several null pointer dereferences.

llvm-svn: 286704

7 years ago[libFuzzer] one more trophy
Kostya Serebryany [Sat, 12 Nov 2016 02:55:45 +0000 (02:55 +0000)]
[libFuzzer] one more trophy

llvm-svn: 286703

7 years ago[libFuzzer] use a valid ASCII string for a dummy seed corpus
Kostya Serebryany [Sat, 12 Nov 2016 02:27:21 +0000 (02:27 +0000)]
[libFuzzer] use a valid ASCII string for a dummy seed corpus

llvm-svn: 286702

7 years ago[ORC] Add a WrappedHandlerReturn type to map handler return types onto error
Lang Hames [Sat, 12 Nov 2016 02:19:31 +0000 (02:19 +0000)]
[ORC] Add a WrappedHandlerReturn type to map handler return types onto error
return types.

This class allows user provided handlers to return either error-wrapped types
or plain types. In the latter case, the plain type is wrapped with a success
value of Error or Expected<T> type to fit it into the rest of the serialization
machinery.

This patch allows us to remove the RPC unit-test workaround added in r286646.

llvm-svn: 286701

7 years ago[analyzer] Update 'Automated' to 'Automatic' from r286694.
Devin Coughlin [Sat, 12 Nov 2016 01:50:04 +0000 (01:50 +0000)]
[analyzer] Update 'Automated' to 'Automatic' from r286694.

ARC is 'Automatic Reference Counting' and not 'Automated Reference Counting'.

llvm-svn: 286700

7 years ago[c++1z] Support constant folding for __builtin_strchr and __builtin_memchr.
Richard Smith [Sat, 12 Nov 2016 01:39:56 +0000 (01:39 +0000)]
[c++1z] Support constant folding for __builtin_strchr and __builtin_memchr.

llvm-svn: 286699

7 years agoRemove dead code.
Rui Ueyama [Sat, 12 Nov 2016 01:32:34 +0000 (01:32 +0000)]
Remove dead code.

llvm-svn: 286698

7 years ago[analyzer] Fix copy-pasta in NullableReturnedFromNonnullChecker checker name.
Devin Coughlin [Sat, 12 Nov 2016 01:23:01 +0000 (01:23 +0000)]
[analyzer] Fix copy-pasta in NullableReturnedFromNonnullChecker checker name.

The name of the NullableReturnedFromNonnullChecker in Checkers.td
was accidentally "NullablePassedToNonnull", which made it impossible
to explicitly turn the checker on.

rdar://problem/28354459

llvm-svn: 286697

7 years agoAdd instructions in clang get_started page about working with a monorepo
Mehdi Amini [Sat, 12 Nov 2016 01:18:17 +0000 (01:18 +0000)]
Add instructions in clang get_started page about working with a monorepo

llvm-svn: 286696

7 years agoImprove `git llvm push` to suggest `git pull` when applying patch fails
Mehdi Amini [Sat, 12 Nov 2016 01:17:59 +0000 (01:17 +0000)]
Improve `git llvm push` to suggest `git pull` when applying patch fails

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

llvm-svn: 286695

7 years ago[analyzer] Improve misleading RetainCountChcker diagnostic under ARC
Devin Coughlin [Sat, 12 Nov 2016 01:03:06 +0000 (01:03 +0000)]
[analyzer] Improve misleading RetainCountChcker diagnostic under ARC

Under automated reference counting the analyzer treats a methods -- even those
starting with  'copy' and friends -- as returning an unowned value. This is
because ownership of CoreFoundation objects must be transferred to ARC
with __bridge_transfer or CFBridgingRelease() before being returned as
ARC-managed bridged objects.

Unfortunately this could lead to a poor diagnostic inside copy methods under
ARC where the analyzer would complain about a leak of a returned CF value inside
a method "whose name does not start with 'copy'" -- even though the name did
start with 'copy'.

This commit improves the diagnostic under ARC to say inside a method "returned
from a method managed by Automated Reference Counting".

rdar://problem/28849667

llvm-svn: 286694

7 years ago[tsan] Test that false races from ObjC's dealloc, .cxx_destruct, and initialize are...
Anna Zaks [Sat, 12 Nov 2016 00:46:07 +0000 (00:46 +0000)]
[tsan] Test that false races from ObjC's dealloc, .cxx_destruct, and initialize are ignored

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

llvm-svn: 286693

7 years agoOne more set of changes to fix formatv() on linux.
Zachary Turner [Sat, 12 Nov 2016 00:35:58 +0000 (00:35 +0000)]
One more set of changes to fix formatv() on linux.

llvm-svn: 286692

7 years agoAdd missing #include.
Zachary Turner [Sat, 12 Nov 2016 00:30:37 +0000 (00:30 +0000)]
Add missing #include.

llvm-svn: 286691

7 years agoFix another problem with formatv().
Zachary Turner [Sat, 12 Nov 2016 00:28:10 +0000 (00:28 +0000)]
Fix another problem with formatv().

llvm-svn: 286690

7 years ago[libFuzzer] use less stack
Kostya Serebryany [Sat, 12 Nov 2016 00:24:35 +0000 (00:24 +0000)]
[libFuzzer] use less stack

llvm-svn: 286689

7 years agoRemove extra semicolon.
Rui Ueyama [Sat, 12 Nov 2016 00:23:32 +0000 (00:23 +0000)]
Remove extra semicolon.

llvm-svn: 286688

7 years agoAMDGPU/SI: Promote i16 = fp_[us]int f32 for VI
Tom Stellard [Sat, 12 Nov 2016 00:19:11 +0000 (00:19 +0000)]
AMDGPU/SI: Promote i16 = fp_[us]int f32 for VI

Summary: This fixes a regression caused by r286464.

Reviewers: arsenm

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

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

llvm-svn: 286687

7 years agoTry to fix build after llvm::formatv() patch.
Zachary Turner [Sat, 12 Nov 2016 00:18:42 +0000 (00:18 +0000)]
Try to fix build after llvm::formatv() patch.

llvm-svn: 286686

7 years ago[c++1z] std::byte didn't make it
Richard Smith [Sat, 12 Nov 2016 00:15:24 +0000 (00:15 +0000)]
[c++1z] std::byte didn't make it

llvm-svn: 286685

7 years agoEmit Section Contributions.
Rui Ueyama [Sat, 12 Nov 2016 00:00:51 +0000 (00:00 +0000)]
Emit Section Contributions.

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

llvm-svn: 286684

7 years agoFix -Werror build with clang-cl.
Zachary Turner [Fri, 11 Nov 2016 23:58:11 +0000 (23:58 +0000)]
Fix -Werror build with clang-cl.

llvm-svn: 286683

7 years ago[Support] Introduce llvm::formatv() function.
Zachary Turner [Fri, 11 Nov 2016 23:57:40 +0000 (23:57 +0000)]
[Support] Introduce llvm::formatv() function.

This introduces a new type-safe general purpose formatting
library.  It provides compile-time type safety, does not require
a format specifier (since the type is deduced), and provides
mechanisms for extending the format capability to user defined
types, and overriding the formatting behavior for existing types.

This patch additionally adds documentation for the API to the
LLVM programmer's manual.

Mailing List Thread:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105836.html

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

llvm-svn: 286682

7 years ago[c++1z] Two more features have been accepted.
Richard Smith [Fri, 11 Nov 2016 23:51:47 +0000 (23:51 +0000)]
[c++1z] Two more features have been accepted.

llvm-svn: 286681

7 years ago[index] Rename SymbolSubKind -> SymbolProperty, NFC.
Argyrios Kyrtzidis [Fri, 11 Nov 2016 23:49:55 +0000 (23:49 +0000)]
[index] Rename SymbolSubKind -> SymbolProperty, NFC.

This better reflects what it represents.

llvm-svn: 286680

7 years ago[c++1z] p0522 is approved.
Richard Smith [Fri, 11 Nov 2016 23:46:25 +0000 (23:46 +0000)]
[c++1z] p0522 is approved.

llvm-svn: 286679

7 years ago[c++1z] Add constant-folding support for strcmp, strncmp, and memcmp, to
Richard Smith [Fri, 11 Nov 2016 23:43:35 +0000 (23:43 +0000)]
[c++1z] Add constant-folding support for strcmp, strncmp, and memcmp, to
support constexpr char_traits.

llvm-svn: 286678

7 years agoDefine DbiStreamBuilder::addSectionContribs.
Rui Ueyama [Fri, 11 Nov 2016 23:41:13 +0000 (23:41 +0000)]
Define DbiStreamBuilder::addSectionContribs.

This patch defines a new function to add a SectionContribs stream
to a PDB file. Unlike SectionMap, SectionContribs contains a list
of input sections as opposed to output sections.

Note that this patch needs improving because currently we do not
set Module field in SectionContribs entries. In a follow-up patch,
I'll add Modules and then fix it after that.

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

llvm-svn: 286677

7 years agoAMDGPU/SI: Fix visit order assumption in SIFixSGPRCopies
Tom Stellard [Fri, 11 Nov 2016 23:35:42 +0000 (23:35 +0000)]
AMDGPU/SI: Fix visit order assumption in SIFixSGPRCopies

Summary:
This pass was assuming that when a PHI instruction defined a register
used by another PHI instruction that the defining insstruction would
be legalized before the using instruction.

This assumption was causing the pass to not legalize some PHI nodes
within divergent flow-control.

This fixes a bug that was uncovered by r285762.

Reviewers: nhaehnle, arsenm

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

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

llvm-svn: 286676

7 years agoPrint correct directory in merge script.
Richard Trieu [Fri, 11 Nov 2016 23:26:28 +0000 (23:26 +0000)]
Print correct directory in merge script.

When providing the project directory to the merge script, print it out in the
commit instructions instead of the default project directory.

llvm-svn: 286675

7 years ago[tsan] Fix typo in test.
Evgeniy Stepanov [Fri, 11 Nov 2016 23:25:09 +0000 (23:25 +0000)]
[tsan] Fix typo in test.

llvm-svn: 286674

7 years agoDisable a test using posix_spawn on Android
Reid Kleckner [Fri, 11 Nov 2016 23:23:33 +0000 (23:23 +0000)]
Disable a test using posix_spawn on Android

llvm-svn: 286673

7 years ago[tsan][clang] Introduce a function attribute to disable TSan checking at run time
Anna Zaks [Fri, 11 Nov 2016 23:22:44 +0000 (23:22 +0000)]
[tsan][clang] Introduce a function attribute to disable TSan checking at run time

This introduces a function annotation that disables TSan checking for the
function at run time. The benefit over attribute((no_sanitize("thread")))
is that the accesses within the callees will also be suppressed.

The motivation for this attribute is a guarantee given by the objective C
language that the calls to the reference count decrement and object
deallocation will be synchronized. To model this properly, we would need to
intercept all ref count decrement calls (which are very common in ObjC due
to use of ARC) and also every single message send. Instead, we propose to
just ignore all accesses made from within dealloc at run time. The main
downside is that this still does not introduce any synchronization, which
means we might still report false positives if the code that relies on this
synchronization is not executed from within dealloc. However, we have not
seen this in practice so far and think these cases will be very rare.

(This problem is similar in nature to https://reviews.llvm.org/D21609;
unfortunately, the same solution does not apply here.)

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

llvm-svn: 286672

7 years ago[InstCombine] use dyn_cast rather isa+cast; NFC
Sanjay Patel [Fri, 11 Nov 2016 23:20:01 +0000 (23:20 +0000)]
[InstCombine] use dyn_cast rather isa+cast; NFC

Follow-up to r286664 cleanup as suggested by Eli. Thanks!

llvm-svn: 286671