platform/upstream/llvm.git
8 years agoFix CodeCompletion & TypoCorrection when combining a PCH with Modules
Ben Langmuir [Wed, 4 May 2016 00:53:13 +0000 (00:53 +0000)]
Fix CodeCompletion & TypoCorrection when combining a PCH with Modules

This commit fixes the IdentifierIterator to actually include identifiers
from a PCH or precompiled preamble when there is also a global module
index. This was causing code-completion (outside of C++) and
typo-correction to be missing global identifiers defined in the
PCH/preamble. Typo-correction has been broken since we first started
using the module index, whereas code-completion only started relying on
identifier iterator in r232793.

rdar://problem/25642879

llvm-svn: 268471

8 years ago[X86] Lower zext i1 arguments
David Majnemer [Wed, 4 May 2016 00:22:23 +0000 (00:22 +0000)]
[X86] Lower zext i1 arguments

i1 is now a legal type for X86 with AVX512.
There were some paths in X86FastISel which were not quite ready to see
an i1 value: they were not quite sure how to deal with sign/zero extends
for call arguments.
DTRT by extending to i8 for zeroext and bailing out of FastISel for
signext.

This fixes PR27591.

llvm-svn: 268470

8 years agoRemove (unused) "using namespace llvm;" in Support header. This caused the modules...
Richard Smith [Wed, 4 May 2016 00:21:33 +0000 (00:21 +0000)]
Remove (unused) "using namespace llvm;" in Support header. This caused the modules build to break.

llvm-svn: 268469

8 years ago[GlobalDCE, Misc] Don't remove functions referenced by ifuncs
David Majnemer [Wed, 4 May 2016 00:20:48 +0000 (00:20 +0000)]
[GlobalDCE, Misc] Don't remove functions referenced by ifuncs

We forgot to consider the target of ifuncs when considering if a
function was alive or dead.

N.B. Also update a few auxiliary tools like bugpoint and
verify-uselistorder.

This fixes PR27593.

llvm-svn: 268468

8 years agoYou have to call setHasLoadedFieldsFromExternalStorage AFTER calling
Jim Ingham [Wed, 4 May 2016 00:06:23 +0000 (00:06 +0000)]
You have to call setHasLoadedFieldsFromExternalStorage AFTER calling
the field_begin that starts the copy or it won't do anything.

This causes failures, but only in complex apps, I haven't found
a reduced test case for this yet.

<rdar://problem/21951798>

llvm-svn: 268467

8 years ago[sanitizer] Move stat/__xstat to the common interceptors
Mike Aizatsky [Tue, 3 May 2016 23:43:45 +0000 (23:43 +0000)]
[sanitizer] Move stat/__xstat to the common interceptors

Summary:
Adds stat/__xstat to the common interceptors.

Removes the now-duplicate stat/__xstat interceptor from msan/tsan/esan.
This adds stat/__xstat to asan, which previously did not intercept it.

Resubmit of http://reviews.llvm.org/D19875 with win build fixes.

Reviewers: aizatsky, eugenis

Subscribers: tberghammer, llvm-commits, danalbert, vitalybuka, bruening, srhines, kubabrecka, kcc

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

llvm-svn: 268466

8 years ago[Support] Add a free toString function for Error
Vedant Kumar [Tue, 3 May 2016 23:32:31 +0000 (23:32 +0000)]
[Support] Add a free toString function for Error

toString() consumes an Error and returns a string representation of its
contents. This commit also adds a message() method to ErrorInfoBase for
convenience.

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

llvm-svn: 268465

8 years agollvm-pdbdump: Update libdeps.
NAKAMURA Takumi [Tue, 3 May 2016 23:25:47 +0000 (23:25 +0000)]
llvm-pdbdump: Update libdeps.

llvm-svn: 268464

8 years agoProduce another specific error message for a malformed Mach-O file when a load
Kevin Enderby [Tue, 3 May 2016 23:13:50 +0000 (23:13 +0000)]
Produce another specific error message for a malformed Mach-O file when a load
command has a size less than 8 bytes.

I think the existing test case in test/Object/macho-invalid.test for
macho64-invalid-too-small-load-command was trying to test for this but that
test case triggered a different error given how it was constructed.  So I
constructed a new test case that would trigger this specific error.

I also changed the error message to be consistent with the other malformed Mach-O
file error messages.  I also removed object_error::macho_small_load_command from
Object/Error.h as it is not needed and can just use object_error::parse_failed
and let the error message string distinguish the error.

llvm-svn: 268463

8 years agoNFC remove unneded spaces (test commit)
Paul Osmialowski [Tue, 3 May 2016 23:10:20 +0000 (23:10 +0000)]
NFC remove unneded spaces (test commit)

llvm-svn: 268462

8 years ago[clang-tidy] MoveConstructorInitCheck - Add parameter name to check message.
Felix Berger [Tue, 3 May 2016 23:07:44 +0000 (23:07 +0000)]
[clang-tidy] MoveConstructorInitCheck - Add parameter name to check message.

Reviewers: alexfh

Subscribers: aaron.ballman, cfe-commits

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

llvm-svn: 268461

8 years ago[modules][debuginfo] Only include imported modules when targeting LLDB
David Blaikie [Tue, 3 May 2016 23:06:40 +0000 (23:06 +0000)]
[modules][debuginfo] Only include imported modules when targeting LLDB

These constructs are only applicable to a debugger capable of loading a
Clang AST, so omit them for brevity when not doing so.

We could potentially propagate more of CodeGenOptions through the
ObjectFilePCGContainerOperations for consistency (so the next person who
adds some CodeGenOpts feature that tweaks debug info output doesn't get
caught by this), so I'm open to objections/alternatives there, but went
with this for now.

Tested just a couple of basic cases (one direct, one indirect (through
the ObjectFilePCHContainerOperations) & fixed up other cases to pass the
-debugger-tuning flag as appropriate.

llvm-svn: 268460

8 years agoUpdate version numbers in docs
Eric Fiselier [Tue, 3 May 2016 22:50:33 +0000 (22:50 +0000)]
Update version numbers in docs

llvm-svn: 268459

8 years agoFix template type deduction error on some compilers.
Zachary Turner [Tue, 3 May 2016 22:37:12 +0000 (22:37 +0000)]
Fix template type deduction error on some compilers.

llvm-svn: 268458

8 years agoAdd opt-bisect support to additional passes that can be skipped
Andrew Kaylor [Tue, 3 May 2016 22:32:30 +0000 (22:32 +0000)]
Add opt-bisect support to additional passes that can be skipped

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

llvm-svn: 268457

8 years agoAdd documentation for new experimental library
Eric Fiselier [Tue, 3 May 2016 22:32:08 +0000 (22:32 +0000)]
Add documentation for new experimental library

llvm-svn: 268456

8 years agoRemove unused variable.
Zachary Turner [Tue, 3 May 2016 22:26:46 +0000 (22:26 +0000)]
Remove unused variable.

llvm-svn: 268455

8 years agoMove CodeViewTypeStream to DebugInfo/CodeView
Zachary Turner [Tue, 3 May 2016 22:18:17 +0000 (22:18 +0000)]
Move CodeViewTypeStream to DebugInfo/CodeView

Ability to parse codeview type streams is also needed by
DebugInfoPDB for parsing PDBs, so moving this into a library
gives us this option.  Since DebugInfoPDB had already hand
rolled some code to do this, that code is now convereted over
to using this common abstraction.

Differential Revision: http://reviews.llvm.org/D19887
Reviewed By: dblaikie, amccarth

llvm-svn: 268454

8 years ago[scan-build] fix dead store warnings emitted on clang code base
David Blaikie [Tue, 3 May 2016 22:14:14 +0000 (22:14 +0000)]
[scan-build] fix dead store warnings emitted on clang code base

This fixes dead store warnings of the type "dead assignment" reported
by CLang Static Analyzer on the following file:

- tools/c-index-test/c-index-test.c.

Patch by Apelete Seketeli <apelete@seketeli.net>!

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

llvm-svn: 268453

8 years agoPM: Port LoopRotation to the new loop pass manager
Justin Bogner [Tue, 3 May 2016 22:02:31 +0000 (22:02 +0000)]
PM: Port LoopRotation to the new loop pass manager

llvm-svn: 268452

8 years agoMake check-libcxx dependant on libc++experimental if present.
Eric Fiselier [Tue, 3 May 2016 21:58:07 +0000 (21:58 +0000)]
Make check-libcxx dependant on libc++experimental if present.

llvm-svn: 268451

8 years ago[X86][XOP] Add placeholder VPERMIL2 combining tests
Simon Pilgrim [Tue, 3 May 2016 21:55:37 +0000 (21:55 +0000)]
[X86][XOP] Add placeholder VPERMIL2 combining tests

llvm-svn: 268450

8 years agoRevert "[sanitizer] Move stat/__xstat to the common interceptors"
Mike Aizatsky [Tue, 3 May 2016 21:49:56 +0000 (21:49 +0000)]
Revert "[sanitizer] Move stat/__xstat to the common interceptors"

This reverts commit 268440 because it breaks the windows bot.

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/21425/steps/build%20compiler-rt/logs/stdio

llvm-svn: 268448

8 years agoPM: Port LoopSimplifyCFG to the new pass manager
Justin Bogner [Tue, 3 May 2016 21:47:32 +0000 (21:47 +0000)]
PM: Port LoopSimplifyCFG to the new pass manager

llvm-svn: 268446

8 years ago[X86] Tidied up SDValue's SDNode referencing. NFCI.
Simon Pilgrim [Tue, 3 May 2016 21:44:45 +0000 (21:44 +0000)]
[X86] Tidied up SDValue's SDNode referencing. NFCI.

llvm-svn: 268445

8 years agoPM: Check that loop passes preserve a basic set of analyses
Justin Bogner [Tue, 3 May 2016 21:35:08 +0000 (21:35 +0000)]
PM: Check that loop passes preserve a basic set of analyses

A loop pass that didn't preserve this entire set of passes wouldn't
play well with other loop passes, since these are generally a basic
requirement to do any interesting transformations to a loop.

Adds a helper to get the set of analyses a loop pass should preserve,
and checks that any loop pass we run satisfies the requirement.

llvm-svn: 268444

8 years agoCreate new library 'libc++experimental.a' for packaging TS symbols.
Eric Fiselier [Tue, 3 May 2016 21:30:18 +0000 (21:30 +0000)]
Create new library 'libc++experimental.a' for packaging TS symbols.

Summary:
Out-of-line symbols for <experimental/...> headers are not ABI or API stable and cannot live in the 'libc++.dylib'. Currently they have nowhere to live. I would like to add a new library target `libc++experimental.a` to fix this.

Previously I had suggested different libraries for different TS's (`libc++filesystem.a`, 'libc++LFTS.a`, ect). I no longer think this is the right approach.
Instead `c++experimental` will hold *all* TS implementations as a single monolithic library. I see two main benefits to this:

1. Users only have to know about and manually link one library.
2. It makes it easy to implement TS's with one or two out-of-line symbols. (Ex. PMRs)

`c++experimental` provides NO ABI compatibility. Symbols can freely be added/removed/changed without concern for ABI stability.
I will add documentation for this after landing this patch (but before adding anything to it).

`c++experimental` only builds as a static library. By default CMake will build/test this library but will *NOT* install it.

This patch adds the CMake and LIT logic needed to build/test the new library. Once this lands I plan on using it to implement parts of `<experimental/memory_resource>`.

Reviewers: mclow.lists

Subscribers: cfe-commits, theraven, krememek, dexonsmith, bcraig, beanz, danalbert

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

llvm-svn: 268443

8 years ago[IPO/ConstantMerge] Garbage collect dead code. NFC.
Davide Italiano [Tue, 3 May 2016 21:30:10 +0000 (21:30 +0000)]
[IPO/ConstantMerge] Garbage collect dead code. NFC.

llvm-svn: 268442

8 years agoDisable LLVM_ENABLE_TIMESTAMPS by default
Chris Bieneman [Tue, 3 May 2016 21:22:14 +0000 (21:22 +0000)]
Disable LLVM_ENABLE_TIMESTAMPS by default

This change is based on the discussion from http://lists.llvm.org/pipermail/llvm-dev/2016-May/098990.html.

The goal is to make the default LLVM configuration build deterministically.

llvm-svn: 268441

8 years ago[sanitizer] Move stat/__xstat to the common interceptors
Mike Aizatsky [Tue, 3 May 2016 21:22:06 +0000 (21:22 +0000)]
[sanitizer] Move stat/__xstat to the common interceptors

Summary:
Adds stat/__xstat to the common interceptors.

Removes the now-duplicate stat/__xstat interceptor from msan/tsan/esan.
This adds stat/__xstat to asan, which previously did not intercept it.

Reviewers: aizatsky, eugenis

Subscribers: tberghammer, danalbert, srhines, kubabrecka, llvm-commits, vitalybuka, eugenis, kcc, bruening

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

llvm-svn: 268440

8 years ago[Support] Drop template line in favor of 'inline'
Vedant Kumar [Tue, 3 May 2016 21:04:42 +0000 (21:04 +0000)]
[Support] Drop template line in favor of 'inline'

Reviewed-by: lhames
llvm-svn: 268438

8 years agoX86-Darwin: start emitting data-region directives for jump-tables.
Tim Northover [Tue, 3 May 2016 21:03:41 +0000 (21:03 +0000)]
X86-Darwin: start emitting data-region directives for jump-tables.

The surrounding tools can cope these days, and they were invented for a reason.

llvm-svn: 268437

8 years ago[RS4GC] Add a test case around calling conventions; NFC
Sanjoy Das [Tue, 3 May 2016 20:58:10 +0000 (20:58 +0000)]
[RS4GC] Add a test case around calling conventions; NFC

llvm-svn: 268436

8 years agoImplement --build-id=none.
Rafael Espindola [Tue, 3 May 2016 20:55:47 +0000 (20:55 +0000)]
Implement --build-id=none.

Both bfd and gold have this. It allows disabling build-id when it is the
default with by adding -Wl,--build-id=none no the clang command line.

llvm-svn: 268435

8 years ago[ADT] Add drop_front method to ArrayRef
Reid Kleckner [Tue, 3 May 2016 20:53:20 +0000 (20:53 +0000)]
[ADT] Add drop_front method to ArrayRef

We have it for StringRef but not ArrayRef, and ArrayRef has drop_back,
so I see no reason it shouldn't have drop_front. Splitting this out of a
change that I have that will use this funcitonality.

llvm-svn: 268434

8 years agoAdded a testcase for the ptr_refs tool so we catch if it stops working.
Sean Callanan [Tue, 3 May 2016 20:36:06 +0000 (20:36 +0000)]
Added a testcase for the ptr_refs tool so we catch if it stops working.

llvm-svn: 268433

8 years agoAdd address space 258 (X86 SS segment) to clang documentation.
David L Kreitzer [Tue, 3 May 2016 20:20:59 +0000 (20:20 +0000)]
Add address space 258 (X86 SS segment) to clang documentation.
The change reflects llvm r268431.

Patch by Michael Lemay (michael.lemay@intel.com)

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

llvm-svn: 268432

8 years agoAdd an address space for the X86 SS segment.
David L Kreitzer [Tue, 3 May 2016 20:16:08 +0000 (20:16 +0000)]
Add an address space for the X86 SS segment.

Patch by Michael LeMay (michael.lemay@intel.com)

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

llvm-svn: 268431

8 years ago[clang-tidy] Speedup misc-static-assert.
Samuel Benzaquen [Tue, 3 May 2016 20:11:09 +0000 (20:11 +0000)]
[clang-tidy] Speedup misc-static-assert.

Summary:
Speedup the misc-static-assert check by not use `stmt()` as the toplevel matcher.
The framework runs a filter on the matchers before trying them on each node and
uses the toplevel type for this.
Using `stmt()` as the toplevel causes the matcher to be run on every `Stmt` node,
even if the node doesn't match the desired types.

This change speeds up clang-tidy by ~5% in a benchmark.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 268430

8 years ago[IPO/IPCP] Convert to use static functions. NFC.
Davide Italiano [Tue, 3 May 2016 20:08:24 +0000 (20:08 +0000)]
[IPO/IPCP] Convert to use static functions. NFC.

In preparation for porting this pass to the new PM.

llvm-svn: 268429

8 years ago[ProfileData] Propagate an error from InstrProfSymtab
Vedant Kumar [Tue, 3 May 2016 20:01:01 +0000 (20:01 +0000)]
[ProfileData] Propagate an error from InstrProfSymtab

CovMapFuncReader::get should propagate up errors from InstrProfSymtab.

This is part of a series of patches to transition ProfileData over to
the stricter Error/Expected interface.

llvm-svn: 268428

8 years ago[CMake] NFC. Add support for testing the compiler without testing the linker
Chris Bieneman [Tue, 3 May 2016 19:48:11 +0000 (19:48 +0000)]
[CMake] NFC. Add support for testing the compiler without testing the linker

Summary:
One of the big limitations we have in the compiler-rt build system today is that we cannot bootstrap building the builtins because you need a fully functional toolchain to pass CMake's tests.

This change adds support for compile only tests.

It is NFC because nothing is using the compile-only tests yet.

I believe this is the last separable part of D16653.

Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 268427

8 years ago[esan] Use do-while rather than braces for empty interceptors
Derek Bruening [Tue, 3 May 2016 19:44:32 +0000 (19:44 +0000)]
[esan] Use do-while rather than braces for empty interceptors

Summary:
Replaces {} with a do..while sequence in esan's empty interceptors to allow
natural use with a trailing semicolon.  The sequence uses each argument to
avoid warnings.

Reviewers: filcab

Subscribers: kubabrecka, llvm-commits, zhaoqin

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

llvm-svn: 268426

8 years ago[IPO/GlobalDCE] Port to the new pass manager.
Davide Italiano [Tue, 3 May 2016 19:39:15 +0000 (19:39 +0000)]
[IPO/GlobalDCE] Port to the new pass manager.

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

llvm-svn: 268425

8 years ago[SROA] Function canConvertValue needs to check whether both NewTy and OldTy pointers are
Jack Liu [Tue, 3 May 2016 19:30:48 +0000 (19:30 +0000)]
[SROA] Function canConvertValue needs to check whether both NewTy and OldTy pointers are
pointing to the same addr space. This can prevent SROA from creating a bitcast
between pointers with different addr spaces.

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

llvm-svn: 268424

8 years agoAArch64: fixup comment after change
Tim Northover [Tue, 3 May 2016 19:24:47 +0000 (19:24 +0000)]
AArch64: fixup comment after change

llvm-svn: 268423

8 years agoAArch64: simplify illegal vector check. NFC.
Tim Northover [Tue, 3 May 2016 19:22:41 +0000 (19:22 +0000)]
AArch64: simplify illegal vector check. NFC.

Use a utility function to check whether the number of elements is a power of 2
and drop the redundant upper limit (a 128-bit vector with more than 16 elements
would have each element < 8 bits, not possible).

llvm-svn: 268422

8 years agoRevert 268409 due to missing comment.
Jack Liu [Tue, 3 May 2016 19:15:02 +0000 (19:15 +0000)]
Revert 268409 due to missing comment.

llvm-svn: 268421

8 years ago[ProfileData] Assert NoError in CoverageMappingTest
Vedant Kumar [Tue, 3 May 2016 18:49:41 +0000 (18:49 +0000)]
[ProfileData] Assert NoError in CoverageMappingTest

Check for success values in the CoverageMappingTest unit test file.

This is part of a series of patches to transition ProfileData over to
the stricter Error/Expected interface.

llvm-svn: 268420

8 years agoFix use of LLVM IR names in lit test
Reid Kleckner [Tue, 3 May 2016 18:48:50 +0000 (18:48 +0000)]
Fix use of LLVM IR names in lit test

llvm-svn: 268419

8 years ago[MS] Pass CalleeDecl to adjustThisArgumentForVirtualFunctionCall
Reid Kleckner [Tue, 3 May 2016 18:44:29 +0000 (18:44 +0000)]
[MS] Pass CalleeDecl to adjustThisArgumentForVirtualFunctionCall

If we are devirtualizing, then we want to compute the 'this' adjustment
of the devirtualized target, not the adjustment of the base's method
definition, which is usually zero.

Fixes PR27621

llvm-svn: 268418

8 years ago[Reassociate] Remove unneeded constructor.
Davide Italiano [Tue, 3 May 2016 18:34:51 +0000 (18:34 +0000)]
[Reassociate] Remove unneeded constructor.

llvm-svn: 268417

8 years agoChange test to use regex instead of explicit value numbers. NFC.
Pete Cooper [Tue, 3 May 2016 18:32:01 +0000 (18:32 +0000)]
Change test to use regex instead of explicit value numbers.  NFC.

We were seeing an internal failure when running this test.  I can't
see a good reason for the difference, but the simple fix is to use
%{{.*}} instead of %1.

llvm-svn: 268416

8 years ago[ExecutionEngine] Add comment explainging that ExecutionEngine::addGlobalMapping
Lang Hames [Tue, 3 May 2016 18:19:35 +0000 (18:19 +0000)]
[ExecutionEngine] Add comment explainging that ExecutionEngine::addGlobalMapping
can only be used on named values.

https://llvm.org/bugs/PR23497

llvm-svn: 268415

8 years ago[ImplicitNullChecks] Account for implicit-defs as well when updating the liveness.
Quentin Colombet [Tue, 3 May 2016 18:09:06 +0000 (18:09 +0000)]
[ImplicitNullChecks] Account for implicit-defs as well when updating the liveness.

The replaced load may have implicit-defs and those defs may be used
in the block of the original load. Make sure to update the liveness
accordingly.

This is a generalization of r267817.

llvm-svn: 268412

8 years agoELF: Fix regression in TLS attribute mismatch logic.
Peter Collingbourne [Tue, 3 May 2016 18:03:47 +0000 (18:03 +0000)]
ELF: Fix regression in TLS attribute mismatch logic.

Introduce a special symbol type to indicate that we have not yet seen a type
for the symbol, so we should not report TLS mismatches for that symbol.

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

llvm-svn: 268411

8 years agoCheck return value of addOptionalSynthetic before calling a member function on it.
Peter Collingbourne [Tue, 3 May 2016 18:03:45 +0000 (18:03 +0000)]
Check return value of addOptionalSynthetic before calling a member function on it.

Found with UBSan.

llvm-svn: 268410

8 years ago(no commit message)
Jack Liu [Tue, 3 May 2016 18:01:43 +0000 (18:01 +0000)]
(no commit message)

llvm-svn: 268409

8 years ago[LICM] Kill SCEV loop dispositions if needed
Sanjoy Das [Tue, 3 May 2016 17:50:11 +0000 (17:50 +0000)]
[LICM] Kill SCEV loop dispositions if needed

SCEV caches whether SCEV expressions are loop invariant, variant or
computable.  LICM breaks this cache, almost by definition; so clear the
SCEV disposition cache if LICM changed anything.

llvm-svn: 268408

8 years agoUse all_of instead of a raw loop; NFC
Sanjoy Das [Tue, 3 May 2016 17:50:06 +0000 (17:50 +0000)]
Use all_of instead of a raw loop; NFC

Added some tests despite being NFC, since it looks like nothing was
exercising the "all incoming values to exit PHIs are same" logic.

llvm-svn: 268407

8 years ago[LoopDeletion] Clear SCEV loop dispositions
Sanjoy Das [Tue, 3 May 2016 17:50:02 +0000 (17:50 +0000)]
[LoopDeletion] Clear SCEV loop dispositions

`Loop::makeLoopInvariant` can hoist instructions out of loops, so loop
dispositions for the loop it operated on may need to be cleared.  We can
be smarter here (especially around how `forgetLoopDispositions` is
implemented), but let's be correct first.

Fixes PR27570.

llvm-svn: 268406

8 years ago[SCEV] Tweak the output format and content of -analyze
Sanjoy Das [Tue, 3 May 2016 17:49:57 +0000 (17:49 +0000)]
[SCEV] Tweak the output format and content of -analyze

In the "LoopDispositions:" section:

 - Instead of printing out a list, print out a "dictionary" to make it
   obvious by inspection which disposition is for which loop.  This is
   just a cosmetic change.

 - Print dispositions for parent _and_ sibling loops.  I will use this
   to write a test case.

llvm-svn: 268405

8 years agoProduce cpio files for --reproduce.
Rafael Espindola [Tue, 3 May 2016 17:30:44 +0000 (17:30 +0000)]
Produce cpio files for --reproduce.

We want --reproduce to

* not rewrite scripts and thin archives
* work with absolute paths

Given that, it pretty much has to create a full directory tree. On windows that
is problematic because of the very short maximum path limit. On most cases
users can still work around it with "--repro c:\r", but that is annoying and
not viable for automated testing.

We then need to produce some form of archive with the files. The first option
that comes to mind is .a files since we already have code for writing them.
There are a few problems with them

The format has a dedicated string table, so we cannot start writing it until
all members are known.
Regular implementations don't support creating directories. We could make
llvm-ar support that, but that is probably not a good idea.
The next natural option would be tar. The problem is that to support long path
names (which is how this started) it needs a "pax extended header" making this
an annoying format to write.

The next option I looked at seems a natural fit: cpio files.

They are available on pretty much every unix, support directories and long path
names and are really easy to write. The only slightly annoying part is a
terminator, but at least gnu cpio only prints a warning if it is missing, which
is handy for crashes. This patch still makes an effort to always create it.

llvm-svn: 268404

8 years agoProduce another specific error message for a malformed Mach-O file when a load
Kevin Enderby [Tue, 3 May 2016 17:16:08 +0000 (17:16 +0000)]
Produce another specific error message for a malformed Mach-O file when a load
command other than the first one is past the end of the load commands.

This is like the test case in test/Object/macho-invalid.test for
macho64-invalid-incomplete-load-command but it is the second load command
that is past the end of all the load commands instead of the first.

The code in the constructor for MachOObjectFile that loops over the load
commands used getNextLoadCommandInfo() which was not producing
a good error message.  So that was fixed and a test case was added.

llvm-svn: 268403

8 years ago[ProfileData] Assert NoError in InstrProfTest
Vedant Kumar [Tue, 3 May 2016 17:07:06 +0000 (17:07 +0000)]
[ProfileData] Assert NoError in InstrProfTest

Check for success values in the InstrProfTest unit test file.

This is part of a series of patches to transition ProfileData over to
the stricter Error/Expected interface.

llvm-svn: 268402

8 years ago[CMake] Fix a copy-paste error
Chris Bieneman [Tue, 3 May 2016 16:54:20 +0000 (16:54 +0000)]
[CMake] Fix a copy-paste error

Based on post commit feedback from Eric Fiselier.

llvm-svn: 268401

8 years ago[ProfileData] Add error codes for compression failures
Vedant Kumar [Tue, 3 May 2016 16:53:17 +0000 (16:53 +0000)]
[ProfileData] Add error codes for compression failures

Be more specific in describing compression failures. Also, check for
this kind of error in emitNameData().

This is part of a series of patches to transition ProfileData over to
the stricter Error/Expected interface.

llvm-svn: 268400

8 years agoWin packaging script: include the OpenMP run-time
Hans Wennborg [Tue, 3 May 2016 16:43:40 +0000 (16:43 +0000)]
Win packaging script: include the OpenMP run-time

llvm-svn: 268398

8 years agoSplit out console and file writing cases in TestCommandScriptImmediateOutput
Francis Ricci [Tue, 3 May 2016 16:31:36 +0000 (16:31 +0000)]
Split out console and file writing cases in TestCommandScriptImmediateOutput

Summary:
As these are really testing separate issues, they should be run as separate
tests.

Reviewers: zturner, granata.enrico, clayborg

Subscribers: lldb-commits

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

llvm-svn: 268397

8 years agoAMDGPU/SI: Use range loops to simplify some code in the SI Scheduler
Tom Stellard [Tue, 3 May 2016 16:30:56 +0000 (16:30 +0000)]
AMDGPU/SI: Use range loops to simplify some code in the SI Scheduler

Reviewers: arsenm, axeldavy

Subscribers: MatzeB, arsenm, llvm-commits

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

llvm-svn: 268396

8 years agoMove "Eliminate Available Externally" immediately after the inliner
Mehdi Amini [Tue, 3 May 2016 15:46:00 +0000 (15:46 +0000)]
Move "Eliminate Available Externally" immediately after the inliner

This pass is supposed to reduce the size of the IR for compile time
purpose. We should run it ASAP, except when we prepare for LTO or
ThinLTO, and we want to keep them available for link-time inline.

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 268394

8 years agoProvide some default values for the ThinLTO Cache pruning
Mehdi Amini [Tue, 3 May 2016 15:17:50 +0000 (15:17 +0000)]
Provide some default values for the ThinLTO Cache pruning

This control how the cache is pruned. The cache still has to
be explicitely enabled/disabled by providing a path.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 268393

8 years agoSilence unused variable warning; NFC.
Aaron Ballman [Tue, 3 May 2016 15:17:25 +0000 (15:17 +0000)]
Silence unused variable warning; NFC.

llvm-svn: 268392

8 years ago[X86][SSE] Added target shuffle combine to MOVQ
Simon Pilgrim [Tue, 3 May 2016 15:05:13 +0000 (15:05 +0000)]
[X86][SSE] Added target shuffle combine to MOVQ

llvm-svn: 268391

8 years agoFold compares irrespective of whether allocation can be elided
Anna Thomas [Tue, 3 May 2016 14:58:21 +0000 (14:58 +0000)]
Fold compares irrespective of whether allocation can be elided

Summary
When a non-escaping pointer is compared to a global value, the
comparison can be folded even if the corresponding malloc/allocation
call cannot be elided.
We need to make sure the global value is not null, since comparisons to
null cannot be folded.

In future, we should also handle cases when the the comparison
instruction dominates the pointer escape.

Reviewers: sanjoy
Subscribers s.egerton, llvm-commits

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

llvm-svn: 268390

8 years ago[Sparc] Constification of TargetMachine arguments
James Y Knight [Tue, 3 May 2016 14:57:18 +0000 (14:57 +0000)]
[Sparc] Constification of TargetMachine arguments

This patch changes the TargetMachine arguments to be const. This is
required for {D19265}, and was requested to be done in a separate patch.

Patch by Jacob Hansen!

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

llvm-svn: 268389

8 years agoDon't depend on checking the response file when lld fails.
Rafael Espindola [Tue, 3 May 2016 14:29:42 +0000 (14:29 +0000)]
Don't depend on checking the response file when lld fails.

llvm-svn: 268388

8 years ago[clang][AVX512][BuiltIn] Adding intrinsics for cast{pd|ps|si}128_{pd|ps|si}512 and...
Michael Zuckerman [Tue, 3 May 2016 14:26:52 +0000 (14:26 +0000)]
[clang][AVX512][BuiltIn] Adding intrinsics for cast{pd|ps|si}128_{pd|ps|si}512 and castsi256_si512 instruction set

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

llvm-svn: 268387

8 years ago[mips][fastisel] ADJCALLSTACKUP has a second immediate operand.
Daniel Sanders [Tue, 3 May 2016 14:19:26 +0000 (14:19 +0000)]
[mips][fastisel] ADJCALLSTACKUP has a second immediate operand.

Summary:
It's always zero for SelectionDAG and is never read by the MIPS backend so
do the same for FastISel.

Reviewers: sdardis

Subscribers: dsanders, llvm-commits, sdardis

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

llvm-svn: 268386

8 years ago[Clang][avx512][Builtin] Adding intrinsics for cvtw2mask{128|256|512} instruction set
Michael Zuckerman [Tue, 3 May 2016 14:12:23 +0000 (14:12 +0000)]
[Clang][avx512][Builtin] Adding intrinsics for cvtw2mask{128|256|512} instruction set

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

llvm-svn: 268385

8 years agoRevert "Add a read_full_buffer argument to ConnectionFileDescriptor::Read"
Pavel Labath [Tue, 3 May 2016 14:07:41 +0000 (14:07 +0000)]
Revert "Add a read_full_buffer argument to ConnectionFileDescriptor::Read"

This reverts commit r268380 as it breaks windows build (I forgot to make neccesary adjustments to
ConnectionGenericFileWindows).

llvm-svn: 268384

8 years ago[mips] Fix unused variable warning for release builds introduced by r268379.
Daniel Sanders [Tue, 3 May 2016 14:00:37 +0000 (14:00 +0000)]
[mips] Fix unused variable warning for release builds introduced by r268379.

llvm-svn: 268383

8 years agotsan: update tsan_analyze to what tip clang generates
Dmitry Vyukov [Tue, 3 May 2016 13:59:41 +0000 (13:59 +0000)]
tsan: update tsan_analyze to what tip clang generates

We used to depend on host gcc. But some distributions got
new gcc recently which broke the check. Generally, we can't
depend that an arbitrary host gcc generates something stable.

Switch to clang.
This has an additional advantage of catching regressions in
clang codegen.

llvm-svn: 268382

8 years agoRemove unused includes.
Rafael Espindola [Tue, 3 May 2016 13:57:49 +0000 (13:57 +0000)]
Remove unused includes.

llvm-svn: 268381

8 years agoAdd a read_full_buffer argument to ConnectionFileDescriptor::Read
Pavel Labath [Tue, 3 May 2016 13:55:53 +0000 (13:55 +0000)]
Add a read_full_buffer argument to ConnectionFileDescriptor::Read

Summary:
AdbClient was attempting to handle the case where the socket input arrived in pieces, but it was
failing to handle the case where the connection was closed before that happened. In this case, it
would just spin in an infinite loop calling Connection::Read. (This was also the cause of the
spurious timeouts on the darwin->android buildbot. The exact cause of the premature EOF remains
to be investigated, but is likely a server bug.)

Since this wait-for-a-certain-number-of-bytes seems like a useful functionality to have, I am
moving it (with the infinite loop fixed) to the Connection class, and adding an
appropriate test for it.

Reviewers: clayborg, zturner, ovyalov

Subscribers: tberghammer, danalbert, lldb-commits

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

llvm-svn: 268380

8 years ago[mips] Use MipsMCExpr instead of MCSymbolRefExpr for all relocations.
Daniel Sanders [Tue, 3 May 2016 13:35:44 +0000 (13:35 +0000)]
[mips] Use MipsMCExpr instead of MCSymbolRefExpr for all relocations.

Summary:
This is much closer to the way MIPS relocation expressions work
(%hi(foo + 2) rather than %hi(foo) + 2) and removes the need for the
various bodges in MipsAsmParser::evaluateRelocExpr().

Removing those bodges ensures that the constant stored in MCValue is the
full 32 or 64-bit (depending on ABI) offset from the symbol. This will be used
to correct the %hi/%lo matching needed to sort the relocation table correctly.

As part of this:
* Gave MCExpr::print() the ability to omit parenthesis when emitting a
  symbol reference inside a MipsMCExpr operator like %hi(X). Without this
  we print things like %lo(($L1)).
* %hi(%neg(%gprel(X))) is now three MipsMCExpr's instead of one. Most of
  the related special cases have been removed or moved to MipsMCExpr. We
  can remove the rest as we gain support for the less common relocations
  when they are not part of this specific combination.
* Renamed MipsMCExpr::VariantKind and the enum prefix ('VK_') to avoid confusion
  with MCSymbolRefExpr::VariantKind and its prefix (also 'VK_').
* fixup_Mips_GOT_Local and fixup_Mips_GOT_Global were found to be identical
  and merged into fixup_Mips_GOT.
* MO_GOT16 and MO_GOT turned out to be identical and have been merged into
  MO_GOT.
* VK_Mips_GOT and VK_Mips_GOT16 turned out to be the same thing so they
  have been merged into MEK_GOT

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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

llvm-svn: 268379

8 years ago[X86][SSSE3] Missing combine opportunity to simplify to a MOVQ shuffle
Simon Pilgrim [Tue, 3 May 2016 13:12:44 +0000 (13:12 +0000)]
[X86][SSSE3] Missing combine opportunity to simplify to a MOVQ shuffle

llvm-svn: 268378

8 years ago[Clang][AVX512][Builtin] Adding intrinsics for vcvt{ph|ps}2{ps|ph} instruction set
Michael Zuckerman [Tue, 3 May 2016 12:45:04 +0000 (12:45 +0000)]
[Clang][AVX512][Builtin] Adding intrinsics for vcvt{ph|ps}2{ps|ph} instruction set

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

llvm-svn: 268376

8 years ago[AVX512] Add support for commutative MAX/MIN . In general VMAX{PS,PD} and VMIN{PS...
Igor Breger [Tue, 3 May 2016 11:51:45 +0000 (11:51 +0000)]
[AVX512] Add support for commutative MAX/MIN . In general VMAX{PS,PD} and VMIN{PS,PD} instruction are not commutative . In combine pass only if UnsafeFPMath are used VMAX/VMAX are converted to commutative nodes VMAXC/VMAXC.

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

llvm-svn: 268375

8 years agoFix cppcoreguidelines-pro-type-member-init failure test on Windows.
Haojian Wu [Tue, 3 May 2016 11:19:46 +0000 (11:19 +0000)]
Fix cppcoreguidelines-pro-type-member-init failure test on Windows.

llvm-svn: 268374

8 years ago[Clang][AVX512][Builtin] Adding intrinsics for vcvttpd2udq instruction set
Michael Zuckerman [Tue, 3 May 2016 11:05:24 +0000 (11:05 +0000)]
[Clang][AVX512][Builtin] Adding intrinsics for vcvttpd2udq instruction set

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

llvm-svn: 268373

8 years ago[Clang][AVX512][BUILTIN] Adding intrinsics for compressstore{df|di|sf|si} instruction...
Michael Zuckerman [Tue, 3 May 2016 10:42:46 +0000 (10:42 +0000)]
[Clang][AVX512][BUILTIN] Adding intrinsics for compressstore{df|di|sf|si} instruction set.

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

llvm-svn: 268372

8 years ago[include-fixer] Abstract includeFixerMain function.
Haojian Wu [Tue, 3 May 2016 08:38:35 +0000 (08:38 +0000)]
[include-fixer] Abstract includeFixerMain function.

llvm-svn: 268371

8 years agoMark that SpeculativeExecution preserves Globals Alias Analysis.
Kristof Beyls [Tue, 3 May 2016 08:33:26 +0000 (08:33 +0000)]
Mark that SpeculativeExecution preserves Globals Alias Analysis.

A few benchmarks with lots of accesses to global variables in the hot
loops regressed a lot since r266399, which added the
SpeculativeExecution pass to the default pipeline. The problem is that
this pass doesn't mark Globals Alias Analysis as preserved. Globals
Alias Analysis is computed in a module pass, whereas
SpeculativeExecution is a function pass, and a lot of passes dependent
on the Globals Alias Analysis to optimize these benchmarks are also
function passes. As such, the Globals Alias Analysis information cannot
be recomputed between SpeculativeExecution and the following function
passes needing that information.

SpeculativeExecution doesn't invalidate Globals Alias Analysis, so mark
it as such to fix those performance regressions.

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

llvm-svn: 268370

8 years agoFix a crash in cppcoreguidelines-pro-type-member-init when checking a class that...
Haojian Wu [Tue, 3 May 2016 08:11:47 +0000 (08:11 +0000)]
Fix a crash in cppcoreguidelines-pro-type-member-init when checking a class that initializes itself as a base

Summary: Fix a crash when a record type initializes itself in its own base class initializer list.

Patch by Michael Miller!

Reviewers: alexfh, aaron.ballman, hokein

Subscribers: cfe-commits

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

llvm-svn: 268369

8 years ago[AVX512] Fix lowerV4X128VectorShuffle to select correctly input operands .
Igor Breger [Tue, 3 May 2016 08:08:44 +0000 (08:08 +0000)]
[AVX512] Fix lowerV4X128VectorShuffle to select correctly input operands .

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

llvm-svn: 268368

8 years ago[lib/Object] Make this assertion more useful.
Davide Italiano [Tue, 3 May 2016 07:30:56 +0000 (07:30 +0000)]
[lib/Object] Make this assertion more useful.

llvm-svn: 268367

8 years ago[libclang] Expose the ElaboratedType
Sergey Kalinichev [Tue, 3 May 2016 06:58:29 +0000 (06:58 +0000)]
[libclang] Expose the ElaboratedType

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

llvm-svn: 268366

8 years ago[CodeGen] Add some space optimized forms of EmitNode and MorphNodeTo that implicitly...
Craig Topper [Tue, 3 May 2016 05:54:13 +0000 (05:54 +0000)]
[CodeGen] Add some space optimized forms of EmitNode and MorphNodeTo that implicitly indicate the number of result VTs. This shaves about 16K off the X86 matching table taking it down to about 470K.

Overall this reduces the llc binary size with all in-tree targets by about 40K.

llvm-svn: 268365

8 years ago[OpenCL] Fix pipe type dump.
Xiuli Pan [Tue, 3 May 2016 05:37:07 +0000 (05:37 +0000)]
[OpenCL] Fix pipe type dump.

Summary:
Fix the dump of PipeType.
Now we will have "pipe int" and element type.

Reviewers: yaxunl, Anastasia

Subscribers: cfe-commits, bader

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

llvm-svn: 268364