Commit Graph

144953 Commits

Author SHA1 Message Date
Craig Topper
6954de742c [AVX-512] Add various EVEX move instructions to load folding tables using the VEX equivalents as a guide.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294908 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 18:47:46 +00:00
Craig Topper
f6aebc088c [AVX-512] Add VMOV64toSDZrm CodeGenOnly instruction based on the same instruction from AVX/SSE.
I can't prove that we can select this instruction or the AVX/SSE version, but I'm adding it for consistency for now so I can continue matching the load folding tables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294907 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 18:47:44 +00:00
Craig Topper
0efd4d7c18 [X86] Fix a couple instruction names to use 'mr' instead of 'rm' to indicate they are stores. AVX-512 version was already named with 'mr'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294906 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 18:47:40 +00:00
Craig Topper
82c3f60cd8 [AVX-512] Add VPEXTRD/Q to load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294905 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 18:47:37 +00:00
Simon Pilgrim
a654726bd9 [X86][SSE] Update argument names to match function name. NFCI.
The target shuffle match function arguments were using the term 'Ops' but the function names referred to them as 'Inputs' - use 'Inputs' consistently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294900 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 16:46:41 +00:00
Sanjay Patel
095a0b49b3 [InstCombine] fold icmp sgt/slt (add nsw X, C2), C --> icmp sgt/slt X, (C - C2)
I found one special case of this transform for 'slt 0', so I removed that and added the general transform.

Alive code to check correctness:

Name: slt_no_overflow
Pre: WillNotOverflowSignedSub(C1, C2)
%a = add nsw i8 %x, C2
%b = icmp slt %a, C1
  =>
%b = icmp slt %x, C1 - C2

Name: sgt_no_overflow
Pre: WillNotOverflowSignedSub(C1, C2)
%a = add nsw i8 %x, C2
%b = icmp sgt %a, C1
  =>
%b = icmp sgt %x, C1 - C2

http://rise4fun.com/Alive/MH

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294898 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 16:40:30 +00:00
Sanjay Patel
38d869aaef [ValueTracking] use nonnull argument attribute to eliminate null checks
Enhancing value tracking's analysis of null-ness was suggested in D27855, so here's a first attempt at that.

This is part of solving:
https://llvm.org/bugs/show_bug.cgi?id=28430

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294897 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 15:35:34 +00:00
Simon Pilgrim
211b30744a [X86][AVX2] Add support for combining target shuffles to VPMOVZX
Initial 256-bit vector support - 512-bit support requires extra checks for AVX512BW support (PMOVZXBW) that will be handled in a future patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294896 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 14:31:23 +00:00
NAKAMURA Takumi
c86a6d55f4 AMDGPU::expandMemIntrinsicUses(): Fix an uninitialized variable. This function returned true or undef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294895 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 13:15:31 +00:00
Dorit Nuzman
7078fa3567 [LV/LoopAccess] Check statically if an unknown dependence distance can be
proven larger than the loop-count

This fixes PR31098: Try to resolve statically data-dependences whose
compile-time-unknown distance can be proven larger than the loop-count, 
instead of resorting to runtime dependence checking (which are not always 
possible).

For vectorization it is sufficient to prove that the dependence distance 
is >= VF; But in some cases we can prune unknown dependence distances early,
and even before selecting the VF, and without a runtime test, by comparing 
the distance against the loop iteration count. Since the vectorized code 
will be executed only if LoopCount >= VF, proving distance >= LoopCount 
also guarantees that distance >= VF. This check is also equivalent to the 
Strong SIV Test.

Reviewers: mkuper, anemet, sanjoy

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294892 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 09:32:53 +00:00
Elena Demikhovsky
3e3c8f2d4a AVX-512: Fixed DWARF register numbers for XMM16-31
The reference is here: 
https://software.intel.com/sites/default/files/article/402129/mpx-linux64-abi.pdf



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294890 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 07:56:50 +00:00
Davide Italiano
2b8862559e [LTO] Remove useless redirection from test. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 05:43:25 +00:00
Chandler Carruth
1f7ef68a4e [PM] Add devirtualization-based iteration utility into the new PM's
default pipeline.

A clang with this patch built with ASan and asserts can build all of the
test-suite as well, so it seems to not uncover any latent problems.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294888 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 05:38:04 +00:00
Chandler Carruth
9c2410924c [PM] Enable GlobalsAA in the new PM's pipeline by default.
All the invalidation issues and bugs in this seem to be fixed, it has
survived a full build of the test suite plus SPEC with asserts and ASan
enabled on the Clang binary used.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294887 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 05:34:04 +00:00
Davide Italiano
820dc664db [lib/LTO] Add support for hotness optremarks in the new API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294885 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 05:05:35 +00:00
Davide Italiano
45001dcc35 [LTO] Simplify this test quite a bit, @func2 is unused/unneeded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 03:47:54 +00:00
Davide Italiano
9234696c2f [llvm-lto2] Fix typo in error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294883 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 03:42:09 +00:00
Davide Italiano
9c7400c731 [lib/LTO] Initial support for optimization remarks in the new API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294882 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 03:31:30 +00:00
NAKAMURA Takumi
f92e231ad4 Kaleidoscope-Ch7: Add TranformUtils for llvm::createPromoteMemoryToRegisterPass() added in r294870.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294881 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 01:18:32 +00:00
Craig Topper
6f54ad393b [X86] Update test case I missed in r294876.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 23:23:11 +00:00
Craig Topper
fe892ae261 [X86] Move code for using blendi for insert_subvector out to an isel pattern. This gives the DAG combiner more opportunity to optimize without needing to dig through the blend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294876 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 22:57:12 +00:00
Craig Topper
a1a9b947dc [DAGCombiner] Make the combine of INSERT_SUBVECTOR into a CONCAT_VECTOR more generic to support larger concats.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294875 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 22:57:09 +00:00
Simon Pilgrim
04a335bf92 [X86][SSE] Use VSEXT/VZEXT constant folding for SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG
Preparatory step for PR31712

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294874 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 22:47:06 +00:00
Simon Pilgrim
796f9e5e57 [X86][SSE] Improve VSEXT/VZEXT constant folding.
Generalize VSEXT/VZEXT constant folding to work with any target constant bits source not just BUILD_VECTOR .

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294873 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 21:55:24 +00:00
Mehdi Amini
e0ae1eda9c Update Kaleidoscope tutorial and improve Windows support
Many quoted code blocks were not in sync with the actual toy.cpp
files. Improve tutorial text slightly in several places.
Added some step descriptions crucial to avoid crashes (like
InitializeNativeTarget* calls).
Solve/workaround problems with Windows (JIT'ed method not found, using
custom and standard library functions from host process).

Patch by: Moritz Kroll <moritz.kroll@gmx.de>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 21:26:52 +00:00
Amaury Sechet
c0358c4bfe Fix atomic-minmax-i6432.ll .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294867 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 19:34:11 +00:00
Amaury Sechet
021167a86e Regen expected tests result. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294866 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 19:27:15 +00:00
Aaron Ballman
342bf77f71 Correcting several sphinx errors; should fix the LLVM documentation build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 18:45:24 +00:00
Simon Pilgrim
276a1497f1 [X86][SSE] Add early-out when trying to match blend shuffle. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 18:06:24 +00:00
Sanjay Patel
57101fca7a [TargetLowering] check for sign-bit comparisons in SimplifyDemandedBits
I don't know if anything other than x86 vectors is affected by this change, but this may allow 
us to remove target-specific intrinsics for blendv* (vector selects). The simplification arises
from the fact that blendv* instructions only use the sign-bit when deciding which vector element
to choose for the destination vector. The mechanism to fold VSELECT into SHRUNKBLEND nodes already
exists in x86 lowering; this demanded bits change just enables the transform to fire more often.

The original motivation starts with a bug for DSE of masked stores that seems completely unrelated, 
but I've explained the likely steps in this series here:
https://llvm.org/bugs/show_bug.cgi?id=11210

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 18:01:55 +00:00
Amaury Sechet
561536223d Fix typo in test filename. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294860 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 17:48:49 +00:00
Amaury Sechet
3f9b6c1139 Fix indentation in X86ISelLowering. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 17:48:48 +00:00
Craig Topper
5bb68b46d1 [AVX-512] Add VPMINS/MINU/MAXS/MAXU instructions to load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294858 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 17:35:28 +00:00
Craig Topper
b3ac0dcae6 [X86] Improve alphabetizing of load folding tables. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294857 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 17:35:25 +00:00
Simon Pilgrim
dcd6d02210 [X86][SSE] Convert getTargetShuffleMaskIndices to use getTargetConstantBitsFromNode.
Removes duplicate constant extraction code in getTargetShuffleMaskIndices.

getTargetConstantBitsFromNode - adds support for VZEXT_MOVL(SCALAR_TO_VECTOR) and fail if the caller doesn't support undef bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 17:27:21 +00:00
Simon Pilgrim
68155852cf [X86] Merge repeated getScalarValueSizeInBits calls. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294852 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 16:42:07 +00:00
Daniel Berlin
1886f7825d NewGVN: Reverse sense of this test to make it clearer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294851 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 15:20:15 +00:00
Daniel Berlin
df694af921 NewGVN: Add missing initialization of NumFuncArgs lost due to bad merge.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294850 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 15:13:49 +00:00
Daniel Berlin
364f3b139d NewGVN: Rank and order commutative operands consistently.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294849 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 15:07:01 +00:00
Simon Pilgrim
ec8a2fa14d [X86][3DNow!] Add tests to ensure PFMAX/PFMIN are not commuted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294848 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 14:01:37 +00:00
Simon Pilgrim
bff8d8792a [X86][3DNow!] Enable PFSUB<->PFSUBR commutation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294847 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 13:51:14 +00:00
Simon Pilgrim
0b45ed990b [X86][3DNow!] Enable commutation for PFADD/PFMUL/PFCMPEQ/PAVGUSB/PMULHRW
All commutations confirmed to give identical results - note PFMAX/PFMIN do not

PFSUB<->PFSUBR should be commutable as well

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294846 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 13:32:55 +00:00
Simon Pilgrim
1b593317d1 [X86][3DNow!] Add tests showing missed commutation opportunities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294845 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 13:00:32 +00:00
Daniel Berlin
f6af3ae082 NewGVN: Clean up how we handle the INITIAL class so that everything in
it is dead or unreachable, as it should be.
This also makes the leader of INITIAL undef, enabling us to handle
irreducibility properly.

Summary:
This lets us verify, more than we do now, that we didn't screw up
value numbering.

Reviewers: davide

Subscribers: Prazek, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294844 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 12:48:50 +00:00
Vitaly Buka
5de15e70cb Fix "left shift of negative value -1" introduced by r294805
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294843 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 12:44:03 +00:00
Simon Pilgrim
fec1e4fec7 [X86][XOP] Regenerate XOP commutation tests.
Added 32-bit tests as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294841 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 12:30:59 +00:00
Simon Pilgrim
53b6da2428 [X86][SSE] Regenerate float comparison commutation tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 12:29:56 +00:00
Simon Pilgrim
b50a97818a [X86] Regenerate CLMUL commutation tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294839 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 12:23:22 +00:00
Benjamin Kramer
3264d3f56b Move symbols from the global namespace into (anonymous) namespaces. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294837 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 11:06:55 +00:00
Craig Topper
02524a88e4 [AVX-512] Add VPINSRB/W/D/Q instructions to load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294830 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 07:01:40 +00:00