145425 Commits

Author SHA1 Message Date
Xin Tong
fbff24df0b More comments for getUniqueExitBlocks. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295750 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 19:08:03 +00:00
Adrian Prantl
fb2cee97e4 Teach the IR verifier to reject conflicting debug info for function arguments.
Conflicting debug info for function arguments causes hard-to-debug
assertions in the DWARF backend, so the Verifier should reject it.
For performance reasons this only checks function arguments from
non-inlined debug intrinsics for now.

rdar://problem/30520286

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295749 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 19:03:15 +00:00
Geoff Berry
fc170d8f5d [CodeGenPrepare] Sink and duplicate more 'and' instructions.
Summary:
Rework the code that was sinking/duplicating (icmp and, 0) sequences
into blocks where they were being used by conditional branches to form
more tbz instructions on AArch64.  The new code is more general in that
it just looks for 'and's that have all icmp 0's as users, with a target
hook used to select which subset of 'and' instructions to consider.
This change also enables 'and' sinking for X86, where it is more widely
beneficial than on AArch64.

The 'and' sinking/duplicating code is moved into the optimizeInst phase
of CodeGenPrepare, where it can take advantage of the fact the
OptimizeCmpExpression has already sunk/duplicated any icmps into the
blocks where they are used.  One minor complication from this change is
that optimizeLoadExt needed to be updated to always mark 'and's it has
determined should be in the same block as their feeding load in the
InsertedInsts set to avoid an infinite loop of hoisting and sinking the
same 'and'.

This change fixes a regression on X86 in the tsan runtime caused by
moving GVNHoist to a later place in the optimization pipeline (see
PR31382).

Reviewers: t.p.northover, qcolombet, MatzeB

Subscribers: aemerson, mcrosier, sebpop, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295746 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 18:53:14 +00:00
Wei Ding
8d22e6f3bb AMDGPU : AMDGPU : Update AMDGPU Trap Handler ABI.
Differential Revision: http://reviews.llvm.org/D29913

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295745 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 18:48:01 +00:00
Dmitry Preobrazhensky
b3352252da Test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295740 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 18:07:07 +00:00
Simon Pilgrim
2ffda75993 [X86] EltsFromConsecutiveLoads SDLoc argument should be const&.
There appears never to have been a time that the reference was updated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295739 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 17:42:28 +00:00
Vassil Vassilev
ab07cb9da1 Do not leak OpenedHandles.
Reviewed by Vedant Kumar (D30178)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295737 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 17:30:43 +00:00
Simon Pilgrim
0e35fcb104 [X86][AVX512] Update VPBROADCASTQ test to combine from VPERMQ instead of VPERMI2Q.
VPERMI2Q doesn't have shuffle decoding from re-materializable constants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295736 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 17:04:11 +00:00
Simon Pilgrim
d0be5ae522 [X86][AVX] Rename shuffle combine tests to show combined shuffle type. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295735 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 16:45:31 +00:00
John Brawn
e29ba7b266 [ARM] Correct SP/PC handling in t2MOVr
Add a missing test that I forgot to svn add in my previous commit


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295734 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 16:45:04 +00:00
Simon Pilgrim
3f5e9f4627 [X86][AVX2] Fix VPBROADCASTQ folding on 32-bit targets.
As i64 isn't a value type on 32-bit targets, we need to fold the VZEXT_LOAD into VPBROADCASTQ.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295733 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 16:41:44 +00:00
John Brawn
eb973f7868 [ARM] Correct SP/PC handling in t2MOVr
PC isn't allowed in the source operand of t2MOVr, so change the register class
to one without PC. SP handling is slightly trickier and changes depending on if
we're in ARMv8, so do that in checkTargetMatchPredicate.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295732 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 16:41:29 +00:00
Simon Pilgrim
77c8682840 [X86][AVX2] Add AVX512 test targets to AVX2 shuffle combines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295731 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 16:29:28 +00:00
Simon Pilgrim
a77fb3315a [X86][AVX] Add tests showing missed VPBROADCASTQ folding on 32-bit targets.
As i64 isn't a value type on 32-bit targets, we fail to fold the VZEXT_LOAD into VPBROADCASTQ.

Also shows that we're not decoding VPERMIV3 shuffles very well....

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295729 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 16:05:35 +00:00
Simon Pilgrim
d14347a186 [X86][SSE] Prefer to combine shuffles to VZEXT over VZEXT_MOVL.
This matches what is already done during shuffle lowering and helps prevent the need for a zero-vector in cases where shuffles match both patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295723 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 15:09:00 +00:00
Simon Pilgrim
70dcac1118 [X86][SSE] Added SSE41 shuffle combining test file.
Currently just contains one case where we combine to VZEXT_MOVL instead of VZEXT which would avoid the need for a zero vector to be generated

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295721 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 14:51:15 +00:00
Anna Thomas
20c0e163af [InstCombine] Do not exercise nested max/min pattern on abs
Summary:
This is a fix for assertion failure in
`getInverseMinMaxSelectPattern` when ABS is passed in as a select pattern.

We should not be invoking the simplification rule for
ABS(MIN(~ x,y))) or ABS(MAX(~x,y)) combinations.

Added a test case which would cause an assertion failure without the patch.

Reviewers: sanjoy, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295719 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 14:40:28 +00:00
Igor Breger
253f60a6d8 [AVX512] Fix EXTRACT_VECTOR_ELT for v2i1/v4i1/v32i1/v64i1 with variable index.
Differential Revision: https://reviews.llvm.org/D30189



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295718 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 14:01:25 +00:00
Alexey Bataev
9e606c16f0 [SLP] Tests for shuffle/blending operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295717 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 13:40:55 +00:00
Diana Picus
c247010cec [ARM] GlobalISel: Lower calls to void() functions
For now, we hardcode a BLX instruction, and generate an ADJCALLSTACKDOWN/UP pair
with amount 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295716 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 11:33:59 +00:00
Pavel Labath
94403df1dd tablegen: Fix android build
use llvm::to_string instead of std:: version.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295711 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 09:19:41 +00:00
Craig Topper
4e7e88abb9 [X86] Remove ssse3 intrinsic tests from the avx intrinsics test file.
They are all covered by the SSSE3 intrinsics test with SSSE3, AVX, and AVX512 command lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295708 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 08:06:08 +00:00
Craig Topper
f12d64f2d3 [X86] Remove sse4.2 intrinsic tests from the avx intrinsics test file. Fix some other consistency issues.
They are all covered by the SSE4.2 intrinsics test with SSE4.2, AVX, and AVX512 command lines.

Merge sse42.ll into the other intrinsics test. Rename sse42_64.ll to be named like other intrinsic tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295707 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 08:06:05 +00:00
Craig Topper
74f63b561d [X86] Remove sse4.1 intrinsic tests from the avx intrinsics test file.
They are all covered by the SSE4.1 intrinsics test with SSE4.1, AVX, and AVX512 command lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295706 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 08:06:02 +00:00
Craig Topper
c39fbcaf44 [X86] Remove sse3 intrinsic tests from the avx intrinsics test file.
They are all covered by the SSE3 intrinsics test with SSE2, AVX, and AVX512 command lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295705 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 08:05:59 +00:00
Evgeny Stupachenko
141320fd99 The patch introduces new way of narrowing complex (>UINT16 variants) solutions.
The new method introduced under "-lsr-exp-narrow" option (currenlty set to true).

Summary:

The method is based on registers number mathematical expectation and should be
 generally closer to optimal solution.
Please see details in comments to
 "LSRInstance::NarrowSearchSpaceByDeletingCostlyFormulas()" function
 (in lib/Transforms/Scalar/LoopStrengthReduce.cpp).

Reviewers: qcolombet

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

From: Evgeny Stupachenko <evstupac@gmail.com>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295704 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 07:34:40 +00:00
Craig Topper
f80e7ef629 [X86] Remove aes intrinsic tests from the avx intrinsics test file.
They are all covered by the AES intrinsics test with a legacy command line and an AVX command line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295702 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 07:32:18 +00:00
Craig Topper
068549b757 [X86] Add an AVX command line and regenerate AES intrinsics test using the update_llc_test_checks.py
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295701 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 07:32:14 +00:00
Craig Topper
4228b1201f [X86] Remove sse2 intrinsic tests from the avx intrinsics test file.
They are all covered by the SSE2 intrinsics test with SSE2, AVX, and AVX512 command lines.

Also remove an unneeded lfence intrinsic test since it was already covered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295700 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 07:32:11 +00:00
Craig Topper
3ba7715b43 [X86] Remove sse1 intrinsic tests from the avx intrinsics test file.
They are all covered by the SSE intrinsics test with SSE, AVX, and AVX512 command lines.

Also remove an unneeded sfence intrinsic test since it was already covered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295699 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 07:32:03 +00:00
Craig Topper
02e45aadbe [X86] Use SHLD with both inputs from the same register to implement rotate on Sandy Bridge and later Intel CPUs
Summary:
Sandy Bridge and later CPUs have better throughput using a SHLD to implement rotate versus the normal rotate instructions. Additionally it saves one uop and avoids a partial flag update dependency.

This patch implements this change on any Sandy Bridge or later processor without BMI2 instructions. With BMI2 we will use RORX as we currently do.

Reviewers: zvi

Reviewed By: zvi

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295697 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 06:39:13 +00:00
Craig Topper
97823bb7e5 [X86] Fix formatting. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295695 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 06:27:13 +00:00
Craig Topper
4d13821a7e [AVX-512] Use sse_load_f32/f64 in place of scalar_to_vector and scalar load in some patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295693 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 04:26:10 +00:00
Craig Topper
7f8d3281a8 [AVX-512] Add test cases showing failure to fold zero extending scalar loads in scalar intrinsics without the peephole pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295692 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 04:26:07 +00:00
Craig Topper
962f06c537 [AVX-512] Fix the ExeDomain for vcmpss/vcmpsd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295691 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 04:26:04 +00:00
Sanjoy Das
475a9ff8bb [ValueTracking] clang-format a section I'm about to touch; NFC
(Whitespace only change)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295690 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 02:42:42 +00:00
Matthias Braun
1cd3a6f835 ScheduleDAG: Cleanup; NFC
- Fix doxygen comments (do not repeat documented name, remove definition
    comment if there is already one at the declaration, add \p, ...)
- Add some const modifiers
- Use range based for

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295688 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 01:27:33 +00:00
Matthias Braun
60202aba32 SubtargetFeature: Cleanup; NFC
- Fix doxygen comments
- Remove duplicated comments
- Remove section comments (which became wrong over time)
- Use more `const` and references but less `auto`

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295687 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 01:27:29 +00:00
Sanjoy Das
81f0f4690c Add a wrapper around copy_if in STLExtras; NFC
I will add one more use for this in a later change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295685 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 00:38:44 +00:00
Taewook Oh
f8bacbb9bd [BranchFolding] Update debug location along with the update of branch instruction.
Summary:
Currently, BranchFolder drops DebugLoc for branch instructions in some places. For example, for the test code attached, the branch instruction of 'entry' block has a DILocation of

```
!12 = !DILocation(line: 6, column: 3, scope: !11)
```

, but this information is gone when then block is lowered because BranchFolder misses it. This patch is a fix for this issue.

Reviewers: qcolombet, aprantl, craig.topper, MatzeB

Reviewed By: aprantl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295684 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 00:12:38 +00:00
Craig Topper
b7493bfcda [X86] Add additonal check lines to one of the rotate tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295682 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-20 23:38:51 +00:00
Craig Topper
575ba996f6 [X86] FileCheckize one of the rotate tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295681 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-20 23:38:48 +00:00
Sanjoy Das
98b4a5bae5 [IndVars] Add an assert
We've already checked that the loop is in simplify form before, but a
little paranoia never hurt anyone.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295680 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-20 23:37:11 +00:00
Davide Italiano
3abe103b2e [IR/Verifier] List the CU we weren't able to find in llvm.dbg.cu.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295678 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-20 22:51:42 +00:00
Daniel Berlin
4f1c254f51 MemorySSA: Add support for renaming uses in the updater.
Summary:
This lets one add aliasing stores to the updater.
(i'm next going to move the creation/etc functions to the updater)

Reviewers: george.burgess.iv

Subscribers: llvm-commits, Prazek

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295677 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-20 22:26:03 +00:00
Craig Topper
c4d575e7fe [X86] FileCheckize one of the rotate tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295676 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-20 19:44:10 +00:00
Steven Wu
acfd73b22c Fix use-after-free found by ASAN
DenseMap::lookup returns copy of the value in the map. Returning the
address of the temporary return value will cause use-after-free.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295675 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-20 18:33:40 +00:00
Craig Topper
cce48e320d [AVX-512] Add a few more patterns for selecting masked vpternlog with broadcast loads where the passthru operand is not operand 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295673 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-20 17:44:09 +00:00
Simon Pilgrim
c8319a4345 [X86] Tidyup combineExtractVectorElt. NFCI.
Pull out repeated code for extraction index operand and source vector value type.

Use isNullConstant helper to check for zero extraction index.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295670 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-20 16:09:45 +00:00
Simon Pilgrim
8ea8e13dbf [X86][SSE] Regenerate extracted bitcasted constant tests and add 32-bit test target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295669 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-20 15:57:14 +00:00