platform/upstream/llvm.git
7 years agoMark LWG 2716 as complete - shuffle and sample disallows lvalue URNGs.
Eric Fiselier [Sun, 28 Aug 2016 21:55:00 +0000 (21:55 +0000)]
Mark LWG  2716 as complete - shuffle and sample disallows lvalue URNGs.

Libc++'s implementation of shuffle and sample already support lvalue and rvalue
RNG's. This patch adds tests for both categories and marks the issue as complete.

This patch also contains drive-by change for std::experimental::sample which
improves the diagnostics produced when the correct iterator categories are
not supplied.

llvm-svn: 279947

7 years agoAST: improve layout of SimpleTypoCorrector
Saleem Abdulrasool [Sun, 28 Aug 2016 21:33:30 +0000 (21:33 +0000)]
AST: improve layout of SimpleTypoCorrector

Add the "explicit" specifier to the single-argument constructor of
SimpleTypoCorrector.  Reorder the fields to remove excessive padding (8 bytes).

Patch by Alexander Shaposhnikov!

llvm-svn: 279946

7 years agoImplement LWG 2711. Constrain path members.
Eric Fiselier [Sun, 28 Aug 2016 21:26:01 +0000 (21:26 +0000)]
Implement LWG 2711. Constrain path members.

llvm-svn: 279945

7 years agoFix some typos in the doc
Sylvestre Ledru [Sun, 28 Aug 2016 20:33:42 +0000 (20:33 +0000)]
Fix some typos in the doc

llvm-svn: 279944

7 years agoFix some typos in the doc
Sylvestre Ledru [Sun, 28 Aug 2016 20:29:18 +0000 (20:29 +0000)]
Fix some typos in the doc

llvm-svn: 279943

7 years agoFix a typo in the doc: overriden -> overridden
Sylvestre Ledru [Sun, 28 Aug 2016 20:22:34 +0000 (20:22 +0000)]
Fix a typo in the doc: overriden -> overridden

llvm-svn: 279942

7 years agoEHABI: fail on WMMX vops without WMMX support
Saleem Abdulrasool [Sun, 28 Aug 2016 20:10:33 +0000 (20:10 +0000)]
EHABI: fail on WMMX vops without WMMX support

When the unwinder is built without WMMX support, if we encounter a WMMX register
virtual operation, early rather than attempting to continue as we would not have
saved the register set anyways.  This should never come down this path, but,
just in case, help it abort more explicitly.

llvm-svn: 279941

7 years ago[Docs] Update libc++ target names after r279675.
Eric Fiselier [Sun, 28 Aug 2016 18:33:08 +0000 (18:33 +0000)]
[Docs] Update libc++ target names after r279675.

llvm-svn: 279940

7 years ago[x86] add tests for <3 x N> vector types (PR29114)
Sanjay Patel [Sun, 28 Aug 2016 18:31:32 +0000 (18:31 +0000)]
[x86] add tests for <3 x N> vector types (PR29114)

llvm-svn: 279939

7 years ago[CMake] Be more consistent about naming targets and components in libc++abi
Eric Fiselier [Sun, 28 Aug 2016 18:28:51 +0000 (18:28 +0000)]
[CMake] Be more consistent about naming targets and components in libc++abi

This patch (and commit summary) mirror r279675 by Chris B which was applied
to libc++ but not libc++abi.

Summary:
The point of this patch is to have a consistent convention for naming build,
check and install targets so that the targets can be constructed from the
project name.

This change renames a bunch of CMake components and targets from libcxxabi to
cxxabi. For each renamed target I've added a convenience target that matches
the old target name and depends on the new target. This will preserve function
of the old targets so that the change doesn't break the world. We can evaluate
if it is worth removing the extra targets later.

llvm-svn: 279938

7 years ago[InstCombine] use m_APInt to allow icmp (and X, Y), C folds for splat constant vectors
Sanjay Patel [Sun, 28 Aug 2016 18:18:00 +0000 (18:18 +0000)]
[InstCombine] use m_APInt to allow icmp (and X, Y), C folds for splat constant vectors

llvm-svn: 279937

7 years ago[CMake] Apply r279151 cleanup to libc++abi.
Eric Fiselier [Sun, 28 Aug 2016 18:16:18 +0000 (18:16 +0000)]
[CMake] Apply r279151 cleanup to libc++abi.

This patch applies changes similar to those in r279515 to libc++abi.

Summary of changes in this patch:

* Renamed variable LLVM_CONFIG -> LLVM_CONFIG_PATH
* Renamed variable LIBCXXABI_BUILT_STANDALONE -> LIBCXXABI_STANDALONE_BUILD
* Add an include of AddLLVM in the tests subdirectory for add_lit_testsuite.

llvm-svn: 279936

7 years agotest: fix test under ASAN and MSAN
Saleem Abdulrasool [Sun, 28 Aug 2016 18:16:00 +0000 (18:16 +0000)]
test: fix test under ASAN and MSAN

When we're running tests under ASAN or MSAN, they're compiled with -O1, which
enables tail call elimination. This causes backtrace_test to fail: the compiler
performs tail call elimination for call3_nothrow, but it can't for call3_throw,
leading to a mismatched frame count. Disable tail call elimination (and
inlining, just to be explicit) to avoid this.

Patch by Shoaib Meenai!

llvm-svn: 279935

7 years ago[X86][AVX512] Only combine EVEX targets shuffles to shuffles of the same number of...
Simon Pilgrim [Sun, 28 Aug 2016 17:27:14 +0000 (17:27 +0000)]
[X86][AVX512] Only combine EVEX targets shuffles to shuffles of the same number of vector elements

Over eager combing prevents the correct folding of writemasks.

At the moment this occurs for ALL EVEX shuffles, in the future we need to check that the user of the root shuffle is a VSELECT that can fold to a writemask.

llvm-svn: 279934

7 years ago[PowerPC] Implement lowering for atomicrmw min/max/umin/umax
Hal Finkel [Sun, 28 Aug 2016 16:17:58 +0000 (16:17 +0000)]
[PowerPC] Implement lowering for atomicrmw min/max/umin/umax

Implement lowering for atomicrmw min/max/umin/umax. Fixes PR28818.

llvm-svn: 279933

7 years agoRevert "Start reifying error descriptions. Second try: Try to appease Visual Studio."
Filipe Cabecinhas [Sun, 28 Aug 2016 10:42:21 +0000 (10:42 +0000)]
Revert "Start reifying error descriptions. Second try: Try to appease Visual Studio."

This reverts r279931. Will try it with the same Visual Studio version
before committing again.

llvm-svn: 279932

7 years agoStart reifying error descriptions. Second try: Try to appease Visual Studio.
Filipe Cabecinhas [Sun, 28 Aug 2016 10:32:44 +0000 (10:32 +0000)]
Start reifying error descriptions. Second try: Try to appease Visual Studio.

Summary:
This commit sets up the infrastructure to use reified error
descriptions, and moves ReportStackOverflow to the new system.

After we convert all the errors, we'll be able to simplify ScopedInErrorReport
and remove the older debugging mechanism which had some errors partly reified
in some way. We'll be able to maintain the external API.

ScopedInErrorReport will be able to track one of the reified errors at a time.
The purpose of this is so we have its destructor actually print the error and
possibly interface with the debugger (will depend on the platform, of course).

Reviewers: kcc, samsonov, timurrrr

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 279931

7 years ago[Loop Vectorizer] Fixed memory confilict checks.
Elena Demikhovsky [Sun, 28 Aug 2016 08:53:53 +0000 (08:53 +0000)]
[Loop Vectorizer] Fixed memory confilict checks.

Fixed a bug in run-time checks for possible memory conflicts inside loop.
The bug is in Low <-> High boundaries calculation. The High boundary should be calculated as "last memory access pointer + element size".

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

llvm-svn: 279930

7 years ago[AVX-512] Promote AND/OR/XOR to v2i64/v4i64/v8i64 even when we have AVX512F/AVX512VL.
Craig Topper [Sun, 28 Aug 2016 06:06:28 +0000 (06:06 +0000)]
[AVX-512] Promote AND/OR/XOR to v2i64/v4i64/v8i64 even when we have AVX512F/AVX512VL.

Previously we weren't creating masked logical operations if bitcasts appeared between the logic operation and the select. The IR optimizers can move bitcasts across logic operations and create these cases. To minimize the number of cases we need to handle, this change promotes all logic ops to an i64 vector type just like when only SSE or AVX is available.

Unfortunately, this also has the consequence of making it difficult to select unmasked VPANDD/VPORD/VPXORD in all the cases it was previously used. This is the cause of most of the test change. This shouldn't result in any functional change though.

llvm-svn: 279929

7 years ago[AVX-512] Add tests to show that we don't select masked logic ops if there are bitcas...
Craig Topper [Sun, 28 Aug 2016 06:06:24 +0000 (06:06 +0000)]
[AVX-512] Add tests to show that we don't select masked logic ops if there are bitcasts between the logic op and the select.

This is taken from optimized IR of clang test cases for masked logic ops.

llvm-svn: 279928

7 years ago[X86] Rename PABSB/D/W instructions to be consistent with SSE/AVX instructions instea...
Craig Topper [Sun, 28 Aug 2016 06:06:21 +0000 (06:06 +0000)]
[X86] Rename PABSB/D/W instructions to be consistent with SSE/AVX instructions instead of ending 128/256. NFC

llvm-svn: 279927

7 years agoAvoid embedded preprocessor directives in __tree
Dimitry Andric [Sat, 27 Aug 2016 19:32:03 +0000 (19:32 +0000)]
Avoid embedded preprocessor directives in __tree

Similar to rL242623, move C++ version checks outside of _NOEXCEPT_()
macro invocation argument lists, to avoid "embedding a directive within
macro arguments has undefined behavior" warnings.

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

llvm-svn: 279926

7 years agoAMDGPU/R600: Enable Load combine
Jan Vesely [Sat, 27 Aug 2016 19:09:43 +0000 (19:09 +0000)]
AMDGPU/R600: Enable Load combine

Fix and improve tests

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

llvm-svn: 279925

7 years ago[X86] Rename predicate function that detects if requires one of the REX.B, REX.X...
Craig Topper [Sat, 27 Aug 2016 17:13:43 +0000 (17:13 +0000)]
[X86] Rename predicate function that detects if requires one of the REX.B, REX.X or REX.R bits. It's old name conflicted with a function in X8II namespace that doesnt' quite do the same thing. NFC

llvm-svn: 279924

7 years ago[X86] Keep looping over operands looking for byte registers even if we already found...
Craig Topper [Sat, 27 Aug 2016 17:13:41 +0000 (17:13 +0000)]
[X86] Keep looping over operands looking for byte registers even if we already found a register that requires a REX prefix. Otherwise we don't error if a high byte register is used after SPL/BPL/DIL/SIL.

llvm-svn: 279923

7 years ago[X86] Include XMM/YMM/ZMM16-23 in X86II::isX86_64ExtendedReg. This feels more consist...
Craig Topper [Sat, 27 Aug 2016 17:13:37 +0000 (17:13 +0000)]
[X86] Include XMM/YMM/ZMM16-23 in X86II::isX86_64ExtendedReg. This feels more consistent with its name and simplifies assembler code.

llvm-svn: 279922

7 years ago[X86] Don't allow DR8-DR15 to be assembled in 32-bit mode. Add missing test for CR8...
Craig Topper [Sat, 27 Aug 2016 17:13:34 +0000 (17:13 +0000)]
[X86] Don't allow DR8-DR15 to be assembled in 32-bit mode. Add missing test for CR8-CR15.

llvm-svn: 279921

7 years agoFix some build bot breakages.
Zachary Turner [Sat, 27 Aug 2016 16:38:11 +0000 (16:38 +0000)]
Fix some build bot breakages.

There was some code that was ifdef'ed out that I didn't catch
in my earlier patch.

llvm-svn: 279920

7 years agoAdd some unit tests for StringExtractor::GetNameColonValue.
Zachary Turner [Sat, 27 Aug 2016 16:35:15 +0000 (16:35 +0000)]
Add some unit tests for StringExtractor::GetNameColonValue.

These are helpful on their own, but will be even more useful
once the GetNameColonValue is updated to return StringRefs
instead of std::strings.

llvm-svn: 279919

7 years ago[asan] Disable tests more selectively.
Akira Hatanaka [Sat, 27 Aug 2016 16:06:36 +0000 (16:06 +0000)]
[asan] Disable tests more selectively.

Add "target-arch+host-os" to the feature list to enable disabling the
tests I committed in r279614 and r279880 more selectively.

llvm-svn: 279918

7 years agoConvert some functions to use StringRef instead of c_str, len
Zachary Turner [Sat, 27 Aug 2016 15:52:29 +0000 (15:52 +0000)]
Convert some functions to use StringRef instead of c_str, len

This started as an effort to change StringExtractor to store a
StringRef internally instead of a std::string.  I got that working
locally with just 1 test failure which I was unable to figure out the
cause of.  But it was also a massive changelist due to a trickle
down effect of changes.

So I'm starting over, using what I learned from the first time to
tackle smaller, more isolated changes hopefully leading up to
a full conversion by the end.

At first the changes (such as in this CL) will seem mostly
a matter of preference and pointless otherwise.  However, there
are some places in my larger CL where using StringRef turned 20+
lines of code into 2, drastically simplifying logic.  Hopefully
once these go in they will illustrate some of the benefits of
thinking in terms of StringRef.

llvm-svn: 279917

7 years ago[asan] Use "REQUIRES: x86_64-target-arch" to disable the test on i386.
Akira Hatanaka [Sat, 27 Aug 2016 05:57:50 +0000 (05:57 +0000)]
[asan] Use "REQUIRES: x86_64-target-arch" to disable the test on i386.

My attempt to disable this test on i386 by adding "UNSUPPORTED: i386-apple"
in r279880 wasn't succesful, so I'm using REQUIRES instead.

llvm-svn: 279916

7 years ago[X86] Remove stale comment about FixupBWInsts pass being off by default. NFC
Craig Topper [Sat, 27 Aug 2016 05:26:54 +0000 (05:26 +0000)]
[X86] Remove stale comment about FixupBWInsts pass being off by default. NFC

llvm-svn: 279915

7 years ago[AVX-512] Allow EVEX encoding unordered/ordered/equal/notequal VCMPPS/PD/SS/SD to...
Craig Topper [Sat, 27 Aug 2016 05:22:15 +0000 (05:22 +0000)]
[AVX-512] Allow EVEX encoding unordered/ordered/equal/notequal VCMPPS/PD/SS/SD to be commuted just like the SSE and AVX counterparts.

llvm-svn: 279914

7 years ago[X86] Enable FR32/FR64 cmpeq/cmpne/cmpunord/cmpord to be commuted.
Craig Topper [Sat, 27 Aug 2016 05:22:12 +0000 (05:22 +0000)]
[X86] Enable FR32/FR64 cmpeq/cmpne/cmpunord/cmpord to be commuted.

llvm-svn: 279913

7 years ago[AVX-512] Add load folding for EVEX vcmpps/pd/ss/sd.
Craig Topper [Sat, 27 Aug 2016 05:22:08 +0000 (05:22 +0000)]
[AVX-512] Add load folding for EVEX vcmpps/pd/ss/sd.

llvm-svn: 279912

7 years ago[LTO] Don't create a new common unless merged has different size
Teresa Johnson [Sat, 27 Aug 2016 04:41:22 +0000 (04:41 +0000)]
[LTO] Don't create a new common unless merged has different size

Summary:
This addresses a regression in common handling from the new LTO
API in r278338. Only create a new common if the size is different.
The type comparison against an array type fails when the size is
different but not an array. GlobalMerge does not handle the
array types as well and we lose some global merging opportunities.

Reviewers: mehdi_amini

Subscribers: junbuml, llvm-commits, mehdi_amini

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

llvm-svn: 279911

7 years agoAMDGPU: Mark sched model complete
Matt Arsenault [Sat, 27 Aug 2016 03:39:27 +0000 (03:39 +0000)]
AMDGPU: Mark sched model complete

Fixes bug 26800

llvm-svn: 279910

7 years agoAMDGPU: Remove unneeded implicit exec uses/defs
Matt Arsenault [Sat, 27 Aug 2016 03:00:51 +0000 (03:00 +0000)]
AMDGPU: Remove unneeded implicit exec uses/defs

SI_BREAK, SI_IF_BREAK, and SI_ELSE_BREAK do not def exec.
SI_IF_BREAK and SI_ELSE_BREAK do not read it either.

llvm-svn: 279909

7 years ago[Orc] Explicitly specify type for assignment.
Lang Hames [Sat, 27 Aug 2016 02:59:24 +0000 (02:59 +0000)]
[Orc] Explicitly specify type for assignment.

This should fix the MSVC errors in
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15120

llvm-svn: 279908

7 years agoGVN-hoist: invalidate MD cache (PR29144)
Sebastian Pop [Sat, 27 Aug 2016 02:48:41 +0000 (02:48 +0000)]
GVN-hoist: invalidate MD cache (PR29144)

Without invalidating the entries in the MD cache we would try to access instructions
that were removed in previous iterations of hoisting.

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

llvm-svn: 279907

7 years ago[RegBankSelect] Do not abort when the target wants to fall back.
Quentin Colombet [Sat, 27 Aug 2016 02:38:27 +0000 (02:38 +0000)]
[RegBankSelect] Do not abort when the target wants to fall back.

llvm-svn: 279906

7 years ago[InstructionSelect] Do not abort when the target wants to fall back.
Quentin Colombet [Sat, 27 Aug 2016 02:38:24 +0000 (02:38 +0000)]
[InstructionSelect] Do not abort when the target wants to fall back.

llvm-svn: 279905

7 years ago[MachineLegalize] Do not abort when the target wants to fall back.
Quentin Colombet [Sat, 27 Aug 2016 02:38:21 +0000 (02:38 +0000)]
[MachineLegalize] Do not abort when the target wants to fall back.

llvm-svn: 279904

7 years agoAdd attribute noreturn to functions that throw
Aditya Kumar [Sat, 27 Aug 2016 02:26:42 +0000 (02:26 +0000)]
Add attribute noreturn to functions that throw

Reviewers: mclow.lists, EricWF, howard.hinnant, sebpop
Subscribers: cfe-commits

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

llvm-svn: 279903

7 years agoAMDGPU: Select mulhi 24-bit instructions
Matt Arsenault [Sat, 27 Aug 2016 01:32:27 +0000 (01:32 +0000)]
AMDGPU: Select mulhi 24-bit instructions

llvm-svn: 279902

7 years agoAMDGPU: Move cndmask pseudo to be isel pseudo
Matt Arsenault [Sat, 27 Aug 2016 01:00:37 +0000 (01:00 +0000)]
AMDGPU: Move cndmask pseudo to be isel pseudo

There's only one use of this for the convenience
of a pattern. I think v_mov_b64_pseudo should also be
moved, but SIFoldOperands does currently make use of it.

llvm-svn: 279901

7 years agoAMDGPU: Fix sched type for branches
Matt Arsenault [Sat, 27 Aug 2016 00:51:02 +0000 (00:51 +0000)]
AMDGPU: Fix sched type for branches

llvm-svn: 279900

7 years agoAMDGPU: Remove register operand from si_mask_branch
Matt Arsenault [Sat, 27 Aug 2016 00:42:21 +0000 (00:42 +0000)]
AMDGPU: Remove register operand from si_mask_branch

It isn't used for anything, and is also misleading since
it could be spilled at the end of the block, so it can't be relied
on. There ends up being a verifier error about using an undefined
register since the spill kills the register.

llvm-svn: 279899

7 years ago[asan] restrict release_to_os_test.cc to x86_64
Kostya Serebryany [Sat, 27 Aug 2016 00:36:20 +0000 (00:36 +0000)]
[asan] restrict release_to_os_test.cc to x86_64

llvm-svn: 279898

7 years agoThis test now succeeds.
Jim Ingham [Sat, 27 Aug 2016 00:35:48 +0000 (00:35 +0000)]
This test now succeeds.

llvm-svn: 279897

7 years agoFixed the location of a conditional to make the following code clearer.
Sean Callanan [Sat, 27 Aug 2016 00:35:37 +0000 (00:35 +0000)]
Fixed the location of a conditional to make the following code clearer.

llvm-svn: 279896

7 years agoAMDGPU: Improve error reporting for maximum branch distance
Matt Arsenault [Sat, 27 Aug 2016 00:21:22 +0000 (00:21 +0000)]
AMDGPU: Improve error reporting for maximum branch distance

Unfortunately this seems to only help the assembler diagnostic.

llvm-svn: 279895

7 years agoThe error stream in IRForTarget is never null, so use it instead of the log.
Sean Callanan [Sat, 27 Aug 2016 00:20:38 +0000 (00:20 +0000)]
The error stream in IRForTarget is never null, so use it instead of the log.

llvm-svn: 279894

7 years ago[CMake] Only generate Components.cmake if components are specified
Chris Bieneman [Sat, 27 Aug 2016 00:19:51 +0000 (00:19 +0000)]
[CMake] Only generate Components.cmake if components are specified

Generating the Components import file is useless if there are no components coming in from the runtimes configuration, so we should skip generation in that case.

This also should fix the configuration error that Renato reported on llvm-dev.

llvm-svn: 279893

7 years ago[ORC] Fix typo in LogicalDylib, add unit test.
Lang Hames [Sat, 27 Aug 2016 00:19:05 +0000 (00:19 +0000)]
[ORC] Fix typo in LogicalDylib, add unit test.

llvm-svn: 279892

7 years ago[GlobalISel] Add a fallback path to SDISel.
Quentin Colombet [Sat, 27 Aug 2016 00:18:31 +0000 (00:18 +0000)]
[GlobalISel] Add a fallback path to SDISel.

When global-isel fails on a MachineFunction MF, MF will be cleaned up
and given to SDISel.
Thanks to this fallback, we can already perform correctness test even if
we support only a small portion of the functions in a test.

llvm-svn: 279891

7 years ago[AArch64][CallLowering] Do not assert for not implemented part.
Quentin Colombet [Sat, 27 Aug 2016 00:18:28 +0000 (00:18 +0000)]
[AArch64][CallLowering] Do not assert for not implemented part.

When doing the ABI lowering, report a failure to the caller instead of
asserting. This gives a chance for the caller to recover.

llvm-svn: 279890

7 years ago[GlobalISel] Teach the core pipeline not to run if ISel failed.
Quentin Colombet [Sat, 27 Aug 2016 00:18:24 +0000 (00:18 +0000)]
[GlobalISel] Teach the core pipeline not to run if ISel failed.

llvm-svn: 279889

7 years ago[X86] Add baseline test for "odd" shuffles. NFC.
Michael Kuperstein [Sat, 27 Aug 2016 00:10:24 +0000 (00:10 +0000)]
[X86] Add baseline test for "odd" shuffles. NFC.

Adds a baseline test for lowering shuffles where the width of the output
vector is not twice the size of the input vectors. Many of those sequences
are suboptimal, and will hopefully be improved in follow-up patches.

llvm-svn: 279888

7 years ago[asan] first attempt at releasing free-d memory back to the system using madvise...
Kostya Serebryany [Fri, 26 Aug 2016 23:58:42 +0000 (23:58 +0000)]
[asan] first attempt at releasing free-d memory back to the system using madvise. Requires quite some tuning.

llvm-svn: 279887

7 years ago[IRTranslator] Do not abort when the target wants to fall back.
Quentin Colombet [Fri, 26 Aug 2016 23:49:05 +0000 (23:49 +0000)]
[IRTranslator] Do not abort when the target wants to fall back.

Every pass in the GlobalISel pipeline will need to do something similar.

llvm-svn: 279886

7 years ago[MFProperties] Introduce a FailedISel property.
Quentin Colombet [Fri, 26 Aug 2016 23:49:01 +0000 (23:49 +0000)]
[MFProperties] Introduce a FailedISel property.

This is used to communicate that the instruction selection pipeline
failed at some point.
Another way to achieve that would be to have some kind of conditional
scheduling in the PassManager, such that we only schedule a pass based
on the success/failure of another one. The property approach has the
advantage of being lightweight and solve the problem at stake.

llvm-svn: 279885

7 years agoFixed a bad lldbassert() condition.
Sean Callanan [Fri, 26 Aug 2016 23:48:03 +0000 (23:48 +0000)]
Fixed a bad lldbassert() condition.

llvm-svn: 279884

7 years ago[ThinLTO] Move loading of cache entry to client
Teresa Johnson [Fri, 26 Aug 2016 23:29:14 +0000 (23:29 +0000)]
[ThinLTO] Move loading of cache entry to client

Summary:
Have the cache pass back the path to the cache entry when it
is ready to be loaded, instead of a buffer.

For gold-plugin we can simply pass this file back to gold directly,
which avoids expensive writing of a separate tmp file. Ensure
the cache entry is not deleted on cleanup by adjusting the setting
of the IsTemporary flags.

Moved the loading of the buffer into llvm-lto2 to maintain current
behavior.

Reviewers: mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 279883

7 years agoTables of command options in LLDB benefit from hand-formatting to make it
Kate Stone [Fri, 26 Aug 2016 23:28:47 +0000 (23:28 +0000)]
Tables of command options in LLDB benefit from hand-formatting to make it
easier to scan a set of options with a relatively large number of positional
arguments. This commit standardizes their formatting throughout LLDB and
applies surrounding directives to exempt them from being formatted by
clang-format.

These kinds of exemptions should be rare cases that benefit significantly
from alternative formatting. They also imply a long-term obligation to
maintain their format since the automated tools will not do so.

llvm-svn: 279882

7 years agoAdding document describing the use of the -opt-bisect-limit option.
Andrew Kaylor [Fri, 26 Aug 2016 23:11:48 +0000 (23:11 +0000)]
Adding document describing the use of the -opt-bisect-limit option.

llvm-svn: 279881

7 years ago[asan] Mark symbolize_pc.cc as UNSUPPORTED on i386-apple.
Akira Hatanaka [Fri, 26 Aug 2016 23:08:28 +0000 (23:08 +0000)]
[asan] Mark symbolize_pc.cc as UNSUPPORTED on i386-apple.

atos currently doesn't work well when loaded from 32-bit binaries, which
was causing some of the bots to fail. Disable this test until we can
come up with a better fix.

llvm-svn: 279880

7 years ago[TargetPassConfig] Add a target hook to know what GlobalISel should do on error.
Quentin Colombet [Fri, 26 Aug 2016 22:32:59 +0000 (22:32 +0000)]
[TargetPassConfig] Add a target hook to know what GlobalISel should do on error.

By default, this hook tells GlobalISel to abort (report a fatal error)
when it encounters an error. The alternative will be to fall back on
SDISel.
This fall back will be removed when the bring-up of GlobalISel is over.

llvm-svn: 279879

7 years ago[IRTranslator][NFC] Use DEBUG_TYPE instead of repeating the name.
Quentin Colombet [Fri, 26 Aug 2016 22:32:57 +0000 (22:32 +0000)]
[IRTranslator][NFC] Use DEBUG_TYPE instead of repeating the name.

llvm-svn: 279878

7 years ago[SelectionDAG] Do not run the ISel process on already selected code.
Quentin Colombet [Fri, 26 Aug 2016 22:32:55 +0000 (22:32 +0000)]
[SelectionDAG] Do not run the ISel process on already selected code.

Right now, this cannot happen, but with the fall back path of GlobalISel
it will show up eventually.

llvm-svn: 279877

7 years ago[MachineFunction] Introduce a reset method.
Quentin Colombet [Fri, 26 Aug 2016 22:32:53 +0000 (22:32 +0000)]
[MachineFunction] Introduce a reset method.

This method allows to reset the state of a MachineFunction as if it was
just created. This will be used during the bring-up of GlobalISel to
provide a way to fallback on SelectionDAG. That way, we can start doing
correctness testing even if we are not able to select all functions via
the global instruction selector.

llvm-svn: 279876

7 years agoTableGen: Switch from a std::map to a DenseMap in CodeGenSubRegIndex. NFC
Justin Bogner [Fri, 26 Aug 2016 22:29:36 +0000 (22:29 +0000)]
TableGen: Switch from a std::map to a DenseMap in CodeGenSubRegIndex. NFC

This mapping is between pointers, which DenseMap is particularly good
at. Most targets aren't really affected, but if there's a lot of
subregister composition this can shave off a good chunk of time from
generating registers.

llvm-svn: 279875

7 years ago[MFProperties] Introduce a reset method with no argument.
Quentin Colombet [Fri, 26 Aug 2016 22:09:11 +0000 (22:09 +0000)]
[MFProperties] Introduce a reset method with no argument.

This method allows to reset all the properties in one go.

llvm-svn: 279874

7 years ago[MFProperties][NFC] Rename clear into reset to match BitVector naming.
Quentin Colombet [Fri, 26 Aug 2016 22:09:08 +0000 (22:09 +0000)]
[MFProperties][NFC] Rename clear into reset to match BitVector naming.

The name clear is used to reset all the bit in bitvectors and using it
to reset just properties was confusing.

llvm-svn: 279873

7 years agoclang-cl: Support MSVC2015's /validate-charset flag.
Nico Weber [Fri, 26 Aug 2016 21:51:14 +0000 (21:51 +0000)]
clang-cl: Support MSVC2015's /validate-charset flag.

Clang always assumes that files are utf-8. If an invalidly encoded character is
used in an identifier, clang always errors. If it's used in a character
literal, clang warns Winvalid-source-encoding (on by default). Clang never
checks the encoding of things in comments (adding this seems like a nice
feature if it doesn't impact performance).

For cl.exe /utf-8 (which enables /validate-charset), if a bad character is used
in an identifier, it emits both an error and a warning. If it's used in a
literal or a comment, it emits a warning.

So mapping /validate-charset to -Winvalid-source-encoding seems like a fairly
decent fit.

https://reviews.llvm.org/D23945

llvm-svn: 279872

7 years ago[ARM] Adding .arch directives around WMMX unwind code
Renato Golin [Fri, 26 Aug 2016 21:45:39 +0000 (21:45 +0000)]
[ARM] Adding .arch directives around WMMX unwind code

Some unwind code is purposedly old enough to work on previous architecutres
and they're guaranteed to never trigger in newer architectures, so we need
to add .arch directives to tell the compiler/assembler that it's fine and we
know what we're doing.

Fixes PR29149.

llvm-svn: 279871

7 years agoAMDGPU/SI: Canonicalize offset order for merged DS instructions
Tom Stellard [Fri, 26 Aug 2016 21:36:47 +0000 (21:36 +0000)]
AMDGPU/SI: Canonicalize offset order for merged DS instructions

Summary:
If the scheduler clusters the loads, then the offsets will be sorted,
but it is possible for the scheduler to scheduler loads together
without out explicitly clustering them, which would give us non-sorted
offsets.

Also, we will want to do this if we move the load/store optimizer before
the scheduler.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits, kzhuravl

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

llvm-svn: 279870

7 years agoclang-cl: Accept MSVC2015's '/utf-8' flag.
Nico Weber [Fri, 26 Aug 2016 21:26:29 +0000 (21:26 +0000)]
clang-cl: Accept MSVC2015's '/utf-8' flag.

Clang always behaves as if that's passed, so just ignore the flag.

llvm-svn: 279869

7 years agoXXX
Tom Stellard [Fri, 26 Aug 2016 21:16:40 +0000 (21:16 +0000)]
XXX

llvm-svn: 279868

7 years agoAMDGPU/SI: Use a better method for determining the largest pressure sets
Tom Stellard [Fri, 26 Aug 2016 21:16:37 +0000 (21:16 +0000)]
AMDGPU/SI: Use a better method for determining the largest pressure sets

Summary:
There are a few different sgpr pressure sets, but we only care about
the one which covers all of the sgprs.  We were using hard-coded
register pressure set names to determine the reg set id for the
biggest sgpr set.  However, we were using the wrong name, and this
method is pretty fragile, since the reg pressure set names may
change.

The new method just looks for the pressure set that contains the most
reg units and sets that set as our SGPR pressure set.  We've also
adopted the same technique for determining our VGPR pressure set.

Reviewers: arsenm

Subscribers: MatzeB, arsenm, llvm-commits, kzhuravl

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

llvm-svn: 279867

7 years agoclang-cl: Accept MSVC 2015's `/execution-charset:utf-8` flag.
Nico Weber [Fri, 26 Aug 2016 21:11:43 +0000 (21:11 +0000)]
clang-cl: Accept MSVC 2015's `/execution-charset:utf-8` flag.

Also makes -fexec-charset accept utf-8 case-insensitively.
Like https://reviews.llvm.org/D23807, but for execution-charset.
Also replace a few .lower() comparisons with equals_lower().

https://reviews.llvm.org/D23938

llvm-svn: 279866

7 years agoRevert "Start reifying error descriptions"
Filipe Cabecinhas [Fri, 26 Aug 2016 20:59:02 +0000 (20:59 +0000)]
Revert "Start reifying error descriptions"

This reverts r279862 to investigate VS failures.

llvm-svn: 279865

7 years ago[CMake] Connect Compiler-RT targets to LLVM Runtimes directory
Chris Bieneman [Fri, 26 Aug 2016 20:52:22 +0000 (20:52 +0000)]
[CMake] Connect Compiler-RT targets to LLVM Runtimes directory

This patch builds on LLVM r279776.

In this patch I've done some cleanup and abstracted three common steps runtime components have in their CMakeLists files, and added a fourth.

The three steps I abstract are:

(1) Add a top-level target (i.e asan, msan, ...)
(2) Set the target properties for sorting files in IDE generators
(3) Make the compiler-rt target depend on the top-level target

The new step is to check if a command named "runtime_register_component" is defined, and to call it with the component name.

The runtime_register_component command is defined in llvm/runtimes/CMakeLists.txt, and presently just adds the component to a list of sub-components, which later gets used to generate target mappings.

With this patch a new workflow for runtimes builds is supported. The new workflow when building runtimes from the LLVM runtimes directory is:

> cmake [...]
> ninja runtimes-configure
> ninja asan

The "runtimes-configure" target builds all the dependencies for configuring the runtimes projects, and runs CMake on the runtimes projects. Running the runtimes CMake generates a list of targets to bind into the top-level CMake so subsequent build invocations will have access to some of Compiler-RT's targets through the top-level build.

Note: This patch does exclude some top-level targets from compiler-rt libraries because they either don't install files (sanitizer_common), or don't have a cooresponding `check` target (stats).
llvm-svn: 279863

7 years agoStart reifying error descriptions
Filipe Cabecinhas [Fri, 26 Aug 2016 20:49:11 +0000 (20:49 +0000)]
Start reifying error descriptions

Summary:
This commit sets up the infrastructure to use reified error
descriptions, and moves ReportStackOverflow to the new system.

After we convert all the errors, we'll be able to simplify ScopedInErrorReport
and remove the older debugging mechanism which had some errors partly reified
in some way. We'll be able to maintain the external API.

ScopedInErrorReport will be able to track one of the reified errors at a time.
The purpose of this is so we have its destructor actually print the error and
possibly interface with the debugger (will depend on the platform, of course).

Reviewers: kcc, samsonov, timurrrr

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 279862

7 years ago[CMake] Expose runtime component check targets
Chris Bieneman [Fri, 26 Aug 2016 20:34:11 +0000 (20:34 +0000)]
[CMake] Expose runtime component check targets

This will expose the check targets for runtime project components into the top-level build. It will enable exposing targets like check-asan.

llvm-svn: 279861

7 years ago[Inliner] Report when inlining fails because callee's def is unavailable
Adam Nemet [Fri, 26 Aug 2016 20:21:05 +0000 (20:21 +0000)]
[Inliner] Report when inlining fails because callee's def is unavailable

Summary:
This is obviously an interesting case because it may motivate code
restructuring or LTO.

Reporting this requires instantiation of ORE in the loop where the call
sites are first gathered.  I've checked compile-time
overhead *with* -Rpass-with-hotness and the worst slow-down was 6% in
mcf and quickly tailing off.  As before without -Rpass-with-hotness
there is no overhead.

Because this could be a pretty noisy diagnostics, it is currently
qualified as 'verbose'.  As of this patch, 'verbose' diagnostics are
only emitted with -Rpass-with-hotness, i.e. when the output is expected
to be filtered.

Reviewers: eraman, chandlerc, davidxl, hfinkel

Subscribers: tejohnson, Prazek, davide, llvm-commits

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

llvm-svn: 279860

7 years agoMake writeToResolutionFile a static helper.
Rafael Espindola [Fri, 26 Aug 2016 20:19:35 +0000 (20:19 +0000)]
Make writeToResolutionFile a static helper.

llvm-svn: 279859

7 years agoTailDuplication: Record blocks that received the duplicated block. NFC.
Kyle Butt [Fri, 26 Aug 2016 20:12:40 +0000 (20:12 +0000)]
TailDuplication: Record blocks that received the duplicated block. NFC.

This will allow tail duplication during layout to handle the cfg changes more
cleanly.

llvm-svn: 279858

7 years ago[CMake] Fixing LLVM_INCLUDE_TESTS for runtimes directory
Chris Bieneman [Fri, 26 Aug 2016 20:08:57 +0000 (20:08 +0000)]
[CMake] Fixing LLVM_INCLUDE_TESTS for runtimes directory

We need to explicitly pass LLVM_INCLUDE_TESTS through from the top-level to the runtimes configuration because it isn't in LLVMConfig.cmake

llvm-svn: 279857

7 years agoStreamline LTO getComdat invocation (NFC)
Teresa Johnson [Fri, 26 Aug 2016 20:07:15 +0000 (20:07 +0000)]
Streamline LTO getComdat invocation (NFC)

We already have obtained a pointer to the underlying GlobalObject,
use it directly to find the comdat, rather than using the
GlobalValue::getComdat which will do the same thing again.

llvm-svn: 279856

7 years ago[StreamExecutor] Fix KernelSpec Doxygen
Jason Henline [Fri, 26 Aug 2016 19:55:32 +0000 (19:55 +0000)]
[StreamExecutor] Fix KernelSpec Doxygen

Summary:
There was a typo where \endcode was spelled as \encode and it was
keeping the whole file document from rendering. I also added in some \c
annotations for inline code stuff to make it look nicer.

Reviewers: jprice

Subscribers: parallel_libs-commits

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

llvm-svn: 279855

7 years agoNext set of additional error checks for invalid Mach-O files for bad LC_SYMTAB’s.
Kevin Enderby [Fri, 26 Aug 2016 19:34:07 +0000 (19:34 +0000)]
Next set of additional error checks for invalid Mach-O files for bad LC_SYMTAB’s.

This contains the missing checks for LC_SYMTAB load command fields.

llvm-svn: 279854

7 years agoSwift Calling Convetion: add support for AArch64.
Manman Ren [Fri, 26 Aug 2016 19:28:17 +0000 (19:28 +0000)]
Swift Calling Convetion: add support for AArch64.

It will just be the same as the regular calling convention.

rdar://28029509

llvm-svn: 279853

7 years agoAArch64: avoid assertion on illegal types in performFDivCombine.
Tim Northover [Fri, 26 Aug 2016 18:52:31 +0000 (18:52 +0000)]
AArch64: avoid assertion on illegal types in performFDivCombine.

In the code to detect fixed-point conversions and make use of AArch64's special
instructions, we weren't prepared for weird types. The fptosi direction got
fixed recently, but not the similar sitofp code.

llvm-svn: 279852

7 years ago[InstCombine] add helper function for icmp (and (sh X, Y), C2), C1 ; NFC
Sanjay Patel [Fri, 26 Aug 2016 18:28:46 +0000 (18:28 +0000)]
[InstCombine] add helper function for icmp (and (sh X, Y), C2), C1 ; NFC

Like other recent changes near here, the goal is to allow vector types for
all of these folds. Splitting things up makes it easier to incrementally
enhance the code and easier to read.

llvm-svn: 279851

7 years agoDon't crash when trying to capture persistent variables in a block.
Sean Callanan [Fri, 26 Aug 2016 18:12:39 +0000 (18:12 +0000)]
Don't crash when trying to capture persistent variables in a block.

Reports an error instead.  We can fix this later to make persistent variables
work, but right now we hit an LLVM assertion if we get this wrong.

<rdar://problem/27770298>

llvm-svn: 279850

7 years ago[AArch64] Avoid materializing constant values when generating csel instructions.
Chad Rosier [Fri, 26 Aug 2016 18:05:50 +0000 (18:05 +0000)]
[AArch64] Avoid materializing constant values when generating csel instructions.

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

llvm-svn: 279849

7 years ago[AsmParser] Placate a -Wmisleading-indentantion warning (GCC7).
Davide Italiano [Fri, 26 Aug 2016 18:05:03 +0000 (18:05 +0000)]
[AsmParser] Placate a -Wmisleading-indentantion warning (GCC7).

llvm-svn: 279848

7 years ago[MC] Move .cv_loc management logic out of MCContext
Reid Kleckner [Fri, 26 Aug 2016 17:58:37 +0000 (17:58 +0000)]
[MC] Move .cv_loc management logic out of MCContext

MCContext already has many tasks, and separating CodeView out from it is
probably a good idea. The .cv_loc tracking was modelled on the DWARF
tracking which lived directly in MCContext.

Removes the inclusion of MCCodeView.h from MCContext.h, so now there are
only 10 build actions while I hack on CodeView support instead of 265.

llvm-svn: 279847