platform/upstream/llvm.git
7 years agoRevert "[MC] Fix handling of end-of-line preprocessor comments"
Nirav Dave [Tue, 2 Aug 2016 15:08:52 +0000 (15:08 +0000)]
Revert "[MC] Fix handling of end-of-line preprocessor comments"

Causes TSan failure on PPC64

This reverts commit r277459.

llvm-svn: 277468

7 years ago[WebAssembly] Remove a README.txt entry that is now implemented.
Dan Gohman [Tue, 2 Aug 2016 14:53:44 +0000 (14:53 +0000)]
[WebAssembly] Remove a README.txt entry that is now implemented.

llvm-svn: 277467

7 years ago[LVI] NFC. Fix a typo getValueFromFromCondition -> getValueFromCondition
Artur Pilipenko [Tue, 2 Aug 2016 14:44:32 +0000 (14:44 +0000)]
[LVI] NFC. Fix a typo getValueFromFromCondition -> getValueFromCondition

llvm-svn: 277466

7 years ago[CodeGen] Generalize MachineFunctionProperties::print comma handling.
Ahmed Bougacha [Tue, 2 Aug 2016 14:42:57 +0000 (14:42 +0000)]
[CodeGen] Generalize MachineFunctionProperties::print comma handling.

This is only used for debug prints, but the previous hardcoded ", "
caused it to be printed unnecessarily when OnlySet, and is annoying
when adding new properties.

llvm-svn: 277465

7 years ago[GlobalISel] Require isSSA in GISel passes.
Ahmed Bougacha [Tue, 2 Aug 2016 14:42:55 +0000 (14:42 +0000)]
[GlobalISel] Require isSSA in GISel passes.

The GISel passes don't make sense on non-SSA functions.
All GISel tests already set isSSA. Enforce that.

llvm-svn: 277464

7 years agoFollow-up for r277458: Update the tsan_mman_test.cc unit test.
Kuba Brecka [Tue, 2 Aug 2016 14:41:03 +0000 (14:41 +0000)]
Follow-up for r277458: Update the tsan_mman_test.cc unit test.

llvm-svn: 277463

7 years ago[tsan] Fix the behavior of OSAtomicTestAndClear
Kuba Brecka [Tue, 2 Aug 2016 14:30:52 +0000 (14:30 +0000)]
[tsan] Fix the behavior of OSAtomicTestAndClear

The system implementation of OSAtomicTestAndClear returns the original bit, but the TSan interceptor has a bug which always returns zero from the function. This patch fixes this and adds a test.

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

llvm-svn: 277461

7 years ago[LV] Untangle the concepts of uniform and scalar
Matthew Simpson [Tue, 2 Aug 2016 14:29:41 +0000 (14:29 +0000)]
[LV] Untangle the concepts of uniform and scalar

This patch refactors the logic in collectLoopUniforms and
collectValuesToIgnore, untangling the concepts of "uniform" and "scalar". It
adds isScalarAfterVectorization along side isUniformAfterVectorization to
distinguish the two. Known scalar values include those that are uniform,
getelementptr instructions that won't be vectorized, and induction variables
and induction variable update instructions whose users are all known to be
scalar.

This patch includes the following functional changes:

- In collectLoopUniforms, we mark uniform the pointer operands of interleaved
  accesses. Although non-consecutive, these pointers are treated like
  consecutive pointers during vectorization.

- In collectValuesToIgnore, we insert a value into VecValuesToIgnore if it
  isScalarAfterVectorization rather than isUniformAfterVectorization. This
  differs from the previous functionaly in that we now add getelementptr
  instructions that will not be vectorized into VecValuesToIgnore.

This patch also removes the ValuesNotWidened set used for induction variable
scalarization since, after the above changes, it is now equivalent to
isScalarAfterVectorization.

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

llvm-svn: 277460

7 years ago[MC] Fix handling of end-of-line preprocessor comments
Nirav Dave [Tue, 2 Aug 2016 14:25:49 +0000 (14:25 +0000)]
[MC] Fix handling of end-of-line preprocessor comments

Recommitting after fixing test.

When parsing assembly where the line comment syntax is not hash, the
lexer cannot distinguish between hash's that start a hash line comment
and one that is part of an assembly statement and must be distinguished
during parsing. Previously, this was incompletely handled by not checking
for EndOfStatement at the end of statements and interpreting hash
prefixed statements as comments.

Change EndOfStatement Parsing to check for Hash comments and reintroduce
Hash statement parsing to catch previously handled cases.

Reviewers: rnk, majnemer

Subscribers: llvm-commits

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

llvm-svn: 277459

7 years ago[tsan] Fix behavior of realloc(nullptr, 0) on Darwin
Kuba Brecka [Tue, 2 Aug 2016 14:22:12 +0000 (14:22 +0000)]
[tsan] Fix behavior of realloc(nullptr, 0) on Darwin

On Darwin, there are some apps that rely on realloc(nullptr, 0) returning a valid pointer. TSan currently returns nullptr in this case, let's fix it to avoid breaking binary compatibility.

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

llvm-svn: 277458

7 years ago[clang-cl] Fix PCH tests to use x86_64 as target
Diana Picus [Tue, 2 Aug 2016 13:53:00 +0000 (13:53 +0000)]
[clang-cl] Fix PCH tests to use x86_64 as target

These tests require x86-registered-target, but they don't force the target as
x86 on the command line, which means they will be run and they might fail when
building the x86 backend on another platform (such as AArch64).

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

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

llvm-svn: 277457

7 years agoFixing 'Aquire' typo and libcxx build.
Ben Craig [Tue, 2 Aug 2016 13:43:48 +0000 (13:43 +0000)]
Fixing 'Aquire' typo and libcxx build.

llvm-svn: 277456

7 years agoRevert rL277454
David Callahan [Tue, 2 Aug 2016 13:26:07 +0000 (13:26 +0000)]
Revert rL277454

llvm-svn: 277455

7 years agotest commit
David Callahan [Tue, 2 Aug 2016 13:19:12 +0000 (13:19 +0000)]
test commit

llvm-svn: 277454

7 years agoRevert rL277429: Correct makefile.rules to use toolchain specific AR and OBJCOPY
Omair Javaid [Tue, 2 Aug 2016 13:17:49 +0000 (13:17 +0000)]
Revert rL277429: Correct makefile.rules to use toolchain specific AR and OBJCOPY

This commit is causing problems on gcc-* compiler with version number sufix.

Requires a new solution will post a follow up patch.

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

llvm-svn: 277453

7 years agoclang-tools-extra/test/clang-rename/TemplateTypenameFindBy*.cpp: Appease targeting...
NAKAMURA Takumi [Tue, 2 Aug 2016 13:17:40 +0000 (13:17 +0000)]
clang-tools-extra/test/clang-rename/TemplateTypenameFindBy*.cpp: Appease targeting ms mode.

llvm-svn: 277452

7 years agoclang-tools-extra/test/clang-rename/TemplateTypenameFindBy*.cpp: Move RUN: lines...
NAKAMURA Takumi [Tue, 2 Aug 2016 13:17:36 +0000 (13:17 +0000)]
clang-tools-extra/test/clang-rename/TemplateTypenameFindBy*.cpp: Move RUN: lines below not to be affected by tweaks of parameters.

llvm-svn: 277451

7 years ago[ARM] Improve smul* and smla* isel for Thumb2
Sam Parker [Tue, 2 Aug 2016 12:44:27 +0000 (12:44 +0000)]
[ARM] Improve smul* and smla* isel for Thumb2

Added (sra (shl x, 16), 16) to the sext_16_node PatLeaf for ARM to
simplify some pattern matching. This has allowed several patterns
for smul* and smla* to be removed as well as making it easier to add
the matching for the corresponding instructions for Thumb2 targets.
Also added two Pat classes that are predicated on Thumb2 with the
hasDSP flag and UseMulOps flags. Updated the smul codegen test with
the wider range of patterns plus the ThumbV6 and ThumbV6T2 targets.

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

llvm-svn: 277450

7 years ago[analyzer] Respect statement-specific data in CloneDetection.
Artem Dergachev [Tue, 2 Aug 2016 12:21:09 +0000 (12:21 +0000)]
[analyzer] Respect statement-specific data in CloneDetection.

So far the CloneDetector only respected the kind of each statement when
searching for clones. This patch refines the way the CloneDetector collects data
from each statement by providing methods for each statement kind,
that will read the kind-specific attributes.

For example, statements 'a < b' and 'a > b' are no longer considered to be
clones, because they are different in operation code, which is an attribute
specific to the BinaryOperator statement kind.

Patch by Raphael Isemann!

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

llvm-svn: 277449

7 years agoHexagonVectorPrint.cpp: Fix r277370. Don't use getInstrVecReg() in the expression...
NAKAMURA Takumi [Tue, 2 Aug 2016 11:59:16 +0000 (11:59 +0000)]
HexagonVectorPrint.cpp: Fix r277370. Don't use getInstrVecReg() in the expression of assert(). It has side effects.

llvm-svn: 277448

7 years ago[GlobalISel] Don't RegBankSelect target-specific instructions.
Ahmed Bougacha [Tue, 2 Aug 2016 11:41:16 +0000 (11:41 +0000)]
[GlobalISel] Don't RegBankSelect target-specific instructions.

They don't have types and should be using register classes.

llvm-svn: 277447

7 years ago[GlobalISel] Don't legalize non-generic instructions.
Ahmed Bougacha [Tue, 2 Aug 2016 11:41:09 +0000 (11:41 +0000)]
[GlobalISel] Don't legalize non-generic instructions.

They don't have types and should be legal.

llvm-svn: 277446

7 years ago[GlobalISel] Const-ify MachineInstrs passed to MachineLegalizer.
Ahmed Bougacha [Tue, 2 Aug 2016 11:41:03 +0000 (11:41 +0000)]
[GlobalISel] Const-ify MachineInstrs passed to MachineLegalizer.

llvm-svn: 277445

7 years ago[clang-tidy] Fix an unused-using-decl false positive about template arguments in
Haojian Wu [Tue, 2 Aug 2016 11:26:35 +0000 (11:26 +0000)]
[clang-tidy] Fix an unused-using-decl false positive about template arguments in
function call expression.

Summary:
The check doesn't mark the template argument as used when the template
argument is a template.

Reviewers: djasper, alexfh

Subscribers: klimek, cfe-commits

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

llvm-svn: 277444

7 years agoSupport for OCaml native debugging
Tamas Berghammer [Tue, 2 Aug 2016 11:15:55 +0000 (11:15 +0000)]
Support for OCaml native debugging

This introduces basic support for debugging OCaml binaries.
Use of the native compiler with DWARF emission support (see
https://github.com/ocaml/ocaml/pull/574) is required.

Available variables are considered as 64 bits unsigned integers,
their interpretation will be left to a OCaml-made debugging layer.

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

llvm-svn: 277443

7 years ago[include-fixer] Correct nested class search for identifiers with scoped information
Haojian Wu [Tue, 2 Aug 2016 10:43:10 +0000 (10:43 +0000)]
[include-fixer] Correct nested class search for identifiers with scoped information

Summary:
include-fixer will firstly try to use scoped namespace context information to
search identifier. However, in some cases, it's unsafe to do nested class
search, because it might treat the identifier as a nested class of scoped
namespace.

Given the following code, and the symbol database only has two classes: "foo" and
"b::Bar".

    namespace foo { Bar t; }

Before getting fixing, include-fixer will never search "Bar" symbol.
Because it firstly tries to search "foo::Bar", there is no "Bar" in foo namespace,
then it finds "foo" in database finally. So it treats "Bar" is a nested class
of "foo".

Reviewers: bkramer

Subscribers: cfe-commits

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

llvm-svn: 277442

7 years ago[mips] Update the P5600 scheduler for isComplete = 1
Simon Dardis [Tue, 2 Aug 2016 10:32:00 +0000 (10:32 +0000)]
[mips] Update the P5600 scheduler for isComplete = 1

These changes update the schedule model for the P5600 and includes the
rest of the MSA and MIPS32R5 instruction sets.

Reviewers: dsanders, vkalintris

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

llvm-svn: 277441

7 years ago[ARM] Some saturation instructions not DSP-only
Bernard Ogden [Tue, 2 Aug 2016 10:04:03 +0000 (10:04 +0000)]
[ARM] Some saturation instructions not DSP-only

Summary:
Commit 276701 requires that targets have the DSP extensions to use
certain saturating instructions. This requires some corrections.

For ARM ISA the instructions in question are available in all v6*
architectures.

For Thumb2, the instructions in question are available from v6T2.
SSAT and USAT are part of the base architecture while SSAT16 and
USAT16 require the DSP extensions.

Reviewers: rengolin

Subscribers: aemerson, rengolin, samparker, llvm-commits

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

llvm-svn: 277439

7 years agoclang-rename: split existing options into two new subcommands
Miklos Vajna [Tue, 2 Aug 2016 09:51:31 +0000 (09:51 +0000)]
clang-rename: split existing options into two new subcommands

- rename-at is meant to be integrated with editors and works mainly off
  of a location in a file, and this is the default
- rename-all is optimized for one or more oldname->newname renames, and
  works with clang-apply-replacements

Reviewers: bkramer, klimek

Subscribers: omtcyfz

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

llvm-svn: 277438

7 years ago[clang-rename] add support for template parameter renaming
Kirill Bobyrev [Tue, 2 Aug 2016 09:38:38 +0000 (09:38 +0000)]
[clang-rename] add support for template parameter renaming

Few simple tweaks allow template parameters to be renamed. See
TemplateTypenameFindBy{TemplateParam|TypeInside}.cpp

Reviewers: alexfh

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

llvm-svn: 277437

7 years ago[LoadStoreVectorizer] Don't use a linear walk for an existence check in a SmallPtrSet
Benjamin Kramer [Tue, 2 Aug 2016 09:35:17 +0000 (09:35 +0000)]
[LoadStoreVectorizer] Don't use a linear walk for an existence check in a SmallPtrSet

No functionality change intended.

llvm-svn: 277436

7 years ago[AVX512] Don't use i128 masked gather/scatter/load/store. Do more accurately dataWidt...
Igor Breger [Tue, 2 Aug 2016 09:15:28 +0000 (09:15 +0000)]
[AVX512] Don't use i128 masked gather/scatter/load/store. Do more accurately dataWidth check.

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

llvm-svn: 277435

7 years agoAArch64: Assert on branch displacement bits
Matt Arsenault [Tue, 2 Aug 2016 08:56:52 +0000 (08:56 +0000)]
AArch64: Assert on branch displacement bits

llvm-svn: 277434

7 years ago[clang-rename] add basic Emacs integration
Kirill Bobyrev [Tue, 2 Aug 2016 08:51:26 +0000 (08:51 +0000)]
[clang-rename] add basic Emacs integration

This patch aims to add very basic Emacs integration.

Reviewers: hokein, alexfh

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

llvm-svn: 277433

7 years ago[ELF] - Fix: do not ignore relocations addends when using lld -r
George Rimar [Tue, 2 Aug 2016 08:49:57 +0000 (08:49 +0000)]
[ELF] - Fix: do not ignore relocations addends when using lld -r

Previously addends were ignored. This is PR28779.
Patch fixes the issue.

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

llvm-svn: 277432

7 years agoAArch64: Consolidate branch inversion logic
Matt Arsenault [Tue, 2 Aug 2016 08:30:06 +0000 (08:30 +0000)]
AArch64: Consolidate branch inversion logic

llvm-svn: 277431

7 years agoAArch64: BranchRelaxtion cleanups
Matt Arsenault [Tue, 2 Aug 2016 08:06:17 +0000 (08:06 +0000)]
AArch64: BranchRelaxtion cleanups

Move some logic into TII.

llvm-svn: 277430

7 years agoCorrect makefile.rules to use toolchain specific AR and OBJCOPY
Omair Javaid [Tue, 2 Aug 2016 07:56:11 +0000 (07:56 +0000)]
Correct makefile.rules to use toolchain specific AR and OBJCOPY

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

llvm-svn: 277429

7 years agoAArch64: Add missing branch relaxation tests
Matt Arsenault [Tue, 2 Aug 2016 07:41:05 +0000 (07:41 +0000)]
AArch64: Add missing branch relaxation tests

The branch relaxation pass has the worst test coverage
of any pass in AArch64. Add a few tests that hit some
large pieces of code in the pass.

llvm-svn: 277428

7 years agoAArch64: Fix end iterator dereference
Matt Arsenault [Tue, 2 Aug 2016 07:20:09 +0000 (07:20 +0000)]
AArch64: Fix end iterator dereference

Not all blocks have terminators. I'm not sure how this wasn't
crashing before.

llvm-svn: 277427

7 years ago[LLVM][MIPS] Add (D)SUBU, (D)ADDU, LUI instructions emulation . Fix emulation for...
Nitesh Jain [Tue, 2 Aug 2016 07:18:07 +0000 (07:18 +0000)]
[LLVM][MIPS] Add (D)SUBU, (D)ADDU, LUI instructions emulation . Fix emulation for (D)ADDIU, SD/SW and LW/LD instructions

Reviewers: clayborg, jaydeep, bhushan

Subscribers: mohit.bhakkad, slthakur, sdardis, lldb-commits

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

llvm-svn: 277426

7 years ago[AVX-512] Mark VADDPS/PD and VMULPS/PD as commutable. This necessitated adding itiner...
Craig Topper [Tue, 2 Aug 2016 06:16:53 +0000 (06:16 +0000)]
[AVX-512] Mark VADDPS/PD and VMULPS/PD as commutable. This necessitated adding itineraries to all of the instructions that use the avx512_fp_binop_p class.

llvm-svn: 277422

7 years ago[AVX-512] Use SSE_MUL_ITINS_S/SSE_DIV_ITINS_S for the scalar FMUL/FDIV instructions...
Craig Topper [Tue, 2 Aug 2016 06:16:51 +0000 (06:16 +0000)]
[AVX-512] Use SSE_MUL_ITINS_S/SSE_DIV_ITINS_S for the scalar FMUL/FDIV instructions to match SSE/AVX.

llvm-svn: 277421

7 years agoRevert "[CMake] Pass -nostdlib if supported"
Jonas Hahnfeld [Tue, 2 Aug 2016 06:01:05 +0000 (06:01 +0000)]
Revert "[CMake] Pass -nostdlib if supported"

This reverts commit r277419.

llvm-svn: 277420

7 years ago[CMake] Pass -nostdlib if supported
Jonas Hahnfeld [Tue, 2 Aug 2016 05:51:09 +0000 (05:51 +0000)]
[CMake] Pass -nostdlib if supported

The sanitizers use C++ but don't require linking with the library.

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

llvm-svn: 277419

7 years ago[CMake] Load LLVMConfig for standalone build of builtins
Jonas Hahnfeld [Tue, 2 Aug 2016 05:51:05 +0000 (05:51 +0000)]
[CMake] Load LLVMConfig for standalone build of builtins

Therefore move some code into reusable macros.

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

llvm-svn: 277418

7 years ago[Inliner] Clean up doxygen comments to match modern style.
Chandler Carruth [Tue, 2 Aug 2016 05:49:32 +0000 (05:49 +0000)]
[Inliner] Clean up doxygen comments to match modern style.

llvm-svn: 277417

7 years ago[AVX-512] Correct ExeDomain for many AVX-512 instructions.
Craig Topper [Tue, 2 Aug 2016 05:11:15 +0000 (05:11 +0000)]
[AVX-512] Correct ExeDomain for many AVX-512 instructions.

llvm-svn: 277416

7 years agoMinor code cleanups. NFC.
Junmo Park [Tue, 2 Aug 2016 04:38:27 +0000 (04:38 +0000)]
Minor code cleanups. NFC.

llvm-svn: 277415

7 years ago[Verifier] Improve test coverage for rL277413
Sanjoy Das [Tue, 2 Aug 2016 03:23:22 +0000 (03:23 +0000)]
[Verifier] Improve test coverage for rL277413

As suggest via post-commit review.

llvm-svn: 277414

7 years ago[Verifier] Disallow illegal ptr<->int casts in ConstantExprs
Sanjoy Das [Tue, 2 Aug 2016 02:55:57 +0000 (02:55 +0000)]
[Verifier] Disallow illegal ptr<->int casts in ConstantExprs

This should have been a part of rL277085, but I hadn't considered this
case.

llvm-svn: 277413

7 years agoRevert r277408 and r277407
Bruno Cardoso Lopes [Tue, 2 Aug 2016 02:53:59 +0000 (02:53 +0000)]
Revert r277408 and r277407

Revert r277408 "Fix test from rL277407."
Revert r277407 "[MC] Fix handling of end-of-line preprocessor comments"

This is currently breaking:
  http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/20731

llvm-svn: 277412

7 years agoCodeExtractor : Add ability to preserve profile data.
Sean Silva [Tue, 2 Aug 2016 02:15:45 +0000 (02:15 +0000)]
CodeExtractor : Add ability to preserve profile data.

Added ability to estimate the entry count of the extracted function and
the branch probabilities of the exit branches.

Patch by River Riddle!

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

llvm-svn: 277411

7 years agoRemove DefinedCommon::Section.
Rui Ueyama [Tue, 2 Aug 2016 01:35:13 +0000 (01:35 +0000)]
Remove DefinedCommon::Section.

Since CommonInputSection is a singleton class, we don't need
to store pointers to all DefinedCommon symbols.

llvm-svn: 277410

7 years agoTie the Verifier class to a Module; NFCI
Sanjoy Das [Tue, 2 Aug 2016 01:34:50 +0000 (01:34 +0000)]
Tie the Verifier class to a Module; NFCI

Summary:
This commit changes the Verifier class to accept a Module via the
constructor to make it obvious that a specific instance of the class is
only intended to work with a specific module.  The `updateModule` setter
(despite being private) was making this fact less transparent.

There are fields in the `Verifier` class like `DeoptimizeDeclarations`
and `GlobalValueVisited` which are module specific, so a given
Verifier instance will not in fact work across multiple modules today.
This change just makes that more obvious.

The motivation is to make it easy to get to the datalayout of the
module unambiguously.  That is required to verify that `inttoptr` and
`ptrtoint` constant expressions are well typed in the face of
non-integral pointer types.

Reviewers: dexonsmith, bkramer, majnemer, chandlerc

Subscribers: mehdi_amini, mcrosier, llvm-commits

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

llvm-svn: 277409

7 years agoFix test from rL277407.
Nirav Dave [Tue, 2 Aug 2016 01:27:09 +0000 (01:27 +0000)]
Fix test from rL277407.

llvm-svn: 277408

7 years ago[MC] Fix handling of end-of-line preprocessor comments
Nirav Dave [Tue, 2 Aug 2016 01:05:29 +0000 (01:05 +0000)]
[MC] Fix handling of end-of-line preprocessor comments

Summary:
When parsing assembly where the line comment syntax is not hash, the
lexer cannot distinguish between hash's that start a hash line comment
and one that is part of an assembly statement and must be distinguished
during parsing. Previously, this was incompletely handled by not checking
for EndOfStatement at the end of statements and interpreting hash
prefixed statements as comments.

Change EndOfStatement Parsing to check for Hash comments and reintroduce
Hash statement parsing to catch previously handled cases.

Reviewers: rnk, majnemer

Subscribers: llvm-commits

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

llvm-svn: 277407

7 years ago[winasan] Try to fix LNK4099 warnings seen by users
Reid Kleckner [Tue, 2 Aug 2016 01:02:46 +0000 (01:02 +0000)]
[winasan] Try to fix LNK4099 warnings seen by users

/Zi creates a separate PDB that we're supposed to pass along with our
sanitizer libraries, but the object library compilation rules aren't set
up to handle that. Rather than set that up, put the debug info in the
object files the way every other platform does it with /Z7.

llvm-svn: 277406

7 years agoRevert r276896 "Update Clang Parser test error message to match new parser errors"
Hans Wennborg [Mon, 1 Aug 2016 23:34:42 +0000 (23:34 +0000)]
Revert r276896 "Update Clang Parser test error message to match new parser errors"

This depended on r276895, which was reverted in r277402.

llvm-svn: 277405

7 years agoNFC: fix typo
JF Bastien [Mon, 1 Aug 2016 23:34:29 +0000 (23:34 +0000)]
NFC: fix typo

llvm-svn: 277404

7 years agoimprove test cases to fix bot failure
Xinliang David Li [Mon, 1 Aug 2016 23:20:30 +0000 (23:20 +0000)]
improve test cases to fix bot failure

llvm-svn: 277403

7 years agoRevert r276895 "[MC][X86] Fix Intel Operand assembly parsing for .set ids"
Hans Wennborg [Mon, 1 Aug 2016 23:00:01 +0000 (23:00 +0000)]
Revert r276895 "[MC][X86] Fix Intel Operand assembly parsing for .set ids"

This caused PR28805. Adding a regression test.

llvm-svn: 277402

7 years ago[Order Files] Fixing an error in the perf-helper script
Chris Bieneman [Mon, 1 Aug 2016 22:54:00 +0000 (22:54 +0000)]
[Order Files] Fixing an error in the perf-helper script

Dtrace probemod needs to be based on the first argument of the command, not the first argument of the args. This error was introduced a while back when I added support for skipping the driver and invoking cc1 directly.

llvm-svn: 277401

7 years ago[ADT] NFC: Generalize GraphTraits requirement of "NodeType *" in interfaces to "NodeR...
Tim Shen [Mon, 1 Aug 2016 22:32:20 +0000 (22:32 +0000)]
[ADT] NFC: Generalize GraphTraits requirement of "NodeType *" in interfaces to "NodeRef", and migrate SCCIterator.h to use NodeRef

Summary: By generalize the interface, users are able to inject more flexible Node token into the algorithm, for example, a pair of vector<Node>* and index integer. Currently I only migrated SCCIterator to use NodeRef, but more is coming. It's a NFC.

Reviewers: dblaikie, chandlerc

Subscribers: llvm-commits

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

llvm-svn: 277399

7 years ago[WebAssembly] Support CFI for WebAssembly target
Derek Schuff [Mon, 1 Aug 2016 22:25:02 +0000 (22:25 +0000)]
[WebAssembly] Support CFI for WebAssembly target

Summary: This patch implements CFI for WebAssembly. It modifies the
LowerTypeTest pass to pre-assign table indexes to functions that are
called indirectly, and lowers type checks to test against the
appropriate table indexes. It also modifies the WebAssembly backend to
support a special ".indidx" assembly directive that propagates the table
index assignments out to the linker.

Patch by Dominic Chen

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

llvm-svn: 277398

7 years ago[Orc] Fix common symbol support in ORC.
Lang Hames [Mon, 1 Aug 2016 22:23:24 +0000 (22:23 +0000)]
[Orc] Fix common symbol support in ORC.

Common symbol support in ORC was broken in r270716 when the symbol resolution
rules in RuntimeDyld were changed. With the switch to lazily materialized
symbols in r277386, common symbols can be supported by having
RuntimeDyld::emitCommonSymbols search for (but not materialize!) definitions
elsewhere in the logical dylib.

This patch adds the 'Common' flag to JITSymbolFlags, and the necessary check
to RuntimeDyld::emitCommonSymbols.

llvm-svn: 277397

7 years agoAdd FIXMEs for MSVC 2013 hacks in r277211. NFC.
Paul Robinson [Mon, 1 Aug 2016 22:12:46 +0000 (22:12 +0000)]
Add FIXMEs for MSVC 2013 hacks in r277211. NFC.

llvm-svn: 277396

7 years ago[asan] Disable android-coverage test on anything other than arm.
Evgeniy Stepanov [Mon, 1 Aug 2016 21:58:34 +0000 (21:58 +0000)]
[asan] Disable android-coverage test on anything other than arm.

llvm-svn: 277395

7 years agoSimplify some code found when it was moved in r277177
David Blaikie [Mon, 1 Aug 2016 21:50:43 +0000 (21:50 +0000)]
Simplify some code found when it was moved in r277177

llvm-svn: 277394

7 years ago[PM] Port SpeculativeExecution to the new PM
Michael Kuperstein [Mon, 1 Aug 2016 21:48:33 +0000 (21:48 +0000)]
[PM] Port SpeculativeExecution to the new PM

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

llvm-svn: 277393

7 years ago[WebAssembly] Add asm.js-style exception handling support
Derek Schuff [Mon, 1 Aug 2016 21:34:04 +0000 (21:34 +0000)]
[WebAssembly] Add asm.js-style exception handling support

Summary: This patch includes asm.js-style exception handling support for
WebAssembly. The WebAssembly MVP does not have any support for
unwinding or non-local control flow. In order to support C++ exceptions,
emscripten currently uses JavaScript exceptions along with some support
code (written in JavaScript) that is bundled by emscripten with the
generated code.
This scheme lowers exception-related instructions for wasm such that
wasm modules can be compatible with emscripten's existing scheme and
share the support code.

Patch by Heejin Ahn

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

llvm-svn: 277391

7 years agoCodeGen: simplify the CC handling for TLS wrappers
Saleem Abdulrasool [Mon, 1 Aug 2016 21:31:24 +0000 (21:31 +0000)]
CodeGen: simplify the CC handling for TLS wrappers

Use the calling convention of the wrapper directly to set the calling convention
to ensure that the calling convention matches.  Incorrectly setting the calling
convention results in the code path being entirely nullified as InstCombine +
SimplifyCFG will prune the mismatched CC calls.

llvm-svn: 277390

7 years agoBuild llvm with ccache if package is present
Sumanth Gundapaneni [Mon, 1 Aug 2016 21:28:03 +0000 (21:28 +0000)]
Build llvm with ccache if package is present

This patch has the following changes

The CMake variable LLVM_CCACHE_BUILD is set to OFF by default.
Set this to ON for a ccache enabled build

CCACHE_CPP2 is required to compile the source file directly instead
of compiling the preprocessed file. This will help WERROR is turned ON
for a host clang compiler

The below two options makes more sense in the context of a buildbot

CCACHE_HASHDIR is required to maintain the separate cached data across
builders. This will also help the debuggers to point to the correct source
location

CCACHE_SIZE is important in the perspective of buildbot to increase the
limit on the amount of data to hold in cache for faster compilation

CCACHE_DIR is used to save the cached data to a specific directory.

llvm-svn: 277389

7 years ago[msf] Teach LLVM to parse a split Fpm.
Zachary Turner [Mon, 1 Aug 2016 21:19:45 +0000 (21:19 +0000)]
[msf] Teach LLVM to parse a split Fpm.

The FPM is split at regular intervals across the MSF file, as the MS code
suggests. It turns out that the value of the interval is precisely the
block size. If the block size is 4096, then there are two Fpm pages every
4096 blocks.

So here we teach the PDBFile class to parse a split FPM, and also add more
options when dumping the FPM to display some additional information such
as orphaned pages (pages which the FPM says are allocated, but which
nothing appears to use), use after free pages (pages which the FPM says
are not allocated, but which are referenced by a stream), and multiple use
pages (pages which the FPM says are allocated but are used more than
once).

Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D23022

llvm-svn: 277388

7 years agoMake test more robust with better matching
Xinliang David Li [Mon, 1 Aug 2016 21:06:54 +0000 (21:06 +0000)]
Make test more robust with better matching

llvm-svn: 277387

7 years ago[ExecutionEngine][MCJIT][Orc] Replace RuntimeDyld::SymbolInfo with JITSymbol.
Lang Hames [Mon, 1 Aug 2016 20:49:11 +0000 (20:49 +0000)]
[ExecutionEngine][MCJIT][Orc] Replace RuntimeDyld::SymbolInfo with JITSymbol.

This patch replaces RuntimeDyld::SymbolInfo with JITSymbol: A symbol class
that is capable of lazy materialization (i.e. the symbol definition needn't be
emitted until the address is requested). This can be used to support common
and weak symbols in the JIT (though this is not implemented in this patch).

For consistency, RuntimeDyld::SymbolResolver is renamed to JITSymbolResolver.

For space efficiency a new class, JITEvaluatedSymbol, is introduced that
behaves like the old RuntimeDyld::SymbolInfo - i.e. it is just a pair of an
address and symbol flags. Instances of JITEvaluatedSymbol can be used in
symbol-tables to avoid paying the space cost of the materializer.

llvm-svn: 277386

7 years ago[Hexagon] Tidy up some code, NFC: reapply r277372 with a fix
Krzysztof Parzyszek [Mon, 1 Aug 2016 20:31:50 +0000 (20:31 +0000)]
[Hexagon] Tidy up some code, NFC: reapply r277372 with a fix

llvm-svn: 277383

7 years ago[Profile] Add new test case to cover comdat renaming
Xinliang David Li [Mon, 1 Aug 2016 20:28:26 +0000 (20:28 +0000)]
[Profile] Add new test case to cover comdat renaming

Test checks that context specific profiles for comdat functions
are not lost.

llvm-svn: 277381

7 years agoatomics.align: XFAIL GCC
JF Bastien [Mon, 1 Aug 2016 20:28:13 +0000 (20:28 +0000)]
atomics.align: XFAIL GCC

It currently fails because GCC changed the mangling of templates, which affects std::atomic using __attribute__((vector(X))). The bot using GCC 4.9 generates the following message:

In file included from /home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp:24:0:
/home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic: In instantiation of 'atomic_test<T>::atomic_test() [with T = __vector(2) int]':
/home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp:66:3:   required from here
/home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic:583:5: error: 'std::__1::__gcc_atomic::__gcc_atomic_t<_Tp>::__gcc_atomic_t() [with _Tp = __vector(2) int]' conflicts with a previous declaration
     __gcc_atomic_t() _NOEXCEPT = default;
     ^
/home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic:583:5: note: previous declaration 'std::__1::__gcc_atomic::__gcc_atomic_t<_Tp>::__gcc_atomic_t() [with _Tp = __vector(1) int]'
/home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic:583:5: note: -fabi-version=6 (or =0) avoids this error with a change in mangling
/home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic:583:5: error: 'std::__1::__gcc_atomic::__gcc_atomic_t<_Tp>::__gcc_atomic_t() [with _Tp = __vector(2) int]' conflicts with a previous declaration
/home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic:583:5: note: previous declaration 'std::__1::__gcc_atomic::__gcc_atomic_t<_Tp>::__gcc_atomic_t() [with _Tp = __vector(1) int]'
/home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic:583:5: note: -fabi-version=6 (or =0) avoids this error with a change in mangling
/home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic:939:5: note: synthesized method 'std::__1::__gcc_atomic::__gcc_atomic_t<_Tp>::__gcc_atomic_t() [with _Tp = __vector(2) int]' first required here
     __atomic_base() _NOEXCEPT = default;
     ^

GCC's docs say the following about ABI version 6:
Version 6, which first appeared in G++ 4.7, corrects the promotion behavior of C++11 scoped enums and the mangling of template argument packs, const/static_cast, prefix ++ and –, and a class scope function used as a template argument.

llvm-svn: 277380

7 years ago[Profile] IR profiling minor cleanup /nfc
Xinliang David Li [Mon, 1 Aug 2016 20:25:06 +0000 (20:25 +0000)]
[Profile] IR profiling minor cleanup /nfc

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

llvm-svn: 277379

7 years ago[ObjC Availability] Fix partial-availability false positive introduced in r277058
Erik Pilkington [Mon, 1 Aug 2016 20:19:49 +0000 (20:19 +0000)]
[ObjC Availability] Fix partial-availability false positive introduced in r277058

Thanks to Nico Weber for pointing this out!

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

llvm-svn: 277378

7 years ago[CMake] Don't trust compiler error code, also check for errors
Chris Bieneman [Mon, 1 Aug 2016 20:18:18 +0000 (20:18 +0000)]
[CMake] Don't trust compiler error code, also check for errors

Summary: rnk reported that MSVC ignores unknown flags and still returns 0. This should cause unknown flags to be an error during the compiler check.

Reviewers: rnk

Subscribers: brad.king, llvm-commits

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

llvm-svn: 277377

7 years ago[LV] Move isGatherOrScatterLegal into LoopVectorizationLegality (NFC)
Matthew Simpson [Mon, 1 Aug 2016 20:11:25 +0000 (20:11 +0000)]
[LV] Move isGatherOrScatterLegal into LoopVectorizationLegality (NFC)

llvm-svn: 277376

7 years ago[LV] Use getPointerOperand helper where appropriate (NFC)
Matthew Simpson [Mon, 1 Aug 2016 20:08:09 +0000 (20:08 +0000)]
[LV] Use getPointerOperand helper where appropriate (NFC)

llvm-svn: 277375

7 years agoRevert r277372, it is causing buildbot failures
Krzysztof Parzyszek [Mon, 1 Aug 2016 20:00:33 +0000 (20:00 +0000)]
Revert r277372, it is causing buildbot failures

llvm-svn: 277374

7 years agoAdding smart_ptr benchmark
Ben Craig [Mon, 1 Aug 2016 19:56:39 +0000 (19:56 +0000)]
Adding smart_ptr benchmark

Initial draft here:
https://reviews.llvm.org/D22470
... though this is Eric Fiselier's rewrite to fit in with Google
Benchmark.

llvm-svn: 277373

7 years ago[Hexagon] Tidy up some code, NFC
Krzysztof Parzyszek [Mon, 1 Aug 2016 19:46:21 +0000 (19:46 +0000)]
[Hexagon] Tidy up some code, NFC

llvm-svn: 277372

7 years ago[DAGCombine] Make sext(setcc) combine respect getBooleanContents
Michael Kuperstein [Mon, 1 Aug 2016 19:39:49 +0000 (19:39 +0000)]
[DAGCombine] Make sext(setcc) combine respect getBooleanContents

We used to combine "sext(setcc x, y, cc) -> (select (setcc x, y, cc), -1, 0)"
Instead, we should combine to (select (setcc x, y, cc), T, 0) where the value
of T is 1 or -1, depending on the type of the setcc, and getBooleanContents()
for the type if it is not i1.

This fixes PR28504.

llvm-svn: 277371

7 years ago[Hexagon] Generate vector printing instructions
Ron Lieberman [Mon, 1 Aug 2016 19:36:39 +0000 (19:36 +0000)]
[Hexagon]  Generate vector printing instructions

llvm-svn: 277370

7 years ago[ELF/ARM] Add support for R_ARM_TARGET1 relocation.
Davide Italiano [Mon, 1 Aug 2016 19:28:13 +0000 (19:28 +0000)]
[ELF/ARM] Add support for R_ARM_TARGET1 relocation.

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

llvm-svn: 277369

7 years agolibc++: test lock-free atomic alignment
JF Bastien [Mon, 1 Aug 2016 19:27:08 +0000 (19:27 +0000)]
libc++: test lock-free atomic alignment

Summary:
libc++ implements std::atomic<_Tp> using __atomic_base<_Tp> with
`mutable _Atomic(_Tp) __a_`. That member must be suitably aligned on
relevant ISAs for instructions such as cmpxchg to work properly, but
this alignment isn't checked anywhere. __atomic_base's implementation
relies on _Atomic doing "the right thing" since it's under the
compiler's control, and only the compiler knows about lock-freedom and
instruction generation. This test makes sure that the compiler isn't
breaking libc++'s expectations.

I'm looking at a few odd things in the C++ standard, and will have a few
other fixes around this area in the future.

This requires building with `-DLIBCXX_HAS_ATOMIC_LIB=True`, the test
marks the dependency as REQUIRES and won't be run without.

Reviewers: cfe-commits

Subscribers: EricWF, mclow.lists

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

llvm-svn: 277368

7 years ago[codeview] Skip injected class names in nested record emission
Reid Kleckner [Mon, 1 Aug 2016 18:56:13 +0000 (18:56 +0000)]
[codeview] Skip injected class names in nested record emission

We were already trying to do this, but our check wasn't quite right.

Fixes PR28790

llvm-svn: 277367

7 years ago[CFLAA] Remove modref queries from CFLAA.
George Burgess IV [Mon, 1 Aug 2016 18:47:28 +0000 (18:47 +0000)]
[CFLAA] Remove modref queries from CFLAA.

As it turns out, modref queries are broken with CFLAA. Specifically,
the data source we were using for determining modref behaviors
explicitly ignores operations on non-pointer values. So, it wouldn't
note e.g. storing an i32 to an i32* (or loading an i64 from an i64*).
It also ignores external function calls, rather than acting
conservatively for them.

(N.B. These operations, where necessary, *are* tracked by CFLAA; we just
use a different mechanism to do so. Said mechanism is relatively
imprecise, so it's unlikely that we can provide reasonably good modref
answers with it as implemented.)

Patch by Jia Chen.

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

llvm-svn: 277366

7 years ago[AArch64] Add support for Samsung Exynos M2 (NFC).
Evandro Menezes [Mon, 1 Aug 2016 18:39:55 +0000 (18:39 +0000)]
[AArch64] Add support for Samsung Exynos M2 (NFC).

llvm-svn: 277365

7 years ago[AArch64] Add support for Samsung Exynos M2 (NFC).
Evandro Menezes [Mon, 1 Aug 2016 18:39:45 +0000 (18:39 +0000)]
[AArch64] Add support for Samsung Exynos M2 (NFC).

llvm-svn: 277364

7 years agoUse 'unsigned long' to match the APIs of the MS bitscan intrinsics
Reid Kleckner [Mon, 1 Aug 2016 18:39:27 +0000 (18:39 +0000)]
Use 'unsigned long' to match the APIs of the MS bitscan intrinsics

We were getting warnings about how 'uint32_t*' is different from
'unsigned long*' even though they are effectively the same on Windows.

llvm-svn: 277363

7 years ago[CFLAA] Make CFLAnders more conservative with new Values.
George Burgess IV [Mon, 1 Aug 2016 18:27:33 +0000 (18:27 +0000)]
[CFLAA] Make CFLAnders more conservative with new Values.

Currently, CFLAnders assumes that values it hasn't seen don't alias
anything. This patch fixes that. Given that the only way for this to
happen is to query AA, rely on specific transformations happening, then
query AA again (looking for a specific set of queries), lit testing is a
bit difficult. If someone really wants a test, I'm happy to add one.

Patch by Jia Chen.

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

llvm-svn: 277362

7 years agoIncluded test for r277360.
David Majnemer [Mon, 1 Aug 2016 18:07:19 +0000 (18:07 +0000)]
Included test for r277360.

llvm-svn: 277361

7 years ago[Verifier] Resume instructions can only be in functions w/ a personality
David Majnemer [Mon, 1 Aug 2016 18:06:34 +0000 (18:06 +0000)]
[Verifier] Resume instructions can only be in functions w/ a personality

This fixes PR28799.

llvm-svn: 277360

7 years ago[asan] Remove unused #include (NFC)
Vedant Kumar [Mon, 1 Aug 2016 18:02:56 +0000 (18:02 +0000)]
[asan] Remove unused #include (NFC)

llvm-svn: 277359