OSDN Git Service

android-x86/external-llvm.git
7 years agoSupportTests: Suppress ParallelTests on mingw for now. Investigating.
NAKAMURA Takumi [Thu, 11 May 2017 06:35:51 +0000 (06:35 +0000)]
SupportTests: Suppress ParallelTests on mingw for now. Investigating.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302766 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove redundant initialization. NFC
Paul Robinson [Thu, 11 May 2017 02:07:08 +0000 (02:07 +0000)]
Remove redundant initialization. NFC

Post-commit review of r301940 by David Blaikie.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302756 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd temporary workaround to allow in-tree libc++ builds on Windows
Eric Fiselier [Thu, 11 May 2017 01:44:30 +0000 (01:44 +0000)]
Add temporary workaround to allow in-tree libc++ builds on Windows

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302753 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFinal (hopefully) fix for the build bots.
Zachary Turner [Thu, 11 May 2017 00:22:18 +0000 (00:22 +0000)]
Final (hopefully) fix for the build bots.

This time it actually occurred to me to change the #defines
to actually test the pre-processed out codepath.  Hopefully
this time it works.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302752 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTry again to fix the buildbots.
Zachary Turner [Thu, 11 May 2017 00:18:52 +0000 (00:18 +0000)]
Try again to fix the buildbots.

TaskGroup and Latch need to be in llvm::parallel::detail, not
in llvm::detail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302751 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix build errors with Parallel.
Zachary Turner [Thu, 11 May 2017 00:09:30 +0000 (00:09 +0000)]
Fix build errors with Parallel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302749 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Support] Move Parallel algorithms from LLD to LLVM.
Zachary Turner [Thu, 11 May 2017 00:03:52 +0000 (00:03 +0000)]
[Support] Move Parallel algorithms from LLD to LLVM.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302748 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] fix a compiler warning
Kostya Serebryany [Wed, 10 May 2017 23:59:03 +0000 (23:59 +0000)]
[libFuzzer] fix a compiler warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302747 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[SDAG] Relax conditions under stores of loaded values can be merged"
David L. Jones [Wed, 10 May 2017 23:56:21 +0000 (23:56 +0000)]
Revert "[SDAG] Relax conditions under stores of loaded values can be merged"

This reverts r302712.

The change fails with ASAN enabled:

ERROR: AddressSanitizer: use-after-poison on address ... at ...
READ of size 2 at ... thread T0
  #0 ... in llvm::SDNode::getNumValues() const <snip>/include/llvm/CodeGen/SelectionDAGNodes.h:855:42
  #1 ... in llvm::SDNode::hasAnyUseOfValue(unsigned int) const <snip>/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:7270:3
  #2 ... in llvm::SDValue::use_empty() const <snip> include/llvm/CodeGen/SelectionDAGNodes.h:1042:17
  #3 ... in (anonymous namespace)::DAGCombiner::MergeConsecutiveStores(llvm::StoreSDNode*) <snip>/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:12944:7

Reviewers: niravd

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302746 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[IR] Rollback changes in r302744 which caused buildbots failures.
Eugene Zelenko [Wed, 10 May 2017 23:53:40 +0000 (23:53 +0000)]
[IR] Rollback changes in r302744 which caused buildbots failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302745 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[IR] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC).
Eugene Zelenko [Wed, 10 May 2017 23:41:30 +0000 (23:41 +0000)]
[IR] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302744 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PHIElimination] Use the same name for DEBUG_TYPE and pass name.
Davide Italiano [Wed, 10 May 2017 23:13:26 +0000 (23:13 +0000)]
[PHIElimination] Use the same name for DEBUG_TYPE and pass name.

In an attempt to reduce the confusion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302742 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] remove fold that swaps xor/or with constants; NFCI
Sanjay Patel [Wed, 10 May 2017 21:33:55 +0000 (21:33 +0000)]
[InstCombine] remove fold that swaps xor/or with constants; NFCI

// (X ^ C1) | C2 --> (X | C2) ^ (C1&~C2)

This canonicalization was added at:
https://reviews.llvm.org/rL7264

By moving xors out/down, we can more easily combine constants. I'm adding
tests that do not change with this patch, so we can verify that those kinds
of transforms are still happening.

This is no-functional-change-intended because there's a later fold:
// (X^C)|Y -> (X|Y)^C iff Y&C == 0
...and demanded-bits appears to guarantee that any fold that would have
hit the fold we're removing here would be caught by that 2nd fold.

Similar reasoning was used in:
https://reviews.llvm.org/rL299384

The larger motivation for removing this code is that it could interfere with
the fix for PR32706:
https://bugs.llvm.org/show_bug.cgi?id=32706

Ie, we're not checking if the 'xor' is actually a 'not', so we could reverse
a 'not' optimization and cause an infinite loop by altering an 'xor X, -1'.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302733 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Make some packed shuffles free
Matt Arsenault [Wed, 10 May 2017 21:29:33 +0000 (21:29 +0000)]
AMDGPU: Make some packed shuffles free

VOP3P instructions can encode access to either
half of the register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302730 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Add new subtarget features for gfx9 flat instructions
Matt Arsenault [Wed, 10 May 2017 21:19:05 +0000 (21:19 +0000)]
AMDGPU: Add new subtarget features for gfx9 flat instructions

Flat instructions gain an immediate offset, and 2 new
sets of segment specific flat instructions are added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302729 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ConstantRange] Fix the early out in ConstantRange::multiply for positive numbers...
Craig Topper [Wed, 10 May 2017 20:01:48 +0000 (20:01 +0000)]
[ConstantRange] Fix the early out in ConstantRange::multiply for positive numbers to really do what the comment says

r271020 added an early out to skip the signed multiply portion of ConstantRange::multiply. The comment says we don't need to do signed multiply if the range is only positive numbers, but the implemented check only ensures that the start of the range is positive. It doesn't look at the end of the range.

This patch checks the end of the range instead. Because Upper is one more than the end we have to see if its positive or if its one past the last positive number.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302717 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Add negate helper method to implement twos complement. Use it to shorten...
Craig Topper [Wed, 10 May 2017 20:01:38 +0000 (20:01 +0000)]
[APInt] Add negate helper method to implement twos complement. Use it to shorten code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302716 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[NewGVN] Introduce a definesNoMemory() helper and use it.
Davide Italiano [Wed, 10 May 2017 19:57:43 +0000 (19:57 +0000)]
[NewGVN] Introduce a definesNoMemory() helper and use it.

This is nice as is, but it will be used in my next patch to
fix a bug. Suggested by Daniel Berlin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302714 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SDAG] Relax conditions under stores of loaded values can be merged
Nirav Dave [Wed, 10 May 2017 19:53:41 +0000 (19:53 +0000)]
[SDAG] Relax conditions under stores of loaded values can be merged

Summary:

Allow consecutive stores whose values come from consecutive loads to
merged in the presense of other uses of the loads. Previously this was
disallowed as in general the merged load cannot be shared with the
other uses. Merging N stores into 1 may cause as many as N redundant
loads. However in the context of caching this should have neglible
affect on memory pressure and reduce instruction count making it
almost always a win.

Fixes PR32086.

Reviewers: spatel, jyknight, andreadb, hfinkel, efriedma

Reviewed By: efriedma

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302712 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoEnsure non-null ProfileSummaryInfo passed to ModuleSummaryIndex builder
Teresa Johnson [Wed, 10 May 2017 18:52:16 +0000 (18:52 +0000)]
Ensure non-null ProfileSummaryInfo passed to ModuleSummaryIndex builder

This fixes a ubsan bot failure after r302597, which made getProfileCount
non-static, but ended up invoking it on a null ProfileSummaryInfo object
in some cases from buildModuleSummaryIndex.

Most testing passed because the non-static getProfileCount currently
doesn't access any member variables, but I found this when testing a
follow on patch (D32877) that adds a member variable access.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302705 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Make toString use udivrem instead of calling the divide helper method directl...
Craig Topper [Wed, 10 May 2017 18:15:24 +0000 (18:15 +0000)]
[APInt] Make toString use udivrem instead of calling the divide helper method directly. Do a better job of reusing allocations while looping. NFCI

This lets toString take advantage of the degenerate case checks in udivrem and is just generally cleaner.

One minor downside of this is that the divisor APInt now needs to be the same size as Tmp which requires an additional allocation. But we were doing a poor job of reusing allocations before so the new code should still be an improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302704 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Use uint32_t instead of unsigned for the storage type throughout the divide...
Craig Topper [Wed, 10 May 2017 18:15:20 +0000 (18:15 +0000)]
[APInt] Use uint32_t instead of unsigned for the storage type throughout the divide code. Use Lo_32/Hi_32/Make_64 helpers instead of casts and shifts. NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302703 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Use getRawData to slightly simplify some code.
Craig Topper [Wed, 10 May 2017 18:15:17 +0000 (18:15 +0000)]
[APInt] Use getRawData to slightly simplify some code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302702 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Remove check for single word since single word was handled earlier in the...
Craig Topper [Wed, 10 May 2017 18:15:14 +0000 (18:15 +0000)]
[APInt] Remove check for single word since single word was handled earlier in the function. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302701 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ConstantRange] Add test case showing a case where we pick too large of a range for...
Craig Topper [Wed, 10 May 2017 18:15:06 +0000 (18:15 +0000)]
[ConstantRange] Add test case showing a case where we pick too large of a range for multiply after r271020.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302700 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSmall refactoring in DAGCombine. NFC
Amaury Sechet [Wed, 10 May 2017 17:58:28 +0000 (17:58 +0000)]
Small refactoring in DAGCombine. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302699 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstSimplify, InstCombine] move 'or' simplification tests; NFC
Sanjay Patel [Wed, 10 May 2017 15:57:47 +0000 (15:57 +0000)]
[InstSimplify, InstCombine] move 'or' simplification tests; NFC

Surprisingly, I don't think these are redundant for InstSimplify.
They were just misplaced as InstCombine tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302684 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][SSE] Check vec_set BUILD_VECTOR tests on both 32 and 64-bit targets
Simon Pilgrim [Wed, 10 May 2017 15:52:59 +0000 (15:52 +0000)]
[X86][SSE] Check vec_set BUILD_VECTOR tests on both 32 and 64-bit targets

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302683 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AArch64][RegisterBankInfo] Change the default mapping of fp stores.
Quentin Colombet [Wed, 10 May 2017 15:19:41 +0000 (15:19 +0000)]
[AArch64][RegisterBankInfo] Change the default mapping of fp stores.

For stores, check if the stored value is defined by a floating point
instruction and if yes, we return a default mapping with FPR instead
of GPR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302679 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AArch64] Enable use of reduction intrinsics.
Amara Emerson [Wed, 10 May 2017 15:15:38 +0000 (15:15 +0000)]
[AArch64] Enable use of reduction intrinsics.

The new experimental reduction intrinsics can now be used, so I'm enabling this
for AArch64. We will need this for SVE anyway, so it makes sense to do this for
NEON reductions as well.

The existing code to match shufflevector patterns are replaced with a direct
lowering of the reductions to AArch64-specific nodes. Tests updated with the
new, simpler, representation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302678 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] remove redundant tests
Sanjay Patel [Wed, 10 May 2017 14:54:49 +0000 (14:54 +0000)]
[InstCombine] remove redundant tests

The first test in this file is duplicated exactly in and.ll -> test33.
We have commuted and vector variants there too.

The second test is a composite of 2 folds. The first fold is tested
independently in add.ll -> flip_and_mask (including vector variant).
After that transform fires, the IR is identical to the first transform.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302676 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] fix auto-generated FileCheck-captured variable refs
Sanjay Patel [Wed, 10 May 2017 14:40:04 +0000 (14:40 +0000)]
[InstCombine] fix auto-generated FileCheck-captured variable refs

The script at utils/update_test_checks.py has (had?) a bug when variables
start with the same sequence of letters (clearly, not all of the time).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302674 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] fix typo in test comment; NFC
Sanjay Patel [Wed, 10 May 2017 14:25:23 +0000 (14:25 +0000)]
[InstCombine] fix typo in test comment; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302669 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SystemZ] Add miscellaneous instructions
Ulrich Weigand [Wed, 10 May 2017 14:20:15 +0000 (14:20 +0000)]
[SystemZ] Add miscellaneous instructions

This adds a few missing instructions for the assembler and
disassembler.  Those should be the last missing general-
purpose (Chapter 7) instructions for the z10 ISA.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302667 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SystemZ] Add missing arithmetic instructions
Ulrich Weigand [Wed, 10 May 2017 14:18:47 +0000 (14:18 +0000)]
[SystemZ] Add missing arithmetic instructions

This adds the remaining general arithmetic instructions
for assembler / disassembler use.  Most of these are not
useful for codegen; a few might be, and those are listed
in the README.txt for future improvements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302665 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[llvm-readobj] Improve errors on invalid binary
Sam Clegg [Wed, 10 May 2017 14:18:11 +0000 (14:18 +0000)]
[llvm-readobj] Improve errors on invalid binary

The previous code was discarding the error message from
createBinary() by calling errorToErrorCode().
This meant that such error were always reported unhelpfully
as "Invalid data was encountered while parsing the file".

Other tools such as llvm-objdump already produce a more
the error message in this case.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302664 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agochang type from 'int' to 'size_t'. This will fix revision number 302652
Michael Zuckerman [Wed, 10 May 2017 14:00:57 +0000 (14:00 +0000)]
chang type from 'int' to 'size_t'. This will fix revision number 302652

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302660 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] add (ashr (shl i32 X, 31), 31), 1 --> and (not X), 1
Sanjay Patel [Wed, 10 May 2017 13:56:52 +0000 (13:56 +0000)]
[InstCombine] add (ashr (shl i32 X, 31), 31), 1 --> and (not X), 1

This is another step towards favoring 'not' ops over random 'xor' in IR:
https://bugs.llvm.org/show_bug.cgi?id=32706

This transformation may have occurred in longer IR sequences using computeKnownBits,
but that could be much more expensive to calculate.

As the scalar result shows, we do not currently favor 'not' in all cases. The 'not'
created by the transform is transformed again (unnecessarily). Vectors don't have
this problem because vectors are (wrongly) excluded from several other combines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302659 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse explicit false instead of casted nullptr. NFC.
Serge Guelton [Wed, 10 May 2017 13:24:17 +0000 (13:24 +0000)]
Use explicit false instead of casted nullptr. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302656 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse clang++-3.5 compatible initializer_list constructor
Serge Guelton [Wed, 10 May 2017 13:23:47 +0000 (13:23 +0000)]
Use clang++-3.5 compatible initializer_list constructor

Otherwise, a warning is issued.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302655 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LLVM][inline-asm] Altmacro string escape character '!'
Michael Zuckerman [Wed, 10 May 2017 13:08:11 +0000 (13:08 +0000)]
[LLVM][inline-asm] Altmacro string escape character '!'

This patch is the fourth patch in a series of reviews for the Altmacro feature.
This patch introduces a new escape character '!' and it depends on D32701.

according to https://sourceware.org/binutils/docs/as/Altmacro.html:
"single-character string escape
To include any single character literally in a string (even if the character would otherwise have some special meaning), you can prefix the character with !' (an exclamation mark). For example, you can write <4.3 !> 5.4!!>' to get the literal text `4.3 > 5.4!'. "

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302652 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAGCombiner] Dropped explicit (sra 0, x) -> 0 and (sra -1, x) -> 0 folds.
Simon Pilgrim [Wed, 10 May 2017 13:06:26 +0000 (13:06 +0000)]
[DAGCombiner] Dropped explicit (sra 0, x) -> 0 and (sra -1, x) -> 0 folds.

These are both handled (and tested) by the earlier ComputeNumSignBits == EltSizeInBits fold.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302651 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[IfConversion] Add missing check in IfConversion/canFallThroughTo
Mikael Holmen [Wed, 10 May 2017 13:06:13 +0000 (13:06 +0000)]
[IfConversion] Add missing check in IfConversion/canFallThroughTo

Summary:
When trying to figure out if MBB could fallthrough to ToMBB (possibly by
falling through a bunch of other MBBs) we didn't actually check if there
was fallthrough between the last two blocks in the chain.

Reviewers: kparzysz, iteratee, MatzeB

Reviewed By: kparzysz, iteratee

Subscribers: javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302650 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SystemZ] Implement getRepRegClassFor()
Jonas Paulsson [Wed, 10 May 2017 13:03:25 +0000 (13:03 +0000)]
[SystemZ]  Implement getRepRegClassFor()

This method must return a valid register class, or the list-ilp isel
scheduler will crash. For MVT::Untyped nullptr was previously returned, but
now ADDR128BitRegClass is returned instead. This is needed just as long as
list-ilp (and probably also list-hybrid) is still there.

Review: Ulrich Weigand, A Trick
https://reviews.llvm.org/D32802

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302649 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AMDGPU][MC] Corrected v_madak/madmk to avoid printing "_e32" in disassembler output
Dmitry Preobrazhensky [Wed, 10 May 2017 13:00:28 +0000 (13:00 +0000)]
[AMDGPU][MC] Corrected v_madak/madmk to avoid printing "_e32" in disassembler output

See bug 32927: https://bugs.llvm.org//show_bug.cgi?id=32927

Reviewers: vpykhtin, artem.tamazov, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302648 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[GlobalISel][X86] Split test file. NFC
Igor Breger [Wed, 10 May 2017 12:58:31 +0000 (12:58 +0000)]
[GlobalISel][X86] Split test file. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302647 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SystemZ] Add decimal integer instructions
Ulrich Weigand [Wed, 10 May 2017 12:42:45 +0000 (12:42 +0000)]
[SystemZ] Add decimal integer instructions

This adds the set of decimal integer (BCD) instructions for
assembler / disassembler use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302646 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SystemZ] Add crypto instructions
Ulrich Weigand [Wed, 10 May 2017 12:42:00 +0000 (12:42 +0000)]
[SystemZ] Add crypto instructions

This adds the set of message-security assist instructions for
assembler / disassembler use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302645 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SystemZ] Add translate/convert instructions
Ulrich Weigand [Wed, 10 May 2017 12:41:12 +0000 (12:41 +0000)]
[SystemZ] Add translate/convert instructions

This adds the set of character-set translate and convert instructions
for assembler / disassembler use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302644 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SystemZ] Add missing memory/string instructions
Ulrich Weigand [Wed, 10 May 2017 12:40:15 +0000 (12:40 +0000)]
[SystemZ] Add missing memory/string instructions

This adds a number of missing memory and string instructions
for assembler / disassembler use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302643 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SystemZ] Reformat assembler/disassembler tests
Ulrich Weigand [Wed, 10 May 2017 12:39:11 +0000 (12:39 +0000)]
[SystemZ] Reformat assembler/disassembler tests

The assembler and disassmebler test cases started out formatted and
sorted in a particular way, but this got lost over time as patches
were added.  Reformat them again.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302642 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAGCombiner] Add vector support to fold (shl/srl 0, x) -> 0
Simon Pilgrim [Wed, 10 May 2017 12:34:27 +0000 (12:34 +0000)]
[DAGCombiner] Add vector support to fold (shl/srl 0, x) -> 0

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302641 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r301950: SpeculativeExecution: Stop using whitelist for costs
Chandler Carruth [Wed, 10 May 2017 12:30:07 +0000 (12:30 +0000)]
Revert r301950: SpeculativeExecution: Stop using whitelist for costs

This pass doesn't correctly handle testing for when it is legal to hoist
arbitrary instructions. The whitelist happens to make it safe, so before
it is removed the pass's legality checks will need to be enhanced.

Details have been added to the code review thread for the patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302640 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AArch64] Fix a comment to match the code. NFC.
Martin Storsjo [Wed, 10 May 2017 10:51:32 +0000 (10:51 +0000)]
[AArch64] Fix a comment to match the code. NFC.

For the ELF case, the default/preferred form is the generic one, not
the short one as used for Apple - fix the comment to say so. Currently
it is a copy-paste typo.

Make the comments on the darwin default a bit more verbose.

Use enum names instead of literal 0/1 to further increase readability
and reduce fragility.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302634 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd a late IR expansion pass for the experimental reduction intrinsics.
Amara Emerson [Wed, 10 May 2017 09:42:49 +0000 (09:42 +0000)]
Add a late IR expansion pass for the experimental reduction intrinsics.

This pass uses a new target hook to decide whether or not to expand a particular
intrinsic to the shuffevector sequence.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302631 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Fix indentation of tcDivide. Combine variable declaration and initialization.
Craig Topper [Wed, 10 May 2017 07:50:17 +0000 (07:50 +0000)]
[APInt] Fix indentation of tcDivide. Combine variable declaration and initialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302626 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Use getNumWords function in udiv/urem/udivrem instead of reimplementinging it.
Craig Topper [Wed, 10 May 2017 07:50:15 +0000 (07:50 +0000)]
[APInt] Use getNumWords function in udiv/urem/udivrem instead of reimplementinging it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302625 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[GlobalISel][X86] G_ZEXT i1 to i32/i64 support.
Igor Breger [Wed, 10 May 2017 06:52:58 +0000 (06:52 +0000)]
[GlobalISel][X86] G_ZEXT i1 to i32/i64 support.

Summary: Support G_ZEXT i1 to i32/i64 instruction selection.

Reviewers: zvi, guyblank

Reviewed By: guyblank

Subscribers: rovka, llvm-commits, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302623 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[UnreachableBlockElim] Check return value of constrainRegClass().
Mikael Holmen [Wed, 10 May 2017 06:33:43 +0000 (06:33 +0000)]
[UnreachableBlockElim] Check return value of constrainRegClass().

Summary:
MachineRegisterInfo::constrainRegClass() can fail if two register classes
don't have a common subclass or if the register class doesn't contain
enough registers. Check the return value before trying to remove Phi nodes,
and if we can't constrain, we output a COPY instead of simply replacing
registers.

Reviewers: kparzysz, david2050, wmi

Reviewed By: kparzysz

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302622 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeGen] Don't require AA in TwoAddress at -O0.
Ahmed Bougacha [Wed, 10 May 2017 00:56:00 +0000 (00:56 +0000)]
[CodeGen] Don't require AA in TwoAddress at -O0.

This is a follow-up to r302611, which moved an -O0 computation of DT
from SDAGISel to TwoAddress.

Don't use it here either, and avoid computing it completely.  The only
use was forwarding the analysis as an optional argument to utility
functions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302612 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeGen] Don't require AA in SDAGISel at -O0.
Ahmed Bougacha [Wed, 10 May 2017 00:39:30 +0000 (00:39 +0000)]
[CodeGen] Don't require AA in SDAGISel at -O0.

Before r247167, the pass manager builder controlled which AA
implementations were used, exporting them all in the AliasAnalysis
analysis group.

Now, AAResultsWrapperPass always uses BasicAA, but still uses other AA
implementations if made available in the pass pipeline.

But regardless, SDAGISel is required at O0, and really doesn't need to
be doing fancy optimizations based on useful AA results.

Don't require AA at CodeGenOpt::None, and only use it otherwise.

This does have a functional impact (and one testcase is pessimized
because we can't reuse a load).  But I think that's desirable no matter
what.

Note that this alone doesn't result in less DT computations: TwoAddress
was previously able to reuse the DT we computed for SDAG.  That will be
fixed separately.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302611 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeGen] Compute DT/LI lazily in SafeStackLegacyPass. NFC.
Ahmed Bougacha [Wed, 10 May 2017 00:39:25 +0000 (00:39 +0000)]
[CodeGen] Compute DT/LI lazily in SafeStackLegacyPass. NFC.

We currently require SCEV, which requires DT/LI.  Those are expensive to
compute, but the pass only runs for functions that have the safestack
attribute.

Compute DT/LI to build SCEV lazily, only when the pass is actually going
to transform the function.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302610 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeGen] Split SafeStack into a LegacyPass and a utility. NFC.
Ahmed Bougacha [Wed, 10 May 2017 00:39:22 +0000 (00:39 +0000)]
[CodeGen] Split SafeStack into a LegacyPass and a utility. NFC.

This lets the pass focus on gathering the required analyzes, and the
utility class focus on the transformation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302609 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeGen] Add an -O0 backend pipeline test. NFC.
Ahmed Bougacha [Wed, 10 May 2017 00:39:17 +0000 (00:39 +0000)]
[CodeGen] Add an -O0 backend pipeline test. NFC.

This should hopefully makes changes to the O0 pipeline obvious; it's
easy to require expensive passes, and this helps make informed
decisions.

Case in point: in the few weeks separating the time when I initially
wrote this patch to the time when I committed, the test regressed as
r302103 added another use of DT!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302608 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Fix build error in wasm YAML code
Sam Clegg [Wed, 10 May 2017 00:14:04 +0000 (00:14 +0000)]
[WebAssembly] Fix build error in wasm YAML code

This warning didn't show up on my local build
but is causing the bots to fail.  Seems like a
bad idea to have types and variables with the
same name anyhow.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302606 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] add helper function for add X, C folds; NFCI
Sanjay Patel [Wed, 10 May 2017 00:07:16 +0000 (00:07 +0000)]
[InstCombine] add helper function for add X, C folds; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302605 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Improve libObject support for wasm imports and exports
Sam Clegg [Tue, 9 May 2017 23:48:41 +0000 (23:48 +0000)]
[WebAssembly] Improve libObject support for wasm imports and exports

Previously we had only supported the importing and
exporting of functions and globals.

Also, add usefull overload of getWasmSymbol() and
getNumberOfSymbols() in support of lld port.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302601 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] add tests for andn; NFC
Sanjay Patel [Tue, 9 May 2017 23:40:13 +0000 (23:40 +0000)]
[InstCombine] add tests for andn; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302599 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ProfileSummary] Make getProfileCount a non-static member function.
Easwaran Raman [Tue, 9 May 2017 23:21:10 +0000 (23:21 +0000)]
[ProfileSummary] Make getProfileCount a non-static member function.

This change is required because the notion of count is different for
sample profiling and getProfileCount will need to determine the
underlying profile type.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302597 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFunctionImport: Simplify function llvm::thinLTOInternalizeModule. NFCI.
Peter Collingbourne [Tue, 9 May 2017 22:43:31 +0000 (22:43 +0000)]
FunctionImport: Simplify function llvm::thinLTOInternalizeModule. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302595 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ExecutionEngine] Make RuntimeDyld::MemoryManager responsible for tracking EH
Lang Hames [Tue, 9 May 2017 21:32:18 +0000 (21:32 +0000)]
[ExecutionEngine] Make RuntimeDyld::MemoryManager responsible for tracking EH
frames.

RuntimeDyld was previously responsible for tracking allocated EH frames, but it
makes more sense to have the RuntimeDyld::MemoryManager track them (since the
frames are allocated through the memory manager, and written to memory owned by
the memory manager). This patch moves the frame tracking into
RTDyldMemoryManager, and changes the deregisterFrames method on
RuntimeDyld::MemoryManager from:

void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size);

to:

void deregisterEHFrames();

Separating this responsibility will allow ORC to continue to throw the
RuntimeDyld instances away post-link (saving a few dozen bytes per lazy
function) while properly deregistering frames when modules are unloaded.

This patch also updates ORC to call deregisterEHFrames when modules are
unloaded. This fixes a bug where an exception that tears down the JIT can then
unwind through dangling EH frames that have been deallocated but not
deregistered, resulting in UB.

For people using SectionMemoryManager this should be pretty much a no-op. For
people with custom allocators that override registerEHFrames/deregisterEHFrames,
you will now be responsible for tracking allocated EH frames.

Reviewed in https://reviews.llvm.org/D32829

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302589 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[GVN] Fix a crash on encountering non-integral pointers
Keno Fischer [Tue, 9 May 2017 21:07:20 +0000 (21:07 +0000)]
[GVN] Fix a crash on encountering non-integral pointers

Summary:
This fixes the immediate crash caused by introducing an incorrect inttoptr
before attempting the conversion. There may still be a legality
check missing somewhere earlier for non-integral pointers, but this change
seems necessary in any case.

Reviewers: sanjoy, dberlin

Reviewed By: dberlin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302587 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AMDGPU] Fixed typo in GCNRegPressure, NFC
Stanislav Mekhanoshin [Tue, 9 May 2017 20:50:04 +0000 (20:50 +0000)]
[AMDGPU] Fixed typo in GCNRegPressure, NFC

VGRP -> VGPR, SGRP -> SGPR

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302586 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] update test file to use FileCheck; NFC
Sanjay Patel [Tue, 9 May 2017 20:46:12 +0000 (20:46 +0000)]
[InstCombine] update test file to use FileCheck; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302585 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDAGCombine: Combine shuffles of splat-shuffles
Zvi Rackover [Tue, 9 May 2017 20:25:38 +0000 (20:25 +0000)]
DAGCombine: Combine shuffles of splat-shuffles

Summary: Reapply r299047, but this time handle correctly splat-masks with undef elements.

Reviewers: spatel, RKSimon, eli.friedman, andreadb

Reviewed By: spatel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302583 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AArch64] Consider widening instructions in cost calculations
Matthew Simpson [Tue, 9 May 2017 20:18:12 +0000 (20:18 +0000)]
[AArch64] Consider widening instructions in cost calculations

The AArch64 instruction set has a few "widening" instructions (e.g., uaddl,
saddl, uaddw, etc.) that take one or more doubleword operands and produce
quadword results. The operands are automatically sign- or zero-extended as
appropriate. However, in LLVM IR, these extends are explicit. This patch
updates TTI to consider these widening instructions as single operations whose
cost is attached to the arithmetic instruction. It marks extends that are part
of a widening operation "free" and applies a sub-target specified overhead
(zero by default) to the arithmetic instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302582 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] clean up matchDeMorgansLaws(); NFCI
Sanjay Patel [Tue, 9 May 2017 20:05:05 +0000 (20:05 +0000)]
[InstCombine] clean up matchDeMorgansLaws(); NFCI

The motivation for getting rid of dyn_castNotVal is to allow fixing:
https://bugs.llvm.org/show_bug.cgi?id=32706

So this was supposed to be functional-change-intended for the case
of inverting constants and applying DeMorgan. However, I can't find
any cases where that pattern will actually get to matchDeMorgansLaws()
because we have other folds in visitAnd/visitOr that do the same
thing. So this ends up just being a clean-up patch with slight efficiency
improvement, but no-functional-change-intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302581 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[NewGVN] Simplify a DEBUG() statement. NFCI.
Davide Italiano [Tue, 9 May 2017 20:02:48 +0000 (20:02 +0000)]
[NewGVN] Simplify a DEBUG() statement. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302579 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[codeview] Check for a DIExpression offset for local variables
Reid Kleckner [Tue, 9 May 2017 19:59:29 +0000 (19:59 +0000)]
[codeview] Check for a DIExpression offset for local variables

Fixes inalloca parameters, which previously all pointed to the same
offset. Extend the test to use llvm-readobj so that we can test the
offset in a readable way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302578 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMake it illegal for two Functions to point to the same DISubprogram
Adrian Prantl [Tue, 9 May 2017 19:47:37 +0000 (19:47 +0000)]
Make it illegal for two Functions to point to the same DISubprogram

As recently discussed on llvm-dev [1], this patch makes it illegal for
two Functions to point to the same DISubprogram and updates
FunctionCloner to also clone the debug info of a function to conform
to the new requirement. To simplify the implementation it also factors
out the creation of inlineAt locations from the Inliner into a
general-purpose utility in DILocation.

[1] http://lists.llvm.org/pipermail/llvm-dev/2017-May/112661.html
<rdar://problem/31926379>

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

This reapplies r302469 with a fix for a bot failure (reparentDebugInfo
now checks for the case the orig and new function are identical).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302576 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNFC: refactor replaceDominatedUsesWith
Piotr Padlewski [Tue, 9 May 2017 19:39:44 +0000 (19:39 +0000)]
NFC: refactor replaceDominatedUsesWith

Summary:
Since I will post patch with some changes to
replaceDominatedUsesWith, it would be good to avoid
duplicating code again.

Reviewers: davide, dberlin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302575 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DWARF] Fix a parsing issue with type unit headers.
Wolfgang Pieb [Tue, 9 May 2017 19:38:38 +0000 (19:38 +0000)]
[DWARF] Fix a parsing issue with type unit headers.

Reviewers: dblaikie

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302574 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix the Endianness bug by adding the little endian UTF marker.
Eric Beckmann [Tue, 9 May 2017 19:35:45 +0000 (19:35 +0000)]
Fix the Endianness bug by adding the little endian UTF marker.

Summary: Quick fix

Reviewers: zturner, uweigand

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302573 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSuppress all uses of LLVM_END_WITH_NULL. NFC.
Serge Guelton [Tue, 9 May 2017 19:31:13 +0000 (19:31 +0000)]
Suppress all uses of LLVM_END_WITH_NULL. NFC.

Use variadic templates instead of relying on <cstdarg> + sentinel.
This enforces better type checking and makes code more readable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302571 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[lanai] Add computeKnownBitsForTargetNode for Lanai.
Jacques Pienaar [Tue, 9 May 2017 18:35:26 +0000 (18:35 +0000)]
[lanai] Add computeKnownBitsForTargetNode for Lanai.

Summary: computeKnownBitsForTargetNode was not defined for Lanai which resulted in additional AND's with 0x1 for the output of SETCC instructions.

Reviewers: eliben, majnemer

Reviewed By: majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302568 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[NewGVN] Explain why sorting by pointer values doesn't introduce non-determinism.
Davide Italiano [Tue, 9 May 2017 18:29:37 +0000 (18:29 +0000)]
[NewGVN] Explain why sorting by pointer values doesn't introduce non-determinism.

Thanks to Eli for pointing out in a post-commit review comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302566 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SystemZ] Support missing relocation types in RuntimeDyldELF
Ulrich Weigand [Tue, 9 May 2017 18:27:39 +0000 (18:27 +0000)]
[SystemZ] Support missing relocation types in RuntimeDyldELF

Handle some more relocation types in
RuntimeDyldELF::resolveSystemZRelocation

This fixes a number of failing LLDB test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302565 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Fix validation of start function
Sam Clegg [Tue, 9 May 2017 17:51:38 +0000 (17:51 +0000)]
[WebAssembly] Fix validation of start function

The check for valid start function was inverted.  Added a new
test in test/Object to check this case and fixed the existing
tests in for ObjectYAML.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302560 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[RegScavenger] Rangify a loop, NFC
Krzysztof Parzyszek [Tue, 9 May 2017 17:16:52 +0000 (17:16 +0000)]
[RegScavenger] Rangify a loop, NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302554 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdding VSCode syntax colorizer to utils (generated from textmate colorizer).
Puyan Lotfi [Tue, 9 May 2017 17:13:37 +0000 (17:13 +0000)]
Adding VSCode syntax colorizer to utils (generated from textmate colorizer).
--This line, and those below, will be igored--

A    utils/vscode
A    utils/vscode/README
A    utils/vscode/tablegen
A    utils/vscode/tablegen/.vscode
A    utils/vscode/tablegen/.vscode/launch.json
A    utils/vscode/tablegen/CHANGELOG.md
A    utils/vscode/tablegen/README.md
A    utils/vscode/tablegen/language-configuration.json
A    utils/vscode/tablegen/package.json
A    utils/vscode/tablegen/syntaxes
A    utils/vscode/tablegen/syntaxes/TableGen.tmLanguage
A    utils/vscode/tablegen/vsc-extension-quickstart.md

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302553 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[NewGVN] Fix a consistent order for phi nodes operands.
Davide Italiano [Tue, 9 May 2017 16:58:28 +0000 (16:58 +0000)]
[NewGVN] Fix a consistent order for phi nodes operands.

The way we currently define congruency for two PHIExpression(s) is:

1) The operands to the phi functions are congruent
2) The PHIs are defined in the same BasicBlock.

NewGVN works under the assumption that phi operands are in predecessor
order, or at least in some consistent order. OTOH, is valid IR:

patatino:
  %meh = phi i16 [ %0, %winky ], [ %conv1, %tinky ]
  %banana = phi i16 [ %0, %tinky ], [ %conv1, %winky ]
  br label %end

and the in-memory representations of the two SSA registers have an
inconsistent order. This violation of NewGVN assumptions results into
two PHIs found congruent when they're not. While we think it's useful
to have always a consistent order enforced, let's fix this in NewGVN
sorting uses in predecessor order before creating a PHI expression.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302552 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Remove return value from tcFullMultiply.
Craig Topper [Tue, 9 May 2017 16:47:33 +0000 (16:47 +0000)]
[APInt] Remove return value from tcFullMultiply.

The description says it returns the number of words needed to represent the results. But the way it was coded it always returns (lhsWords + rhsWords) or (lhsWords + rhsWords - 1). But the result could be even smaller than that and it wouldn't tell you.

No one uses the result today so rather than try to fix it, just remove it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302551 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNewGVN: Make all of symbolic evaluation logically const.
Daniel Berlin [Tue, 9 May 2017 16:40:04 +0000 (16:40 +0000)]
NewGVN: Make all of symbolic evaluation logically const.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302550 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Add more patterns for BZHI isel
Craig Topper [Tue, 9 May 2017 16:32:11 +0000 (16:32 +0000)]
[X86] Add more patterns for BZHI isel

This patch adds more patterns that a reasonable person might write that can be compiled to BZHI.

This adds support for

(~0U >> (32 - b)) & a;

and

a << (32 - b) >> (32 - b);

This was inspired by the code in APInt::clearUnusedBits.

This can pass an index of 32 to the bzhi instruction which a quick test of Haswell hardware shows will not mask any bits. Though the description text in the Intel manual says the "index is saturated to OperandSize-1". The pseudocode in the same manual indicates no bits will be zeroed for this case.

I think this is still missing cases where the subtract portion is an 8-bit operation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302549 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombineCasts] Fix checks in sext->lshr->trunc pattern.
Sanjay Patel [Tue, 9 May 2017 16:24:59 +0000 (16:24 +0000)]
[InstCombineCasts] Fix checks in sext->lshr->trunc pattern.

The comment says to avoid the case where zero bits are shifted into the truncated value,
but the code checks that the shift is smaller than the truncated value instead of the
number of bits added by the sign extension. Fixing this allows a shift by more than the
value size to be introduced, which is undefined behavior, so the shift is capped at the
value size minus one, which has the expected behavior of filling the value with the sign
bit.

Patch by Jacob Young!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302548 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoVX512] Only look at lower bit in constant scalar masks
Guy Blank [Tue, 9 May 2017 16:16:48 +0000 (16:16 +0000)]
VX512] Only look at lower bit in constant scalar masks

for scalar masked instructions only the lower bit of the mask is relevant. so for constant masks we should either do an unmasked operation or no operation, depending on the value of the lower bit.
This patch handles cases where the lower bit is '1'.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302546 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRe-land "Use the frame index side table for byval and inalloca arguments"
Reid Kleckner [Tue, 9 May 2017 16:02:20 +0000 (16:02 +0000)]
Re-land "Use the frame index side table for byval and inalloca arguments"

This re-lands r302483. It was not the cause of PR32977.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302544 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRe-land "Don't add DBG_VALUE instructions for static allocas in dbg.declare"
Reid Kleckner [Tue, 9 May 2017 16:01:47 +0000 (16:01 +0000)]
Re-land "Don't add DBG_VALUE instructions for static allocas in dbg.declare"

This re-lands commit r302461. It was not the cause of PR32977.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302543 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Atomic] Remove IsStore/IsLoad in the interface, and pass the instruction instead...
Tim Shen [Tue, 9 May 2017 15:27:17 +0000 (15:27 +0000)]
[Atomic] Remove IsStore/IsLoad in the interface, and pass the instruction instead. NFC.

Now both emitLeadingFence and emitTrailingFence take the instruction
itself, instead of taking IsLoad/IsStore pairs.
Instruction::mayReadFromMemory and Instrucion::mayWriteToMemory are used
for determining those two booleans.

The instruction argument is also useful for later D32763, in
emitTrailingFence. For emitLeadingFence, it seems to have cleaner
interface with the proposed change.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302539 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAmend r302535; ifndef and ifdef are different, as it turns out.
Aaron Ballman [Tue, 9 May 2017 15:12:03 +0000 (15:12 +0000)]
Amend r302535; ifndef and ifdef are different, as it turns out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302537 91177308-0d34-0410-b5e6-96231b3b80d8