platform/upstream/llvm.git
8 years agoFix build breakage.
Rui Ueyama [Wed, 26 Oct 2016 20:27:38 +0000 (20:27 +0000)]
Fix build breakage.

llvm-svn: 285236

8 years agoAdd comments.
Rui Ueyama [Wed, 26 Oct 2016 20:26:29 +0000 (20:26 +0000)]
Add comments.

llvm-svn: 285235

8 years agoCleanup nonportable behavior in tests for std::any
Casey Carter [Wed, 26 Oct 2016 20:18:13 +0000 (20:18 +0000)]
Cleanup nonportable behavior in tests for std::any

Fixes MS issues 63, 64, and 65.

test/std/utilities/any/any.class/any.cons/move.pass.cpp:
* "Moves are always destructive" is not a portable assumption; check with LIBCPP_ASSERT.

test/std/utilities/any/any.class/any.cons/value.pass.cpp:
* The standard does not forbid initializing std::any from any pointer-to-function type. Remove the non-conforming "DecayTag" test.

test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp:
* Self-swap is not specified to perform no moves; check with LIBCPP_ASSERT.

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

llvm-svn: 285234

8 years ago[PPC] Remove testcase from incorrect directory
Ehsan Amiri [Wed, 26 Oct 2016 20:16:59 +0000 (20:16 +0000)]
[PPC] Remove testcase from incorrect directory

During my last commit this testcase was put in an incorrect directory. Removing
it. Will put it in the right directory when I can verify everything is correct.

llvm-svn: 285233

8 years agoARM: don't rely on push/pop reglists being in order when folding SP adjust.
Tim Northover [Wed, 26 Oct 2016 20:01:00 +0000 (20:01 +0000)]
ARM: don't rely on push/pop reglists being in order when folding SP adjust.

It would be a very nice invariant to rely on, but unfortunately it doesn't
necessarily hold (and the causes of mis-sorted reglists appear to be quite
varied) so to be robust the frame lowering code can't assume that the first
register in the list is also the first one that actually gets pushed.

Should fix an issue where we were turning something like:

    push {r8, r4, r7, lr}
    sub sp, #24

into nonsense like:

    push {r2, r3, r4, r5, r6, r7, r8, r4, r7, lr}

llvm-svn: 285232

8 years agoDo not assume that FP vector operands are never legalized by expanding
Nemanja Ivanovic [Wed, 26 Oct 2016 19:51:35 +0000 (19:51 +0000)]
Do not assume that FP vector operands are never legalized by expanding

This patch ensures that if a floating point vector operand is legalized by
expanding, it is legalized through the stack rather than by calling
DAGTypeLegalizer::IntegerToVector which will cause a failure since the operand
is a non-integer type.

This fixes PR 30715.

llvm-svn: 285231

8 years ago[PowerPC] Implement vector_insert_exp builtins - clang portion
Nemanja Ivanovic [Wed, 26 Oct 2016 19:27:11 +0000 (19:27 +0000)]
[PowerPC] Implement vector_insert_exp builtins - clang portion

This patch corresponds to review https://reviews.llvm.org/D25956.
Committing on behalf of Zaara Syeda.

llvm-svn: 285229

8 years agoSimplify `x >=u x >> y` and `x >=u x udiv y`
Sanjoy Das [Wed, 26 Oct 2016 19:18:43 +0000 (19:18 +0000)]
Simplify `x >=u x >> y` and `x >=u x udiv y`

Summary:
Extends InstSimplify to handle both `x >=u x >> y` and `x >=u x udiv y`.

This is a folloup of rL258422 and
https://github.com/rust-lang/rust/pull/30917 where llvm failed to
optimize away the bounds checking in a binary search.

Patch by Arthur Silva!

Reviewers: sanjoy

Subscribers: llvm-commits

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

llvm-svn: 285228

8 years agoRevert "[AliasSetTracker] Make AST smarter about intrinsics that don't actually affec...
Chad Rosier [Wed, 26 Oct 2016 19:18:19 +0000 (19:18 +0000)]
Revert "[AliasSetTracker] Make AST smarter about intrinsics that don't actually affect memory."

This reverts commit r285191.

LICM appears to rely on the Alias Set Tracker hitting lifetime markers to prevent
code from being moved outside of the original scope.

llvm-svn: 285227

8 years agoFix an issue where frame variable -s <varname> would not show the scope even though...
Enrico Granata [Wed, 26 Oct 2016 19:17:49 +0000 (19:17 +0000)]
Fix an issue where frame variable -s <varname> would not show the scope even though the user asked for it

Part of rdar://28434047

llvm-svn: 285226

8 years ago[PowerPC] Implement vec_insert_exp builtins - llvm portion
Nemanja Ivanovic [Wed, 26 Oct 2016 19:03:40 +0000 (19:03 +0000)]
[PowerPC] Implement vec_insert_exp builtins - llvm portion

This revision corresponds to review: https://reviews.llvm.org/D25957.
Committing on behalf of Zaara Syeda.

llvm-svn: 285225

8 years agoCall _exit.
Rafael Espindola [Wed, 26 Oct 2016 18:59:00 +0000 (18:59 +0000)]
Call _exit.

As the state of lld gets more complicated, shutting down gets more
expensive.

In a normal lld run we can just call _exit immediately after renaming
the temporary output file. We still want the ability to run a full
shutdown since that is useful for detecting memory leaks.

This patch adds a --full-shutdown flag and changes lit to use it.

llvm-svn: 285224

8 years ago[libFuzzer] simplify TracePC::HandleTrace even further. Also, when dealing with ...
Kostya Serebryany [Wed, 26 Oct 2016 18:52:04 +0000 (18:52 +0000)]
[libFuzzer] simplify TracePC::HandleTrace even further. Also, when dealing with -exit_on_src_pos, symbolize every PC only once

llvm-svn: 285223

8 years agoFix test from r285217.
Chad Rosier [Wed, 26 Oct 2016 18:49:16 +0000 (18:49 +0000)]
Fix test from r285217.

llvm-svn: 285222

8 years agoPass a InputSectionData to classoff.
Rafael Espindola [Wed, 26 Oct 2016 18:44:57 +0000 (18:44 +0000)]
Pass a InputSectionData to classoff.

This allows a non template class to hold input sections.

llvm-svn: 285221

8 years agoMove a helper function that doesn't depend on a class out of the class.
Rui Ueyama [Wed, 26 Oct 2016 18:28:08 +0000 (18:28 +0000)]
Move a helper function that doesn't depend on a class out of the class.

llvm-svn: 285220

8 years agoDefine a helper function to demangle symbols.
Rui Ueyama [Wed, 26 Oct 2016 18:28:06 +0000 (18:28 +0000)]
Define a helper function to demangle symbols.

llvm-svn: 285219

8 years ago[PPC] Implement vector reverse elements builtins (vec_reve)
Nemanja Ivanovic [Wed, 26 Oct 2016 18:25:45 +0000 (18:25 +0000)]
[PPC] Implement vector reverse elements builtins (vec_reve)

This patch corresponds to review https://reviews.llvm.org/D25906.
Committing on behalf of Tony Jiang.

llvm-svn: 285218

8 years ago[AArch64] Avoid materializing constant 1 when generating cneg instructions.
Chad Rosier [Wed, 26 Oct 2016 18:15:32 +0000 (18:15 +0000)]
[AArch64] Avoid materializing constant 1 when generating cneg instructions.

Instead of

 cmp w0, #1
 orr w8, wzr, #0x1
 cneg w0, w8, ne

we now generate

 cmp w0, #1
 csinv w0, w0, wzr, eq

PR28965

llvm-svn: 285217

8 years agoActually use = delete to mark constructors and operators we want to not exist. Just...
Enrico Granata [Wed, 26 Oct 2016 18:12:52 +0000 (18:12 +0000)]
Actually use = delete to mark constructors and operators we want to not exist. Just declaring them as private works, but it can confuse certain tools as it doesn't actually declare intent, and the C++11 way is more expressive anyway, so this is pure win

rdar://28960209

llvm-svn: 285216

8 years ago[WebAssembly] Update the README.txt.
Dan Gohman [Wed, 26 Oct 2016 17:44:09 +0000 (17:44 +0000)]
[WebAssembly] Update the README.txt.

Update the README.txt with newer information, add a link to the Emscripten
page explaining the current easiest way to use the LLVM wasm backend, and
mention that other ways of using the LLVM wasm backend are in development.

llvm-svn: 285215

8 years ago[MC] Fix comma typo in .loc parsing
Nirav Dave [Wed, 26 Oct 2016 17:28:58 +0000 (17:28 +0000)]
[MC] Fix comma typo in .loc parsing

llvm-svn: 285214

8 years agoSilence unused parameter warnings in archetypes.hpp
Casey Carter [Wed, 26 Oct 2016 17:22:25 +0000 (17:22 +0000)]
Silence unused parameter warnings in archetypes.hpp
Reviewed at: https://reviews.llvm.org/D25958

llvm-svn: 285213

8 years agoReapply: "Remove debug location from common tail when tail-merging"
Robert Lougher [Wed, 26 Oct 2016 17:01:47 +0000 (17:01 +0000)]
Reapply: "Remove debug location from common tail when tail-merging"

This reapplies revision 285093.  Original commit message:

The branch folding pass tail merges blocks into a common-tail.  However, the
tail retains the debug information from one of the original inputs to the
merge (chosen randomly).  This is a problem for sampled-based PGO, as hits
on the common-tail will be attributed to whichever block was chosen,
irrespective of which path was actually taken to the common-tail.

This patch fixes the issue by nulling the debug location for the common-tail.

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

llvm-svn: 285212

8 years agoAMDGPU: Add missing ISA versions gfx7.x.x and 8.x.x.
Yaxun Liu [Wed, 26 Oct 2016 16:40:21 +0000 (16:40 +0000)]
AMDGPU: Add missing ISA versions gfx7.x.x and 8.x.x.

Patch by Laurent Morichetti.

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

llvm-svn: 285211

8 years agoAMDGPU: Refactor processor definition to use ISA version features
Yaxun Liu [Wed, 26 Oct 2016 16:37:56 +0000 (16:37 +0000)]
AMDGPU: Refactor processor definition to use ISA version features

Add missing ISA versions 7.0.2/8.0.4/8.1.0. to backend.

Refactor processor definition to use ISA version features.

Fixed ISA version for stoney.

Based on Laurent Morichetti's patch.

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

llvm-svn: 285210

8 years ago[scudo] Lay the foundation for 32-bit support
Kostya Kortchinsky [Wed, 26 Oct 2016 16:16:58 +0000 (16:16 +0000)]
[scudo] Lay the foundation for 32-bit support

Summary:
In order to support 32-bit platforms, we have to make some adjustments in
multiple locations, one of them being the Scudo chunk header. For it to fit on
64 bits (as a reminder, on x64 it's 128 bits), I had to crunch the space taken
by some of the fields. In order to keep the offset field small, the secondary
allocator was changed to accomodate aligned allocations for larger alignments,
hence making the offset constant for chunks serviced by it.

The resulting header candidate has been added, and further modifications to
allow 32-bit support will follow.

Another notable change is the addition of MaybeStartBackgroudThread() to allow
release of the memory to the OS.

Reviewers: kcc

Subscribers: llvm-commits

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

llvm-svn: 285209

8 years ago[ubsan] Fix vptr.cpp test to be more resilient. NFC.
Robert Lougher [Wed, 26 Oct 2016 16:02:36 +0000 (16:02 +0000)]
[ubsan] Fix vptr.cpp test to be more resilient. NFC.

The test contains a switch statement in which two of the cases are
tail-merged, with the call to __ubsan_handle_dynamic_type_cache_miss_abort
in the common tail. When tail-merging occurs, the debug location of the
tail is randomly taken from one of the merge inputs.  Luckily for the test,
the expected line number in the check is the one which is chosen by the
tail-merge.  However, if the switch cases are re-ordered the test will
fail.

This patch disables tail-merge, making the test resilient to changes
in tail-merge, and unblocking review D25742.  It does not change the
semantics of the test.

llvm-svn: 285208

8 years agoIntroduce updateDiscriminator interface to DILocation to make it cleaner assigning...
Dehao Chen [Wed, 26 Oct 2016 15:48:45 +0000 (15:48 +0000)]
Introduce updateDiscriminator interface to DILocation to make it cleaner assigning discriminators.

Summary: This patch introduces updateDiscriminator to DILocation so that it can be directly called by AddDiscriminator. It also makes it easier to update the discriminator later.

Reviewers: dnovillo, dblaikie, aprantl, echristo

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 285207

8 years ago[CMake] Adding example distribution CMake cache files
Chris Bieneman [Wed, 26 Oct 2016 15:41:38 +0000 (15:41 +0000)]
[CMake] Adding example distribution CMake cache files

These cache file are provided as an example of how to set up simple multi-stage CMake builds. I have a batch of documentation updates for LLVM.org which reference these files.

llvm-svn: 285206

8 years agoReduce the number of allocators.
Rafael Espindola [Wed, 26 Oct 2016 15:34:24 +0000 (15:34 +0000)]
Reduce the number of allocators.

We used to have one allocator per file, which reduces the advantage of
using an allocator in the first place.

This is a small speed up is most cases. The largest speedup was in
1.014X in chromium no-gc. The largest slowdown was scylla at 1.003X.

llvm-svn: 285205

8 years ago[ARM RT] Fix broken clear_cache debug build on ARM
Renato Golin [Wed, 26 Oct 2016 15:20:33 +0000 (15:20 +0000)]
[ARM RT] Fix broken clear_cache debug build on ARM

clear_cache is using R7 for the SVC call and that's the frame pointer in
GCC, which is only disabled on -O2/3, so Release builds finish, Debug don't.

Fixes PR30797.

llvm-svn: 285204

8 years agoReapply "AMDGPU: Don't use offen if it is 0"
Matt Arsenault [Wed, 26 Oct 2016 15:08:16 +0000 (15:08 +0000)]
Reapply "AMDGPU: Don't use offen if it is 0"

This reverts r283003

llvm-svn: 285203

8 years agoAMDGPU: Fix counting si_mask_branch as 4 bytes
Matt Arsenault [Wed, 26 Oct 2016 14:53:54 +0000 (14:53 +0000)]
AMDGPU: Fix counting si_mask_branch as 4 bytes

llvm-svn: 285202

8 years agoFix nondeterministic output in local stack slot alloc pass
Matt Arsenault [Wed, 26 Oct 2016 14:53:50 +0000 (14:53 +0000)]
Fix nondeterministic output in local stack slot alloc pass

This finds all of the references to a frame index in a function, and
sorts by the offset. If multiple instructions use the same offset,
nothing was breaking the tie for sorting.

This avoids the test failures the reverted r282999 introduced.

llvm-svn: 285201

8 years ago[InstCombine] clean up commonCastTransforms; NFC
Sanjay Patel [Wed, 26 Oct 2016 14:52:35 +0000 (14:52 +0000)]
[InstCombine] clean up commonCastTransforms; NFC

1. Use 'auto' with dyn_cast.
2. Variables start with a capital letter.
3. Use proper punctuation in comments.

llvm-svn: 285200

8 years agoLegalizeDAG: Support promoting [US]DIV and [US]REM operations
Tom Stellard [Wed, 26 Oct 2016 14:52:25 +0000 (14:52 +0000)]
LegalizeDAG: Support promoting [US]DIV and [US]REM operations

Summary:
AMDGPU will need this one i16 is added as a legal type.  This is tested by:

test/CodeGen/AMDGPU/sdiv.ll
test/CodeGen/AMDGPU/sdivrem24.ll
test/CodeGen/AMDGPU/udiv.ll
test/CodeGen/AMDGPU/udivrem24.ll

Reviewers: bogner, efriedma

Subscribers: efriedma, wdng, llvm-commits

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

llvm-svn: 285199

8 years agoAMDGPU/SI: Don't emit multi-dword flat memory ops when they might access scratch
Tom Stellard [Wed, 26 Oct 2016 14:38:47 +0000 (14:38 +0000)]
AMDGPU/SI: Don't emit multi-dword flat memory ops when they might access scratch

Summary:
A single flat memory operations that might access the scratch buffer
can only access MaxPrivateElementSize bytes.

Reviewers: arsenm

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

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

llvm-svn: 285198

8 years agoAMDGPU/SI: Remove unnecessary run lines from test
Tom Stellard [Wed, 26 Oct 2016 14:21:09 +0000 (14:21 +0000)]
AMDGPU/SI: Remove unnecessary run lines from test

Summary:
This test had run lines disabling/enabling the promote alloca pass, but
enabling/disabling promote alloca had no impact on the output.

Reviewers: arsenm

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

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

llvm-svn: 285197

8 years ago[X86] AVX512 fallback for floating-point scalar selects
Zvi Rackover [Wed, 26 Oct 2016 14:12:46 +0000 (14:12 +0000)]
[X86] AVX512 fallback for floating-point scalar selects

Summary:
In the case where of 'select i1 , f32, f32' or select i1, f64, f64 prefer lowering to masked-moves over branches.

Fixes pr30561

Reviewers: igorb, aymanmus, delena

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

llvm-svn: 285196

8 years ago[InstCombine] consolidate zext tests and auto-generate checks; NFC
Sanjay Patel [Wed, 26 Oct 2016 14:08:49 +0000 (14:08 +0000)]
[InstCombine] consolidate zext tests and auto-generate checks; NFC

llvm-svn: 285195

8 years ago[InstCombine] auto-generate better checks; NFC
Sanjay Patel [Wed, 26 Oct 2016 13:58:22 +0000 (13:58 +0000)]
[InstCombine] auto-generate better checks; NFC

llvm-svn: 285194

8 years ago[PP] Replace some index based for loops with range based ones
Erik Verbruggen [Wed, 26 Oct 2016 13:06:13 +0000 (13:06 +0000)]
[PP] Replace some index based for loops with range based ones

While in the area, also change some unsigned variables to size_t, and
introduce an LLVM_FALLTHROUGH instead of a comment stating that.

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

llvm-svn: 285193

8 years agoFix use-after-scope in ASTContext.
Benjamin Kramer [Wed, 26 Oct 2016 12:51:45 +0000 (12:51 +0000)]
Fix use-after-scope in ASTContext.

Extend lifetime of ExceptionTypeStorage, as it is referenced by
CanonicalEPI and used outside the block (ExceptionSpec.Exceptions is an
ArrayRef)

Patch by Sam McCall!

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

llvm-svn: 285192

8 years ago[AliasSetTracker] Make AST smarter about intrinsics that don't actually affect memory.
Chad Rosier [Wed, 26 Oct 2016 12:42:11 +0000 (12:42 +0000)]
[AliasSetTracker] Make AST smarter about intrinsics that don't actually affect memory.

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

llvm-svn: 285191

8 years agoDelete trivial getters. NFC.
Rafael Espindola [Wed, 26 Oct 2016 12:36:56 +0000 (12:36 +0000)]
Delete trivial getters. NFC.

llvm-svn: 285190

8 years agoDebugInfo: support for DWARFv5 DW_AT_alignment attribute
Victor Leschuk [Wed, 26 Oct 2016 11:59:03 +0000 (11:59 +0000)]
DebugInfo: support for DWARFv5 DW_AT_alignment attribute

* Assume that clang passes non-zero alignment value to DIBuilder
only in case when it was forced by C++11 'alignas', C11 '_Alignas'
or compiler attribute '__attribute__((aligned (N)))'.

* Emit DW_AT_alignment if alignment is specified for type/object.

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

llvm-svn: 285189

8 years ago[PP] Remove another unused parameter
Erik Verbruggen [Wed, 26 Oct 2016 11:46:10 +0000 (11:46 +0000)]
[PP] Remove another unused parameter

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

llvm-svn: 285188

8 years agoDon't set a software stepping breakpoint at 0 on arm or mips.
Pavel Labath [Wed, 26 Oct 2016 11:13:56 +0000 (11:13 +0000)]
Don't set a software stepping breakpoint at 0 on arm or mips.

Summary:
Check whether the setting the breakpoint failed during instruction emulation. If
it did, the next pc is likely in unmapped memory, and the inferior will crash
anyway after the next instruction. Do not return an error in this case, but just
continue stepping.
Reenabled the crash during step test for android/linux.

Reviewers: labath

Subscribers: aemerson, rengolin, tberghammer, danalbert, srhines, lldb-commits

Differential Revision: https://reviews.llvm.org/D25926
Author: Jason Majors <jmajors@google.com>

llvm-svn: 285187

8 years ago[ELF] Better error reporting for undefined symbols
Eugene Leviant [Wed, 26 Oct 2016 11:07:09 +0000 (11:07 +0000)]
[ELF] Better error reporting for undefined symbols

This patch make lld show following details for undefined symbol errors:
- file (line)
- file (function name)
- file (section name + offset)

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

llvm-svn: 285186

8 years ago[IndVarSimplify][DebugLoc] When widening the exit loop condition, correctly reuse...
Andrea Di Biagio [Wed, 26 Oct 2016 10:28:32 +0000 (10:28 +0000)]
[IndVarSimplify][DebugLoc] When widening the exit loop condition, correctly reuse the debug location of the original comparison.

When the loop exit condition is canonicalized as a != compaison, reuse the
debug location of the original (non canonical) comparison.

Before this patch, the debug location of the new icmp was obtained from the
loop latch terminator. This patch fixes the issue by correctly setting the
IRBuilder's "current debug location" to the location of the original compare.

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

llvm-svn: 285185

8 years ago[modules] PR28812: Modules can return duplicate field decls.
Vassil Vassilev [Wed, 26 Oct 2016 10:24:29 +0000 (10:24 +0000)]
[modules] PR28812: Modules can return duplicate field decls.

If two modules contain duplicate class definitions the lookup result can contain
more than 2 elements. Sift the lookup results until we find a field decl.

It is not necessary to do ODR checks in place as they done elsewhere.

This should fix issues when compiling with libstdc++ 5.2 and 6.2.

Patch developed in collaboration with Richard Smith!

llvm-svn: 285184

8 years agoRevert r285181 "DebugInfo: support for DWARFv5 DW_AT_alignment attribute".
Vassil Vassilev [Wed, 26 Oct 2016 10:13:47 +0000 (10:13 +0000)]
Revert r285181 "DebugInfo: support for DWARFv5 DW_AT_alignment attribute".

The commit broke the builds.

llvm-svn: 285183

8 years ago[PP] Replace some uses of unsigned with size_t
Erik Verbruggen [Wed, 26 Oct 2016 09:58:31 +0000 (09:58 +0000)]
[PP] Replace some uses of unsigned with size_t

All values are returned by a method as size_t, and subsequently passed
to functions taking a size_t, or used where a size_t is also valid.
Better still, two loops (which had an unsigned), can be replaced by
a range-based for loop.

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

llvm-svn: 285182

8 years agoDebugInfo: support for DWARFv5 DW_AT_alignment attribute
Victor Leschuk [Wed, 26 Oct 2016 08:55:27 +0000 (08:55 +0000)]
DebugInfo: support for DWARFv5 DW_AT_alignment attribute

* Assume that clang passes non-zero alignment value to DIBuilder
only in case when it was forced by C++11 'alignas', C11 '_Alignas'
or compiler attribute '__attribute__((aligned (N)))'.

* Emit DW_AT_alignment if alignment is specified for type/object.

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

llvm-svn: 285181

8 years agoPP: Remove unused parameters from methods
Erik Verbruggen [Wed, 26 Oct 2016 08:52:41 +0000 (08:52 +0000)]
PP: Remove unused parameters from methods

NFC

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

llvm-svn: 285180

8 years agoDebugInfo: add bitcode upgrade test for alignment
Victor Leschuk [Wed, 26 Oct 2016 08:34:19 +0000 (08:34 +0000)]
DebugInfo: add bitcode upgrade test for alignment

Bitcode format was changed in D25073, this adds bitcode upgrade test.

llvm-svn: 285179

8 years agoBug 28065 - clang-format incorrectly aligns backslash.
Andi-Bogdan Postelnicu [Wed, 26 Oct 2016 07:44:51 +0000 (07:44 +0000)]
Bug 28065 - clang-format incorrectly aligns backslash.

llvm-svn: 285178

8 years ago[lsan] Relax check for allocator_end in ProcessGlobalRegionsCallback.
Maxim Ostapenko [Wed, 26 Oct 2016 06:56:51 +0000 (06:56 +0000)]
[lsan] Relax check for allocator_end in ProcessGlobalRegionsCallback.

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

llvm-svn: 285177

8 years ago[CodeGen] Don't emit lifetime intrinsics for some local variables
Vitaly Buka [Wed, 26 Oct 2016 05:42:30 +0000 (05:42 +0000)]
[CodeGen] Don't emit lifetime intrinsics for some local variables

Summary:
Current generation of lifetime intrinsics does not handle cases like:

```
  {
    char x;
  l1:
    bar(&x, 1);
  }
  goto l1;

```
We will get code like this:

```
  %x = alloca i8, align 1
  call void @llvm.lifetime.start(i64 1, i8* nonnull %x)
  br label %l1
l1:
  %call = call i32 @bar(i8* nonnull %x, i32 1)
  call void @llvm.lifetime.end(i64 1, i8* nonnull %x)
  br label %l1
```

So the second time bar was called for x which is marked as dead.
Lifetime markers here are misleading so it's better to remove them at all.
This type of bypasses are rare, e.g. code detects just 8 functions building
clang (2329 targets).

PR28267

Reviewers: eugenis

Subscribers: beanz, mgorny, cfe-commits

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

llvm-svn: 285176

8 years ago[AVX-512] Fix the operand order for all calls to __builtin_ia32_vfmaddss3_mask.
Craig Topper [Wed, 26 Oct 2016 05:35:38 +0000 (05:35 +0000)]
[AVX-512] Fix the operand order for all calls to __builtin_ia32_vfmaddss3_mask.

Summary: The preserved input should be the first argument and the vector inputs should be in the same order as the intrinsics it is used to implement.

Reviewers: igorb, delena

Subscribers: cfe-commits

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

llvm-svn: 285175

8 years ago[XRay] Be case-insensitive for error strings
Dean Michael Berris [Wed, 26 Oct 2016 05:10:39 +0000 (05:10 +0000)]
[XRay] Be case-insensitive for error strings

On Windows, "no such file or directory" is the default error translation
as opposed to the capitalized form on Linux.

llvm-svn: 285174

8 years ago[AVX-512] Add scalar vfmsub/vfnmsub mask3 intrinsics
Craig Topper [Wed, 26 Oct 2016 04:59:58 +0000 (04:59 +0000)]
[AVX-512] Add scalar vfmsub/vfnmsub mask3 intrinsics

Summary: Clang's intrinsic header currently tries to negate the third operand of a vfmadd mask3 in order to create vfmsub, but this fails isel. This patch adds scalar vfmsub and vfnmsub mask3 that we can use instead to avoid the negate. This is consistent with the packed instructions.

Reviewers: igorb, delena

Subscribers: llvm-commits

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

llvm-svn: 285173

8 years agoEnable the use of the new dyld SPI on the current
Jason Molenda [Wed, 26 Oct 2016 04:48:41 +0000 (04:48 +0000)]
Enable the use of the new dyld SPI on the current
generation macosx/ios/tvos/watchos.

llvm-svn: 285172

8 years ago[XRay] Remove unnecessary include of <unistd.h>
Dean Michael Berris [Wed, 26 Oct 2016 04:46:50 +0000 (04:46 +0000)]
[XRay] Remove unnecessary include of <unistd.h>

llvm-svn: 285171

8 years ago[XRay] Remove unnecessary include of <unistd.h>
Dean Michael Berris [Wed, 26 Oct 2016 04:36:31 +0000 (04:36 +0000)]
[XRay] Remove unnecessary include of <unistd.h>

llvm-svn: 285170

8 years agoSplit LinkerDriver::link. NFC.
Rui Ueyama [Wed, 26 Oct 2016 04:34:16 +0000 (04:34 +0000)]
Split LinkerDriver::link. NFC.

llvm-svn: 285169

8 years ago[XRay] Move specialisations into correct namespace
Dean Michael Berris [Wed, 26 Oct 2016 04:26:53 +0000 (04:26 +0000)]
[XRay] Move specialisations into correct namespace

llvm-svn: 285168

8 years ago[XRay] Remove extra `;` to make -wpedantic happy
Dean Michael Berris [Wed, 26 Oct 2016 04:21:17 +0000 (04:21 +0000)]
[XRay] Remove extra `;` to make -wpedantic happy

llvm-svn: 285167

8 years ago[XRay] Add llvm-xray as a dependency to test/CMakeLists.txt
Dean Michael Berris [Wed, 26 Oct 2016 04:16:05 +0000 (04:16 +0000)]
[XRay] Add llvm-xray as a dependency to test/CMakeLists.txt

llvm-svn: 285166

8 years ago[XRay] Implement `llvm-xray extract`, start of the llvm-xray tool
Dean Michael Berris [Wed, 26 Oct 2016 04:14:34 +0000 (04:14 +0000)]
[XRay] Implement `llvm-xray extract`, start of the llvm-xray tool

Usage:

  llvm-xray extract <object file> [-o <filename or '-'>]

The tool gets the XRay instrumentation map from an object file and turns
it into YAML.  We first support ELF64 sleds on x86_64 binaries, with
provision for supporting other supported platforms and formats later.

This is the first of a many-part change to fully implement the
`llvm-xray` tool.

We also define a subcommand registration and dispatch mechanism to be
used by other further subcommand implementations for llvm-xray.

Diffusion Revision: https://reviews.llvm.org/D21987

llvm-svn: 285165

8 years agoRename variable to be more consistent.
Rui Ueyama [Wed, 26 Oct 2016 04:01:07 +0000 (04:01 +0000)]
Rename variable to be more consistent.

llvm-svn: 285164

8 years agoTruncate a SVN path part from --version output.
Rui Ueyama [Wed, 26 Oct 2016 03:52:06 +0000 (03:52 +0000)]
Truncate a SVN path part from --version output.

This is in sync with what clang does.

llvm-svn: 285163

8 years agoUse printf instead of "echo -ne".
Rui Ueyama [Wed, 26 Oct 2016 03:38:48 +0000 (03:38 +0000)]
Use printf instead of "echo -ne".

Not all echo commands support "-e".

llvm-svn: 285162

8 years agoCloning: Also clone global variable attached metadata.
Peter Collingbourne [Wed, 26 Oct 2016 02:57:33 +0000 (02:57 +0000)]
Cloning: Also clone global variable attached metadata.

llvm-svn: 285161

8 years ago[modules] Fix assert if multiple update records provide a definition for a
Richard Smith [Wed, 26 Oct 2016 02:31:56 +0000 (02:31 +0000)]
[modules] Fix assert if multiple update records provide a definition for a
class template specialization and that specialization has attributes.

llvm-svn: 285160

8 years ago[Sema] Handle CaseStmt and DefaultStmt as SwitchCase
Vitaly Buka [Wed, 26 Oct 2016 02:00:00 +0000 (02:00 +0000)]
[Sema] Handle CaseStmt and DefaultStmt as SwitchCase

Summary: rsmith

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

llvm-svn: 285159

8 years ago[CodeGen] Move shouldEmitLifetimeMarkers into more convenient place
Vitaly Buka [Wed, 26 Oct 2016 01:59:57 +0000 (01:59 +0000)]
[CodeGen] Move shouldEmitLifetimeMarkers into more convenient place

Summary: D24693 will need access to it from other places

Reviewers: eugenis

Subscribers: cfe-commits

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

llvm-svn: 285158

8 years ago[libFuzzer] refresh docs
Kostya Serebryany [Wed, 26 Oct 2016 01:55:17 +0000 (01:55 +0000)]
[libFuzzer] refresh docs

llvm-svn: 285157

8 years agoRevert "[XRay] Implement `llvm-xray extract`, start of the llvm-xray tool"
Dean Michael Berris [Wed, 26 Oct 2016 01:50:59 +0000 (01:50 +0000)]
Revert "[XRay] Implement `llvm-xray extract`, start of the llvm-xray tool"

Reverts r285155 -- misconfigured tests.

llvm-svn: 285156

8 years ago[XRay] Implement `llvm-xray extract`, start of the llvm-xray tool
Dean Michael Berris [Wed, 26 Oct 2016 01:42:59 +0000 (01:42 +0000)]
[XRay] Implement `llvm-xray extract`, start of the llvm-xray tool

Usage:

  llvm-xray extract <object file> [-o <filename or '-'>]

The tool gets the XRay instrumentation map from an object file and turns
it into YAML.  We first support ELF64 sleds on x86_64 binaries, with
provision for supporting other supported platforms and formats later.

This is the first of a many-part change to fully implement the
`llvm-xray` tool.

We also define a subcommand registration and dispatch mechanism to be
used by other further subcommand implementations for llvm-xray.

llvm-svn: 285155

8 years ago[cxx_status] update comment
Richard Smith [Wed, 26 Oct 2016 01:37:36 +0000 (01:37 +0000)]
[cxx_status] update comment

llvm-svn: 285154

8 years agoSBWatchpoint::Disable doesn't actually work. Add a test that shows this.
Jim Ingham [Wed, 26 Oct 2016 01:09:21 +0000 (01:09 +0000)]
SBWatchpoint::Disable doesn't actually work.  Add a test that shows this.

Next to fix it!

llvm-svn: 285153

8 years agoTreat module headers wrapped by our builtin headers as implicitly being textual
Richard Smith [Wed, 26 Oct 2016 01:08:55 +0000 (01:08 +0000)]
Treat module headers wrapped by our builtin headers as implicitly being textual
headers. We previously got this check backwards and treated the wrapper header
as being textual.

This is important because our wrapper headers sometimes inject macros into the
system headers that they #include_next, and sometimes replace them entirely.

llvm-svn: 285152

8 years agoUse printf instead of "echo -e" or "echo -n".
Rui Ueyama [Wed, 26 Oct 2016 01:07:26 +0000 (01:07 +0000)]
Use printf instead of "echo -e" or "echo -n".

Not all echo commands support "-e". On the other hand, printf
command is in POSIX, so it's more portable than "echo -e".

llvm-svn: 285151

8 years agoImplement name mangling proposal for exception specifications from cxx-abi-dev 2016...
Richard Smith [Wed, 26 Oct 2016 01:05:54 +0000 (01:05 +0000)]
Implement name mangling proposal for exception specifications from cxx-abi-dev 2016-10-11.

This has the following ABI impact:

 1) Functions whose parameter or return types are non-throwing function pointer
    types have different manglings in c++1z mode from prior modes. This is
    necessary because c++1z permits overloading on the noexceptness of function
    pointer parameter types. A warning is issued for cases that will change
    manglings in c++1z mode.

 2) Functions whose parameter or return types contain instantiation-dependent
    exception specifications change manglings in all modes. This is necessary
    to support overloading on / SFINAE in these exception specifications, which
    a careful reading of the standard indicates has essentially always been
    permitted.

Note that, in order to be affected by these changes, the code in question must
specify an exception specification on a function pointer/reference type that is
written syntactically within the declaration of another function. Such
declarations are very rare, and I have so far been unable to find any code
that would be affected by this. (Note that such things will probably become
more common in C++17, since it's a lot easier to get a noexcept function type
as a function parameter / return type there.)

This change does not affect the set of symbols produced by a build of clang,
libc++, or libc++abi.

llvm-svn: 285150

8 years agoUse uint32_t for consistency.
Rafael Espindola [Wed, 26 Oct 2016 00:58:23 +0000 (00:58 +0000)]
Use uint32_t for consistency.

llvm-svn: 285149

8 years agoRead section headers upfront.
Rafael Espindola [Wed, 26 Oct 2016 00:54:03 +0000 (00:54 +0000)]
Read section headers upfront.

Instead of storing a pointer, store the members we need.

The reason for doing this is that it makes it far easier to create
synthetic sections. It also avoids reading data from files multiple
times., which might help with cross endian linking and host
architectures with slow unaligned access.

There are obvious compacting opportunities, but this already has mixed
results even on native x86_64 linking.

There is also the possibility of better refactoring the code for
handling common symbols, but this already shows that a custom class is
not necessary.

llvm-svn: 285148

8 years ago[libFuzzer] simplify the code in TracePC::HandleTrace a bit more
Kostya Serebryany [Wed, 26 Oct 2016 00:42:52 +0000 (00:42 +0000)]
[libFuzzer] simplify the code in TracePC::HandleTrace a bit more

llvm-svn: 285147

8 years ago[libFuzzer] simplify the code to print new PCs
Kostya Serebryany [Wed, 26 Oct 2016 00:20:51 +0000 (00:20 +0000)]
[libFuzzer] simplify the code to print new PCs

llvm-svn: 285145

8 years ago[Myriad] add empty file to simulated bin dir
Douglas Katzman [Tue, 25 Oct 2016 23:59:11 +0000 (23:59 +0000)]
[Myriad] add empty file to simulated bin dir

llvm-svn: 285144

8 years agoUtility functions for appending to llvm.used/llvm.compiler.used.
Evgeniy Stepanov [Tue, 25 Oct 2016 23:53:31 +0000 (23:53 +0000)]
Utility functions for appending to llvm.used/llvm.compiler.used.

llvm-svn: 285143

8 years ago[libFuzzer] simplify the code in TracePC::HandleTrace
Kostya Serebryany [Tue, 25 Oct 2016 23:52:25 +0000 (23:52 +0000)]
[libFuzzer] simplify the code in TracePC::HandleTrace

llvm-svn: 285142

8 years ago[docs] Avoid repetition of 'considerable' in Error docs.
Lang Hames [Tue, 25 Oct 2016 23:08:32 +0000 (23:08 +0000)]
[docs] Avoid repetition of 'considerable' in Error docs.

llvm-svn: 285141

8 years ago[Myriad] Find libc++ adjacent to libstdc++
Douglas Katzman [Tue, 25 Oct 2016 23:02:30 +0000 (23:02 +0000)]
[Myriad] Find libc++ adjacent to libstdc++

llvm-svn: 285140

8 years ago[docs] Use consistent style for "do more stuff" in Error docs examples.
Lang Hames [Tue, 25 Oct 2016 22:41:54 +0000 (22:41 +0000)]
[docs] Use consistent style for "do more stuff" in Error docs examples.

llvm-svn: 285138

8 years ago[docs] Fix yet another Error docs formatting issue...
Lang Hames [Tue, 25 Oct 2016 22:38:50 +0000 (22:38 +0000)]
[docs] Fix yet another Error docs formatting issue...

llvm-svn: 285137

8 years ago[docs] Fix a few more Error docs formatting issues.
Lang Hames [Tue, 25 Oct 2016 22:35:55 +0000 (22:35 +0000)]
[docs] Fix a few more Error docs formatting issues.

Thanks to Pete Cooper for the review.

llvm-svn: 285136

8 years ago[libFuzzer] add StandaloneFuzzTargetMain.c and a test for it
Kostya Serebryany [Tue, 25 Oct 2016 22:30:34 +0000 (22:30 +0000)]
[libFuzzer] add StandaloneFuzzTargetMain.c and a test for it

llvm-svn: 285135

8 years ago[docs] Fix a missing code-block in the new Error docs.
Lang Hames [Tue, 25 Oct 2016 22:25:07 +0000 (22:25 +0000)]
[docs] Fix a missing code-block in the new Error docs.

llvm-svn: 285134