platform/upstream/llvm.git
7 years agoGive external linkage and mangling to lambdas inside inline variables and variable...
Richard Smith [Wed, 20 Sep 2017 22:17:55 +0000 (22:17 +0000)]
Give external linkage and mangling to lambdas inside inline variables and variable templates.

This implements the proposed approach in https://github.com/itanium-cxx-abi/cxx-abi/issues/33

llvm-svn: 313827

7 years agoCommit local changes that missed llvm.dbg.addr
Reid Kleckner [Wed, 20 Sep 2017 21:56:21 +0000 (21:56 +0000)]
Commit local changes that missed llvm.dbg.addr

llvm-svn: 313826

7 years ago[IR] Add llvm.dbg.addr, a control-dependent version of llvm.dbg.declare
Reid Kleckner [Wed, 20 Sep 2017 21:52:33 +0000 (21:52 +0000)]
[IR] Add llvm.dbg.addr, a control-dependent version of llvm.dbg.declare

Summary:
This implements the design discussed on llvm-dev for better tracking of
variables that live in memory through optimizations:
  http://lists.llvm.org/pipermail/llvm-dev/2017-September/117222.html

This is tracked as PR34136

llvm.dbg.addr is intended to be produced and used in almost precisely
the same way as llvm.dbg.declare is today, with the exception that it is
control-dependent. That means that dbg.addr should always have a
position in the instruction stream, and it will allow passes that
optimize memory operations on local variables to insert llvm.dbg.value
calls to reflect deleted stores. See SourceLevelDebugging.rst for more
details.

The main drawback to generating DBG_VALUE machine instrs is that they
usually cause LLVM to emit a location list for DW_AT_location. The next
step will be to teach DwarfDebug.cpp how to recognize more DBG_VALUE
ranges as not needing a location list, and possibly start setting
DW_AT_start_offset for variables whose lifetimes begin mid-scope.

Reviewers: aprantl, dblaikie, probinson

Subscribers: eraman, hiraditya, llvm-commits

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

llvm-svn: 313825

7 years ago[docs] llvm-cov: Document -show-instantiation-summary
Vedant Kumar [Wed, 20 Sep 2017 21:52:09 +0000 (21:52 +0000)]
[docs] llvm-cov: Document -show-instantiation-summary

llvm-svn: 313824

7 years ago[ARM] Fix some Clang-tidy modernize-use-using and Include What You Use warnings;...
Eugene Zelenko [Wed, 20 Sep 2017 21:35:51 +0000 (21:35 +0000)]
[ARM] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 313823

7 years agoRevert "Revert "ExecutionEngine: add R_AARCH64_ABS{16,32}""
Saleem Abdulrasool [Wed, 20 Sep 2017 21:32:44 +0000 (21:32 +0000)]
Revert "Revert "ExecutionEngine: add R_AARCH64_ABS{16,32}""

This reverts commit SVN r313668.  The original test case attempted to
write a pointer value into 16-bits, although the value may exceed the
range representable in 16-bits.  Ensure that the symbol is located in
the address space such that its absolute address is representable in
16-bits.  This should fix the assertion failure that was seen on the
Windows hosts.

llvm-svn: 313822

7 years ago[SimplifyCFG] auto-generate full checks; NFC
Sanjay Patel [Wed, 20 Sep 2017 21:25:02 +0000 (21:25 +0000)]
[SimplifyCFG] auto-generate full checks; NFC

llvm-svn: 313821

7 years ago[NVPTX] Implemented shfl.sync instruction and supporting intrinsics/builtins.
Artem Belevich [Wed, 20 Sep 2017 21:23:07 +0000 (21:23 +0000)]
[NVPTX] Implemented shfl.sync instruction and supporting intrinsics/builtins.

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

llvm-svn: 313820

7 years ago[InstCombine] Handle (X & C2) < C1 --> (X & C2) == 0
Craig Topper [Wed, 20 Sep 2017 21:18:17 +0000 (21:18 +0000)]
[InstCombine] Handle (X & C2) < C1 --> (X & C2) == 0

We already did (X & C2) > C1 --> (X & C2) != 0, if any bit set in (X & C2) will produce a result greater than C1. But there is an equivalent inverse condition with <= C1 (which will be canonicalized to < C1+1)

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

llvm-svn: 313819

7 years ago[InstCombine] Pre-commit test cases for D38065.
Craig Topper [Wed, 20 Sep 2017 21:18:12 +0000 (21:18 +0000)]
[InstCombine] Pre-commit test cases for D38065.

llvm-svn: 313818

7 years ago[WebAssembly] Add support for local symbol bindings
Sam Clegg [Wed, 20 Sep 2017 21:17:04 +0000 (21:17 +0000)]
[WebAssembly] Add support for local symbol bindings

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

llvm-svn: 313817

7 years ago[llvm-readobj] Fix 'Teach readobj to dump .res files'.
Marek Sokolowski [Wed, 20 Sep 2017 21:03:37 +0000 (21:03 +0000)]
[llvm-readobj] Fix 'Teach readobj to dump .res files'.

Fix-up for r313790. Some buildbots couldn't convert size_t to
uint{}_t; do it manually.

llvm-svn: 313816

7 years ago[mips] Fix calculation of a branch instruction offset to escape left shift of negativ...
Simon Atanasyan [Wed, 20 Sep 2017 21:01:30 +0000 (21:01 +0000)]
[mips] Fix calculation of a branch instruction offset to escape left shift of negative value

llvm-svn: 313815

7 years agoAMDGPU: Start selecting v_mad_mixhi_f16
Matt Arsenault [Wed, 20 Sep 2017 21:01:24 +0000 (21:01 +0000)]
AMDGPU: Start selecting v_mad_mixhi_f16

llvm-svn: 313814

7 years agoX86: treat SwiftCC as Win64_CC on Win64
Saleem Abdulrasool [Wed, 20 Sep 2017 21:00:40 +0000 (21:00 +0000)]
X86: treat SwiftCC as Win64_CC on Win64

The Swift CC is identical to Win64 CC with the exception of swift error
being passed in r12 which is a CSR.  However, since this calling
convention is only used in swift -> swift code, it does not impact
interoperability and can be treated entirely as Win64 CC.  We would
previously incorrectly lower the frame setup as we did not treat the
frame as conforming to Win64 specifications.

llvm-svn: 313813

7 years agoAMDGPU: Add tied operands to v_mad_mix{lo|hi}_f16
Matt Arsenault [Wed, 20 Sep 2017 20:53:49 +0000 (20:53 +0000)]
AMDGPU: Add tied operands to v_mad_mix{lo|hi}_f16

These write to the low and high half of the destination
register and leave the other 16-bits unchanged. This is true
for most 16-bit instructions on gfx9, but we don't use that
now.

llvm-svn: 313812

7 years agoImplement cl_khr_int64_extended_atomics builtins
Jan Vesely [Wed, 20 Sep 2017 20:42:19 +0000 (20:42 +0000)]
Implement cl_khr_int64_extended_atomics builtins

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>
Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 313811

7 years agoImplement cl_khr_int64_base_atomics builtins
Jan Vesely [Wed, 20 Sep 2017 20:42:14 +0000 (20:42 +0000)]
Implement cl_khr_int64_base_atomics builtins

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>
Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 313810

7 years agoIntroduce the llvm-cfi-verify tool (resubmission of D37937).
Vlad Tsyrklevich [Wed, 20 Sep 2017 20:38:14 +0000 (20:38 +0000)]
Introduce the llvm-cfi-verify tool (resubmission of D37937).

Summary: Resubmission of D37937. Fixed i386 target building (conversion from std::size_t& to uint64_t& failed). Fixed documentation warning failure about docs/CFIVerify.rst not being in the tree.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Patch by Mitch Phillips

Subscribers: sbc100, mgorny, pcc, llvm-commits, kcc

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

llvm-svn: 313809

7 years agoRemove the default subtarget from the new Nios2 port. It's unused and deprecated.
Eric Christopher [Wed, 20 Sep 2017 20:32:23 +0000 (20:32 +0000)]
Remove the default subtarget from the new Nios2 port. It's unused and deprecated.

llvm-svn: 313808

7 years ago[lit] Undo the patch to stop writing pyc files.
Zachary Turner [Wed, 20 Sep 2017 20:31:24 +0000 (20:31 +0000)]
[lit] Undo the patch to stop writing pyc files.

The problems on the bots appear to be resolved and this was
determined to not be the culprit.  Removing this.

llvm-svn: 313807

7 years agoAMDGPU: Start selecting v_mad_mixlo_f16
Matt Arsenault [Wed, 20 Sep 2017 20:28:39 +0000 (20:28 +0000)]
AMDGPU: Start selecting v_mad_mixlo_f16

Also add some tests that should be able to use v_mad_mixhi_f16,
but do not yet. This is trickier because we don't really model
the partial update of the register done by 16-bit instructions.

llvm-svn: 313806

7 years ago[OPENMP] Support for re-declarations when checking captured variables.
Alexey Bataev [Wed, 20 Sep 2017 20:11:31 +0000 (20:11 +0000)]
[OPENMP] Support for re-declarations when checking captured variables.

Need to check for variables re-declarations when checking that the
variable was already captured in the captured region.

llvm-svn: 313805

7 years agoRevert "Introduce the llvm-cfi-verify tool (resubmission of D37937)."
Vlad Tsyrklevich [Wed, 20 Sep 2017 19:46:02 +0000 (19:46 +0000)]
Revert "Introduce the llvm-cfi-verify tool (resubmission of D37937)."

This reverts commit r313798, it's causing buildbot failures.

llvm-svn: 313804

7 years agoRevert 313789 because gcc doesn't like it
Marshall Clow [Wed, 20 Sep 2017 19:38:43 +0000 (19:38 +0000)]
Revert 313789 because gcc doesn't like it

llvm-svn: 313803

7 years agoFixed unused variable warning introduced in r313796 causing build failure
Cameron Desrochers [Wed, 20 Sep 2017 19:37:37 +0000 (19:37 +0000)]
Fixed unused variable warning introduced in r313796 causing build failure

llvm-svn: 313802

7 years ago[clangd] Fixed crash on MacOS.
Ilya Biryukov [Wed, 20 Sep 2017 19:32:06 +0000 (19:32 +0000)]
[clangd] Fixed crash on MacOS.

Caused by invalid order of members in ClangdServer.
DiagnosticsMutex was used after destruction.

llvm-svn: 313801

7 years agoConsider ForceAbsolute again in moveAbsRight.
Rafael Espindola [Wed, 20 Sep 2017 19:24:57 +0000 (19:24 +0000)]
Consider ForceAbsolute again in moveAbsRight.

This patch goes back to considering ForceAbsolute in moveAbsRight, but
only if the second argument is not already absolute.

With this we can handle "foo + ABSOLUTE(foo)" and "ABSOLUTE(foo) + foo".

llvm-svn: 313800

7 years agoFix warning caused by new clang::BuiltinType::Float16 added in r312794
Ted Woodward [Wed, 20 Sep 2017 19:16:53 +0000 (19:16 +0000)]
Fix warning caused by new clang::BuiltinType::Float16 added in r312794

llvm-svn: 313799

7 years agoIntroduce the llvm-cfi-verify tool (resubmission of D37937).
Vlad Tsyrklevich [Wed, 20 Sep 2017 19:14:16 +0000 (19:14 +0000)]
Introduce the llvm-cfi-verify tool (resubmission of D37937).

Summary: Resubmission of D37937. Fixed i386 target building (conversion from std::size_t& to uint64_t& failed). Fixed documentation warning failure about docs/CFIVerify.rst not being in the tree.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Patch by Mitch Phillips

Subscribers: mgorny, pcc, llvm-commits, kcc

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

llvm-svn: 313798

7 years agoAMDGPU: Fix encoding of op_sel for mad_mix* opcodes
Matt Arsenault [Wed, 20 Sep 2017 19:09:28 +0000 (19:09 +0000)]
AMDGPU: Fix encoding of op_sel for mad_mix* opcodes

llvm-svn: 313797

7 years ago[PCH] Fixed preamble breaking with BOM presence (and particularly, fluctuating BOM...
Cameron Desrochers [Wed, 20 Sep 2017 19:03:37 +0000 (19:03 +0000)]
[PCH] Fixed preamble breaking with BOM presence (and particularly, fluctuating BOM presence)

This patch fixes broken preamble-skipping when the preamble region includes a byte order mark (BOM). Previously, parsing would fail if preamble PCH generation was enabled and a BOM was present.

This also fixes preamble invalidation when a BOM appears or disappears. This may seem to be an obscure edge case, but it happens regularly with IDEs that pass buffer overrides that never (or always) have a BOM, yet the underlying file from the initial parse that generated a PCH might (or might not) have a BOM.

I've included a test case for these scenarios.

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

llvm-svn: 313796

7 years agoReland "[WebAssembly] Add support for naming wasm data segments"
Sam Clegg [Wed, 20 Sep 2017 19:03:35 +0000 (19:03 +0000)]
Reland "[WebAssembly] Add support for naming wasm data segments"

Add adds support for naming data segments.  This is useful
useful linkers so that they can merge similar sections.

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

llvm-svn: 313795

7 years agoConsider only A.Sec in moveAbsRight.
Rafael Espindola [Wed, 20 Sep 2017 18:56:08 +0000 (18:56 +0000)]
Consider only A.Sec in moveAbsRight.

The idea of this function is to simplify the implementation of binary
operators like add.

A value might be absolute because of an ABSOLUTE expression, but it
still depends on the value of a section and we might not be able to
evaluate it early. We should keep such values on the LHS, so that we
can delay the evaluation.

We can now handle both "1 + ABSOLUTE(foo)" and "ABSOLUTE(foo) + 1".

llvm-svn: 313794

7 years ago[APInt] Use getActiveBits() to implement logBase2 and ceilLogBase2. NFC
Craig Topper [Wed, 20 Sep 2017 18:49:31 +0000 (18:49 +0000)]
[APInt] Use getActiveBits() to implement logBase2 and ceilLogBase2. NFC

llvm-svn: 313793

7 years ago[InstCombine] Use APInt::getActiveBits() to avoid creating an APInt from a trailing...
Craig Topper [Wed, 20 Sep 2017 18:49:29 +0000 (18:49 +0000)]
[InstCombine] Use APInt::getActiveBits() to avoid creating an APInt from a trailing zero count to do a comparison. NFCI

llvm-svn: 313792

7 years agoCodeGen: support SwiftError SwiftCC on Windows x64
Saleem Abdulrasool [Wed, 20 Sep 2017 18:40:59 +0000 (18:40 +0000)]
CodeGen: support SwiftError SwiftCC on Windows x64

Add support for passing SwiftError through a register on the Windows x64
calling convention.  This allows the use of swifterror attributes on
parameters which is used by the swift front end for the `Error`
parameter.  This partially enables building the swift standard library
for Windows x86_64.

llvm-svn: 313791

7 years ago[llvm-readobj] Teach readobj to dump .res files (WindowsResource).
Marek Sokolowski [Wed, 20 Sep 2017 18:33:35 +0000 (18:33 +0000)]
[llvm-readobj] Teach readobj to dump .res files (WindowsResource).

This enables readobj to output Windows resource files (.res). This way,
we'll be able to test .res outputs without comparing them byte-by-byte
with "magic binary files" generated by MS toolchain.

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

llvm-svn: 313790

7 years agoMark the __eval methods on independent_bits_engine (and __independent_bits_engine...
Marshall Clow [Wed, 20 Sep 2017 18:32:08 +0000 (18:32 +0000)]
Mark the __eval methods on independent_bits_engine (and __independent_bits_engine) as const, since they make no changes to the object. NFC.

llvm-svn: 313789

7 years agoFix assigning to _gp in linker scripts.
Rafael Espindola [Wed, 20 Sep 2017 18:30:57 +0000 (18:30 +0000)]
Fix assigning to _gp in linker scripts.

The previous logic was to try to detect if a linker script defined _gp
by checking !ElfSym::MipsGp->Value. That doesn't work in all cases as
the assigned value can be 0.

We now just always defined it Writer.cpp and always overwrite it
afterwards if needed.

llvm-svn: 313788

7 years agoRename K_MIPS64 to K_GNU64
Jake Ehrlich [Wed, 20 Sep 2017 18:23:01 +0000 (18:23 +0000)]
Rename K_MIPS64 to K_GNU64

This patch renames K_MIPS64 to K_GNU64 as part of a change to add
support for writing archives with 64-bit indexes in the symbol table.

llvm-svn: 313787

7 years agoRe-land "[DebugInfo] Insert DW_OP_deref when spilling indirect DBG_VALUEs"
Reid Kleckner [Wed, 20 Sep 2017 18:19:08 +0000 (18:19 +0000)]
Re-land "[DebugInfo] Insert DW_OP_deref when spilling indirect DBG_VALUEs"

After r313775, it's easier to maintain a parallel BitVector of spilled
locations indexed by location number.

I wasn't able to build a good reduced test case for this iteration of
the bug, but I added a more direct assertion that spilled values must
use frame index locations. If this bug reappears, it won't only fire on
the NEON vector code that we detected it on, but on medium-sized
integer-only programs as well.

llvm-svn: 313786

7 years agoFix the SIGINT handlers
Adrian McCarthy [Wed, 20 Sep 2017 18:09:39 +0000 (18:09 +0000)]
Fix the SIGINT handlers

1. Fix a data race (g_interrupt_sent flag usage was not thread safe, signals
can be handled on arbitrary threads)

2. exit() is not signal-safe, replaced it with the signal-safe equivalent
_exit()

(This differs from the patch on Phabrictor because I had to add
`#include <atomic>` to get the definition of `std::atomic_flag`.)

patch by lemo

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

llvm-svn: 313785

7 years agoRemove offset size check in nullptr arithmetic handling
Andrew Kaylor [Wed, 20 Sep 2017 18:06:44 +0000 (18:06 +0000)]
Remove offset size check in nullptr arithmetic handling

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

llvm-svn: 313784

7 years ago[TableGen] Some optimizations to TableGen.
Zachary Turner [Wed, 20 Sep 2017 18:01:40 +0000 (18:01 +0000)]
[TableGen] Some optimizations to TableGen.

This changes some STL data types to corresponding LLVM
data types that have better performance characteristics.

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

llvm-svn: 313783

7 years ago[TableGen] Add a DenseMapInfo for MachineValueType.
Zachary Turner [Wed, 20 Sep 2017 18:01:20 +0000 (18:01 +0000)]
[TableGen] Add a DenseMapInfo for MachineValueType.

No functional change, just adding a DenseMapInfo and tombstone
value so that MVT's can be put into a DenseMap / DenseSet.

llvm-svn: 313782

7 years agoRevert r313771 "[SLP] Vectorize jumbled memory loads."
Hans Wennborg [Wed, 20 Sep 2017 18:00:03 +0000 (18:00 +0000)]
Revert r313771 "[SLP] Vectorize jumbled memory loads."

This broke the buildbots, e.g.
http://bb.pgr.jp/builders/test-llvm-i686-linux-RA/builds/391

> Summary:
> This patch tries to vectorize loads of consecutive memory accesses, accessed
> in non-consecutive or jumbled way. An earlier attempt was made with patch D26905
> which was reverted back due to some basic issue with representing the 'use mask'
> jumbled accesses.
>
> This patch fixes the mask representation by recording the 'use mask' in the usertree entry.
>
> Change-Id: I9fe7f5045f065d84c126fa307ef6ebe0787296df
>
> Subscribers: mzolotukhin
>
> Reviewed By: ayal
>
> Differential Revision: https://reviews.llvm.org/D36130
>
> Review comments updated accordingly
>
> Change-Id: I22ab0a8a9bac9d49d74baa81a08e1e486f5e75f0
>
> Added a TODO for sortLoadAccesses API
>
> Change-Id: I3c679bf1865422d1b45e17ea28f1992bca660b58
>
> Modified the TODO for sortLoadAccesses API
>
> Change-Id: Ie64a66cb5f9e2a7610438abb0e750c6e090f9565
>
> Review comment update for using OpdNum to insert the mask in respective location
>
> Change-Id: I016d0c1b29874e979efc0205bbf078991f92edce
>
> Fixes '-Wsign-compare warning' in LoopAccessAnalysis.cpp and code rebase
>
> Change-Id: I64b2ea5e68c1d7b6a028f5ef8251c5a97333f89b

llvm-svn: 313781

7 years agoPacify a gcc -Wparentheses warning
Hans Wennborg [Wed, 20 Sep 2017 18:00:02 +0000 (18:00 +0000)]
Pacify a gcc -Wparentheses warning

llvm-svn: 313780

7 years agoPacify gcc's -Wnum-compare after r313775
Hans Wennborg [Wed, 20 Sep 2017 18:00:02 +0000 (18:00 +0000)]
Pacify gcc's -Wnum-compare after r313775

llvm-svn: 313779

7 years agollvm-dwarfdump: implement --recurse-depth=<N>
Adrian Prantl [Wed, 20 Sep 2017 17:44:00 +0000 (17:44 +0000)]
llvm-dwarfdump: implement --recurse-depth=<N>

This patch implements the Darwin dwarfdump option --recurse-depth=<N>,
which limits the recursion depth when selectively printing DIEs at an
offset.

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

llvm-svn: 313778

7 years agoAdd a special case for trivial alignment.
Rafael Espindola [Wed, 20 Sep 2017 17:43:44 +0000 (17:43 +0000)]
Add a special case for trivial alignment.

Normally to find the offset of a value in a section, we have to
compute the value since the alignment is defined on the final address.

If the alignment is trivial, we can skip the value computation. This
allows us to know the offset even in cases where we cannot yet know
the value.

llvm-svn: 313777

7 years agoFix a bit of UB in __independent_bits_engine. Fixes PR#34663
Marshall Clow [Wed, 20 Sep 2017 17:34:11 +0000 (17:34 +0000)]
Fix a bit of UB in __independent_bits_engine. Fixes PR#34663

llvm-svn: 313776

7 years ago[DebugInfo] Use a MapVector to coalesce MachineOperand locations
Reid Kleckner [Wed, 20 Sep 2017 17:32:54 +0000 (17:32 +0000)]
[DebugInfo] Use a MapVector to coalesce MachineOperand locations

Summary:
The new code should be linear in the number of DBG_VALUEs, while the old
code was quadratic. NFC intended.

This is also hopefully a more direct expression of the problem, which is
to:

1. Rewrite all virtual register operands to stack slots or physical
   registers
2. Uniquely number those machine operands, assigning them location
   numbers
3. Rewrite all uses of the old location numbers in the interval map to
   use the new location numbers

In r313400, I attempted to track which locations were spilled in a
parallel bitvector indexed by location number. My code was broken
because these location numbers are not stable during rewriting.

Reviewers: aprantl, hans

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 313775

7 years ago[InstCombine] Add select simplifications
Quentin Colombet [Wed, 20 Sep 2017 17:32:16 +0000 (17:32 +0000)]
[InstCombine] Add select simplifications

In these cases, two selects have constant selectable operands for
both the true and false components and have the same conditional
expression.
We then create two arithmetic operations of the same type and feed a
final select operation using the result of the true arithmetic for the true
operand and the result of the false arithmetic for the false operand and reuse
the original conditionl expression.
The arithmetic operations are naturally folded as a consequence, leaving
only the newly formed select to replace the old arithmetic operation.

Patch by: Michael Berg <michael_c_berg@apple.com>
Differential Revision: https://reviews.llvm.org/D37019

llvm-svn: 313774

7 years agoAdd travis CI configuration file
Jan Vesely [Wed, 20 Sep 2017 17:28:58 +0000 (17:28 +0000)]
Add travis CI configuration file

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 313773

7 years agoReland "[llvm-objcopy] Add support for .dynamic, .dynsym, and .dynstr"
Jake Ehrlich [Wed, 20 Sep 2017 17:22:06 +0000 (17:22 +0000)]
Reland "[llvm-objcopy] Add support for .dynamic, .dynsym, and .dynstr"

I did not upload two binaries that I reference in tests.

This change adds support for sections involved in dynamic loading such
as SHT_DYNAMIC, SHT_DYNSYM, and allocated string tables.

The two added binaries used for tests can be downloaded here and here

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

llvm-svn: 313772

7 years ago[SLP] Vectorize jumbled memory loads.
Mohammad Shahid [Wed, 20 Sep 2017 17:19:57 +0000 (17:19 +0000)]
[SLP] Vectorize jumbled memory loads.

Summary:
This patch tries to vectorize loads of consecutive memory accesses, accessed
in non-consecutive or jumbled way. An earlier attempt was made with patch D26905
which was reverted back due to some basic issue with representing the 'use mask'
jumbled accesses.

This patch fixes the mask representation by recording the 'use mask' in the usertree entry.

Change-Id: I9fe7f5045f065d84c126fa307ef6ebe0787296df

Subscribers: mzolotukhin

Reviewed By: ayal

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

Review comments updated accordingly

Change-Id: I22ab0a8a9bac9d49d74baa81a08e1e486f5e75f0

Added a TODO for sortLoadAccesses API

Change-Id: I3c679bf1865422d1b45e17ea28f1992bca660b58

Modified the TODO for sortLoadAccesses API

Change-Id: Ie64a66cb5f9e2a7610438abb0e750c6e090f9565

Review comment update for using OpdNum to insert the mask in respective location

Change-Id: I016d0c1b29874e979efc0205bbf078991f92edce

Fixes '-Wsign-compare warning' in LoopAccessAnalysis.cpp and code rebase

Change-Id: I64b2ea5e68c1d7b6a028f5ef8251c5a97333f89b
llvm-svn: 313771

7 years ago[cmake] Add an option to build llvm with IR PGO
Vedant Kumar [Wed, 20 Sep 2017 17:16:01 +0000 (17:16 +0000)]
[cmake] Add an option to build llvm with IR PGO

This adds an LLVM_ENABLE_IR_PGO option to enable building llvm and its
tools with IR PGO instrumentation.

Usage: -DLLVM_BUILD_INSTRUMENTED=On -DLLVM_ENABLE_IR_PGO=On (both
options must be enabled)

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

llvm-svn: 313770

7 years ago[cmake] Unmark LLVM_BUILD_INSTRUMENTED_COVERAGE as experimental
Vedant Kumar [Wed, 20 Sep 2017 17:16:00 +0000 (17:16 +0000)]
[cmake] Unmark LLVM_BUILD_INSTRUMENTED_COVERAGE as experimental

The coverage bot has been stable for a while:

  http://lab.llvm.org:8080/coverage/coverage-reports/index.html

llvm-svn: 313769

7 years ago[docs] Make a note of LLVM_BUILD_INSTRUMENTED_COVERAGE
Vedant Kumar [Wed, 20 Sep 2017 17:16:00 +0000 (17:16 +0000)]
[docs] Make a note of LLVM_BUILD_INSTRUMENTED_COVERAGE

llvm-svn: 313768

7 years agoReland "[llvm-objcopy] Add support for .dynamic, .dynsym, and .dynstr"
Jake Ehrlich [Wed, 20 Sep 2017 17:11:58 +0000 (17:11 +0000)]
Reland "[llvm-objcopy] Add support for .dynamic, .dynsym, and .dynstr"

I overzealously landed this before I was sure that another change
wouldn't break the build that this change depends on.

This change adds support for sections involved in dynamic loading such
as SHT_DYNAMIC, SHT_DYNSYM, and allocated string tables.

The two added binaries used for tests can be downloaded here and here

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

llvm-svn: 313767

7 years ago[ThinLTO] Fix dead stripping analysis for SamplePGO
Teresa Johnson [Wed, 20 Sep 2017 17:09:47 +0000 (17:09 +0000)]
[ThinLTO] Fix dead stripping analysis for SamplePGO

Summary:
The fix for dead stripping analysis in the case of SamplePGO indirect
calls to local functions (r313151) introduced the possibility of an
infinite loop.

Make sure we check for the value being already live after we update it
for SamplePGO indirect call handling.

Reviewers: danielcdh

Subscribers: mehdi_amini, inglorion, llvm-commits, eraman

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

llvm-svn: 313766

7 years ago[lit] Reverse path list when updating environment vars.
Zachary Turner [Wed, 20 Sep 2017 17:08:20 +0000 (17:08 +0000)]
[lit] Reverse path list when updating environment vars.

Bug pointed out by EricWF.  This would construct a path where
items would be added in the wrong order, potentially leading
to using the wrong tools for testing.

llvm-svn: 313765

7 years agoDon't try to compute a value that is known to fail.
Rafael Espindola [Wed, 20 Sep 2017 16:42:56 +0000 (16:42 +0000)]
Don't try to compute a value that is known to fail.

We try to evaluate expressions early when possible, but it is not
possible to evaluate them early if they are based on a section.

Before we would get this wrong on ABSOLUTE expressions.

llvm-svn: 313764

7 years agoMake libcxx tests work when llvm sources are not present.
Zachary Turner [Wed, 20 Sep 2017 16:01:50 +0000 (16:01 +0000)]
Make libcxx tests work when llvm sources are not present.

Despite a strong CMake warning that this is an unsupported
libcxx build configuration, some bots still rely on being
able to check out lit and libcxx independently with no
LLVM sources, and then run lit against libcxx.

A previous patch broke that workflow, so this is making it work
again.  Unfortunately, it breaks generation of the llvm-lit
script for libcxx, but we will just have to live with that until
a solution is found that allows libcxx to make more use of
llvm build pieces.  libcxx can still run tests by using the
ninja check target, or by running lit.py directly against the
build tree or source tree.

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

llvm-svn: 313763

7 years agoDebugInfo: Remove unneeded attributes from test/DebugInfo/Generic/imported-name-inlin...
David Blaikie [Wed, 20 Sep 2017 15:59:57 +0000 (15:59 +0000)]
DebugInfo: Remove unneeded attributes from test/DebugInfo/Generic/imported-name-inlined.ll

Remove unneeded attributes from test/DebugInfo/Generic/imported-name-inlined.ll because it was causing failures on pure MIPS builds.

Patch by MiloÅ¡ Stojanović!

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

llvm-svn: 313762

7 years ago[mips] Add a valid test case to check the reason of the recent build-bot failure...
Simon Atanasyan [Wed, 20 Sep 2017 15:57:25 +0000 (15:57 +0000)]
[mips] Add a valid test case to check the reason of the recent build-bot failure. NFC

llvm-svn: 313761

7 years agoPut target deduced from executable name at the start of argument list
Serge Pavlov [Wed, 20 Sep 2017 15:22:27 +0000 (15:22 +0000)]
Put target deduced from executable name at the start of argument list

When clang is called as 'target-clang', put deduced target option at
the start of argument list so that option '--target=' specified in command
line could override it.

This change fixes PR34671.

llvm-svn: 313760

7 years ago[clangd] Put inacessible items to the end of completion list.
Ilya Biryukov [Wed, 20 Sep 2017 15:09:14 +0000 (15:09 +0000)]
[clangd] Put inacessible items to the end of completion list.

Reviewers: bkramer, krasimir

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

llvm-svn: 313759

7 years agoRevert r313736: "[SLP] Vectorize jumbled memory loads."
Alexander Kornienko [Wed, 20 Sep 2017 14:53:07 +0000 (14:53 +0000)]
Revert r313736: "[SLP] Vectorize jumbled memory loads."

The revision breaks buildbots:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/6694/steps/test/logs/stdio

llvm-svn: 313758

7 years agoRevert r313753: "Fix a -Wsign-compare warning in LoopAccessAnalysis.cpp"
Alexander Kornienko [Wed, 20 Sep 2017 14:52:56 +0000 (14:52 +0000)]
Revert r313753: "Fix a -Wsign-compare warning in LoopAccessAnalysis.cpp"

llvm-svn: 313757

7 years agoReplace r313747, don't always warn on enums, rework testcases.
Roman Lebedev [Wed, 20 Sep 2017 13:50:01 +0000 (13:50 +0000)]
Replace r313747, don't always warn on enums, rework testcases.

As Aaron Ballman has pointed out, that is not really correct.
So the key problem there is the invalidity of the testcase.

Revert r313747, and rework testcase in such a way, so these
details (platform-specific default enum sigdness) are
accounted for.

Also, add a C++-specific testcase.

llvm-svn: 313756

7 years ago[X86][SSE] Add PR22415 test case
Simon Pilgrim [Wed, 20 Sep 2017 13:49:52 +0000 (13:49 +0000)]
[X86][SSE] Add PR22415 test case

llvm-svn: 313755

7 years ago[clangd] Serialize onDiagnosticsReady callbacks for the same file.
Ilya Biryukov [Wed, 20 Sep 2017 12:58:55 +0000 (12:58 +0000)]
[clangd] Serialize onDiagnosticsReady callbacks for the same file.

Summary:
Calls to onDiagnosticsReady were done concurrently before. This sometimes
led to older versions of diagnostics being reported to the user after
the newer versions.

Reviewers: klimek, bkramer, krasimir

Reviewed By: klimek

Subscribers: cfe-commits

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

llvm-svn: 313754

7 years agoFix a -Wsign-compare warning in LoopAccessAnalysis.cpp
Alexander Kornienko [Wed, 20 Sep 2017 12:18:22 +0000 (12:18 +0000)]
Fix a -Wsign-compare warning in LoopAccessAnalysis.cpp

llvm-svn: 313753

7 years ago[clang-tidy] Fix linkage-related compiler errors in clang-tidy tests
Alexander Kornienko [Wed, 20 Sep 2017 12:16:35 +0000 (12:16 +0000)]
[clang-tidy] Fix linkage-related compiler errors in clang-tidy tests

llvm-svn: 313752

7 years agoRecommit [MachineCombiner] Update instruction depths incrementally for large BBs.
Florian Hahn [Wed, 20 Sep 2017 11:54:37 +0000 (11:54 +0000)]
Recommit [MachineCombiner] Update instruction depths incrementally for large BBs.

This version of the patch fixes an off-by-one error causing PR34596. We
do not need to use std::next(BlockIter) when calling updateDepths, as
BlockIter already points to the next element.

Original commit message:
> For large basic blocks with lots of combinable instructions, the
> MachineTraceMetrics computations in MachineCombiner can dominate the compile
> time, as computing the trace information is quadratic in the number of
> instructions in a BB and it's relevant successors/predecessors.

> In most cases, knowing the instruction depth should be enough to make
> combination decisions. As we already iterate over all instructions in a basic
> block, the instruction depth can be computed incrementally. This reduces the
> cost of machine-combine drastically in cases where lots of instructions
> are combined. The major drawback is that AFAIK, computing the critical path
> length cannot be done incrementally. Therefore we only compute
> instruction depths incrementally, for basic blocks with more
> instructions than inc_threshold. The -machine-combiner-inc-threshold
> option can be used to set the threshold and allows for easier
> experimenting and checking if using incremental updates for all basic
> blocks has any impact on the performance.
>
> Reviewers: sanjoy, Gerolf, MatzeB, efriedma, fhahn
>
> Reviewed By: fhahn
>
> Subscribers: kiranchandramohan, javed.absar, efriedma, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D36619

llvm-svn: 313751

7 years ago[ScheduleOptimizer] Fix and test schedule tree statistics.
Michael Kruse [Wed, 20 Sep 2017 11:53:05 +0000 (11:53 +0000)]
[ScheduleOptimizer] Fix and test schedule tree statistics.

Fix walking over the schedule tree to collect its properties
(Number of permutable bands etc.).

Also add regression tests for these statistics.

llvm-svn: 313750

7 years ago[clangd] Run clang-format on ClangdUnit.cpp. NFC.
Ilya Biryukov [Wed, 20 Sep 2017 10:46:58 +0000 (10:46 +0000)]
[clangd] Run clang-format on ClangdUnit.cpp. NFC.

llvm-svn: 313749

7 years agoRevert r313746 "[yaml2obj] - Don't crash on invalid document."
George Rimar [Wed, 20 Sep 2017 10:24:37 +0000 (10:24 +0000)]
Revert r313746 "[yaml2obj] - Don't crash on invalid document."

It broke BB:
http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/9781

llvm-svn: 313748

7 years ago[Sema] CheckTautologicalComparisonWithZero(): always complain about enums
Roman Lebedev [Wed, 20 Sep 2017 10:15:27 +0000 (10:15 +0000)]
[Sema] CheckTautologicalComparisonWithZero(): always complain about enums

Hopefully fixes test-clang-msc-x64-on-i686-linux-RA build.

The underlying problem is that the enum is signed there.
Yet still, it is invalid for it to contain negative values,
so the comparison is always tautological in this case.

No differential, but related to https://reviews.llvm.org/D37629

llvm-svn: 313747

7 years ago[yaml2obj] - Don't crash on invalid document.
George Rimar [Wed, 20 Sep 2017 09:57:11 +0000 (09:57 +0000)]
[yaml2obj] - Don't crash on invalid document.

Previously jaml2obj would segfault on empty document.
(without yaml description).
Patch fixes the issue.

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

llvm-svn: 313746

7 years ago[Sema] Move some stuff into -Wtautological-unsigned-enum-zero-compare
Roman Lebedev [Wed, 20 Sep 2017 09:54:47 +0000 (09:54 +0000)]
[Sema] Move some stuff into -Wtautological-unsigned-enum-zero-compare

Recommit. Original commit was reverted because buildbots broke.
The error was only reproducible in the build with assertions.
The problem was that the diagnostic expected true/false as
bool, while it was provided as string "true"/"false".

Summary:
As requested by Sam McCall:
> Enums (not new I guess). Typical case: if (enum < 0 || enum > MAX)
> The warning strongly suggests that the enum < 0 check has no effect
> (for enums with nonnegative ranges).
> Clang doesn't seem to optimize such checks out though, and they seem
> likely to catch bugs in some cases. Yes, only if there's UB elsewhere,
> but I assume not optimizing out these checks indicates a deliberate
> decision to stay somewhat compatible with a technically-incorrect
> mental model.
> If this is the case, should we move these to a
> -Wtautological-compare-enum subcategory?

Reviewers: rjmccall, rsmith, aaron.ballman, sammccall, bkramer, djasper

Reviewed By: aaron.ballman

Subscribers: jroelofs, cfe-commits

Tags: #clang

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

llvm-svn: 313745

7 years agoclang-format clang-format.
Manuel Klimek [Wed, 20 Sep 2017 09:51:03 +0000 (09:51 +0000)]
clang-format clang-format.

llvm-svn: 313744

7 years ago[X86][SSE] Remove unnecessary NonceMasks from combineX86ShufflesRecursively calls...
Simon Pilgrim [Wed, 20 Sep 2017 09:36:11 +0000 (09:36 +0000)]
[X86][SSE] Remove unnecessary NonceMasks from combineX86ShufflesRecursively calls (NFCI)

llvm-svn: 313743

7 years agoFix clang-format's detection of structured bindings.
Manuel Klimek [Wed, 20 Sep 2017 09:29:37 +0000 (09:29 +0000)]
Fix clang-format's detection of structured bindings.

Correctly determine when [ is part of a structured binding instead of a
lambda.

To be able to reuse the implementation already available, this patch also:
- sets the Previous link of FormatTokens in the UnwrappedLineParser
- moves the isCppStructuredBinding function into FormatToken

Before:
  auto const const &&[x, y] { A *i };

After:
  auto const const && [x, y]{A * i};

Fixing formatting of the type of the structured binding is still missing.

llvm-svn: 313742

7 years ago[ELF] - Fix segfault when processing .eh_frame.
George Rimar [Wed, 20 Sep 2017 09:27:41 +0000 (09:27 +0000)]
[ELF] - Fix segfault when processing .eh_frame.

Its a PR34648 which was a segfault that happened because
we stored pointers to elements in DenseMap.
When DenseMap grows such pointers are invalidated.
Solution implemented is to keep elements by pointer
and not by value.

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

llvm-svn: 313741

7 years ago[IfConversion] Add testcases [NFC]
Mikael Holmen [Wed, 20 Sep 2017 08:23:29 +0000 (08:23 +0000)]
[IfConversion] Add testcases [NFC]

These tests should have been included in r310697 / D34099 but apparently
I missed them.

llvm-svn: 313737

7 years ago[SLP] Vectorize jumbled memory loads.
Mohammad Shahid [Wed, 20 Sep 2017 08:18:28 +0000 (08:18 +0000)]
[SLP] Vectorize jumbled memory loads.

Summary:
This patch tries to vectorize loads of consecutive memory accesses, accessed
in non-consecutive or jumbled way. An earlier attempt was made with patch D26905
which was reverted back due to some basic issue with representing the 'use mask' of
jumbled accesses.

This patch fixes the mask representation by recording the 'use mask' in the usertree entry.

Change-Id: I9fe7f5045f065d84c126fa307ef6ebe0787296df

Reviewers: mkuper, loladiro, Ayal, zvi, danielcdh

Reviewed By: Ayal

Subscribers: mzolotukhin

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

Commit after rebase for patch D36130

Change-Id: I8add1c265455669ef288d880f870a9522c8c08ab
llvm-svn: 313736

7 years ago'into' instruction should not be decoded as a valid instr in 64-bit mode
Andrew V. Tischenko [Wed, 20 Sep 2017 08:17:17 +0000 (08:17 +0000)]
'into' instruction should not be decoded as a valid instr in 64-bit mode

llvm-svn: 313735

7 years agoRevert rL313697, "Compact EhSectionPiece from 32 bytes to 16 bytes."
NAKAMURA Takumi [Wed, 20 Sep 2017 08:03:18 +0000 (08:03 +0000)]
Revert rL313697, "Compact EhSectionPiece from 32 bytes to 16 bytes."

It broke selfhosting.
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/4896

llvm-svn: 313731

7 years ago[clangd] Introduced Logger interface.
Ilya Biryukov [Wed, 20 Sep 2017 07:24:15 +0000 (07:24 +0000)]
[clangd] Introduced Logger interface.

Summary: This fixes a bunch of logging-related FIXMEs.

Reviewers: bkramer, krasimir, malaperle

Reviewed By: malaperle

Subscribers: malaperle, klimek, cfe-commits, mgorny

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

llvm-svn: 313730

7 years agoImplement C++ [basic.link]p8.
Richard Smith [Wed, 20 Sep 2017 07:22:00 +0000 (07:22 +0000)]
Implement C++ [basic.link]p8.

If a function or variable has a type with no linkage (and is not extern "C"),
any use of it requires a definition within the same translation unit; the idea
is that it is not possible to define the entity elsewhere, so any such use is
necessarily an error.

There is an exception, though: some types formally have no linkage but
nonetheless can be referenced from other translation units (for example, this
happens to anonymous structures defined within inline functions). For entities
with those types, we suppress the diagnostic except under -pedantic.

llvm-svn: 313729

7 years ago[asan] Try to fix windows test by fflush(stderr)
Vitaly Buka [Wed, 20 Sep 2017 07:16:08 +0000 (07:16 +0000)]
[asan] Try to fix windows test by fflush(stderr)

llvm-svn: 313728

7 years ago[asan] Resolve FIXME by converting gtest into lit test
Vitaly Buka [Wed, 20 Sep 2017 07:01:19 +0000 (07:01 +0000)]
[asan] Resolve FIXME by converting gtest into lit test

llvm-svn: 313727

7 years agoSignal polling is supported with pselect (re-land r313704 without a Windows breakage)
Eugene Zemtsov [Wed, 20 Sep 2017 06:56:46 +0000 (06:56 +0000)]
Signal polling is supported with pselect (re-land r313704 without a Windows breakage)

Older Android API levels don't have ppoll, but LLDB works just fine,
since on Android it always uses pselect anyway.

llvm-svn: 313726

7 years agoRevert "Add support for attribute 'noescape'."
Akira Hatanaka [Wed, 20 Sep 2017 06:55:43 +0000 (06:55 +0000)]
Revert "Add support for attribute 'noescape'."

This reverts commit r313722.

It looks like compiler-rt/lib/tsan/rtl/tsan_libdispatch_mac.cc cannot be
compiled because some of the functions declared in the file do not match
the ones in the SDK headers (which are annotated with 'noescape').

llvm-svn: 313725

7 years ago[X86] Remove isel checks for immediate size on floating point compare and xop compare...
Craig Topper [Wed, 20 Sep 2017 06:38:41 +0000 (06:38 +0000)]
[X86] Remove isel checks for immediate size on floating point compare and xop compare instructions. NFCI

If these checks fail we end up not selecting an instruction at all. So we are already relying on the immediate being checked upstream of isel. So doing the check in isel is just bloat to the isel table. Interestingly, we didn't check on the AVX512 version of the instructions anyway.

llvm-svn: 313724

7 years ago[AMDGPU] Fixed memory leak with inliner replaced
Stanislav Mekhanoshin [Wed, 20 Sep 2017 06:34:28 +0000 (06:34 +0000)]
[AMDGPU] Fixed memory leak with inliner replaced

Delete inliner before replacing it.

llvm-svn: 313723

7 years agoAdd support for attribute 'noescape'.
Akira Hatanaka [Wed, 20 Sep 2017 06:32:45 +0000 (06:32 +0000)]
Add support for attribute 'noescape'.

The attribute informs the compiler that the annotated pointer parameter
of a function cannot escape and enables IRGen to attach attribute
'nocapture' to parameters that are annotated with the attribute. That is
the only optimization that currently takes advantage of 'noescape', but
there are other optimizations that will be added later that improves
IRGen for ObjC blocks.

rdar://problem/19886775

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

llvm-svn: 313722