platform/upstream/llvm.git
7 years agoDon't check the symbol value in this test.
Rafael Espindola [Mon, 5 Dec 2016 20:56:40 +0000 (20:56 +0000)]
Don't check the symbol value in this test.

llvm-svn: 288702

7 years agoDon't check the symbol values.
Rafael Espindola [Mon, 5 Dec 2016 20:53:11 +0000 (20:53 +0000)]
Don't check the symbol values.

This test is just about which symbols are in which table.

llvm-svn: 288701

7 years agoSimplify test. NFC.
Rafael Espindola [Mon, 5 Dec 2016 20:49:16 +0000 (20:49 +0000)]
Simplify test. NFC.

llvm-svn: 288700

7 years agoMake test test what it should be testing.
Rafael Espindola [Mon, 5 Dec 2016 20:42:58 +0000 (20:42 +0000)]
Make test test what it should be testing.

Looks like the second section in this test was lost along the way.

llvm-svn: 288699

7 years agoAMDGPU: Assembler support for exp
Matt Arsenault [Mon, 5 Dec 2016 20:42:41 +0000 (20:42 +0000)]
AMDGPU: Assembler support for exp

compr is not currently parsed (or printed) correctly,
but that should probably be fixed along with
intrinsic changes.

llvm-svn: 288698

7 years agoAMDGPU: Change how exp is printed
Matt Arsenault [Mon, 5 Dec 2016 20:31:49 +0000 (20:31 +0000)]
AMDGPU: Change how exp is printed

This is an improvement over a long list of unreadable numbers.
A follow up patch will try to match how sc formats these.

llvm-svn: 288697

7 years ago[analyzer] Print type for SymbolRegionValues when dumping to stream
Dominic Chen [Mon, 5 Dec 2016 20:30:11 +0000 (20:30 +0000)]
[analyzer] Print type for SymbolRegionValues when dumping to stream

Reviewers: NoQ, dcoughlin, zaks.anna

Subscribers: cfe-commits

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

llvm-svn: 288696

7 years agoAMDGPU: Refactor exp instructions
Matt Arsenault [Mon, 5 Dec 2016 20:23:10 +0000 (20:23 +0000)]
AMDGPU: Refactor exp instructions

Structure the definitions a bit more like the other classes.

The main change here is to split EXP with the done bit set
to a separate opcode, so we can set mayLoad = 1 so that it won't
be reordered before the other exp stores, since this has the special
constraint that if the done bit is set then this should be the last
exp in she shader.

Previously all exp instructions were inferred to have unmodeled
side effects.

llvm-svn: 288695

7 years ago[lit] Support custom parsers in parseIntegratedTestScript
Eric Fiselier [Mon, 5 Dec 2016 20:21:21 +0000 (20:21 +0000)]
[lit] Support custom parsers in parseIntegratedTestScript

Summary:
Libc++ frequently has the need to parse more than just the builtin *test keywords* (`RUN`, `REQUIRES`, `XFAIL`, ect). For example libc++ currently needs a new keyword `MODULES-DEFINES: macro list...`. Instead of re-implementing the script parsing in libc++ this patch allows `parseIntegratedTestScript` to take custom parsers.

This patch introduces a new class `IntegratedTestKeywordParser` which implements the logic to parse/process a test keyword. Parsing of various keyword "kinds" are supported out of the box, including 'TAG', 'COMMAND', and 'LIST', which parse keywords such as `END.`, `RUN:` and `XFAIL:` respectively.

As an example after this change libc++ can implement the `MODULES-DEFINES` simply using:
```
mparser = IntegratedTestKeywordParser('MODULES-DEFINES:', ParserKind.LIST)
parseIntegratedTestScript(test, additional_parsers=[mparser])
macro_list = mparser.getValue()
```

Reviewers: ddunbar, modocache, rnk, danalbert, jroelofs

Subscribers: mgrang, llvm-commits, cfe-commits

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

llvm-svn: 288694

7 years agoTableGen/AsmMatcherEmitter: Bring sorting check back under EXPENSIVE_CHECKS
Matthias Braun [Mon, 5 Dec 2016 19:44:31 +0000 (19:44 +0000)]
TableGen/AsmMatcherEmitter: Bring sorting check back under EXPENSIVE_CHECKS

Bring the sorting check back that I removed in r288655 but put it under
EXPENSIVE_CHECKS this time. Also document that this the check isn't
purely about having a sorted list but also about operator < having the
correct transitive behavior.

Apply the same to the other check in the file.

llvm-svn: 288693

7 years ago[libc++abi] Add _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS
Shoaib Meenai [Mon, 5 Dec 2016 19:42:11 +0000 (19:42 +0000)]
[libc++abi] Add _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS

It's useful to be able to disable visibility annotations entirely; for
example, if we're building libc++abi static to include in another library,
and we don't want any libc++abi functions getting exported out of that
library. This is a generalization of _LIBCXXABI_DISABLE_DLL_IMPORT_EXPORT.

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

llvm-svn: 288692

7 years ago[CMake] Don't add gtest if it is already there
Chris Bieneman [Mon, 5 Dec 2016 19:40:34 +0000 (19:40 +0000)]
[CMake] Don't add gtest if it is already there

LLVM build trees export the gtest library through a special export set. If you're building against a build tree you shouldn't need to re-add gtest, but if you're building against an installed LLVM you do.

llvm-svn: 288691

7 years ago[libc++] Add _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
Shoaib Meenai [Mon, 5 Dec 2016 19:40:12 +0000 (19:40 +0000)]
[libc++] Add _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS

It's useful to be able to disable visibility annotations entirely; for
example, if we're building libc++ static to include in another library,
and we don't want any libc++ functions getting exported out of that
library. This is a generalization of _LIBCPP_DISABLE_DLL_IMPORT_EXPORT.

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

llvm-svn: 288690

7 years agoFix stack-use-after-scope in CheckExplicitlyDefaultedMemberExceptionSpec
Vitaly Buka [Mon, 5 Dec 2016 19:25:00 +0000 (19:25 +0000)]
Fix stack-use-after-scope in CheckExplicitlyDefaultedMemberExceptionSpec

Summary:
Similar to r288685.
getExceptionSpec returned structure with pointers to temporarily object created
by computeImplicitExceptionSpec.

Reviewers: rsmith

Subscribers: aizatsky, cfe-commits

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

llvm-svn: 288689

7 years ago[AArch64][RegisterBankInfo] Fix typo in the logic used in assert.
Quentin Colombet [Mon, 5 Dec 2016 19:02:37 +0000 (19:02 +0000)]
[AArch64][RegisterBankInfo] Fix typo in the logic used in assert.

Thanks to David Binderman <dcb314@hotmail.com> for bringing it to my
attention.

llvm-svn: 288688

7 years ago[lldb] Update the check for Linux or FreeBSD in SymbolFileDWARF::FindFunctions
Alexander Shaposhnikov [Mon, 5 Dec 2016 18:42:21 +0000 (18:42 +0000)]
[lldb] Update the check for Linux or FreeBSD in SymbolFileDWARF::FindFunctions

This diff
1. Adds a comment to ObjectFileELF.cpp about the current
approach to determining the OS.
2. Replaces the check in SymbolFileDWARF.cpp with a more robust one.

Test plan:
Built (on Linux) a test binary linked to a c++ shared library
which contains just an implementation of a function TestFunction,
the library (the binary itself) doesn't contain ELF notes
and EI_OSABI is set to System V.
Checked in lldb that now "p TestFunction()" works fine
(and doesn't work without this patch).

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

llvm-svn: 288687

7 years agoInclude object file name to an error message.
Rui Ueyama [Mon, 5 Dec 2016 18:40:14 +0000 (18:40 +0000)]
Include object file name to an error message.

llvm-svn: 288686

7 years agoFix stack-use-after-scope in EvaluateImplicitExceptionSpec
Vitaly Buka [Mon, 5 Dec 2016 18:30:22 +0000 (18:30 +0000)]
Fix stack-use-after-scope in EvaluateImplicitExceptionSpec

Summary:
getExceptionSpec returns structure with pointers to temporarily object created
by computeImplicitExceptionSpec.

Reviewers: rsmith

Subscribers: aizatsky, cfe-commits

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

llvm-svn: 288685

7 years agoUse "equivalence class" instead of "color" to describe the concept in ICF.
Rui Ueyama [Mon, 5 Dec 2016 18:11:35 +0000 (18:11 +0000)]
Use "equivalence class" instead of "color" to describe the concept in ICF.

Also add a citation to GNU gold safe ICF paper.

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

llvm-svn: 288684

7 years ago[DIExpression] Introduce a dedicated DW_OP_LLVM_fragment operation
Adrian Prantl [Mon, 5 Dec 2016 18:04:47 +0000 (18:04 +0000)]
[DIExpression] Introduce a dedicated DW_OP_LLVM_fragment operation
so we can stop using DW_OP_bit_piece with the wrong semantics.

The entire back story can be found here:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20161114/405934.html

The gist is that in LLVM we've been misinterpreting DW_OP_bit_piece's
offset field to mean the offset into the source variable rather than
the offset into the location at the top the DWARF expression stack. In
order to be able to fix this in a subsequent patch, this patch
introduces a dedicated DW_OP_LLVM_fragment operation with the
semantics that we used to apply to DW_OP_bit_piece, which is what we
actually need while inside of LLVM. This patch is complete with a
bitcode upgrade for expressions using the old format. It does not yet
fix the DWARF backend to use DW_OP_bit_piece correctly.

Implementation note: We discussed several options for implementing
this, including reserving a dedicated field in DIExpression for the
fragment size and offset, but using an custom operator at the end of
the expression works just fine and is more efficient because we then
only pay for it when we need it.

Differential Revision: https://reviews.llvm.org/D27361
rdar://problem/29335809

llvm-svn: 288683

7 years ago[Sema] Respect DLL attributes more faithfully
Shoaib Meenai [Mon, 5 Dec 2016 18:01:35 +0000 (18:01 +0000)]
[Sema] Respect DLL attributes more faithfully

On MSVC, if an implicit instantiation already exists and an explicit
instantiation definition with a DLL attribute is created, the DLL
attribute still takes effect. Make clang match this behavior for
exporting.

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

llvm-svn: 288682

7 years ago[compiler-rt] Remove duplicates from COMPILER_RT_SUPPORTED_ARCH
Kuba Mracek [Mon, 5 Dec 2016 17:52:45 +0000 (17:52 +0000)]
[compiler-rt] Remove duplicates from COMPILER_RT_SUPPORTED_ARCH

Since we’re adding an entry into COMPILER_RT_SUPPORTED_ARCH for all architectures of all Darwin platforms, COMPILER_RT_SUPPORTED_ARCH often ends up having duplicate items. Let’s remove them.

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

llvm-svn: 288681

7 years agoRemove existing file in a separate thread asynchronously.
Rui Ueyama [Mon, 5 Dec 2016 17:40:37 +0000 (17:40 +0000)]
Remove existing file in a separate thread asynchronously.

On Linux (and probably on other Unix-like systems), unlink(2) is
noticeably slow. It takes 250 milliseconds to remove a 1 GB file
on ext4 filesystem on my machine, whether the file is on SSD or
on a spinning disk.

To create a new result file, we remove existing file first. So, if
you repeatedly link a 1 GB program in a regular compile-link-debug
cycle, every cycle wastes 250 milliseconds only to remove a file.

Since LLD can link a 1 GB in about 5 seconds, that waste actually
matters.

This patch defines `unlinkAsync` function. The function spawns a
background thread to call unlink. The calling thread returns
almost immediately.

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

llvm-svn: 288680

7 years ago[CMake] Fix symlink refactor for multi-configuration generators
Chris Bieneman [Mon, 5 Dec 2016 17:02:11 +0000 (17:02 +0000)]
[CMake] Fix symlink refactor for multi-configuration generators

This fix, while a bit complicated, preserves the reusability while fixing the issues reported on llvm-commits with visual studio generators.

llvm-svn: 288679

7 years ago[ELF] Print file:line for unknown PHDR error
Eugene Leviant [Mon, 5 Dec 2016 16:38:32 +0000 (16:38 +0000)]
[ELF] Print file:line for unknown PHDR error

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

llvm-svn: 288678

7 years ago[analyzer] ObjCGenerics: Warn only on mismatch for invariant type parameters
Devin Coughlin [Mon, 5 Dec 2016 16:28:47 +0000 (16:28 +0000)]
[analyzer] ObjCGenerics: Warn only on mismatch for invariant type parameters

On a method call, the ObjCGenerics checker uses the type tracked by
DynamicTypePropagation for the receiver to to infer substituted parmeter types
for the called methods and warns when the argument type does not match the
parameter.

Unfortunately, using the tracked type can result in false positives when the
receiver has a non-invariant type parameter and has been intentionally upcast.
For example, becaue NSArray's type parameter is covaraint, the following code
is perfectly safe:

NSArray<NSString *> *allStrings = ...
NSDate *date = ...;
NSArray<NSObject *> *allObjects = allStrings;
NSArray<NSObject *> *moreObjects = [allObjects arrayByAddingObject:date];

but the checker currently warns that the date parameter is not an NSString *.

To avoid this kind of false positive, the checker will now only warn when
the class defining the called method has only invariant type parameters.

rdar://problem/28803951

llvm-svn: 288677

7 years ago[TargetLowering] add special-case for demanded bits analysis of 'not'
Sanjay Patel [Mon, 5 Dec 2016 15:58:21 +0000 (15:58 +0000)]
[TargetLowering] add special-case for demanded bits analysis of 'not'

We treat bitwise 'not' as a special operation and try not to reduce its all-ones mask.
Presumably, this is because a 'not' may be cheaper than a generic 'xor' or it may get
folded into another logic op if the target has those. However, if we can remove a logic
instruction by changing the xor's constant mask value, that should always be a win.

Note that the IR version of SimplifyDemandedBits() does not treat 'not' as a special-case
currently (although that's marked with a FIXME). So if you run this IR through -instcombine,
you should get the same end result. I'm hoping to add a different backend transform that
will expose this problem though, so I need to solve this first.

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

llvm-svn: 288676

7 years ago[x86] fold fand (fxor X, -1) Y --> fandn X, Y
Sanjay Patel [Mon, 5 Dec 2016 15:45:27 +0000 (15:45 +0000)]
[x86] fold fand (fxor X, -1) Y --> fandn X, Y

I noticed this gap in the scalar FP-logic matching with:
D26712
and:
rL287171

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

llvm-svn: 288675

7 years agoRemove superfluous android include
Pavel Labath [Mon, 5 Dec 2016 14:57:23 +0000 (14:57 +0000)]
Remove superfluous android include

This file is not in the include path when building with a non-standalone
toolchain. In does not seem to be necessary anyway.

llvm-svn: 288674

7 years agoRemove one more if(__ANDROID_NDK__) I missed
Pavel Labath [Mon, 5 Dec 2016 14:57:19 +0000 (14:57 +0000)]
Remove one more if(__ANDROID_NDK__) I missed

llvm-svn: 288673

7 years agoRemove a couple of memset usages from TSan, introduced in r288624.
Daniel Jasper [Mon, 5 Dec 2016 14:37:42 +0000 (14:37 +0000)]
Remove a couple of memset usages from TSan, introduced in r288624.

TSan runtime shouldn't contain memset, so internal_memset is used
instead and syntax that emits memset is avoided.

This doesn't fail in-tree due to TSan being build with -03, but it fails
when TSan is built with -O0, and is (I think) a true positive.

Patch by Sam McCall, review: https://reviews.llvm.org/D27407

llvm-svn: 288672

7 years agoUse range based for loop. NFCI.
Simon Pilgrim [Mon, 5 Dec 2016 14:25:04 +0000 (14:25 +0000)]
Use range based for loop. NFCI.

llvm-svn: 288671

7 years agoELF/AArch64: Fix R_AARCH64_LDST16_ABS_LO12_NC mask
Adhemerval Zanella [Mon, 5 Dec 2016 14:15:44 +0000 (14:15 +0000)]
ELF/AArch64: Fix R_AARCH64_LDST16_ABS_LO12_NC mask

The relocation R_AARCH64_LDST16_ABS_LO12_NC should set a ld/st
immediate value to bits [11:1] not [11:2].  This patches fixes it
and adds a testcase for regression.

With this fix all the faulty tests on test-suite (clavm, lencod,
and trimaran) pass.

llvm-svn: 288670

7 years agoELF/AArch64: Simplify R_AARCH64_ADD_ABS_LO12_NC relocation
Adhemerval Zanella [Mon, 5 Dec 2016 14:15:03 +0000 (14:15 +0000)]
ELF/AArch64: Simplify R_AARCH64_ADD_ABS_LO12_NC relocation

This patch uses the updateAArch64Add on relocation apply and remove
the comment.

llvm-svn: 288669

7 years agoELF/AArch64: consolidate getAArch64Page implementation
Adhemerval Zanella [Mon, 5 Dec 2016 14:14:26 +0000 (14:14 +0000)]
ELF/AArch64: consolidate getAArch64Page implementation

This patch avoid getAArch64Page code duplication by removing the
implementation at InputSection.

llvm-svn: 288668

7 years ago[PPC] Slightly Improve Assembly Parsing errors and add EOL comment
Nirav Dave [Mon, 5 Dec 2016 14:11:03 +0000 (14:11 +0000)]
[PPC] Slightly Improve Assembly Parsing errors and add EOL comment
parsing tests.

NFC intended.

llvm-svn: 288667

7 years ago[mips][ias] N32/N64 must not sort the relocation table.
Simon Dardis [Mon, 5 Dec 2016 12:55:19 +0000 (12:55 +0000)]
[mips][ias] N32/N64 must not sort the relocation table.

Doing so changes the evaluation order for relocation composition.

Patch By: Daniel Sanders

Reviewers: vkalintiris, atanasyan

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

llvm-svn: 288666

7 years agoCFGBuilder: Fix crash when visiting delete expression on dependent type
Martin Bohme [Mon, 5 Dec 2016 11:33:19 +0000 (11:33 +0000)]
CFGBuilder: Fix crash when visiting delete expression on dependent type

Summary:
CXXDeleteExpr::getDestroyedType() can return a null QualType if the destroyed
type is a dependent type. This patch protects against this.

Reviewers: klimek

Subscribers: cfe-commits

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

llvm-svn: 288665

7 years agoClean out unused diagnostics. NFC.
Benjamin Kramer [Mon, 5 Dec 2016 11:30:24 +0000 (11:30 +0000)]
Clean out unused diagnostics. NFC.

llvm-svn: 288664

7 years ago[X86][SSE] Add support for combining target shuffles to UNPCKL/UNPCKH.
Simon Pilgrim [Mon, 5 Dec 2016 11:25:13 +0000 (11:25 +0000)]
[X86][SSE] Add support for combining target shuffles to UNPCKL/UNPCKH.

llvm-svn: 288663

7 years ago[change-namespace] get changing namespace to global correct.
Eric Liu [Mon, 5 Dec 2016 11:17:04 +0000 (11:17 +0000)]
[change-namespace] get changing namespace to global correct.

llvm-svn: 288662

7 years agoClean up some use of __ANDROID_NDK__ in the cmake files
Pavel Labath [Mon, 5 Dec 2016 11:15:36 +0000 (11:15 +0000)]
Clean up some use of __ANDROID_NDK__ in the cmake files

Rationale:
scripts/Python/modules: android is excluded at a higher level, so no point in
  checking here
tools/lldb-mi: lldb-mi builds fine (with some cosmetic tweaks) on android, and
  there is no reason it shouldn't.
tools/lldb-server: LLDB_DISABLE_LIBEDIT/CURSES already take the platform into
  account, so there is no point in checking again.

I am reasonably confident this should not break the build on any platform, but
I'll keep an eye out on the bots.

llvm-svn: 288661

7 years agoHandle tests for noexcept that expect a false value
Roger Ferrer Ibanez [Mon, 5 Dec 2016 11:05:09 +0000 (11:05 +0000)]
Handle tests for noexcept that expect a false value

Under libcpp-no-exceptions, noexcept is trivially true. Some tests expect in
the usual setting to return false, so adjust them to expect true under
libcpp-no-exceptions.

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

llvm-svn: 288660

7 years ago[X86][SSE] Add helper function to create UNPCKL/UNPCKH shuffle masks. NFCI.
Simon Pilgrim [Mon, 5 Dec 2016 11:00:25 +0000 (11:00 +0000)]
[X86][SSE] Add helper function to create UNPCKL/UNPCKH shuffle masks. NFCI.

llvm-svn: 288659

7 years ago[GlobalISel] Extract handleAssignments out of AArch64CallLowering
Diana Picus [Mon, 5 Dec 2016 10:40:33 +0000 (10:40 +0000)]
[GlobalISel] Extract handleAssignments out of AArch64CallLowering

This function seems target-independent so far: all the target-specific behaviour
is isolated in the CCAssignFn and the ValueHandler (which we're also extracting
into the generic CallLowering).

The intention is to use this in the ARM backend.

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

llvm-svn: 288658

7 years ago[AMDGPU] Disassembler: fix s_buffer_store_dword instructions
Sam Kolton [Mon, 5 Dec 2016 09:58:51 +0000 (09:58 +0000)]
[AMDGPU] Disassembler: fix s_buffer_store_dword instructions

Summary: s_buffer_store_dword instructions sdata operand was called sdst in encoding. This caused disassembler to fail.

Reviewers: tstellarAMD, vpykhtin, artem.tamazov

Subscribers: arsenm, nhaehnle, rampitec

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

llvm-svn: 288657

7 years ago[cmake] Include component in Sphinx install rules
Michal Gorny [Mon, 5 Dec 2016 09:15:05 +0000 (09:15 +0000)]
[cmake] Include component in Sphinx install rules

Include component in install rules for Sphinx targets. Based on
a similar suggestion for other doc targets in D24935.

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

llvm-svn: 288656

7 years agoTableGen/AsmMatcherEmitter: Trust that stable_sort works
Matthias Braun [Mon, 5 Dec 2016 08:15:57 +0000 (08:15 +0000)]
TableGen/AsmMatcherEmitter: Trust that stable_sort works

A debug build of AsmMatcherEmitter would use a quadratic algorithm to
check whether std::stable_sort() actually sorted. Let's hope the authors
of our C++ standard library did that testing for us. Removing the check
gives a 3x speedup in the X86 case.

llvm-svn: 288655

7 years agoDR1213: element access on an array xvalue or prvalue produces an xvalue. In the
Richard Smith [Mon, 5 Dec 2016 07:49:14 +0000 (07:49 +0000)]
DR1213: element access on an array xvalue or prvalue produces an xvalue. In the
latter case, a temporary array object is materialized, and can be
lifetime-extended by binding a reference to the member access. Likewise, in an
array-to-pointer decay, an rvalue array is materialized before being converted
into a pointer.

This caused IR generation to stop treating file-scope array compound literals
as having static storage duration in some cases in C++; that has been rectified
by modeling such a compound literal as an lvalue. This also improves clang's
compatibility with GCC for those cases.

llvm-svn: 288654

7 years agoTableGen: Some more std::string->StringInit* replacements
Matthias Braun [Mon, 5 Dec 2016 07:35:13 +0000 (07:35 +0000)]
TableGen: Some more std::string->StringInit* replacements

llvm-svn: 288653

7 years agoTableGen/Record: Shortcut member access in hottest function
Matthias Braun [Mon, 5 Dec 2016 07:35:09 +0000 (07:35 +0000)]
TableGen/Record: Shortcut member access in hottest function

This may seem unusual, but makes most debug tblgen builds ~10% faster.
Usually we wouldn't care about speed that much in debug builds, but for
tblgen that also translates into build time.

llvm-svn: 288652

7 years agoTableGen: TableGenStringKey is no longer necessary as of r288642
Matthias Braun [Mon, 5 Dec 2016 07:04:19 +0000 (07:04 +0000)]
TableGen: TableGenStringKey is no longer necessary as of r288642

llvm-svn: 288651

7 years agoTableGen: Use range based for; reserve vectors where possible
Matthias Braun [Mon, 5 Dec 2016 07:00:44 +0000 (07:00 +0000)]
TableGen: Use range based for; reserve vectors where possible

llvm-svn: 288650

7 years agoTableGen/TGParser: Prefer SmallVector/ArrayRef over std::vector
Matthias Braun [Mon, 5 Dec 2016 06:41:54 +0000 (06:41 +0000)]
TableGen/TGParser: Prefer SmallVector/ArrayRef over std::vector

llvm-svn: 288649

7 years agoTableGen/Record: Replace std::vector with SmallVector/ArrayRef
Matthias Braun [Mon, 5 Dec 2016 06:41:51 +0000 (06:41 +0000)]
TableGen/Record: Replace std::vector with SmallVector/ArrayRef

llvm-svn: 288648

7 years agoListInit::convertInitializerTo: avoid foldingset lookup if nothing changed
Matthias Braun [Mon, 5 Dec 2016 06:41:47 +0000 (06:41 +0000)]
ListInit::convertInitializerTo: avoid foldingset lookup if nothing changed

llvm-svn: 288647

7 years ago[X86] Remove unnecessary explicit uses of .SimpleTy just to do an equality comparison...
Craig Topper [Mon, 5 Dec 2016 06:09:55 +0000 (06:09 +0000)]
[X86] Remove unnecessary explicit uses of .SimpleTy just to do an equality comparison. MVT's operator== already takes care of this. NFCI

llvm-svn: 288646

7 years agoAdapt to llvm/TableGen DagInit changes.
Matthias Braun [Mon, 5 Dec 2016 06:00:51 +0000 (06:00 +0000)]
Adapt to llvm/TableGen DagInit changes.

llvm-svn: 288645

7 years agoTableGen: Use StringInit instead of std::string for DagInit arg names
Matthias Braun [Mon, 5 Dec 2016 06:00:46 +0000 (06:00 +0000)]
TableGen: Use StringInit instead of std::string for DagInit arg names

llvm-svn: 288644

7 years agoTableGen: Use StringInit instead of std::string for DagInit name
Matthias Braun [Mon, 5 Dec 2016 06:00:41 +0000 (06:00 +0000)]
TableGen: Use StringInit instead of std::string for DagInit name

llvm-svn: 288643

7 years agoTableGen: Use more StringInit instead of StringRef
Matthias Braun [Mon, 5 Dec 2016 06:00:36 +0000 (06:00 +0000)]
TableGen: Use more StringInit instead of StringRef

This forces the code to call StringInit::get on the string early and
avoids storing duplicates in std::string and sometimes allows pointer
comparisons instead of string comparisons.

llvm-svn: 288642

7 years ago[AVX-512] Teach fast isel to handle 512-bit vector bitcasts.
Craig Topper [Mon, 5 Dec 2016 05:50:51 +0000 (05:50 +0000)]
[AVX-512] Teach fast isel to handle 512-bit vector bitcasts.

llvm-svn: 288641

7 years agoUse Darwin libtool's -no_warning_for_no_symbols if available to silence the "has...
Kuba Mracek [Mon, 5 Dec 2016 05:21:44 +0000 (05:21 +0000)]
Use Darwin libtool's -no_warning_for_no_symbols if available to silence the "has no symbols" link warning

Building compiler-rt on Darwin produces dozens of meaningless warnings about object files having no symbols during static archive creation. This is very intentional as compiler-rt uses #ifdefs to conditionally compile platform-specific code, and we even have a .cpp source file that only contains static asserts to make sure the environment is configured right. On Linux, this situation is fine and no warning is produced. This patch adds a libtool version detection and if it's new enough, we'll use the -no_warning_for_no_symbols flag that suppresses this warning. Build logs should be much cleaner now!

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

llvm-svn: 288640

7 years agoTableGen: Factor out STRCONCAT constructor, add shortcut.
Matthias Braun [Mon, 5 Dec 2016 05:21:18 +0000 (05:21 +0000)]
TableGen: Factor out STRCONCAT constructor, add shortcut.

Introduce new constructor for STRCONCAT binop with a shortcut that
immediately concatenates if the two arguments are StringInits.
Makes the QualifyName code more readable and tablegen 2-3% faster.

llvm-svn: 288639

7 years agoTableGen/Record: Move PointerIntPair to less used field of RecordVal
Matthias Braun [Mon, 5 Dec 2016 05:21:13 +0000 (05:21 +0000)]
TableGen/Record: Move PointerIntPair to less used field of RecordVal

llvm-svn: 288638

7 years ago[Hexagon] Adding additional tokenization characters in preparation for removing spaci...
Colin LeMahieu [Mon, 5 Dec 2016 04:52:28 +0000 (04:52 +0000)]
[Hexagon] Adding additional tokenization characters in preparation for removing spacing from syntax.

llvm-svn: 288637

7 years ago[AVX-512] Teach fast isel to use masked compare and movss for handling scalar cmp...
Craig Topper [Mon, 5 Dec 2016 04:51:31 +0000 (04:51 +0000)]
[AVX-512] Teach fast isel to use masked compare and movss for handling scalar cmp and select sequence when AVX-512 is enabled. This matches the behavior of normal isel.

llvm-svn: 288636

7 years ago[AVX-512] Add avx512f command lines to fast isel SSE select test.
Craig Topper [Mon, 5 Dec 2016 04:51:28 +0000 (04:51 +0000)]
[AVX-512] Add avx512f command lines to fast isel SSE select test.

Currently the fast isel code emits an avx1 instruction sequence even with avx512. This is different than normal isel. A follow up commit will fix this.

llvm-svn: 288635

7 years ago[Hexagon] Changing from literal numeric value to argument since #-1 will not parse...
Colin LeMahieu [Mon, 5 Dec 2016 04:29:00 +0000 (04:29 +0000)]
[Hexagon] Changing from literal numeric value to argument since #-1 will not parse when '-' is converted to a token.

llvm-svn: 288634

7 years ago[CMake] Use add_llvm_tool_symlink's OUTPUT_DIR option
Chris Bieneman [Mon, 5 Dec 2016 03:29:10 +0000 (03:29 +0000)]
[CMake] Use add_llvm_tool_symlink's OUTPUT_DIR option

This is updating to take r288632 into account.

llvm-svn: 288633

7 years ago[CMake] Refactor add_llvm_tool_symlink for reuse
Chris Bieneman [Mon, 5 Dec 2016 03:28:03 +0000 (03:28 +0000)]
[CMake] Refactor add_llvm_tool_symlink for reuse

The old implementation of add_llvm_tool_symlink could fail in odd ways when building out of tree. This version solves that problem by not using the LLVM_* variables, and instead reaeding the target's properties.

llvm-svn: 288632

7 years agoRun the last iteration of parallel_for_loop using a threadpool.
Rui Ueyama [Mon, 5 Dec 2016 02:07:29 +0000 (02:07 +0000)]
Run the last iteration of parallel_for_loop using a threadpool.

Remainders of tasks were ran in the main thread, so parallel_for_each
could theoretically take 2x time than the ideal.

llvm-svn: 288631

7 years agoSimplify ICF alignment handling.
Rui Ueyama [Mon, 5 Dec 2016 01:31:39 +0000 (01:31 +0000)]
Simplify ICF alignment handling.

llvm-svn: 288630

7 years agoIRGen: Remove an unused overload of CreateAlignedLoad.
Peter Collingbourne [Mon, 5 Dec 2016 00:02:18 +0000 (00:02 +0000)]
IRGen: Remove an unused overload of CreateAlignedLoad.

llvm-svn: 288629

7 years ago[X86][XOP] Add target shuffle tests showing missing UNPCKL combine.
Simon Pilgrim [Sun, 4 Dec 2016 22:55:57 +0000 (22:55 +0000)]
[X86][XOP] Add target shuffle tests showing missing UNPCKL combine.

llvm-svn: 288628

7 years ago[X86][AVX512] Add target shuffle tests showing missing UNPCK combines.
Simon Pilgrim [Sun, 4 Dec 2016 22:54:21 +0000 (22:54 +0000)]
[X86][AVX512] Add target shuffle tests showing missing UNPCK combines.

llvm-svn: 288627

7 years agoRevert "Recover better from an incompatible .pcm file being provided by -fmodule...
Daniel Jasper [Sun, 4 Dec 2016 22:34:37 +0000 (22:34 +0000)]
Revert "Recover better from an incompatible .pcm file being provided by -fmodule-file=. We try to include the headers of the module textually in this case, still enforcing the modules semantic rules. In order to make that work, we need to still track that we're entering and leaving the module. Also, if the module was also marked as unavailable (perhaps because it was missing a file), we shouldn't mark the module unavailable -- we don't need the module to be complete if we're going to enter it textually."

This reverts commit r288449.

I believe that this is currently faulty wrt. modules being imported
inside namespaces. Adding these lines to the new test:

  namespace n {
  #include "foo.h"
  }

Makes it break with

  fatal error: import of module 'M' appears within namespace 'n'

However, I believe it should fail with

  error: redundant #include of module 'M' appears within namespace 'n'

I have tracked this down to us now inserting a tok::annot_module_begin
instead of a tok::annot_module_include in
Preprocessor::HandleIncludeDirective() and then later in
Parser::parseMisplacedModuleImport(), we hit the code path for
tok::annot_module_begin, which doesn't set FromInclude of
checkModuleImportContext to true (thus leading to the "wrong"
diagnostic).

llvm-svn: 288626

7 years agoUpdate status page for variant implementation
Eric Fiselier [Sun, 4 Dec 2016 22:14:53 +0000 (22:14 +0000)]
Update status page for variant implementation

llvm-svn: 288625

7 years ago[sanitizer] Make atos stdin a non-tty pipe to make sure it's not stuck waiting for...
Kuba Mracek [Sun, 4 Dec 2016 21:52:21 +0000 (21:52 +0000)]
[sanitizer] Make atos stdin a non-tty pipe to make sure it's not stuck waiting for user input

On macOS, we often symbolicate using atos (when llvm-symbolizer is not found). The current way we invoke atos involves creating a pseudo-terminal to make sure atos doesn't buffer its output. This however also makes atos think that it's stdin is interactive and in some error situations it will ask the user to enter some input instead of just printing out an error message. For example, when Developer Mode isn't enabled on a machine, atos cannot examine processes, and it will ask the user to enter an administrator's password, which will make the sanitized process get stuck. This patch only connects the pseudo-terminal to the stdout of atos, and uses a regular pipe as its stdin.

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

llvm-svn: 288624

7 years agoChoose better hash values for std::monostate and valueless variants.
Eric Fiselier [Sun, 4 Dec 2016 21:37:37 +0000 (21:37 +0000)]
Choose better hash values for std::monostate and valueless variants.

Previously these hashes were 0 and -1 respectively. These seem like common
sentinel values and should be avoided to prevent needless collisions.

This patch changes those values to different arbitrary numbers, which should
hopefully cause less collisions. Because I couldn't help myself I choose the
fundamental constants for gravity and the speed of light.

llvm-svn: 288623

7 years ago[X86] Mark 256-bit DPPS intrinsic as commutable to increase load matching opportunities.
Craig Topper [Sun, 4 Dec 2016 21:13:05 +0000 (21:13 +0000)]
[X86] Mark 256-bit DPPS intrinsic as commutable to increase load matching opportunities.

llvm-svn: 288622

7 years ago[X86] Add Commutative property to several MMX arithmetic and logic intrinsics.
Craig Topper [Sun, 4 Dec 2016 21:13:01 +0000 (21:13 +0000)]
[X86] Add Commutative property to several MMX arithmetic and logic intrinsics.

I think these intrinsics were added after the Commutative was added to most of the rest of the intrinsics and it must have been forgotten.

llvm-svn: 288621

7 years agoRe-implement the optimization that I removed in r288527.
Rui Ueyama [Sun, 4 Dec 2016 16:33:13 +0000 (16:33 +0000)]
Re-implement the optimization that I removed in r288527.

I removed a wrong optimization for ICF in r288527. Sean Silva suggested
in a post commit review that the correct algorithm can be implemented
easily. So is this patch.

llvm-svn: 288620

7 years ago[stl-extras] Provide an adaptor of std::count for ranges.
Michael Gottesman [Sun, 4 Dec 2016 10:26:53 +0000 (10:26 +0000)]
[stl-extras] Provide an adaptor of std::count for ranges.

llvm-svn: 288619

7 years ago[AVR] Remove 'XFAIL' from a CodeGen test
Dylan McKay [Sun, 4 Dec 2016 09:50:42 +0000 (09:50 +0000)]
[AVR] Remove 'XFAIL' from a CodeGen test

This seems to be fixed as of r288052.

llvm-svn: 288618

7 years agoDon't discard .L symbol with -r.
Rafael Espindola [Sun, 4 Dec 2016 08:34:17 +0000 (08:34 +0000)]
Don't discard .L symbol with -r.

They might be used by relocations.

Fixes pr31252.

llvm-svn: 288617

7 years agoAlways use / as the path separator.
Rafael Espindola [Sun, 4 Dec 2016 07:27:02 +0000 (07:27 +0000)]
Always use / as the path separator.

It is not clear if it is worth the complexity to use \ on
windows. This should fix the bots.

llvm-svn: 288616

7 years agoPrefix path when displaying thin archives.
Rafael Espindola [Sun, 4 Dec 2016 06:52:30 +0000 (06:52 +0000)]
Prefix path when displaying thin archives.

Patch by Mark Santaniello.

llvm-svn: 288615

7 years agoTableGen: Adapt to llvm r288612
Matthias Braun [Sun, 4 Dec 2016 05:55:09 +0000 (05:55 +0000)]
TableGen: Adapt to llvm r288612

llvm-svn: 288614

7 years agoTableGen: Store Records on a BumpPtrAllocator
Matthias Braun [Sun, 4 Dec 2016 05:48:20 +0000 (05:48 +0000)]
TableGen: Store Records on a BumpPtrAllocator

All these records are internalized and will live until exit.  This makes
them perfect candidates for a fast BumpPtrAllocator.

llvm-svn: 288613

7 years agoTableGen: Use StringRef instead of const std::string& in return vals.
Matthias Braun [Sun, 4 Dec 2016 05:48:16 +0000 (05:48 +0000)]
TableGen: Use StringRef instead of const std::string& in return vals.

This will allow to switch to a different string storage in an upcoming
commit.

llvm-svn: 288612

7 years agoTableGen: Optimize common string concatenation with SmallString
Matthias Braun [Sun, 4 Dec 2016 05:48:06 +0000 (05:48 +0000)]
TableGen: Optimize common string concatenation with SmallString

llvm-svn: 288611

7 years agoTableGen: Use StringRef instead of const std::string& for parameters
Matthias Braun [Sun, 4 Dec 2016 05:48:03 +0000 (05:48 +0000)]
TableGen: Use StringRef instead of const std::string& for parameters

This avoid an extra construction of a std::string (and a heap
allocation) when the caller only has a StringRef but no std::string at
hand.

llvm-svn: 288610

7 years agoUpdate comment to clarify the machine spec.
Rui Ueyama [Sun, 4 Dec 2016 02:34:29 +0000 (02:34 +0000)]
Update comment to clarify the machine spec.

llvm-svn: 288609

7 years ago[Object][MachO] Reference-ify some helper function arguments. NFC.
Lang Hames [Sun, 4 Dec 2016 01:56:10 +0000 (01:56 +0000)]
[Object][MachO] Reference-ify some helper function arguments. NFC.

Changes all static helper functions in MachOObjectFile.cpp that expect a
non-null MachOObjectFile pointer to take a reference instead.

llvm-svn: 288608

7 years ago[MC] Generalize MCContext's SectionSymbols field.
Dan Gohman [Sat, 3 Dec 2016 23:55:57 +0000 (23:55 +0000)]
[MC] Generalize MCContext's SectionSymbols field.

Change SectionSymbols so that it doesn't hard-code ELF types, so that
it can be used for non-ELF targets.

llvm-svn: 288607

7 years agoAdd comments about the use of threads in LLD.
Rui Ueyama [Sat, 3 Dec 2016 23:35:22 +0000 (23:35 +0000)]
Add comments about the use of threads in LLD.

llvm-svn: 288606

7 years agoAdd the --no-color option to the git call in the doc when using clang-format-diff
Sylvestre Ledru [Sat, 3 Dec 2016 23:22:45 +0000 (23:22 +0000)]
Add the --no-color option to the git call in the doc when using clang-format-diff

llvm-svn: 288605

7 years ago[WebAssembly] Revert r288447.
Dan Gohman [Sat, 3 Dec 2016 23:03:52 +0000 (23:03 +0000)]
[WebAssembly] Revert r288447.

Revert r288447 which introduced -mdirect. It turns out we don't need a
custom flag for this, as the information we need is in the target triple.

llvm-svn: 288604

7 years agoDAG: Fold out out of bounds insert_vector_elt
Matt Arsenault [Sat, 3 Dec 2016 23:03:26 +0000 (23:03 +0000)]
DAG: Fold out out of bounds insert_vector_elt

getNode already prevents formation of out of bounds constant
extract_vector_elts. Do the same for insert_vector_elt.

llvm-svn: 288603