platform/upstream/llvm.git
8 years agoGPGPU: Optimize kernel IR before generating assembly code
Tobias Grosser [Sun, 24 Jul 2016 06:43:21 +0000 (06:43 +0000)]
GPGPU: Optimize kernel IR before generating assembly code

We optimize the kernel _after_ dumping the IR we generate to make the IR we
dump easier readable and independent of possible changes in the general
purpose LLVM optimizers.

llvm-svn: 276551

8 years agoGPGPU: Verify kernel IR before generating assembly
Tobias Grosser [Sun, 24 Jul 2016 06:43:17 +0000 (06:43 +0000)]
GPGPU: Verify kernel IR before generating assembly

llvm-svn: 276550

8 years agoSkip chash computation in insert/emplace if the unconstrained hash matches.
Eric Fiselier [Sun, 24 Jul 2016 06:22:25 +0000 (06:22 +0000)]
Skip chash computation in insert/emplace if the unconstrained hash matches.

llvm-svn: 276549

8 years agoMake pair/tuples assignment operators SFINAE properly.
Eric Fiselier [Sun, 24 Jul 2016 05:51:11 +0000 (05:51 +0000)]
Make pair/tuples assignment operators SFINAE properly.

llvm-svn: 276548

8 years agoFix memory leak in test.
Eric Fiselier [Sun, 24 Jul 2016 04:41:44 +0000 (04:41 +0000)]
Fix memory leak in test.

llvm-svn: 276547

8 years agoImplement LWG 2393. Check for LValue-callability.
Eric Fiselier [Sun, 24 Jul 2016 04:16:40 +0000 (04:16 +0000)]
Implement LWG 2393. Check for LValue-callability.

llvm-svn: 276546

8 years agoImplement LWG2328. Rvalue stream extraction should perfect forward.
Eric Fiselier [Sun, 24 Jul 2016 04:07:22 +0000 (04:07 +0000)]
Implement LWG2328. Rvalue stream extraction should perfect forward.

llvm-svn: 276545

8 years agoImplement P0040r3: Extending memory management tools
Eric Fiselier [Sun, 24 Jul 2016 03:51:39 +0000 (03:51 +0000)]
Implement P0040r3: Extending memory management tools

llvm-svn: 276544

8 years agoRollback r276538 and r276540 to unbreak asan bot.
Rui Ueyama [Sun, 24 Jul 2016 02:05:09 +0000 (02:05 +0000)]
Rollback r276538 and r276540 to unbreak asan bot.

llvm-svn: 276543

8 years ago[MSSA] Remove useless assert. NFC.
George Burgess IV [Sun, 24 Jul 2016 01:50:07 +0000 (01:50 +0000)]
[MSSA] Remove useless assert. NFC.

liveOnEntry is always a MemoryDef; asserting that a MemoryPhi isn't
liveOnEntry, while correct, isn't very helpful. :)

llvm-svn: 276542

8 years agoRevert r276539 "Silence -Wpointer-bool-conversion warning after r276324"
Bruno Cardoso Lopes [Sun, 24 Jul 2016 01:27:07 +0000 (01:27 +0000)]
Revert r276539 "Silence -Wpointer-bool-conversion warning after r276324"

Some bots are not happy with the change.
This reverts commit d307ca28083065851ad969444f3c063562f2d4bd.

llvm-svn: 276541

8 years agoSimplify. NFC.
Rui Ueyama [Sun, 24 Jul 2016 01:18:18 +0000 (01:18 +0000)]
Simplify. NFC.

llvm-svn: 276540

8 years agoSilence -Wpointer-bool-conversion warning after r276324
Bruno Cardoso Lopes [Sun, 24 Jul 2016 01:09:03 +0000 (01:09 +0000)]
Silence -Wpointer-bool-conversion warning after r276324

sanitizer_common_interceptors.inc:667:12: warning: address of function 'memchr' will always evaluate to 'true' [-Wpointer-bool-conversion]
  if (REAL(memchr)) {
  ~~       ^~~~~~

llvm-svn: 276539

8 years agoSplit LinkerScript::createSections.
Rui Ueyama [Sun, 24 Jul 2016 01:06:18 +0000 (01:06 +0000)]
Split LinkerScript::createSections.

createSections is getting longer, so it is probably time to split.

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

llvm-svn: 276538

8 years agoImplement the in_place tags from p0032r3.
Eric Fiselier [Sat, 23 Jul 2016 22:19:19 +0000 (22:19 +0000)]
Implement the in_place tags from p0032r3.

That paper also has changes to any/optional but those will
be implemented later.

llvm-svn: 276537

8 years ago[ELF/Linkerscript] Define an absolute if we find an undefined.
Davide Italiano [Sat, 23 Jul 2016 22:09:04 +0000 (22:09 +0000)]
[ELF/Linkerscript] Define an absolute if we find an undefined.

Otherwhise undefined references to symbols defined in linker scripts
are never resolved.

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

llvm-svn: 276536

8 years ago[X86][SSE] Added float widened broadcast tests
Simon Pilgrim [Sat, 23 Jul 2016 21:24:02 +0000 (21:24 +0000)]
[X86][SSE] Added float widened broadcast tests

llvm-svn: 276535

8 years ago[X86][SSE] Added more widened broadcast tests
Simon Pilgrim [Sat, 23 Jul 2016 21:15:31 +0000 (21:15 +0000)]
[X86][SSE] Added more widened broadcast tests

Added more vXi16 and vXi8 tests

llvm-svn: 276534

8 years agoFix undefined behavior in __hash_table
Eric Fiselier [Sat, 23 Jul 2016 20:36:55 +0000 (20:36 +0000)]
Fix undefined behavior in __hash_table

Summary:
This patch attempts to fix the undefined behavior in __hash_table by changing the node pointer types used throughout. The pointer types are changed for raw pointers in the current ABI and for fancy pointers in ABI V2 (since the fancy pointer types may not be ABI compatible).

The UB in `__hash_table` arises because tree downcasts the embedded end node and then deferences that pointer. Currently there are 2 node types in __hash_table:

* `__hash_node_base` which contains the `__next_` pointer.
* `__hash_node` which contains `__hash_` and `__value_`.

Currently the bucket list, iterators, and `__next_` pointers store pointers to `__hash_node` even though they all need to store `__hash_node_base` pointers.
This patch makes that change by introducing a `__next_pointer` typedef which is a pointer to `__hash_node` in the current ABI and `__hash_node_base` afterwards.

One notable change is to the type of `__bucket_list` which used to be defined as `unique_ptr<__node_pointer[], ...>` and is now `unique_ptr<__next_pointer[], ...>` meaning that we now allocate and deallocate different types using a different allocator. I'm going to give this part of the change more thought since it may introduce compatibility issues.

This change is similar to D20786.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

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

llvm-svn: 276533

8 years agoChange some more llvm highlighting instances to be text instead. It seems that Pygmen...
Aaron Ballman [Sat, 23 Jul 2016 20:11:21 +0000 (20:11 +0000)]
Change some more llvm highlighting instances to be text instead. It seems that Pygment does not handle "token" or "none" yet, and this caused the documentation bot to go red.

Patch by Gor Nishanov.

llvm-svn: 276532

8 years agoSwitching the highlighting from llvm to none in an attempt to appease the build bot...
Aaron Ballman [Sat, 23 Jul 2016 18:53:35 +0000 (18:53 +0000)]
Switching the highlighting from llvm to none in an attempt to appease the build bot (lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/11984/steps/docs-llvm-html/logs/stdio).

llvm-svn: 276531

8 years agoRemoves a warning about duplicate label named _strings from CommandLine.rst.
Aaron Ballman [Sat, 23 Jul 2016 18:52:21 +0000 (18:52 +0000)]
Removes a warning about duplicate label named _strings from CommandLine.rst.

llvm-svn: 276530

8 years agoCODE_OWNERS: Take ownership of the MIPS backend
Simon Dardis [Sat, 23 Jul 2016 17:40:48 +0000 (17:40 +0000)]
CODE_OWNERS: Take ownership of the MIPS backend

As agreed with Daniel Sanders, I'm taking over as code owner
for the MIPS backend.

llvm-svn: 276529

8 years ago[X86] Fix typo in comment.
Craig Topper [Sat, 23 Jul 2016 16:44:08 +0000 (16:44 +0000)]
[X86] Fix typo in comment.

llvm-svn: 276528

8 years ago[X86][SSE] Added tests where we should be trying to widen a load+splat into a broadcast
Simon Pilgrim [Sat, 23 Jul 2016 16:19:17 +0000 (16:19 +0000)]
[X86][SSE] Added tests where we should be trying to widen a load+splat into a broadcast

llvm-svn: 276527

8 years ago[X86][SSE] Regenerated uitofp <2 x i32> -> <2 x float> conversion tests
Simon Pilgrim [Sat, 23 Jul 2016 15:55:42 +0000 (15:55 +0000)]
[X86][SSE] Regenerated uitofp <2 x i32> -> <2 x float> conversion tests

Demonstrate difference in codegen discussed on PR14760

llvm-svn: 276526

8 years agoRemove Phdr typedef.
Rui Ueyama [Sat, 23 Jul 2016 14:18:48 +0000 (14:18 +0000)]
Remove Phdr typedef.

I don't think this typedef contributes to readability.

llvm-svn: 276525

8 years agoMake a pure function a non-member file-scoped function.
Rui Ueyama [Sat, 23 Jul 2016 14:09:58 +0000 (14:09 +0000)]
Make a pure function a non-member file-scoped function.

llvm-svn: 276524

8 years ago[InstCombine] allow icmp (bit-manipulation-intrinsic(), C) folds for vectors
Sanjay Patel [Sat, 23 Jul 2016 13:06:49 +0000 (13:06 +0000)]
[InstCombine] allow icmp (bit-manipulation-intrinsic(), C) folds for vectors

llvm-svn: 276523

8 years agoFix a GCC error due to this member name also being a type name. This
Chandler Carruth [Sat, 23 Jul 2016 07:50:05 +0000 (07:50 +0000)]
Fix a GCC error due to this member name also being a type name. This
should fix the build with GCC 4.9 at least. Not sure if this is the
right name or fix, but I've followed up on the original commit.

llvm-svn: 276522

8 years ago[AVX512] Implement commuting support for EVEX encoded FMA3 instructions.
Craig Topper [Sat, 23 Jul 2016 07:16:56 +0000 (07:16 +0000)]
[AVX512] Implement commuting support for EVEX encoded FMA3 instructions.

llvm-svn: 276521

8 years ago[X86] Make one of the FMA3 commuting methods static. Remove a call to isFMA3 just...
Craig Topper [Sat, 23 Jul 2016 07:16:53 +0000 (07:16 +0000)]
[X86] Make one of the FMA3 commuting methods static. Remove a call to isFMA3 just to get the IsIntrisic flag, instead get it during the first call and pass it along. NFC

llvm-svn: 276520

8 years ago[X86] Fix switch statement indentation per coding standards.
Craig Topper [Sat, 23 Jul 2016 07:16:50 +0000 (07:16 +0000)]
[X86] Fix switch statement indentation per coding standards.

llvm-svn: 276519

8 years agoAMDGPU: Delete dead code
Matt Arsenault [Sat, 23 Jul 2016 07:07:14 +0000 (07:07 +0000)]
AMDGPU: Delete dead code

This has been dead since r269479

llvm-svn: 276518

8 years ago[Profile] Use a flag to enable PGO rather than the profraw filename
Xinliang David Li [Sat, 23 Jul 2016 04:28:59 +0000 (04:28 +0000)]
[Profile] Use a flag to enable PGO rather than the profraw filename

Patch by Jake VanAdrighem

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

llvm-svn: 276517

8 years ago[Profile] Use explicit flag to enable IR PGO
Xinliang David Li [Sat, 23 Jul 2016 04:28:52 +0000 (04:28 +0000)]
[Profile] Use explicit flag to enable IR PGO

Patch by Jake VanAdrighem

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

llvm-svn: 276516

8 years agoAvoid using a raw AssumptionCacheTracker in various inliner functions.
Sean Silva [Sat, 23 Jul 2016 04:22:50 +0000 (04:22 +0000)]
Avoid using a raw AssumptionCacheTracker in various inliner functions.

This unblocks the new PM part of River's patch in
https://reviews.llvm.org/D22706

Conveniently, this same change was needed for D21921 and so these
changes are just spun out from there.

llvm-svn: 276515

8 years ago[cxx1z-constexpr-lambda] Make a lambda's closure type eligible as a literal-type...
Faisal Vali [Sat, 23 Jul 2016 04:05:19 +0000 (04:05 +0000)]
[cxx1z-constexpr-lambda] Make a lambda's closure type eligible as a literal-type in C++1z

Additionally, for pre-C++1z, instead of forbidding a lambda's closure type from being a literal type through circumlocutorily setting HasNonLiteralTypeFieldsOrBases falsely to true -- handle lambda's more directly in CXXRecordDecl::isLiteral().

One additional small step towards implementing constexpr-lambdas.

Thanks to Richard Smith for his review!
https://reviews.llvm.org/D22662

llvm-svn: 276514

8 years ago[coroutines] Part 1 of N: Documentation
David Majnemer [Sat, 23 Jul 2016 04:05:08 +0000 (04:05 +0000)]
[coroutines] Part 1 of N: Documentation

This is the first patch in the coroutine series.
It contains the documentation for the coroutine intrinsics and their usage.

Patch by Gor Nishanov!

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

llvm-svn: 276513

8 years agoFix buildbot failure
Xinliang David Li [Sat, 23 Jul 2016 03:34:30 +0000 (03:34 +0000)]
Fix buildbot failure

llvm-svn: 276512

8 years agoImplement P0392r0. Integrate filesystem::path and string_view.
Eric Fiselier [Sat, 23 Jul 2016 03:10:56 +0000 (03:10 +0000)]
Implement P0392r0. Integrate filesystem::path and string_view.

llvm-svn: 276511

8 years ago[LoopUnrollAnalyzer] Handle out of bounds accesses in visitLoad
David Majnemer [Sat, 23 Jul 2016 02:56:49 +0000 (02:56 +0000)]
[LoopUnrollAnalyzer] Handle out of bounds accesses in visitLoad

While we handed loads past the end of an array, we didn't handle loads
_before_ the array.

This fixes PR28062.

N.B. While the bug in the code is obvious, I am struggling to craft a
test case which is reasonable in size.

llvm-svn: 276510

8 years agoWork around MSVC's lack of support for unrestricted unions by making this
Richard Smith [Sat, 23 Jul 2016 02:39:52 +0000 (02:39 +0000)]
Work around MSVC's lack of support for unrestricted unions by making this
struct a bit bigger under MSVC (this shouldn't be a big deal; we typically
allocate no more than two of these at a time, on the stack).

llvm-svn: 276509

8 years agoAdd -fmodules-ts flag to cc1 for the provisional C++ modules TS, and mark
Richard Smith [Sat, 23 Jul 2016 02:32:21 +0000 (02:32 +0000)]
Add -fmodules-ts flag to cc1 for the provisional C++ modules TS, and mark
'module' and 'import' as keywords when the flag is specified.

llvm-svn: 276508

8 years agoRevert r276506 - Diagnose invalid memory order arguments in <atomic>.
Eric Fiselier [Sat, 23 Jul 2016 01:43:53 +0000 (01:43 +0000)]
Revert r276506 - Diagnose invalid memory order arguments in <atomic>.

There is a bug in Clang 3.6 and earlier that causes compile failures.
I suspect it's due to the usage of member function parameter names in the
attributes.

llvm-svn: 276507

8 years ago[libcxx] Diagnose invalid memory order arguments in <atomic>. Fixes PR21179.
Eric Fiselier [Sat, 23 Jul 2016 01:16:55 +0000 (01:16 +0000)]
[libcxx] Diagnose invalid memory order arguments in <atomic>. Fixes PR21179.

Summary:
This patch uses the __attribute__((enable_if)) hack suggested by @rsmith to diagnose invalid arguments when possible.

In order to diagnose an invalid argument `m` to `f(m)` we provide an additional overload of `f` that is only enabled when `m` is invalid. When that function is enabled it uses __attribute__((unavailable)) to produce a diagnostic message.

Reviewers: mclow.lists, rsmith, jfb, EricWF

Subscribers: bcraig, jfb, rsmith, cfe-commits

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

llvm-svn: 276506

8 years ago[SCEV] Make isImpliedCondOperandsViaRanges smarter
Sanjoy Das [Sat, 23 Jul 2016 00:54:36 +0000 (00:54 +0000)]
[SCEV] Make isImpliedCondOperandsViaRanges smarter

This change lets us prove things like

  "{X,+,10} s< 5000" implies "{X+7,+,10} does not sign overflow"

It does this by replacing replacing getConstantDifference by
computeConstantDifference (which is smarter) in
isImpliedCondOperandsViaRanges.

llvm-svn: 276505

8 years ago[cmake] Use a sane default for LLVM_PROFILE_DATA_DIR
Vedant Kumar [Sat, 23 Jul 2016 00:38:11 +0000 (00:38 +0000)]
[cmake] Use a sane default for LLVM_PROFILE_DATA_DIR

It's been pointed out that arbitrarily spraying raw profiles into a
build directory is insane. Doing this wastes a tremendous amount of
space and is also very lossy, since the test harness tends to wipe away
temporary sub-directories (which usually contain relevant profile data).

The new default is a `profiles` directory inside of the build dir.

llvm-svn: 276504

8 years ago[SCEV] Change the interface of computeConstantDifference; NFC
Sanjoy Das [Sat, 23 Jul 2016 00:28:56 +0000 (00:28 +0000)]
[SCEV] Change the interface of computeConstantDifference; NFC

This is in preparation of
s/getConstantDifference/computeConstantDifference/ in a later change.

llvm-svn: 276503

8 years ago[InstCombine] move udiv+cmp fold over with other BinOp+cmp folds; NFCI
Sanjay Patel [Sat, 23 Jul 2016 00:28:39 +0000 (00:28 +0000)]
[InstCombine] move udiv+cmp fold over with other BinOp+cmp folds; NFCI

llvm-svn: 276502

8 years agoauto-generate checks
Sanjay Patel [Sat, 23 Jul 2016 00:09:54 +0000 (00:09 +0000)]
auto-generate checks

llvm-svn: 276501

8 years ago[Profile] Tighten test with expected profile count
Xinliang David Li [Fri, 22 Jul 2016 23:53:00 +0000 (23:53 +0000)]
[Profile] Tighten test with expected profile count

llvm-svn: 276500

8 years agoAdd doxygen comments to emmintrin.h's intrinsics.
Ekaterina Romanova [Fri, 22 Jul 2016 23:49:37 +0000 (23:49 +0000)]
Add doxygen comments to emmintrin.h's intrinsics.

Only around 50% of the intrinsics in this file are documented now. The patches for the rest of the intrisics in this file will be send out later.

The doxygen comments are automatically generated based on Sony's intrinsics docu
ment.

I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream. This patch was internally reviewed by Paul Robinson.

llvm-svn: 276499

8 years agoRevert "[AMDGPU] Emit read-only data to .rodata for hsa"
Tom Stellard [Fri, 22 Jul 2016 23:46:40 +0000 (23:46 +0000)]
Revert "[AMDGPU] Emit read-only data to .rodata for hsa"

This reverts commit r276298.

Data stored in .rodata can have a negative offset from .text, but we
don't support negative values in relocations yet.

This caused a regression in one of the amp conformance tests:
5_Data_Cont/5_2_a_v/5_2_3_m/Assignment/Test.02.01

llvm-svn: 276498

8 years agoImplement cbrt builtin
Tom Stellard [Fri, 22 Jul 2016 23:45:15 +0000 (23:45 +0000)]
Implement cbrt builtin

This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 276497

8 years agoImplement cosh builtin
Tom Stellard [Fri, 22 Jul 2016 23:45:13 +0000 (23:45 +0000)]
Implement cosh builtin

This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 276496

8 years agogeometric/floatn.inc: Add vec8 and vec16 types
Tom Stellard [Fri, 22 Jul 2016 23:45:11 +0000 (23:45 +0000)]
geometric/floatn.inc: Add vec8 and vec16 types

llvm-svn: 276495

8 years ago[Profile] Fix a fixme in the test
Xinliang David Li [Fri, 22 Jul 2016 23:44:06 +0000 (23:44 +0000)]
[Profile] Fix a fixme in the test

llvm-svn: 276494

8 years ago[Profile] Add new test
Xinliang David Li [Fri, 22 Jul 2016 23:38:58 +0000 (23:38 +0000)]
[Profile] Add new test

To test that online merging is enabled by default.

llvm-svn: 276493

8 years agoP0217R3: Parsing support and framework for AST representation of C++1z
Richard Smith [Fri, 22 Jul 2016 23:36:59 +0000 (23:36 +0000)]
P0217R3: Parsing support and framework for AST representation of C++1z
decomposition declarations.

There are a couple of things in the wording that seem strange here:
decomposition declarations are permitted at namespace scope (which we partially
support here) and they are permitted as the declaration in a template (which we
reject).

llvm-svn: 276492

8 years ago[LoopDataPrefetch] Fix unused variable in release build
Adam Nemet [Fri, 22 Jul 2016 23:08:10 +0000 (23:08 +0000)]
[LoopDataPrefetch] Fix unused variable in release build

llvm-svn: 276491

8 years agoRevert "fix https://reviews.llvm.org/D22610" and "[compiler-rt] Fix memmove/memcpy...
Bruno Cardoso Lopes [Fri, 22 Jul 2016 23:02:34 +0000 (23:02 +0000)]
Revert "fix https://reviews.llvm.org/D22610" and "[compiler-rt] Fix memmove/memcpy overlap detection on windows"

This currently fails ~500 tests on Darwin:
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/20456/

This reverts commit 4cfee0dff1facb8fa2827d25c5943bfef96d1a8f and
dbd91205d578cb61ab77be06087e9f65ba8a7ec8.

llvm-svn: 276490

8 years ago[LoopDataPrefetch] Include hotness of region in opt remark
Adam Nemet [Fri, 22 Jul 2016 22:53:17 +0000 (22:53 +0000)]
[LoopDataPrefetch] Include hotness of region in opt remark

llvm-svn: 276488

8 years ago[LoopDataPrefetch] Sort headers
Adam Nemet [Fri, 22 Jul 2016 22:53:12 +0000 (22:53 +0000)]
[LoopDataPrefetch] Sort headers

llvm-svn: 276487

8 years ago[CFLAA] Add more offset-sensitivity tracking.
George Burgess IV [Fri, 22 Jul 2016 22:30:48 +0000 (22:30 +0000)]
[CFLAA] Add more offset-sensitivity tracking.

This patch teaches FunctionInfo about offsets.

Like the last patch, this one doesn't introduce any visible
functionality change (the core algorithm knows nothing about offsets;
they're just plumbed through). Tests will come when we start acting
differently because of the offsets.

Patch by Jia Chen.

(N.B. I made a tiny change to Jia's patch to avoid warnings by GCC: I
put DenseMapInfo specializations in the `llvm` namespace. Only realized
that those appeared when compiling locally. :) )

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

llvm-svn: 276486

8 years agoRemove some tab characters that snuck in to my mnost recent edits.
Jason Molenda [Fri, 22 Jul 2016 22:26:26 +0000 (22:26 +0000)]
Remove some tab characters that snuck in to my mnost recent edits.

llvm-svn: 276485

8 years ago[Profile] Enable profile merging with -fprofile-generat[=<dir>]
Xinliang David Li [Fri, 22 Jul 2016 22:25:01 +0000 (22:25 +0000)]
[Profile] Enable profile merging with -fprofile-generat[=<dir>]

This patch enables raw profile merging for this option which is the
new intended behavior.

llvm-svn: 276484

8 years agoadd tests for icmp vector folds
Sanjay Patel [Fri, 22 Jul 2016 22:19:52 +0000 (22:19 +0000)]
add tests for icmp vector folds

llvm-svn: 276482

8 years agoGlobalISel: allow multiple types on MachineInstrs.
Tim Northover [Fri, 22 Jul 2016 22:13:36 +0000 (22:13 +0000)]
GlobalISel: allow multiple types on MachineInstrs.

llvm-svn: 276481

8 years agoUnpoison stack before resume instruction
Vitaly Buka [Fri, 22 Jul 2016 22:04:38 +0000 (22:04 +0000)]
Unpoison stack before resume instruction

Summary:
Clang inserts cleanup code before resume similar way as before return instruction.
This makes asan poison local variables causing false use-after-scope reports.

__asan_handle_no_return does not help here as it was executed before
llvm.lifetime.end inserted into resume block.

To avoid false report we need to unpoison stack for resume same way as for return.

PR27453

Reviewers: kcc, eugenis

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

llvm-svn: 276480

8 years agoAdd flag to PassManagerBuilder to disable GVN Hoist Pass.
Alina Sbirlea [Fri, 22 Jul 2016 22:02:19 +0000 (22:02 +0000)]
Add flag to PassManagerBuilder to disable GVN Hoist Pass.

Summary:
Adding a flag to diable GVN Hoisting by default.
Note: The GVN Hoist Pass causes some Halide tests to hang. Halide will disable the pass while investigating.

Reviewers: llvm-commits, chandlerc, spop, dberlin

Subscribers: mehdi_amini

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

llvm-svn: 276479

8 years agoBreakup TestConcurrentEvents.py into separate test subdirs per test method
Todd Fiala [Fri, 22 Jul 2016 21:50:55 +0000 (21:50 +0000)]
Breakup TestConcurrentEvents.py into separate test subdirs per test method

This change breaks up the monolithic TestConcurrentEvents.py into a
separate subdir per test method. This allows them to run concurrently,
reduces the chance of a timeout occurring during normal operation, and
allows us to home in on any test methods that may be locking up.

This is step one in the process of squashing timeouts in these test
methods.

The reason for breaking each test method into its own file is to make it
very clear to us if there are a subset of the tests that do in fact lock
up frequently. This will limit how much hunting we need to do to
recreate it.

The reason for putting each file in a separate subdirectory is so that
our concurrent test runner can run multiple test files at the same time.
The unit of serialization in the LLDB test suite is the test directory,
so moving them into separate directories enables the test runner to do
more at the same time.

This change introduces usage of VPATH from gnu make. I use that to
facilitate keeping a single copy of the main.cpp in the parent
concurrent_events directory. Initially I had tried specifying the source
file as ../main.cpp, but our current makefile rules get confused by that
and then also build the output into the parent directory, which defeats
the ability to run each of the test methods concurrently. In the event
that not all systems support VPATH, I can do a bit of surgery on the
Makefile rules and attempt to make it smarter with regards to relative
paths to source files used in the build.

llvm-svn: 276478

8 years ago[SLPVectorizer] Vectorize reverse-order loads in horizontal reductions
Michael Kuperstein [Fri, 22 Jul 2016 21:28:48 +0000 (21:28 +0000)]
[SLPVectorizer] Vectorize reverse-order loads in horizontal reductions

When vectorizing a tree rooted at a store bundle, we currently try to sort the
stores before building the tree, so that the stores can be vectorized. For other
trees, the order of the root bundle - which determines the order of all other
bundles - is arbitrary. That is bad, since if a leaf bundle of consecutive loads
happens to appear in the wrong order, we will not vectorize it.

This is partially mitigated when the root is a binary operator, by trying to
build a "reversed" tree when that's considered profitable. This patch extends the
workaround we have for binops to trees rooted in a horizontal reduction.

This fixes PR28474.

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

llvm-svn: 276477

8 years agoadd tests for icmp vector folds
Sanjay Patel [Fri, 22 Jul 2016 21:28:20 +0000 (21:28 +0000)]
add tests for icmp vector folds

llvm-svn: 276476

8 years agoadd tests for icmp vector folds
Sanjay Patel [Fri, 22 Jul 2016 21:13:08 +0000 (21:13 +0000)]
add tests for icmp vector folds

llvm-svn: 276475

8 years ago[Coverage] Mark more methods const (NFC)
Vedant Kumar [Fri, 22 Jul 2016 21:11:55 +0000 (21:11 +0000)]
[Coverage] Mark more methods const (NFC)

llvm-svn: 276474

8 years ago[modules] Teach the ASTWriter to ignore mutations coming from the ASTReader.
Vassil Vassilev [Fri, 22 Jul 2016 21:08:24 +0000 (21:08 +0000)]
[modules] Teach the ASTWriter to ignore mutations coming from the ASTReader.

Processing update records (and loading a module, in general) might trigger
unexpected calls to the ASTWriter (being a mutation listener). Now we have a
mechanism to suppress those calls to the ASTWriter but notify other possible
mutation listeners.

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

Patch by Cristina Cristescu and me.

Reviewed by Richard Smith (D21800).

llvm-svn: 276473

8 years agoadd tests for icmp vector folds
Sanjay Patel [Fri, 22 Jul 2016 21:02:33 +0000 (21:02 +0000)]
add tests for icmp vector folds

llvm-svn: 276472

8 years agoAdd invariant start call creation in IRBuilder.NFC
Anna Thomas [Fri, 22 Jul 2016 20:57:23 +0000 (20:57 +0000)]
Add invariant start call creation in IRBuilder.NFC

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

llvm-svn: 276471

8 years agoUse RValue refs in APInt add/sub methods.
Pete Cooper [Fri, 22 Jul 2016 20:55:46 +0000 (20:55 +0000)]
Use RValue refs in APInt add/sub methods.

This adds versions of operator + and - which are optimized for the LHS/RHS of the
operator being RValue's.  When an RValue is available, we can use its storage space
instead of allocating new space.

On code such as ConstantRange which makes heavy use of APInt's over 64-bits in size,
this results in significant numbers of saved allocations.

Thanks to David Blaikie for all the review and most of the code here.

llvm-svn: 276470

8 years agoAdd regression test for PR27699.
Vassil Vassilev [Fri, 22 Jul 2016 20:49:31 +0000 (20:49 +0000)]
Add regression test for PR27699.

llvm-svn: 276469

8 years ago[llvm-cov] Don't copy stylesheets into index files
Vedant Kumar [Fri, 22 Jul 2016 20:49:23 +0000 (20:49 +0000)]
[llvm-cov] Don't copy stylesheets into index files

Just link in the stylesheet from the toplevel dir of the report.

llvm-svn: 276468

8 years ago[SCEV] Extract out a helper function; NFC
Sanjoy Das [Fri, 22 Jul 2016 20:47:55 +0000 (20:47 +0000)]
[SCEV] Extract out a helper function; NFC

The helper will get smarter in a later change, but right now this is
just code reorganization.

llvm-svn: 276467

8 years agoupdate to use FileCheck and auto-generate checks
Sanjay Patel [Fri, 22 Jul 2016 20:39:07 +0000 (20:39 +0000)]
update to use FileCheck and auto-generate checks

llvm-svn: 276466

8 years agoFix include case. NFC.
George Burgess IV [Fri, 22 Jul 2016 20:15:19 +0000 (20:15 +0000)]
Fix include case. NFC.

llvm-svn: 276465

8 years agoadd tests for icmp vector folds
Sanjay Patel [Fri, 22 Jul 2016 20:11:08 +0000 (20:11 +0000)]
add tests for icmp vector folds

llvm-svn: 276464

8 years agoMake DebugInfoMsf a dependency of DebugInfoPDBTests.
Zachary Turner [Fri, 22 Jul 2016 20:05:30 +0000 (20:05 +0000)]
Make DebugInfoMsf a dependency of DebugInfoPDBTests.

For some reason this doesn't cause linker errors with MSVC or
clang-cl, but the bots seem to be failing with other compilers.

llvm-svn: 276463

8 years agoGlobalISel: implement legalization pass, with just one transformation.
Tim Northover [Fri, 22 Jul 2016 20:03:43 +0000 (20:03 +0000)]
GlobalISel: implement legalization pass, with just one transformation.

This adds the actual MachineLegalizeHelper to do the work and a trivial pass
wrapper that legalizes all instructions in a MachineFunction. Currently the
only transformation supported is splitting up a vector G_ADD into one acting on
smaller vectors.

llvm-svn: 276461

8 years agoMake PDBFile store an msf::Layout.
Zachary Turner [Fri, 22 Jul 2016 19:56:33 +0000 (19:56 +0000)]
Make PDBFile store an msf::Layout.

Previously it was storing all the fields of an msf::Layout as
separate members.  This is a trivial cleanup to make it store
an msf::Layout directly.  This makes the code more readable
since it becomes clear which fields of PDBFile are actually the
msf specific layout information in a sea of other bookkeeping
fields.

llvm-svn: 276460

8 years ago[pdb] Have builders share a single BumpPtrAllocator.
Zachary Turner [Fri, 22 Jul 2016 19:56:26 +0000 (19:56 +0000)]
[pdb] Have builders share a single BumpPtrAllocator.

This makes it easier to have the writable and readable PDB
interfaces share code since the read/write and write-only
interfaces now share a single allocator, you don't have to worry
about a builder building a read only interface and then having
the read-only interface's data become corrupt when the builder
goes out of scope.  Now the allocator is specified explicitly
to all constructors, so all interfaces can share a single allocator
that is scoped appropriately.

llvm-svn: 276459

8 years ago[msf] Create LLVMDebugInfoMsf
Zachary Turner [Fri, 22 Jul 2016 19:56:05 +0000 (19:56 +0000)]
[msf] Create LLVMDebugInfoMsf

This provides a better layering of responsibilities among different
aspects of PDB writing code.  Some of the MSF related code was
contained in CodeView, and some was in PDB prior to this.  Further,
we were often saying PDB when we meant MSF, and the two are
actually independent of each other since in theory you can have
other types of data besides PDB data in an MSF.  So, this patch
separates the MSF specific code into its own library, with no
dependencies on anything else, and DebugInfoCodeView and
DebugInfoPDB take dependencies on DebugInfoMsf.

llvm-svn: 276458

8 years ago[llvm-ar] Document 'T' thin archive modifier (NFC)
Teresa Johnson [Fri, 22 Jul 2016 19:41:00 +0000 (19:41 +0000)]
[llvm-ar] Document 'T' thin archive modifier (NFC)

llvm-svn: 276457

8 years ago[sanitizer] revert r276383 while investigating failures on bot
Kostya Serebryany [Fri, 22 Jul 2016 19:02:59 +0000 (19:02 +0000)]
[sanitizer] revert r276383 while investigating failures on bot

llvm-svn: 276456

8 years agoAdd .rgba syntax extension to ext_vector_type types
Pirama Arumuga Nainar [Fri, 22 Jul 2016 18:49:43 +0000 (18:49 +0000)]
Add .rgba syntax extension to ext_vector_type types

Summary:
This patch enables .rgba accessors to ext_vector_type types and adds
tests for syntax validation and code generation.

'a' and 'b' can appear either in the point access mode or the numeric
access mode (for indices 10 and 11).  To disambiguate between the two
usages, the accessor type is explicitly passed to relevant methods.

Reviewers: rsmith

Subscribers: Anastasia, bader, srhines, cfe-commits

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

llvm-svn: 276455

8 years agoTry to fix more Windows portability issues in sanitizer tests
Reid Kleckner [Fri, 22 Jul 2016 18:41:22 +0000 (18:41 +0000)]
Try to fix more Windows portability issues in sanitizer tests

Add a %stdcxx11 lit substitution for -std=c++11. Windows defaults to
-std=c++14 when VS 2015 is used because the STL requires it. Harcoding
-std=c++11 in the ASan tests actually downgrades the C++ standard level,
leading to test failures.

Relax a FileCheck pattern in use-after-scope-types.cc.

Disable the sanitizer_common OOM tests. They fail on bots with low swap,
and cause other concurrently running tests to OOM.

llvm-svn: 276454

8 years ago[ThinLTO/gold] Remove thin archive part of new test due to bot failures
Teresa Johnson [Fri, 22 Jul 2016 18:32:30 +0000 (18:32 +0000)]
[ThinLTO/gold] Remove thin archive part of new test due to bot failures

I am getting a bot failure from the thin archive part of this test:

From
http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/40468/steps/test_llvm/logs/LLVM%20%3A%3A%20tools__gold__X86__thinlto_emit_linked_objects.ll:

Command Output (stderr):
--
/home/bb/cmake-llvm-x86_64-linux/build/./bin/llvm-ar: creating
/home/bb/cmake-llvm-x86_64-linux/build/test/tools/gold/X86/Output/thinlto_emit_linked_objects.ll.tmp2.a
/usr/bin/ld.gold: internal error in add_writer, at
../../gold/token.h:124

--

This appears to be an issue with an older version of gold. The test case
passes for me locally when I use the gold v1.12 I was testing with, but
when I tried the gold installed on my system which is v1.11 I get the
same error.

Remove the thin archive version of the test, since there isn't a way to
predicate it on gold version.

llvm-svn: 276453

8 years agoRecommit - [DSE]Enhance shorthening MemIntrinsic based on OverlapIntervals
Jun Bum Lim [Fri, 22 Jul 2016 18:27:24 +0000 (18:27 +0000)]
Recommit - [DSE]Enhance shorthening MemIntrinsic based on OverlapIntervals

Recommiting r275571 after fixing crash reported in PR28270.
Now we erase elements of IOL in deleteDeadInstruction().

Original Summary:
This change use the overlap interval map built from partial overwrite tracking to perform shortening MemIntrinsics.
Add test cases which was missing opportunities before.

llvm-svn: 276452

8 years agoadd tests for vector bit manipulation intrinsics
Sanjay Patel [Fri, 22 Jul 2016 18:22:25 +0000 (18:22 +0000)]
add tests for vector bit manipulation intrinsics

llvm-svn: 276451

8 years ago[ThinLTO/gold] Support for getting list of included objects from gold
Teresa Johnson [Fri, 22 Jul 2016 18:20:22 +0000 (18:20 +0000)]
[ThinLTO/gold] Support for getting list of included objects from gold

Summary:
In the distributed backend case, the ThinLink step and the final native
object link are separate processes. This can be problematic when archive
libraries are involved in the link (e.g. via --start-lib/--end-lib
pairs). The linker only includes objects from libraries when
there is a strong reference to them, and depending on the intervening
ThinLTO backend processes' importing/inlining, the strong references
may appear different in the two link steps. See D22356 and D22467
for two scenarios where this causes issues.

To ensure that the final link includes the same objects, this patch
adds support for an "=filename" form of the thinlto-index-only plugin
option, in which case objects gold included in the link are emitted to
the given filename. This should be used as input to the final link (e.g.
via the @filename option to gold), instead of listing all the objects
within --start-lib/--end-lib pairs again.

Note that the support for the gold callback that identifies included
objects was added in gold version 1.12.

Reviewers: davidxl, mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 276450

8 years ago[PM] Port BreakCriticalEdges to the new PM.
Wei Mi [Fri, 22 Jul 2016 18:04:25 +0000 (18:04 +0000)]
[PM] Port BreakCriticalEdges to the new PM.

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

llvm-svn: 276449