platform/upstream/llvm.git
7 years ago[Driver] Support obtaining active toolchain from gcc-config on Gentoo
Michal Gorny [Tue, 25 Oct 2016 15:07:41 +0000 (15:07 +0000)]
[Driver] Support obtaining active toolchain from gcc-config on Gentoo

Support using gcc-config to determine the correct GCC toolchain location
on Gentoo. In order to do that, attempt to read gcc-config configuration
form [[sysroot]]/etc/env.d/gcc, if no custom toolchain location is
provided.

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

llvm-svn: 285074

7 years agoCodeGen: mark protocols as common data
Saleem Abdulrasool [Tue, 25 Oct 2016 14:50:44 +0000 (14:50 +0000)]
CodeGen: mark protocols as common data

This allows for the coalescing of the protocol declarations.  When the protocols
are declared in headers, multiple definitions of the protocol would be emitted.
Marking them as common data indicates that any one can be selected.

llvm-svn: 285073

7 years ago[X86][SSE] Add support for (V)PMOVSX* constant folding
Simon Pilgrim [Tue, 25 Oct 2016 14:29:25 +0000 (14:29 +0000)]
[X86][SSE] Add support for (V)PMOVSX* constant folding

We already have (V)PMOVZX* combining support, this is the beginning of handling (V)PMOVSX* similarly - other combines in combineVSZext can be generalized in future patches.

This unearthed an interesting bug in that we were generating illegal build vectors on 32-bit targets - it was proving difficult to create a test for it from PMOVZX, but it fired immediately with PMOVSX. I've created a more general form of the existing getConstVector to handle these cases - ideally this should be handled in non-target-specific code but I couldn't find an equivalent.

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

llvm-svn: 285072

7 years ago[ScopInfo] Fix: use raw source pointer.
Michael Kruse [Tue, 25 Oct 2016 13:37:43 +0000 (13:37 +0000)]
[ScopInfo] Fix: use raw source pointer.

When adding an llvm.memcpy instruction to AliasSetTracker, it uses the raw
source and target pointers which preserve bitcasts.
MemAccInst::getPointerOperand() also returns the raw target pointers, but
Scop::buildAliasGroups() did not for the source pointer. This lead to mismatches
between AliasSetTracker and ScopInfo on which pointer to use.

Fixed by also using raw pointers in Scop::buildAliasGroups().

llvm-svn: 285071

7 years ago[InstCombine] fix checks for previous commit (r285069)
Sanjay Patel [Tue, 25 Oct 2016 13:30:19 +0000 (13:30 +0000)]
[InstCombine] fix checks for previous commit (r285069)

Accidentally put in the hoped-for checks ahead of the transform!

llvm-svn: 285070

7 years ago[InstCombine] add tests for bitcast interference with min/max (PR28001)
Sanjay Patel [Tue, 25 Oct 2016 13:27:56 +0000 (13:27 +0000)]
[InstCombine] add tests for bitcast interference with min/max (PR28001)

llvm-svn: 285069

7 years agoRevert "Improve the libstdc++ smart pointer formatters"
Pavel Labath [Tue, 25 Oct 2016 13:24:53 +0000 (13:24 +0000)]
Revert "Improve the libstdc++ smart pointer formatters"

This reverts commit r284828, as it causes an infinite loop in
TestPrintStackTraces (funnily enough, only when logging is enabled).

llvm-svn: 285068

7 years agoFix MSVC unused variable warning.
Simon Pilgrim [Tue, 25 Oct 2016 12:59:15 +0000 (12:59 +0000)]
Fix MSVC unused variable warning.

LLVM_ATTRIBUTE_UNUSED doesn't work for non-gcc style compilers.

llvm-svn: 285067

7 years agoRe-apply patch r279045.
Kelvin Li [Tue, 25 Oct 2016 12:50:55 +0000 (12:50 +0000)]
Re-apply patch r279045.

llvm-svn: 285066

7 years agoFix diagnostic format string for err_os_log_argument_to_big
Benjamin Kramer [Tue, 25 Oct 2016 12:39:28 +0000 (12:39 +0000)]
Fix diagnostic format string for err_os_log_argument_to_big

Patch by Sam McCall, test case by me.

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

llvm-svn: 285065

7 years agofix warning
Rafael Espindola [Tue, 25 Oct 2016 12:28:26 +0000 (12:28 +0000)]
fix warning

llvm-svn: 285064

7 years ago[DAGCombine] Preserve shuffles when one of the vector operands is constant
Zvi Rackover [Tue, 25 Oct 2016 12:14:19 +0000 (12:14 +0000)]
[DAGCombine] Preserve shuffles when one of the vector operands is constant

Summary:
Do *not* perform combines such as:

    vector_shuffle<4,1,2,3>(build_vector(Ud, C0, C1 C2), scalar_to_vector(X))
    ->
    build_vector(X, C0, C1, C2)

Keeping the shuffle allows lowering the constant build_vector to a materialized
constant vector (such as a vector-load from the constant-pool or some other idiom).

Reviewers: delena, igorb, spatel, mkuper, andreadb, RKSimon

Subscribers: llvm-commits

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

llvm-svn: 285063

7 years agoUpdate for llvm change.
Rafael Espindola [Tue, 25 Oct 2016 12:02:31 +0000 (12:02 +0000)]
Update for llvm change.

llvm-svn: 285062

7 years agoMake the LTO comdat api more symbol table friendly.
Rafael Espindola [Tue, 25 Oct 2016 12:02:03 +0000 (12:02 +0000)]
Make the LTO comdat api more symbol table friendly.

In an IR symbol table I would expect the comdats to be represented as:

- A table of strings, one for each comdat name.
- Each symbol has an optional index into that table.

The natural api for accessing that would be

InputFile:
ArrayRef<StringRef> getComdatTable() const;

Symbol:
int getComdatIndex() const;

This patch implements an API as close to that as possible.  The
implementation on top of the current IRObjectFile is a bit hackish,
but should map just fine over a symbol table and is very convenient to
use.

llvm-svn: 285061

7 years agoinclude-fixer: Don't overwrite buffer changes
Manuel Klimek [Tue, 25 Oct 2016 11:31:22 +0000 (11:31 +0000)]
include-fixer: Don't overwrite buffer changes

Raise a signal if the buffer has been modified before replacing it, to
avoid overwriting users' changes.

Patch by Philipp Stephani.

llvm-svn: 285060

7 years agoLoad clang-include-fixer.el from the unit test suite so that the unit tests can run...
Manuel Klimek [Tue, 25 Oct 2016 11:30:28 +0000 (11:30 +0000)]
Load clang-include-fixer.el from the unit test suite so that the unit tests can run in batch mode.

Patch by Philipp Stephani.

llvm-svn: 285059

7 years agoInclude full filename range for missing includes
Erik Verbruggen [Tue, 25 Oct 2016 10:13:10 +0000 (10:13 +0000)]
Include full filename range for missing includes

For the purpose of highlighting in an IDE.

llvm-svn: 285057

7 years agoFix 'unknown documentation command' warning ranges
Erik Verbruggen [Tue, 25 Oct 2016 10:06:11 +0000 (10:06 +0000)]
Fix 'unknown documentation command' warning ranges

Warnings generated by -Wdocumentation-unknown-command did only have a
start location, not a full source range. This resulted in only the
"carret" being show in messages, and IDEs highlighting only the single
initial character.

llvm-svn: 285056

7 years agoFix an unused warning in WebAssemblyInstPrinter with NDEBUG.
Benjamin Kramer [Tue, 25 Oct 2016 09:08:50 +0000 (09:08 +0000)]
Fix an unused warning in WebAssemblyInstPrinter with NDEBUG.

Patch by Sam McCall!

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

llvm-svn: 285055

7 years ago[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (Operators: +,*,&...
Michael Zuckerman [Tue, 25 Oct 2016 07:56:04 +0000 (07:56 +0000)]
[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (Operators: +,*,&&,||) intrinsics to Clang

Committed after LGTM and check-all

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

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

Reviwer: 1. igorb
         2. craig.topper
Differential Revision: https://reviews.llvm.org/D25527

llvm-svn: 285054

7 years ago[AVX-512] Add support for creating SIGN_EXTEND_VECTOR_INREG and ZERO_EXTEND_VECTOR_IN...
Craig Topper [Tue, 25 Oct 2016 04:00:29 +0000 (04:00 +0000)]
[AVX-512] Add support for creating SIGN_EXTEND_VECTOR_INREG and ZERO_EXTEND_VECTOR_INREG for 512-bit vectors to support vpmovzxbq and vpmovsxbq.

Summary: The one tricky thing about this is that the sign/zero_extend_inreg uses v64i8 as an input type which isn't legal without BWI support. Though the vpmovsxbq and vpmovzxbq instructions themselves don't require BWI. To support this we need to add custom lowering for ZERO_EXTEND_VECTOR_INREG with v64i8 input. This can mostly reuse the existing sign extend code with a couple checks for sign extend vs zero extend added.

Reviewers: delena, RKSimon

Subscribers: llvm-commits

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

llvm-svn: 285053

7 years agoGlobalDCE: Restore a statement accidentally removed in r285048.
Peter Collingbourne [Tue, 25 Oct 2016 02:57:27 +0000 (02:57 +0000)]
GlobalDCE: Restore a statement accidentally removed in r285048.

llvm-svn: 285052

7 years agoMachineInstrBundle: Pass iterators to getBundle(Start|End); NFC
Matthias Braun [Tue, 25 Oct 2016 02:55:17 +0000 (02:55 +0000)]
MachineInstrBundle: Pass iterators to getBundle(Start|End); NFC

This is a function to go backwards in a block to find the first
instruction in a bundle, so iterator is a more natural choice for
parameter/return rather than a reference to a MachineInstruction.

llvm-svn: 285051

7 years agoIR: Deduplicate getParent() functions on derived classes of GlobalValue into the...
Peter Collingbourne [Tue, 25 Oct 2016 02:54:08 +0000 (02:54 +0000)]
IR: Deduplicate getParent() functions on derived classes of GlobalValue into the base class. NFCI.

llvm-svn: 285050

7 years ago[libFuzzer] simplify the code for use_cmp, also use the position hint when available...
Kostya Serebryany [Tue, 25 Oct 2016 02:04:43 +0000 (02:04 +0000)]
[libFuzzer] simplify the code for use_cmp, also use the position hint when available, add a test

llvm-svn: 285049

7 years agoGlobalDCE: Deduplicate code. NFCI.
Peter Collingbourne [Tue, 25 Oct 2016 01:58:26 +0000 (01:58 +0000)]
GlobalDCE: Deduplicate code. NFCI.

llvm-svn: 285048

7 years agoFix handling of %% format specifier in os_log builtins.
Mehdi Amini [Tue, 25 Oct 2016 00:48:48 +0000 (00:48 +0000)]
Fix handling of %% format specifier in os_log builtins.

Returning `false` was stopping the parsing of further arguments,
which wasn't intended.

llvm-svn: 285047

7 years ago[InstCombine] auto-generate checks
Sanjay Patel [Tue, 25 Oct 2016 00:44:02 +0000 (00:44 +0000)]
[InstCombine] auto-generate checks

llvm-svn: 285046

7 years ago[InstCombine] auto-generate checks
Sanjay Patel [Tue, 25 Oct 2016 00:41:00 +0000 (00:41 +0000)]
[InstCombine] auto-generate checks

llvm-svn: 285045

7 years ago[WebAssembly] Reorder load/store operands to match binary encoding.
Dan Gohman [Tue, 25 Oct 2016 00:17:11 +0000 (00:17 +0000)]
[WebAssembly] Reorder load/store operands to match binary encoding.

The p2align operand of a load/store is encoded before the offset
operand; reorder the MachineInstr operands accordingly.

llvm-svn: 285044

7 years ago[llvm-cov] Do not print out the filename of the object file
Vedant Kumar [Tue, 25 Oct 2016 00:08:33 +0000 (00:08 +0000)]
[llvm-cov] Do not print out the filename of the object file

When we load coverage data from multiple objects, we don't have a way to
attribute a source object to a function record. Printing out the object
filename next to the source filename is already not very useful: soon,
it'll actually become misleading. Stop printing out the filename now.

llvm-svn: 285043

7 years agoAdd dependency from clangCodeGen to clangAnalysis
Mehdi Amini [Mon, 24 Oct 2016 23:38:32 +0000 (23:38 +0000)]
Add dependency from clangCodeGen to clangAnalysis

This is unbreaking the build with shared library after r285019.

llvm-svn: 285042

7 years agotest/CodeGen/builtins.c: reinstate #ifdef __x86_64__ around __builtin_longjmp
Mehdi Amini [Mon, 24 Oct 2016 23:38:24 +0000 (23:38 +0000)]
test/CodeGen/builtins.c: reinstate #ifdef __x86_64__ around __builtin_longjmp

Unadvertently removed in r285019

llvm-svn: 285041

7 years ago[WebAssembly] Implement more WebAssembly binary encoding.
Dan Gohman [Mon, 24 Oct 2016 23:27:49 +0000 (23:27 +0000)]
[WebAssembly] Implement more WebAssembly binary encoding.

This changes locals from being declared by the emitLocal hook in
WebAssemblyTargetStreamer, rather than with an instruction. After exploring
the infastructure in LLVM more, this seems to make more sense since
declaring locals doesn't use an encoded opcode.

This also adds more 0xd opcodes, type encodings, and miscellaneous
binary encoding bits.

llvm-svn: 285040

7 years agoCodeGen/Passes: Pass MachineFunction as functor arg; NFC
Matthias Braun [Mon, 24 Oct 2016 23:23:02 +0000 (23:23 +0000)]
CodeGen/Passes: Pass MachineFunction as functor arg; NFC

Passing a MachineFunction as argument is more natural and avoids an
unnecessary round-trip through the logic determining the correct
Subtarget because MachineFunction already has a reference anyway.

llvm-svn: 285039

7 years ago[Basic] Support 32-bit x86 and ARM targets for Fuchsia
Petr Hosek [Mon, 24 Oct 2016 22:55:57 +0000 (22:55 +0000)]
[Basic] Support 32-bit x86 and ARM targets for Fuchsia

Fuchsia has experimental support for 32-bit x86 and ARM targets, add
them to the list of supported targets.

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

llvm-svn: 285038

7 years agoLink clangCodeGen with clangAnalysis required after r284990.
Artem Belevich [Mon, 24 Oct 2016 22:52:39 +0000 (22:52 +0000)]
Link clangCodeGen with clangAnalysis required after r284990.

Fixes build break for configurations that use shared libraries.

llvm-svn: 285037

7 years ago[InstCombine] regenerate some checks
Sanjay Patel [Mon, 24 Oct 2016 22:50:26 +0000 (22:50 +0000)]
[InstCombine] regenerate some checks

llvm-svn: 285036

7 years agocmake: Rename installhdrs to install-llvm-headers and fix the dependencies
Justin Bogner [Mon, 24 Oct 2016 21:58:58 +0000 (21:58 +0000)]
cmake: Rename installhdrs to install-llvm-headers and fix the dependencies

The installhdrs target was inconsistently named and would behave
differently depending on whether or not you ran a build first. This
renames it to install-llvm-headers to match other target names and
adds a dependency on intrinsics_gen so that it will always install the
same set of things.

llvm-svn: 285035

7 years agoFix regression from my recent GlobalsAA fix.
Eli Friedman [Mon, 24 Oct 2016 21:47:44 +0000 (21:47 +0000)]
Fix regression from my recent GlobalsAA fix.

There are two fixes here: one, AnalyzeUsesOfPointer can't return
false until it has checked all the uses of the pointer. Two, if a
global uses another global, we have to assume the address of the
first global escapes.

Fixes https://llvm.org/bugs/show_bug.cgi?id=30707 .

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

llvm-svn: 285034

7 years ago[SelectionDAG] Update ComputeNumSignBits SRA/SHL handlers to accept scalar or vector...
Simon Pilgrim [Mon, 24 Oct 2016 21:47:19 +0000 (21:47 +0000)]
[SelectionDAG] Update ComputeNumSignBits SRA/SHL handlers to accept scalar or vector splats

Use isConstOrConstSplat helper.

Also use APInt instead of getZExtValue directly to avoid out of range issues.

llvm-svn: 285033

7 years agoremove xfail from TestObjCNewSyntax.py test_expr_gmodules()
Todd Fiala [Mon, 24 Oct 2016 21:46:46 +0000 (21:46 +0000)]
remove xfail from TestObjCNewSyntax.py test_expr_gmodules()

Fixes:
rdar://27792848

llvm-svn: 285032

7 years ago[Sema][ObjC] Warn about implicitly autoreleasing out-parameters captured
Akira Hatanaka [Mon, 24 Oct 2016 21:45:54 +0000 (21:45 +0000)]
[Sema][ObjC] Warn about implicitly autoreleasing out-parameters captured
by blocks.

Add a new warning "-Wblock-capture-autoreleasing". The warning warns
about implicitly autoreleasing out-parameters captured by blocks which
can introduce use-after-free bugs that are hard to debug.

rdar://problem/15377548

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

llvm-svn: 285031

7 years agocmake: Make /usr/share/cmake installable with LLVM_DISTRIBUTION_COMPONENTS
Justin Bogner [Mon, 24 Oct 2016 21:40:15 +0000 (21:40 +0000)]
cmake: Make /usr/share/cmake installable with LLVM_DISTRIBUTION_COMPONENTS

Add a cmake-exports install component and appropriate targets for
LLVM_DISTRIBUTION_COMPONENTS to work with.

llvm-svn: 285030

7 years agoUse MachineInstr::mop_iterator instead of MIOperands; NFC
Matthias Braun [Mon, 24 Oct 2016 21:36:43 +0000 (21:36 +0000)]
Use MachineInstr::mop_iterator instead of MIOperands; NFC

(Const)?MIOperands is equivalent to the C++ style
MachineInstr::mop_iterator. Use the latter for consistency except for a
few callers of MIOperands::analyzePhysReg().

llvm-svn: 285029

7 years agoCodeGen: remove incorrect temporary Twine
Saleem Abdulrasool [Mon, 24 Oct 2016 21:25:57 +0000 (21:25 +0000)]
CodeGen: remove incorrect temporary Twine

Twines should not be stack allocated.  This somehow managed to get past me.

llvm-svn: 285028

7 years agoFix test on non-X86 platforms
Mehdi Amini [Mon, 24 Oct 2016 21:22:01 +0000 (21:22 +0000)]
Fix test on non-X86 platforms

This is a fixup for r285019, adding an `#ifdef __x86_64__` since
the os_log builtin is platform specific.

llvm-svn: 285027

7 years agonother additional error check for an invalid Mach-O file
Kevin Enderby [Mon, 24 Oct 2016 21:15:11 +0000 (21:15 +0000)]
nother additional error check for an invalid Mach-O file
when contained in a Mach-O universal file and the
cputypes in both headers don’t match.

llvm-svn: 285026

7 years agoUse SDValue::getConstantOperandVal() helper. NFCI.
Simon Pilgrim [Mon, 24 Oct 2016 20:56:52 +0000 (20:56 +0000)]
Use SDValue::getConstantOperandVal() helper. NFCI.

llvm-svn: 285025

7 years ago[pbqp] unique_ptr-ify (Vector|Matrix)::Data, NFC.
Vedant Kumar [Mon, 24 Oct 2016 20:51:46 +0000 (20:51 +0000)]
[pbqp] unique_ptr-ify (Vector|Matrix)::Data, NFC.

Suggested by David Blaikie.

llvm-svn: 285024

7 years agoCodeGen: centralise label construction for method lists
Saleem Abdulrasool [Mon, 24 Oct 2016 20:47:58 +0000 (20:47 +0000)]
CodeGen: centralise label construction for method lists

Move all the label construction for the various method list emission into
EmitMethodList.  Rather than have all the names be constructed in pieces in all
of the callers of EmitMethodList, have this occur in one site.  This also makes
the calls much easier to understand as we simplify identify the type of the
method list being emitted and the interface name for which it is being emitted.
NFC.

llvm-svn: 285023

7 years agoFix bug where one of the cases where we mangle a <bare-unresolved-name> failed
Richard Smith [Mon, 24 Oct 2016 20:47:04 +0000 (20:47 +0000)]
Fix bug where one of the cases where we mangle a <bare-unresolved-name> failed
to emit the <template-args> portion. Refactor so that mangleUnresolvedName
actually emits the entire <unresolved-name>, so this mistake is harder to make
again.

llvm-svn: 285022

7 years agoELF: Simplify handling of *_start/*_end symbols.
Peter Collingbourne [Mon, 24 Oct 2016 20:46:21 +0000 (20:46 +0000)]
ELF: Simplify handling of *_start/*_end symbols.

We were previously using the (static) addSynthetic function to create
*_start/*_end symbols. This function was doing almost the same thing as
addOptionalSynthetic, except that it would also create the symbol in the
case where it is unreferenced. Because the symbol has hidden visibility,
creating it in that case would have no effect other than adding another
entry to the static symbol table. Remove addSynthetic and change callers to
use addOptionalSynthetic instead.

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

llvm-svn: 285021

7 years agoFix non-portable tests for temp_directory_path(...)
Eric Fiselier [Mon, 24 Oct 2016 20:40:35 +0000 (20:40 +0000)]
Fix non-portable tests for temp_directory_path(...)

llvm-svn: 285020

7 years agoAdd support for __builtin_os_log_format[_buffer_size]
Mehdi Amini [Mon, 24 Oct 2016 20:39:34 +0000 (20:39 +0000)]
Add support for __builtin_os_log_format[_buffer_size]

This reverts commit r285007 and reapply r284990, with a fix for the
opencl test that I broke. Original commit message follows:

These new builtins support a mechanism for logging OS events, using a
printf-like format string to specify the layout of data in a buffer.
The _buffer_size version of the builtin can be used to determine the size
of the buffer to allocate to hold the data, and then __builtin_os_log_format
can write data into that buffer. This implements format checking to report
mismatches between the format string and the data arguments. Most of this
code was written by Chris Willmore.

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

llvm-svn: 285019

7 years ago[pbqp] Delete some dead code, NFC.
Vedant Kumar [Mon, 24 Oct 2016 20:35:35 +0000 (20:35 +0000)]
[pbqp] Delete some dead code, NFC.

I took the opportunity to replace some copy|move constructors|assignment
operators with default implementations.

As a follow-up, I plan on threading unique_ptr<T []> through a few areas
per David Blaikie's advice.

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

llvm-svn: 285018

7 years ago[WebAssembly] Fix a broken URL.
Dan Gohman [Mon, 24 Oct 2016 20:35:17 +0000 (20:35 +0000)]
[WebAssembly] Fix a broken URL.

llvm-svn: 285017

7 years ago[WebAssembly] Define the `end` opcode value.
Dan Gohman [Mon, 24 Oct 2016 20:32:04 +0000 (20:32 +0000)]
[WebAssembly] Define the `end` opcode value.

CFGStackify differentiates between END_LOOP and END_BLOCK, but wasm
itself doesn't. For now, just use the same opcode for both.

llvm-svn: 285016

7 years agoFix mangling of implicit calls to operator-> to only include a single "pt",
Richard Smith [Mon, 24 Oct 2016 20:29:40 +0000 (20:29 +0000)]
Fix mangling of implicit calls to operator-> to only include a single "pt",
rather than including an extra one for each level of 'operator->()' invoked.

llvm-svn: 285015

7 years ago[WebAssembly] Update opcode values according to recent spec changes.
Dan Gohman [Mon, 24 Oct 2016 20:21:49 +0000 (20:21 +0000)]
[WebAssembly] Update opcode values according to recent spec changes.

This corresponds to the "0xd" opcode renumbering.

llvm-svn: 285014

7 years agoscripts: Document existing problems with the symbolizer build script.
Peter Collingbourne [Mon, 24 Oct 2016 20:15:39 +0000 (20:15 +0000)]
scripts: Document existing problems with the symbolizer build script.

Reviewers: eugenis, vitalybuka

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 285013

7 years agoAdd missing include in string_view tests. Patch from Billy ONeil @ microsoft
Eric Fiselier [Mon, 24 Oct 2016 20:11:17 +0000 (20:11 +0000)]
Add missing include in string_view tests. Patch from Billy ONeil @ microsoft

llvm-svn: 285012

7 years agoFix shadow warnings in string_view tests. Patch from STL@microsoft.com
Eric Fiselier [Mon, 24 Oct 2016 20:10:00 +0000 (20:10 +0000)]
Fix shadow warnings in string_view tests. Patch from STL@microsoft.com

llvm-svn: 285011

7 years ago[compiler-rt] moved __asan_schedule_unregister_globals out of anonymous namespace
Bob Haarman [Mon, 24 Oct 2016 19:56:18 +0000 (19:56 +0000)]
[compiler-rt] moved __asan_schedule_unregister_globals out of anonymous namespace

Summary: Newer versions of clang complain that __asan_schedule_unregister_globals is unused. Moving it outside the anonymous namespace gets rid of that warning.

Reviewers: rnk, timurrrr

Subscribers: kubabrecka, dberris

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

llvm-svn: 285010

7 years ago[WebAssembly] Add an option to make get_local/set_local explicit.
Dan Gohman [Mon, 24 Oct 2016 19:49:43 +0000 (19:49 +0000)]
[WebAssembly] Add an option to make get_local/set_local explicit.

This patch adds a pass, controlled by an option and off by default for
now, for making implicit get_local/set_local explicit. This simplifies
emitting wasm with MC.

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

llvm-svn: 285009

7 years agoMerge two if conditions into one. NFCI.
Davide Italiano [Mon, 24 Oct 2016 19:41:47 +0000 (19:41 +0000)]
Merge two if conditions into one. NFCI.

llvm-svn: 285008

7 years agoRevert "Add support for __builtin_os_log_format[_buffer_size]"
Mehdi Amini [Mon, 24 Oct 2016 19:41:36 +0000 (19:41 +0000)]
Revert "Add support for __builtin_os_log_format[_buffer_size]"

This reverts commit r284990, two opencl test are broken

llvm-svn: 285007

7 years agoTarget: Change various section classifiers in TargetLoweringObjectFile to take a...
Peter Collingbourne [Mon, 24 Oct 2016 19:23:39 +0000 (19:23 +0000)]
Target: Change various section classifiers in TargetLoweringObjectFile to take a GlobalObject.

These functions are about classifying a global which will actually be
emitted, so it does not make sense for them to take a GlobalValue which may
for example be an alias.

Change the Mach-O object writer and the Hexagon, Lanai and MIPS backends to
look through aliases before using TargetLoweringObjectFile interfaces. These
are functional changes but all appear to be bug fixes.

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

llvm-svn: 285006

7 years ago[x86] add tests for {-1,0,1} select of constants
Sanjay Patel [Mon, 24 Oct 2016 19:13:29 +0000 (19:13 +0000)]
[x86] add tests for {-1,0,1} select of constants

llvm-svn: 285005

7 years ago[asan] relax strstr tests.
Tim Northover [Mon, 24 Oct 2016 19:07:27 +0000 (19:07 +0000)]
[asan] relax strstr tests.

Darwin's implementation of strstr seems to trigger slightly different failure
modes from Linux since it calls strncmp. All messages seem about equally useful
and correct, so I relaxed the tests so Darwin can pass.

llvm-svn: 285004

7 years ago[llvm] Remove redundant --check-prefix=CHECK from tests
Mandeep Singh Grang [Mon, 24 Oct 2016 18:57:55 +0000 (18:57 +0000)]
[llvm] Remove redundant --check-prefix=CHECK from tests

Reviewers: MatzeB, mcrosier, rengolin

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

llvm-svn: 285003

7 years agoCodeGen: Do not add a global's address space to the folding set profile.
Peter Collingbourne [Mon, 24 Oct 2016 18:56:09 +0000 (18:56 +0000)]
CodeGen: Do not add a global's address space to the folding set profile.

It is already part of the type (which is part of the global, which is already
being added), so there's no need to do it.

llvm-svn: 285002

7 years ago[clang] Remove redundant --check-prefix=CHECK from tests
Mandeep Singh Grang [Mon, 24 Oct 2016 18:53:43 +0000 (18:53 +0000)]
[clang] Remove redundant --check-prefix=CHECK from tests

Reviewers: mkuper, rengolin, hans

Subscribers: cfe-commits

Tags: #clang-c

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

llvm-svn: 285001

7 years ago[analyzer] Use unsigned integers to rely on well-defined overflow semantics.
Artem Dergachev [Mon, 24 Oct 2016 18:49:04 +0000 (18:49 +0000)]
[analyzer] Use unsigned integers to rely on well-defined overflow semantics.

Found by the UBSan buildbot.

llvm-svn: 285000

7 years agoFix crash if StmtProfile finds a type-dependent member access for which we have
Richard Smith [Mon, 24 Oct 2016 18:47:04 +0000 (18:47 +0000)]
Fix crash if StmtProfile finds a type-dependent member access for which we have
resolved the -> to a call to a specific operator-> function. The particular
test case added here is actually being mishandled: the implicit member access
should not be type-dependent (because it's accessing a non-type-dependent
member of the current instantiation), but calls to a type-dependent operator->
that is a member of the current instantiation would be liable to hit the same
codepath.

llvm-svn: 284999

7 years agoadd-discriminators: Fix handling of lexical scopes.
Adrian Prantl [Mon, 24 Oct 2016 18:23:51 +0000 (18:23 +0000)]
add-discriminators: Fix handling of lexical scopes.

This fixes a bug in the handling of lexical scopes, when more than one
scope is defined on the same line or functions are inlined into call
sites that are on the same line as the function definition. This
situation can easily happen in macro expansions.

The problem is solved by introducing a SmallDenseMap<DIScope *,
DILexicalBlockFile *, 1> that keeps track of all the different lexical
scopes that share a line/file location.

Fixes PR30681.

llvm-svn: 284998

7 years agoClarify that MSVC is not the issue here anymore.
Benjamin Kramer [Mon, 24 Oct 2016 18:11:05 +0000 (18:11 +0000)]
Clarify that MSVC is not the issue here anymore.

llvm-svn: 284997

7 years agoRevert r284972 and remove other defaulted copy/move constructors/=
Krzysztof Parzyszek [Mon, 24 Oct 2016 17:40:46 +0000 (17:40 +0000)]
Revert r284972 and remove other defaulted copy/move constructors/=

David Blaikie pointed out that we get them for free without having to
write anything.

llvm-svn: 284996

7 years ago[PPC] Generate positive FP zero using xor insn instead of loading from constant area
Ehsan Amiri [Mon, 24 Oct 2016 17:31:09 +0000 (17:31 +0000)]
[PPC] Generate positive FP zero using xor insn instead of loading from constant area

https://reviews.llvm.org/D23614

Currently we load +0.0 from constant area. That can change to be generated using
XOR instruction.

llvm-svn: 284995

7 years agoReleaseNotes: mention new compiler requirements
Hans Wennborg [Mon, 24 Oct 2016 17:29:52 +0000 (17:29 +0000)]
ReleaseNotes: mention new compiler requirements

llvm-svn: 284994

7 years agoRevert r284580+r284917. ("Synthesize TBB/TBH instructions")
Eli Friedman [Mon, 24 Oct 2016 17:20:50 +0000 (17:20 +0000)]
Revert r284580+r284917. ("Synthesize TBB/TBH instructions")

The optimization has correctness issues, so reverting for now to fix tests
on thumb1 targets.

llvm-svn: 284993

7 years ago[clang-tidy] Fix identifier naming in macro args.
Jason Henline [Mon, 24 Oct 2016 17:20:32 +0000 (17:20 +0000)]
[clang-tidy] Fix identifier naming in macro args.

Summary:
clang-tidy should fix identifier naming even when the identifier is
referenced inside a macro expansion, provided that the identifier enters
the macro expansion completely within a macro argument.

For example, this will allow fixes to the naming of the identifier
'global' when it is declared and used as follows:

  int global;
  #define USE_IN_MACRO(m) auto use_##m = m
  USE_IN_MACRO(global);

Reviewers: alexfh

Subscribers: jlebar, cfe-commits

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

llvm-svn: 284992

7 years agoRemoved FIXME from include ordering comment
Simon Pilgrim [Mon, 24 Oct 2016 17:15:05 +0000 (17:15 +0000)]
Removed FIXME from include ordering comment

Nothing to fix, it's just the way it has to be.

llvm-svn: 284991

7 years agoAdd support for __builtin_os_log_format[_buffer_size]
Mehdi Amini [Mon, 24 Oct 2016 16:56:23 +0000 (16:56 +0000)]
Add support for __builtin_os_log_format[_buffer_size]

These new builtins support a mechanism for logging OS events, using a
printf-like format string to specify the layout of data in a buffer.
The _buffer_size version of the builtin can be used to determine the size
of the buffer to allocate to hold the data, and then __builtin_os_log_format
can write data into that buffer. This implements format checking to report
mismatches between the format string and the data arguments. Most of this
code was written by Chris Willmore.

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

llvm-svn: 284990

7 years agoCheck the number of Args in LibCallsShrinkWrap.
Rong Xu [Mon, 24 Oct 2016 16:50:12 +0000 (16:50 +0000)]
Check the number of Args in LibCallsShrinkWrap.

Some library fucntions can have no argument.

llvm-svn: 284989

7 years agoFix clang-format vim integration issue with non-ascii characters
Alexander Kornienko [Mon, 24 Oct 2016 16:31:26 +0000 (16:31 +0000)]
Fix clang-format vim integration issue with non-ascii characters

clang-format.py currently seems to treat vim.current.buf as ascii-encoded data,
which leads to an UnicodeDecodeError when trying to format any text containing
non-ascii characters:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File ".../tools/clang/tools/clang-format/clang-format.py", line 110, in <module>
    main()
  File ".../tools/clang/tools/clang-format/clang-format.py", line 87, in main
    stdout, stderr = p.communicate(input=text.encode(encoding))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 3996: ordinal not in range(128)

llvm-svn: 284988

7 years agoUse shorter names in TestConcurrentEvents tests
Pavel Labath [Mon, 24 Oct 2016 16:20:43 +0000 (16:20 +0000)]
Use shorter names in TestConcurrentEvents tests

Otherwise, they tend to generate filename too long errors.

They already contain the same test name in the directory, file, and class names,
so no information is really lost here.

llvm-svn: 284987

7 years ago[AArch64] Optionally use the Newton series for reciprocal estimation
Evandro Menezes [Mon, 24 Oct 2016 16:14:58 +0000 (16:14 +0000)]
[AArch64] Optionally use the Newton series for reciprocal estimation

Add support for estimating the square root or its reciprocal and division or
reciprocal using the combiner generic Newton series.

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

llvm-svn: 284986

7 years ago[ADT] static_assert that SmallDenseMap is instantiated with a power-of-two number...
Justin Lebar [Mon, 24 Oct 2016 16:06:53 +0000 (16:06 +0000)]
[ADT] static_assert that SmallDenseMap is instantiated with a power-of-two number of inline buckets.

Summary:
If you try to instantiate it with a non-power-of-two buckets, DenseMap
will assert at runtime (!) if we ever outgrow our inline storage.

I believe using a constexpr function inside of a static_assert is safe
now that we've unsupported MSVC 2013 and GCC < 4.8.

Reviewers: bkramer, qcolombet, escha

Subscribers: llvm-commits

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

llvm-svn: 284985

7 years ago[EarlyCSE] Optimize MemoryPhis and reduce memory clobber queries w/ MemorySSA
Geoff Berry [Mon, 24 Oct 2016 15:54:00 +0000 (15:54 +0000)]
[EarlyCSE] Optimize MemoryPhis and reduce memory clobber queries w/ MemorySSA

Summary:
When using MemorySSA, re-optimize MemoryPhis when removing a store since
this may create MemoryPhis with all identical arguments.

Also, when using MemorySSA to check if two MemoryUses are reading from
the same version of the heap, use the defining access instead of calling
getClobberingAccess, since the latter can currently result in many more
AA calls.  Once the MemorySSA use optimization tracking changes are
done, we can remove this limitation, which should result in more loads
being CSE'd.

Reviewers: dberlin

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 284984

7 years ago[PPC] Better codegen for AND, ANY_EXT, SRL sequence
Ehsan Amiri [Mon, 24 Oct 2016 15:46:58 +0000 (15:46 +0000)]
[PPC] Better codegen for AND, ANY_EXT, SRL sequence

https://reviews.llvm.org/D24924

This improves the code generated for a sequence of AND, ANY_EXT, SRL instructions. This is a targetted fix for this special pattern. The pattern is generated by target independet dag combiner and so a more general fix may not be necessary. If we come across other similar cases, some ideas for handling it are discussed on the code review.

llvm-svn: 284983

7 years ago[x86] regenerate checks
Sanjay Patel [Mon, 24 Oct 2016 15:43:40 +0000 (15:43 +0000)]
[x86] regenerate checks

llvm-svn: 284982

7 years agoFix arm64 sub-register definitions
Pavel Labath [Mon, 24 Oct 2016 14:57:50 +0000 (14:57 +0000)]
Fix arm64 sub-register definitions

The "value regs" field was filled incorrectly. It is supposed to list the
registers that *this* register is a sub-register of, not the other way around.
This manifested itself in "register read" showing only the smaller sub-registers
(and a bunch of tests not passing). I am not sure if the "invalidates" field is
correct either, but it's usage seems to be inconsistent, so I'll leave that as-is
for now.

llvm-svn: 284981

7 years agoAMDGPU: Fix Two Address problems with v_movreld
Nicolai Haehnle [Mon, 24 Oct 2016 14:56:02 +0000 (14:56 +0000)]
AMDGPU: Fix Two Address problems with v_movreld

Summary:
The v_movreld machine instruction is used with three operands that are
in a sense tied to each other (the explicit VGPR_32 def and the implicit
VGPR_NN def and use). There is no way to express that using the currently
available operand bits, and indeed there are cases where the Two Address
instructions pass does the wrong thing.

This patch introduces a new set of pseudo instructions that are identical
in intended semantics as v_movreld, but they only have two tied operands.

Having to add a new set of pseudo instructions is admittedly annoying, but
it's a fairly straightforward and solid approach. The only alternative I
see is to try to teach the Two Address instructions pass about Three Address
instructions, and I'm afraid that's trickier and is going to end up more
fragile.

Note that v_movrels does not suffer from this problem, and so this patch
does not touch it.

This fixes several GL45-CTS.shaders.indexing.* tests.

Reviewers: tstellarAMD, arsenm

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

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

llvm-svn: 284980

7 years agoRevert 284971.
Nico Weber [Mon, 24 Oct 2016 14:52:04 +0000 (14:52 +0000)]
Revert 284971.

It seems to break selfhost on some bots, see e.g.
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/21
http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/20
http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/22

llvm-svn: 284979

7 years ago[MC] Fix Various End Of Line Comment checkings
Nirav Dave [Mon, 24 Oct 2016 14:35:29 +0000 (14:35 +0000)]
[MC] Fix Various End Of Line Comment checkings

Fix AsmParser lines to correctly handle end-of-line pre-processor
comments parsing when '#' is not the assembly line comment prefix.

Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 284978

7 years ago[Chrono] Fix !HAVE_FUTIMENS build
Pavel Labath [Mon, 24 Oct 2016 14:19:28 +0000 (14:19 +0000)]
[Chrono] Fix !HAVE_FUTIMENS build

If we don't have futimens(), we fall back to futimes(), which only supports
microsecond timestamps. In that case, we need to explicitly cast away the extra
precision in setLastModificationAndAccessTime().

llvm-svn: 284977

7 years agoReformat RegisterInfos_arm64 into a table. NFC
Pavel Labath [Mon, 24 Oct 2016 14:01:52 +0000 (14:01 +0000)]
Reformat RegisterInfos_arm64 into a table. NFC

llvm-svn: 284976

7 years agoRemove unused #includes of TimeValue.h. NFC.
Pavel Labath [Mon, 24 Oct 2016 14:00:26 +0000 (14:00 +0000)]
Remove unused #includes of TimeValue.h. NFC.

llvm-svn: 284975

7 years ago[Object] Replace TimeValue with std::chrono
Pavel Labath [Mon, 24 Oct 2016 13:38:27 +0000 (13:38 +0000)]
[Object] Replace TimeValue with std::chrono

Summary:
Most of the changes are very straight-forward. The only choice I had to make was
to use second-precision time points in the Archive classes. I did this because
the archive files use that precision in the on-disk representation anyway.

Reviewers: rafael, zturner

Subscribers: llvm-commits

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

llvm-svn: 284974