platform/upstream/llvm.git
8 years agoAdd a pointer to a source file to SymbolBody.
Rui Ueyama [Sun, 17 Jul 2016 03:11:46 +0000 (03:11 +0000)]
Add a pointer to a source file to SymbolBody.

Previously, each subclass of SymbolBody had a pointer to a source
file from which it was created. So, there was no single way to get
a source file for a symbol. We had getSourceFile<ELFT>(), but the
function was a bit inconvenient as it's a template.

This patch makes SymbolBody have a pointer to a source file.
If a symbol is not created from a file, the pointer has a nullptr.

llvm-svn: 275701

8 years agoDo not invoke FileCheck with `not` command.
Rui Ueyama [Sun, 17 Jul 2016 01:34:39 +0000 (01:34 +0000)]
Do not invoke FileCheck with `not` command.

We should use CHECK-NOT instead.

llvm-svn: 275700

8 years ago[CodeGen] Some assorted cleanups
David Majnemer [Sun, 17 Jul 2016 00:39:12 +0000 (00:39 +0000)]
[CodeGen] Some assorted cleanups

No functional change, just some cleanups:
- Use auto when it is appropriate.
- There were some strange static_casts which were superfluous.
- Use range-based for loops when appropriate.
- The dyn_cast_or_null construct was used when null was impossible.

llvm-svn: 275699

8 years ago[PM] Convert IVUsers analysis to new pass manager.
Dehao Chen [Sat, 16 Jul 2016 22:51:33 +0000 (22:51 +0000)]
[PM] Convert IVUsers analysis to new pass manager.

Summary: Convert IVUsers analysis to new pass manager.

Reviewers: davidxl, silvas

Subscribers: junbuml, sanjoy, llvm-commits, mzolotukhin

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

llvm-svn: 275698

8 years agoCodeGen: use StringRefs more in ObjC class generation, NFC
Saleem Abdulrasool [Sat, 16 Jul 2016 22:42:06 +0000 (22:42 +0000)]
CodeGen: use StringRefs more in ObjC class generation, NFC

Rather than building up a number of SmallString-s in order to construct a
std::string, use more StringRefs and construct the string once before use.  This
avoids unnecessary string constructions.  NFC.

llvm-svn: 275697

8 years agoCodeGen: simplify using a local variable, NFC
Saleem Abdulrasool [Sat, 16 Jul 2016 22:42:04 +0000 (22:42 +0000)]
CodeGen: simplify using a local variable, NFC

Add a couple of local variables for the class interface and the super class
interface.  This allows for the repeated access of the information to be cached
and makes the code simpler to understand.  NFC.

llvm-svn: 275696

8 years agoAttempt to unbreak Windows bot.
Rui Ueyama [Sat, 16 Jul 2016 19:16:15 +0000 (19:16 +0000)]
Attempt to unbreak Windows bot.

llvm-svn: 275695

8 years agoRemove redundant namespace specifiers.
Rui Ueyama [Sat, 16 Jul 2016 18:55:47 +0000 (18:55 +0000)]
Remove redundant namespace specifiers.

llvm-svn: 275694

8 years agoResurrect code that was lost in conflicting commits.
Rui Ueyama [Sat, 16 Jul 2016 18:45:25 +0000 (18:45 +0000)]
Resurrect code that was lost in conflicting commits.

llvm-svn: 275693

8 years agoUse skip() instead of peek() and expect().
Rui Ueyama [Sat, 16 Jul 2016 18:45:23 +0000 (18:45 +0000)]
Use skip() instead of peek() and expect().

llvm-svn: 275692

8 years ago[InstCombine] allow X + signbit --> X ^ signbit for vector splats
Sanjay Patel [Sat, 16 Jul 2016 18:29:26 +0000 (18:29 +0000)]
[InstCombine] allow X + signbit --> X ^ signbit for vector splats

llvm-svn: 275691

8 years agoadd vector test to show missing transform
Sanjay Patel [Sat, 16 Jul 2016 18:24:18 +0000 (18:24 +0000)]
add vector test to show missing transform

llvm-svn: 275690

8 years agoIPRA: avoid double query to the map (NFC)
Mehdi Amini [Sat, 16 Jul 2016 18:20:26 +0000 (18:20 +0000)]
IPRA: avoid double query to the map (NFC)

llvm-svn: 275689

8 years agoupdate tests to use FileCheck, consolidate tests, fix comments
Sanjay Patel [Sat, 16 Jul 2016 18:08:22 +0000 (18:08 +0000)]
update tests to use FileCheck, consolidate tests, fix comments

llvm-svn: 275688

8 years agoupdate test to use FileCheck
Sanjay Patel [Sat, 16 Jul 2016 16:31:58 +0000 (16:31 +0000)]
update test to use FileCheck

llvm-svn: 275687

8 years agoauto-generate checks
Sanjay Patel [Sat, 16 Jul 2016 16:27:58 +0000 (16:27 +0000)]
auto-generate checks

llvm-svn: 275686

8 years agoauto-ggenerate checks
Sanjay Patel [Sat, 16 Jul 2016 16:24:06 +0000 (16:24 +0000)]
auto-ggenerate checks

llvm-svn: 275685

8 years ago[InstCombine] reassociate logic ops with constants separated by a zext
Sanjay Patel [Sat, 16 Jul 2016 15:20:19 +0000 (15:20 +0000)]
[InstCombine] reassociate logic ops with constants separated by a zext

This is a partial implementation of a general fold for associative+commutative operators:
(op (cast (op X, C2)), C1) --> (cast (op X, op (C1, C2)))
(op (cast (op X, C2)), C1) --> (op (cast X), op (C1, C2))

There are 7 associative operators and 13 cast types, so this could potentially go a lot further.

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

llvm-svn: 275684

8 years agoUpdate for r275682:
George Rimar [Sat, 16 Jul 2016 12:34:06 +0000 (12:34 +0000)]
Update for r275682:

I think
# REQUIRES: shell
is required instead of
# XFAIL: win32

llvm-svn: 275683

8 years agoRecommit r275257 "[ELF] - Implement extern "c++" version script tag"
George Rimar [Sat, 16 Jul 2016 12:26:39 +0000 (12:26 +0000)]
Recommit r275257 "[ELF] - Implement extern "c++" version script tag"

BSD toolchain contains a bug:
https://sourceforge.net/p/elftoolchain/tickets/491/

In short demangler works differently, fix was to update the testcase.
It should fix the FreeBSD bot failture:
http://lab.llvm.org:8011/builders/lld-x86_64-freebsd/builds/19432/steps/test_lld/logs/stdio

Original commit message was:
[ELF] - Implement extern "c++" version script tag

Patch implements 'extern' version script tag.
Currently only values in quotes(") are supported.

Matching of externs is performed in the same pass as exact match of globals.

Differential revision: http://reviews.llvm.org/D21930

llvm-svn: 275682

8 years ago[clang-rename] remove obsolete tests and apply fixes to existing
Kirill Bobyrev [Sat, 16 Jul 2016 08:55:01 +0000 (08:55 +0000)]
[clang-rename] remove obsolete tests and apply fixes to existing

Few tests introduced by previous patch had obsolete counterparts.

Applied fixes to {Dynamic|Static}CastExpr.cpp

llvm-svn: 275681

8 years agoGPGPU: Abort if any dummy function is called
Tobias Grosser [Sat, 16 Jul 2016 07:30:27 +0000 (07:30 +0000)]
GPGPU: Abort if any dummy function is called

This ensures that accidental calls to these functions will break loadly instead
of corrupting the stack with invalid return values.

These functions have been introduced earlier as replacement of pet and parts of
ppcg which we will never use and consequently have not been imported or compiled
into Polly.

llvm-svn: 275680

8 years agoRevert "Revert r275029 - Update Clang tests after adding inference for the returned...
Hal Finkel [Sat, 16 Jul 2016 07:22:09 +0000 (07:22 +0000)]
Revert "Revert r275029 - Update Clang tests after adding inference for the returned argument attribute"

This reverts commit r275043 after reapplying the underlying LLVM commit.

llvm-svn: 275679

8 years agoRevert "Revert r275027 - Let FuncAttrs infer the 'returned' argument attribute"
Hal Finkel [Sat, 16 Jul 2016 07:21:28 +0000 (07:21 +0000)]
Revert "Revert r275027 - Let FuncAttrs infer the 'returned' argument attribute"

This reverts commit r275042; the initial commit triggered self-hosting failures
on ARM/AArch64. James Molloy identified the problematic backend code, which has
been disabled in r275677. Trying again...

Original commit message:

Let FuncAttrs infer the 'returned' argument attribute

A function can have one argument with the 'returned' attribute, indicating that
the associated argument is always the return value of the function. Add
FuncAttrs inference logic.

llvm-svn: 275678

8 years agoDisable this-return argument forwarding on ARM/AArch64
Hal Finkel [Sat, 16 Jul 2016 07:07:29 +0000 (07:07 +0000)]
Disable this-return argument forwarding on ARM/AArch64

r275042 reverted function-attribute inference for the 'returned' attribute
because the feature triggered self-hosting failures on ARM and AArch64. James
Molloy determined that the this-return argument forwarding feature, which
directly ties the returned input argument to the returned value, was the cause.
It seems likely that this forwarding code contains, or triggers, a subtle bug.
Disabling for now until we can track that down.

llvm-svn: 275677

8 years agoRe-commit [AMDGPU] Add metadata for runtime
Yaxun Liu [Sat, 16 Jul 2016 05:09:21 +0000 (05:09 +0000)]
Re-commit [AMDGPU] Add metadata for runtime

Attempting to fix lit test failure on ppc.

llvm-svn: 275676

8 years agoSimplify. NFC.
Rui Ueyama [Sat, 16 Jul 2016 04:19:29 +0000 (04:19 +0000)]
Simplify. NFC.

llvm-svn: 275675

8 years agoRename SymbolVersions VersionDefinitions.
Rui Ueyama [Sat, 16 Jul 2016 04:09:27 +0000 (04:09 +0000)]
Rename SymbolVersions VersionDefinitions.

SymbolVersions sounds like it had versions for a symbol, so rename it.

llvm-svn: 275674

8 years agoRename Version VersionDefinition.
Rui Ueyama [Sat, 16 Jul 2016 04:02:00 +0000 (04:02 +0000)]
Rename Version VersionDefinition.

The identifier `Version` was used too often in the code to handle
symbol versions. The struct that contains version definitions is
named `Version`. Local variables for version ID are named `Version`.
Local varaible for version string are named `Version`.

This patch give them different names.

llvm-svn: 275673

8 years agoUse ScriptParserBase::skip() instead of peek() and next().
Rui Ueyama [Sat, 16 Jul 2016 03:45:59 +0000 (03:45 +0000)]
Use ScriptParserBase::skip() instead of peek() and next().

skip(S) consumes a token if the next token is S,
so it can be used instead of peek() & next().

llvm-svn: 275672

8 years ago[AVX512] Remove CodeGenOnly VBROADCAST m_Int instructions. They can be implemented...
Craig Topper [Sat, 16 Jul 2016 03:42:59 +0000 (03:42 +0000)]
[AVX512] Remove CodeGenOnly VBROADCAST m_Int instructions. They can be implemented with patterns selecting existing instructions. NFC

llvm-svn: 275671

8 years agoSimplify. NFC.
Rui Ueyama [Sat, 16 Jul 2016 03:12:16 +0000 (03:12 +0000)]
Simplify. NFC.

llvm-svn: 275670

8 years agoSimplify default symbol version management. NFC.
Rui Ueyama [Sat, 16 Jul 2016 03:08:26 +0000 (03:08 +0000)]
Simplify default symbol version management. NFC.

llvm-svn: 275669

8 years ago[Driver] Add flags for enabling both types of PGO Instrumentation
Sean Silva [Sat, 16 Jul 2016 02:54:58 +0000 (02:54 +0000)]
[Driver] Add flags for enabling both types of PGO Instrumentation

The flags:
Enable IR-level instrumentation -fprofile-generate or -fprofile-generate=
When applying profile data: -fprofile-use=/path/to/profdata

Patch by Jake VanAdrighem!

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

llvm-svn: 275668

8 years agoRemove redundant variable.
Rui Ueyama [Sat, 16 Jul 2016 02:47:42 +0000 (02:47 +0000)]
Remove redundant variable.

llvm-svn: 275667

8 years agoSet sh_addralign in the constructor for consistency. NFC.
Rui Ueyama [Sat, 16 Jul 2016 02:36:00 +0000 (02:36 +0000)]
Set sh_addralign in the constructor for consistency. NFC.

llvm-svn: 275666

8 years agoMake Verdef and Verdaux adjacent in the version definition section.
Rui Ueyama [Sat, 16 Jul 2016 02:29:45 +0000 (02:29 +0000)]
Make Verdef and Verdaux adjacent in the version definition section.

Previously, Verdefs and Verdauxs are separated in the section.
The new layout is easier to write as we do not have to maintain
two pointers and can avoid passing a reference to a pointer.

llvm-svn: 275665

8 years agollc: Add support for -run-pass none
Matthias Braun [Sat, 16 Jul 2016 02:24:59 +0000 (02:24 +0000)]
llc: Add support for -run-pass none

This does not schedule any passes besides the ones necessary to
construct and print the machine function. This is useful to test .mir
file reading and printing.

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

llvm-svn: 275664

8 years agollc: Move pass query/add code into an own function; NFC
Matthias Braun [Sat, 16 Jul 2016 02:24:15 +0000 (02:24 +0000)]
llc: Move pass query/add code into an own function; NFC

llvm-svn: 275663

8 years agoARM/MIR: Move test from MIR to CodeGen/ARM directory
Matthias Braun [Sat, 16 Jul 2016 02:24:13 +0000 (02:24 +0000)]
ARM/MIR: Move test from MIR to CodeGen/ARM directory

test/CodeGen/MIR/ARM/ARMLoadStoreDBG.mir is an actual test for the ARM
load store optimization pass and not a test of the mir parser/printer.

It belongs to test/CodeGen/ARM; This also updates the test to use the
new -run-pass llc syntax.

llvm-svn: 275662

8 years agoARM: Initialize LoadStore passes in TargetMachine
Matthias Braun [Sat, 16 Jul 2016 02:24:10 +0000 (02:24 +0000)]
ARM: Initialize LoadStore passes in TargetMachine

Initializing them in LLVMInitializeARMTarget() makes them visible early
enough for "llc -run-pass usage".

This required the pass to be renamed from "arm-load-store-opt" to
"arm-ldst-opt", because there already exists an arm-load-store-opt
cl::opt switch which would now clash with the passname getting added as
a switch in opt. On the bright side the pass name now matches the
DEBUG_TYPE name. Renamed "arm-prera-load-store-opt" to
"arm-repra-ldst-opt" as well for consistency.

llvm-svn: 275661

8 years agoUse SymbolVersion::Id instead of a hard-coded local variable.
Rui Ueyama [Sat, 16 Jul 2016 02:00:43 +0000 (02:00 +0000)]
Use SymbolVersion::Id instead of a hard-coded local variable.

llvm-svn: 275660

8 years agoReword comment to be more clear.
Eric Christopher [Sat, 16 Jul 2016 01:55:45 +0000 (01:55 +0000)]
Reword comment to be more clear.

llvm-svn: 275659

8 years agoMIParser: reject subregister indexes on physregs
Matthias Braun [Sat, 16 Jul 2016 01:36:18 +0000 (01:36 +0000)]
MIParser: reject subregister indexes on physregs

llvm-svn: 275658

8 years agoFix modules buildbot after r275633.
Richard Smith [Sat, 16 Jul 2016 01:05:39 +0000 (01:05 +0000)]
Fix modules buildbot after r275633.

llvm-svn: 275657

8 years agoDon't do uint64_t(1) << 64 in maxUIntN.
Justin Lebar [Sat, 16 Jul 2016 00:59:41 +0000 (00:59 +0000)]
Don't do uint64_t(1) << 64 in maxUIntN.

Summary:
This shift is undefined behavior (and, as compiled by clang, gives the
wrong answer for maxUIntN(64)).

Reviewers: mkuper

Subscribers: llvm-commits, jroelofs, rsmith

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

llvm-svn: 275656

8 years agoRemove extra semi-colon. Fixes warning and Werror bots.
Eric Christopher [Sat, 16 Jul 2016 00:58:34 +0000 (00:58 +0000)]
Remove extra semi-colon. Fixes warning and Werror bots.

llvm-svn: 275655

8 years ago[ObjC] Implement @available in the Parser and AST
Erik Pilkington [Sat, 16 Jul 2016 00:35:23 +0000 (00:35 +0000)]
[ObjC] Implement @available in the Parser and AST

This patch adds a new AST node: ObjCAvailabilityCheckExpr, and teaches the
Parser and Sema to generate it. This node represents an availability check of
the form:

  @available(macos 10.10, *);

Which will eventually compile to a runtime check of the host's OS version. This
is the first patch of the feature I proposed here:
http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html

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

llvm-svn: 275654

8 years agoReimplement ExternalSemaSource delegation in terms of
Richard Smith [Sat, 16 Jul 2016 00:35:14 +0000 (00:35 +0000)]
Reimplement ExternalSemaSource delegation in terms of
MultiplexExternalSemaSource to remove one of the places that needs updating
every time the ExternalSemaSource interface changes.

llvm-svn: 275653

8 years agoFixed the location of the Swift bindings in the Xcode build.
Sean Callanan [Sat, 16 Jul 2016 00:18:24 +0000 (00:18 +0000)]
Fixed the location of the Swift bindings in the Xcode build.

$BUILT_PRODUCTS_DIR is usually the same as $CONFIGURATION_BUILD_DIR, but differs
when LLDB is being built BuildAndIntegration, in which case $BUILT_PRODUCTS_DIR
is more accurate.

llvm-svn: 275652

8 years agoUse std::string instead of StringRef when generating the auxiliar triple in the front...
Samuel Antao [Sat, 16 Jul 2016 00:15:56 +0000 (00:15 +0000)]
Use std::string instead of StringRef when generating the auxiliar triple in the frontend tool.

llvm-svn: 275651

8 years agoAttempt to fix breakage caused by r275645 for Windows bots.
Samuel Antao [Fri, 15 Jul 2016 23:51:21 +0000 (23:51 +0000)]
Attempt to fix breakage caused by r275645 for Windows bots.

llvm-svn: 275650

8 years ago[libFuzzer] add hooks for strstr, strcasestr, strcasecmp, strncasecmp
Kostya Serebryany [Fri, 15 Jul 2016 23:27:19 +0000 (23:27 +0000)]
[libFuzzer] add hooks for strstr, strcasestr, strcasecmp, strncasecmp

llvm-svn: 275648

8 years ago[llvm-cov] Attempt to appease an older builder
Vedant Kumar [Fri, 15 Jul 2016 23:15:35 +0000 (23:15 +0000)]
[llvm-cov] Attempt to appease an older builder

It's using a version of clang which can't (or won't) deduce an implicit
conversion from a SmallString to a StringRef. Write the conversion out
explicitly:

  http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/8574

llvm-svn: 275647

8 years agobugpoint: add flag -verbose-errors
Sebastian Pop [Fri, 15 Jul 2016 23:15:06 +0000 (23:15 +0000)]
bugpoint: add flag -verbose-errors

The default behavior of bugpoint is to print "<crash>" when it finds a reduced
test that crashes compilation.  With this flag we now can see the output of the
crashing program.  This is useful to make sure it is the same error being
tracked down and not a different error that happens to crash the compiler as
well.

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

llvm-svn: 275646

8 years ago[CUDA][OpenMP] Create generic offload action
Samuel Antao [Fri, 15 Jul 2016 23:13:27 +0000 (23:13 +0000)]
[CUDA][OpenMP] Create generic offload action

Summary:
This patch replaces the CUDA specific action by a generic offload action. The offload action may have multiple dependences classier in “host” and “device”. The way this generic offloading action is used is very similar to what is done today by the CUDA implementation: it is used to set a specific toolchain and architecture to its dependences during the generation of jobs.

This patch also proposes propagating the offloading information through the action graph so that that information can be easily retrieved at any time during the generation of commands. This allows e.g. the "clang tool” to evaluate whether CUDA should be supported for the device or host and ptas to easily retrieve the target architecture.

This is an example of how the action graphs would look like (compilation of a single CUDA file with two GPU architectures)
```
0: input, "cudatests.cu", cuda, (host-cuda)
1: preprocessor, {0}, cuda-cpp-output, (host-cuda)
2: compiler, {1}, ir, (host-cuda)
3: input, "cudatests.cu", cuda, (device-cuda, sm_35)
4: preprocessor, {3}, cuda-cpp-output, (device-cuda, sm_35)
5: compiler, {4}, ir, (device-cuda, sm_35)
6: backend, {5}, assembler, (device-cuda, sm_35)
7: assembler, {6}, object, (device-cuda, sm_35)
8: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {7}, object
9: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {6}, assembler
10: input, "cudatests.cu", cuda, (device-cuda, sm_37)
11: preprocessor, {10}, cuda-cpp-output, (device-cuda, sm_37)
12: compiler, {11}, ir, (device-cuda, sm_37)
13: backend, {12}, assembler, (device-cuda, sm_37)
14: assembler, {13}, object, (device-cuda, sm_37)
15: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {14}, object
16: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {13}, assembler
17: linker, {8, 9, 15, 16}, cuda-fatbin, (device-cuda)
18: offload, "host-cuda (powerpc64le-unknown-linux-gnu)" {2}, "device-cuda (nvptx64-nvidia-cuda)" {17}, ir
19: backend, {18}, assembler
20: assembler, {19}, object
21: input, "cuda", object
22: input, "cudart", object
23: linker, {20, 21, 22}, image
```
The changes in this patch pass the existent regression tests (keeps the existent functionality) and resulting binaries execute correctly in a Power8+K40 machine.

Reviewers: echristo, hfinkel, jlebar, ABataev, tra

Subscribers: guansong, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin

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

llvm-svn: 275645

8 years ago[asan] trying to fix the windows build
Kostya Serebryany [Fri, 15 Jul 2016 23:13:03 +0000 (23:13 +0000)]
[asan] trying to fix the windows build

llvm-svn: 275644

8 years agoReapply "Mips: Avoid implicit iterator conversions, NFC"
Duncan P. N. Exon Smith [Fri, 15 Jul 2016 23:09:47 +0000 (23:09 +0000)]
Reapply "Mips: Avoid implicit iterator conversions, NFC"

This reverts commit r275562, effectively reapplying r275141.  Doug
Gilmore reported that there was an error when bisecting the Mips
buildbot failure, and that r275141 was not to blame after all.  Here is
the green build:
https://dmz-portal.mips.com/bb/builders/LLVM%20with%20integrated%20assembler%20and%20fPIC%20and%20-O0/builds/803

llvm-svn: 275643

8 years ago[llvm-cov] Attempt to appease Windows bots
Vedant Kumar [Fri, 15 Jul 2016 23:08:22 +0000 (23:08 +0000)]
[llvm-cov] Attempt to appease Windows bots

They appear to reject r275640 because stdin is held open during an
ExecuteAndWait in which it's redirected:

  http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/8390

llvm-svn: 275642

8 years agoFixes for standalone build:
Eugene Zelenko [Fri, 15 Jul 2016 22:46:15 +0000 (22:46 +0000)]
Fixes for standalone build:

* include CheckAtomic to set HAVE_CXX_ATOMICS64_WITHOUT_LIB properly (introduced in r274121)
* hint Clang CMake files for LLVM CMake files location (inctroduced in ~ r274176)

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

llvm-svn: 275641

8 years ago[llvm-cov] Optionally use a symbol demangler when preparing reports
Vedant Kumar [Fri, 15 Jul 2016 22:44:57 +0000 (22:44 +0000)]
[llvm-cov] Optionally use a symbol demangler when preparing reports

Add an option to specify a symbol demangler (as well as options to the
demangler). This can be used to make reports more human-readable.

This option is especially useful in -output-dir mode, since it isn't as
easy to manually pipe reports into a demangler in this mode.

llvm-svn: 275640

8 years ago[llvm-cov] Document a few private fields of CodeCoverageTool (NFC)
Vedant Kumar [Fri, 15 Jul 2016 22:44:54 +0000 (22:44 +0000)]
[llvm-cov] Document a few private fields of CodeCoverageTool (NFC)

llvm-svn: 275639

8 years ago[Support] Fix a doxygen comment (NFC)
Vedant Kumar [Fri, 15 Jul 2016 22:44:52 +0000 (22:44 +0000)]
[Support] Fix a doxygen comment (NFC)

There was a missing "<" on a line, so its contents wrapped around into
the description of the next argument.

llvm-svn: 275638

8 years agoMinor code cleanups. NFC.
Junmo Park [Fri, 15 Jul 2016 22:42:52 +0000 (22:42 +0000)]
Minor code cleanups. NFC.

llvm-svn: 275637

8 years ago[lanai] Small cleanup: remove/comment out unused args
Jacques Pienaar [Fri, 15 Jul 2016 22:38:32 +0000 (22:38 +0000)]
[lanai] Small cleanup: remove/comment out unused args

llvm-svn: 275636

8 years agoAMDGPU: Fix verifier error from partially undef copy
Matt Arsenault [Fri, 15 Jul 2016 22:32:02 +0000 (22:32 +0000)]
AMDGPU: Fix verifier error from partially undef copy

In this situation:

%VGPR2<def> = BUFFER_LOAD_DWORD_OFFSET %SGPR8_SGPR9_SGPR10_SGPR11,
%VGPR7<def,tied3> = V_MAC_F32_e32 %VGPR0<undef>, %VGPR1<kill>, %VGPR7<kill,tied0>, %EXEC<imp-use>
%VGPR3_VGPR4_VGPR5_VGPR6<def> = COPY %VGPR0_VGPR1_VGPR2_VGPR3
%VGPR4<def> = COPY %VGPR2

The copy for VGPR1 -> VGPR4 was an error from reading undefined VGPR1,
but VGPR4 is defined immediately after this copy.

llvm-svn: 275635

8 years agoExpandPostRAPseudos should transfer implicit uses, not only implicit defs
Michael Kuperstein [Fri, 15 Jul 2016 22:31:14 +0000 (22:31 +0000)]
ExpandPostRAPseudos should transfer implicit uses, not only implicit defs

Previously, we would expand:
%BL<def> = COPY %DL<kill>, %EBX<imp-use,kill>, %EBX<imp-def>
Into:
%BL<def> = MOV8rr %DL<kill>, %EBX<imp-def>
Dropping the imp-use on the floor.

That confused CriticalAntiDepBreaker, which (correctly) assumes that if an
instruction defs but doesn't use a register, that register is dead immediately
before the instruction - while in this case, the high lanes of EBX can be very
much alive.

This fixes PR28560.

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

llvm-svn: 275634

8 years agoBPF: Use official ELF e_machine value
Alexei Starovoitov [Fri, 15 Jul 2016 22:27:55 +0000 (22:27 +0000)]
BPF: Use official ELF e_machine value

The same value for EM_BPF is being propagated to glibc,
elfutils, and binutils.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 275633

8 years agoFix a typeo.
George Burgess IV [Fri, 15 Jul 2016 22:24:24 +0000 (22:24 +0000)]
Fix a typeo.

(obligatory s/typeo/typo)

llvm-svn: 275632

8 years ago[lanai] Fix build by updating calls to getLoad & getStore.
Jacques Pienaar [Fri, 15 Jul 2016 22:18:33 +0000 (22:18 +0000)]
[lanai] Fix build by updating calls to getLoad & getStore.

rL275592 removed the boolean parameters of SelectionDAG::getLoad and getStore, updating Lanai backend's calls to these functions.

llvm-svn: 275631

8 years ago[index] Create different USR if a property is a class property.
Argyrios Kyrtzidis [Fri, 15 Jul 2016 22:18:19 +0000 (22:18 +0000)]
[index] Create different USR if a property is a class property.

Avoids USR conflicts between class & instance properties of the same name.

llvm-svn: 275630

8 years ago[pdb] Teach MsfBuilder and other classes about the Free Page Map.
Zachary Turner [Fri, 15 Jul 2016 22:17:19 +0000 (22:17 +0000)]
[pdb] Teach MsfBuilder and other classes about the Free Page Map.

Block 1 and 2 of an MSF file are bit vectors that represent the
list of blocks allocated and free in the file.  We had been using
these blocks to write stream data and other data, so we mark them
as the free page map now.  We don't yet serialize these pages to
the disk, but at least we make a note of what it is, and avoid
writing random data to them.

Doing this also necessitated cleaning up some of the tests to be
more general and hardcode fewer values, which is nice.

llvm-svn: 275629

8 years ago[pdb] Round trip the NameMap data structure to YAML.
Zachary Turner [Fri, 15 Jul 2016 22:17:08 +0000 (22:17 +0000)]
[pdb] Round trip the NameMap data structure to YAML.

llvm-svn: 275628

8 years ago[pdb] Use MsfBuilder to handle the writing PDBs.
Zachary Turner [Fri, 15 Jul 2016 22:16:56 +0000 (22:16 +0000)]
[pdb] Use MsfBuilder to handle the writing PDBs.

Previously we would read a PDB, then write some of it back out,
but write the directory, super block, and other pertinent metadata
back out unchanged.  This generates incorrect PDBs since the amount
of data written was not always the same as the amount of data read.

This patch changes things to use the newly introduced `MsfBuilder`
class to write out a correct and accurate set of Msf metadata for
the data *actually* written, which opens up the door for adding and
removing type records, symbol records, and other types of data to
an existing PDB.

llvm-svn: 275627

8 years agoStructurizeCFG: Fix inverting constantexpr conditions
Matt Arsenault [Fri, 15 Jul 2016 22:13:16 +0000 (22:13 +0000)]
StructurizeCFG: Fix inverting constantexpr conditions

llvm-svn: 275626

8 years ago[Hexagon] Handle instruction latency for 0 or 2 cycles
Krzysztof Parzyszek [Fri, 15 Jul 2016 21:34:02 +0000 (21:34 +0000)]
[Hexagon] Handle instruction latency for 0 or 2 cycles

The Hexagon schedulers need to handle instructions with a latency
of 0 or 2 more accurately. The problem, in v60, is that a dependence
between two instructions with a 2 cycle latency can use a .cur version
of the source to achieve a 0 cycle latency when the use is in the
same packet. Any othe use, must be at least 2 packets later, or a
stall occurs. In other words, the compiler does not want to schedule
the dependent instructions 1 cycle later.

To achieve this, the latency adjustment code allows only a single
dependence to have a zero latency. All other instructions have the
other value, which is typically 2 cycles. We use a heuristic to
determine which instruction gets the 0 latency.

The Hexagon machine scheduler was also changed to increase the cost
associated with 0 latency dependences than can be scheduled in the
same packet.

Patch by Brendon Cahoon.

llvm-svn: 275625

8 years agoRevert r275481, r275490. This broke modules bootstrap.
Richard Smith [Fri, 15 Jul 2016 21:33:46 +0000 (21:33 +0000)]
Revert r275481, r275490. This broke modules bootstrap.

llvm-svn: 275624

8 years agoAMDGPU: Remove legacy ldexp builtin
Matt Arsenault [Fri, 15 Jul 2016 21:33:06 +0000 (21:33 +0000)]
AMDGPU: Remove legacy ldexp builtin

llvm-svn: 275623

8 years agoAMDGPU: Update for rsq intrinsic changes
Matt Arsenault [Fri, 15 Jul 2016 21:33:02 +0000 (21:33 +0000)]
AMDGPU: Update for rsq intrinsic changes

llvm-svn: 275622

8 years ago[sanitizers] add interceptor for memmem; add weak hooks for strncasecmp, strcasecmp...
Kostya Serebryany [Fri, 15 Jul 2016 21:28:58 +0000 (21:28 +0000)]
[sanitizers] add interceptor for memmem; add weak hooks for strncasecmp, strcasecmp, strstr, strcasestr, memmem

llvm-svn: 275621

8 years agoAMDGPU: Remove brev intrinsic
Matt Arsenault [Fri, 15 Jul 2016 21:27:13 +0000 (21:27 +0000)]
AMDGPU: Remove brev intrinsic

llvm-svn: 275620

8 years agoAMDGPU: Fix TargetPrefix for remaining r600 intrinsics
Matt Arsenault [Fri, 15 Jul 2016 21:27:08 +0000 (21:27 +0000)]
AMDGPU: Fix TargetPrefix for remaining r600 intrinsics

llvm-svn: 275619

8 years agoAMDGPU: Remove AMDGPU.ldexp
Matt Arsenault [Fri, 15 Jul 2016 21:26:56 +0000 (21:26 +0000)]
AMDGPU: Remove AMDGPU.ldexp

llvm-svn: 275618

8 years agoAMDGPU: Remove legacy rsq.clamped intrinsic
Matt Arsenault [Fri, 15 Jul 2016 21:26:52 +0000 (21:26 +0000)]
AMDGPU: Remove legacy rsq.clamped intrinsic

Mesa still has a use of llvm.AMDGPU.rsq.f64 remaining.

Also fix mismatch with non-IEEE rsq selecting to IEEE rsq.

llvm-svn: 275617

8 years agoAMDGPU/R600: Delete dead code.
Matt Arsenault [Fri, 15 Jul 2016 21:26:46 +0000 (21:26 +0000)]
AMDGPU/R600: Delete dead code.

Dead or the same as the base implementation.

llvm-svn: 275616

8 years agoDebugInfo: reorder some initializers
Saleem Abdulrasool [Fri, 15 Jul 2016 21:10:31 +0000 (21:10 +0000)]
DebugInfo: reorder some initializers

Fix a few initialization ordering warnings from gcc from `-Wreorder`.  NFC.

llvm-svn: 275615

8 years agoCodeGen: avoid emitting unnecessary CFI
Saleem Abdulrasool [Fri, 15 Jul 2016 21:10:29 +0000 (21:10 +0000)]
CodeGen: avoid emitting unnecessary CFI

Remove unnecessary clutter in assembly output.  When using SjLj EH, the CFI is
not actually used for anything.  Do not emit the CFI needlessly.  The minor test
adjustments are interesting.  The prologue test was just overzealous matcching.
The interesting case is the LSDA change.  It was originally added to ensure that
various compilations did not mangle the name (it explicitly checked the name!).
However, subsequent cleanups made it more reliant on the CFI to find the name.
Parse the generated code flow to generically find the label still.

llvm-svn: 275614

8 years agoMake processInstruction from LCSSA.cpp externally available.
Michael Zolotukhin [Fri, 15 Jul 2016 21:08:41 +0000 (21:08 +0000)]
Make processInstruction from LCSSA.cpp externally available.

Summary:
When a pass tries to keep LCSSA form it's often convenient to be able to update
LCSSA for a set of instructions rather than for the entire loop. This patch makes the
processInstruction from LCSSA externally available under a name
formLCSSAForInstruction.

Reviewers: chandlerc, sanjoy, hfinkel

Subscribers: llvm-commits

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

llvm-svn: 275613

8 years agoPush alias-declarations and alias-template declarations into scope even if
Richard Smith [Fri, 15 Jul 2016 20:53:25 +0000 (20:53 +0000)]
Push alias-declarations and alias-template declarations into scope even if
they're redeclarations. This is necessary in order for name lookup to correctly
find the most recent declaration of the name (which affects default template
argument lookup and cross-module merging, among other things).

llvm-svn: 275612

8 years ago[pdb] Introduce MsfBuilder for laying out PDB files.
Zachary Turner [Fri, 15 Jul 2016 20:43:38 +0000 (20:43 +0000)]
[pdb] Introduce MsfBuilder for laying out PDB files.

Reviewed by: ruiu
Differential Revision: https://reviews.llvm.org/D22308

llvm-svn: 275611

8 years agoSema: support __declspec(dll*) on ObjC interfaces
Saleem Abdulrasool [Fri, 15 Jul 2016 20:41:10 +0000 (20:41 +0000)]
Sema: support __declspec(dll*) on ObjC interfaces

Extend the __declspec(dll*) attribute to cover ObjC interfaces.  This was
requested by Microsoft for their ObjC support.  Cover both import and export.
This only adds the semantic analysis portion of the support, code-generation
still remains outstanding.  Add some basic initial documentation on the
attributes that were previously empty.  Tweak the previous tests to use the
relative expected-warnings to make the tests easier to read.

llvm-svn: 275610

8 years ago[test/objcmt] Add a follow-up test case for r275600.
Argyrios Kyrtzidis [Fri, 15 Jul 2016 20:40:24 +0000 (20:40 +0000)]
[test/objcmt] Add a follow-up test case for r275600.

llvm-svn: 275609

8 years agoELF: Include filenames in error messages.
Rui Ueyama [Fri, 15 Jul 2016 20:38:28 +0000 (20:38 +0000)]
ELF: Include filenames in error messages.

llvm-svn: 275608

8 years agoTeach fast isel about the win64 calling convention.
Nico Weber [Fri, 15 Jul 2016 20:18:37 +0000 (20:18 +0000)]
Teach fast isel about the win64 calling convention.

This mostly just works.

Vectorcall rets are still not supported.

The win64_eh test change is because fast isel doesn't use rsi for temporary
computations, so it doesn't need to be pushed. The test case I'm changing was
originally added to test pushes, but by now there are other test cases in that
file exercising that code path.

https://reviews.llvm.org/D22422

llvm-svn: 275607

8 years ago[Hexagon] Make MI scheduler check for stalls in previous packet on v60
Krzysztof Parzyszek [Fri, 15 Jul 2016 20:16:03 +0000 (20:16 +0000)]
[Hexagon] Make MI scheduler check for stalls in previous packet on v60

Patch by Ikhlas Ajbar.

llvm-svn: 275606

8 years agoRemove variables. NFC.
Rui Ueyama [Fri, 15 Jul 2016 20:05:05 +0000 (20:05 +0000)]
Remove variables. NFC.

llvm-svn: 275605

8 years ago[CFLAA] Add attributes handling for CFLAnders.
George Burgess IV [Fri, 15 Jul 2016 20:02:49 +0000 (20:02 +0000)]
[CFLAA] Add attributes handling for CFLAnders.

This patch adds proper handling of stratified attributes into our
anders-style CFLAA implementation. It also comes bundled with more
CFLAnders tests. :)

Patch by Jia Chen.

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

llvm-svn: 275604

8 years ago[PowerPC] Set kill flag for scratch register when spilling the link register
Nemanja Ivanovic [Fri, 15 Jul 2016 19:56:32 +0000 (19:56 +0000)]
[PowerPC] Set kill flag for scratch register when spilling the link register

This fixes PR 28526.

llvm-svn: 275603

8 years ago[CFLAA] Add an initial CFLAnders implementation.
George Burgess IV [Fri, 15 Jul 2016 19:53:25 +0000 (19:53 +0000)]
[CFLAA] Add an initial CFLAnders implementation.

This adds an incomplete anders-style implementation for CFLAA. It's
incomplete in that it's missing interprocedural analysis, attrs
handling, etc. and that it needs more tests. More tests and features
will be added in future commits.

Patch by Jia Chen.

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

llvm-svn: 275602

8 years agoFix calls to SelectionDAG::getStore
Derek Schuff [Fri, 15 Jul 2016 19:35:43 +0000 (19:35 +0000)]
Fix calls to SelectionDAG::getStore

It was refactored in r275592. NFC

llvm-svn: 275601