145599 Commits

Author SHA1 Message Date
Matt Arsenault
6de2a82753 AMDGPU: Remove llvm.AMDGPU.clamp intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295789 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 23:46:04 +00:00
Matt Arsenault
aac82e218f AMDGPU: Redefine clamp node as clamp 0.0-1.0
Change implementation to use max instead of add.
min/max/med3 do not flush denormals regardless of the mode,
so it is OK to use it whether or not they are enabled.

Also allow using clamp with f16, and use knowledge
of dx10_clamp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295788 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 23:35:48 +00:00
Artem Belevich
b1a24afa7a [NVPTX] Unify vectorization of load/stores of aggregate arguments and return values.
Original code only used vector loads/stores for explicit vector arguments.
It could also do more loads/stores than necessary (e.g v5f32 would
touch 8 f32 values). Aggregate types were loaded one element at a time,
even the vectors contained within.

This change attempts to generalize (and simplify) parameter space
loads/stores so that vector loads/stores can be used more broadly.
Functionality of the patch has been verified by compiling thrust
test suite and manually checking the differences between PTX
generated by llvm with and without the patch.

General algorithm:
* ComputePTXValueVTs() flattens input/output argument into a flat list
  of scalars to load/store and returns their types and offsets.
* VectorizePTXValueVTs() uses that data to create vectorization plan
  which returns an array of flags marking boundaries of vectorized
  load/stores. Scalars are represented as 1-element vectors.
* Code that generates loads/stores implements a simple state machine
  that constructs a vector according to the plan.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295784 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:56:05 +00:00
Matt Arsenault
36229b4631 AMDGPU: Formatting fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295783 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:50:41 +00:00
Matt Arsenault
8f5956381c DAG: Check if extract_vector_elt is legal or custom
Avoids test regressions in future AMDGPU commits when
more vector types are custom lowered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295782 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:47:27 +00:00
Evandro Menezes
450fce7072 [AArch64, X86] Add statistics for the MacroFusion pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295777 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:16:13 +00:00
Evandro Menezes
6a905f67f6 [AArch64, X86] Guard against both instrs being wild cards
If both instrs are wild cards, the result can be a crash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295776 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:16:11 +00:00
Evandro Menezes
bcd633da12 [AArch64] Add test case for fusion of literal generation
Add test case from https://reviews.llvm.org/D28698 that was somehow lost in
transit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295775 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:16:09 +00:00
Evandro Menezes
d9de925b22 [AArch64] Add test case for fusion of AES crypto operations
Add test case from https://reviews.llvm.org/D28491 that was somehow lost in
transit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295774 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:16:06 +00:00
Eugene Zelenko
c688c0bb51 [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295773 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:07:52 +00:00
Zachary Turner
0f341e41e5 Try to fix the buildbot on OSX.
Since I'm only seeing failures on OSX, and it's saying
permission denied, I'm suspecting this is due to the addition
of the MAP_RESILIENT_CODESIGN and/or MAP_RESILIENT_MEDIA flags.
Speculatively trying to remove those to get the bots working.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295770 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 21:31:28 +00:00
Zachary Turner
83fbeaf3ba Try to fix Android build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295769 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 21:13:10 +00:00
Zachary Turner
167b16d8fb [Support] Add a function to check if a file resides locally.
Differential Revision: https://reviews.llvm.org/D30010

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295768 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 20:55:47 +00:00
Xin Tong
97a57b3013 Make default value for disable-licm-promotion in licm explicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295767 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 20:53:48 +00:00
Rafael Espindola
13f0c80b28 Don't modify archive members unless really needed.
For whatever reason ld64 requires that member headers (not the member
themselves) should be aligned. The only way to do that is to edit the
previous member so that it ends at an aligned boundary.

Since modifying data put in an archive is an undesirable property,
llvm-ar should only do it when it is absolutely necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295765 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 20:40:54 +00:00
Evgeniy Stepanov
2c0dd61dd0 Fix PR31896.
Address of an alias of a global with offset is incorrectly lowered as an address of the global (i.e. ignoring offset).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295762 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 20:17:34 +00:00
Zachary Turner
f7ae539291 Try to fix line endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295759 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 19:52:57 +00:00
Sanjay Patel
2d562fe758 [InstCombine] canonicalize non-obivous forms of integer min/max
This is part of trying to clean up our handling of min/max patterns in IR.
By converting these to canonical form, we're more likely to recognize them
because there are various places in InstCombine that don't use 
matchSelectPattern or m_SMax and friends.

The backend fixups referenced in the now deleted TODO comment were added with:
https://reviews.llvm.org/rL291392
https://reviews.llvm.org/rL289738

If there's any codegen fallout from this change, we should be able to address
it in DAGCombiner or target-specific lowering. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295758 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 19:33:53 +00:00
Matt Arsenault
8a7ccd7129 AMDGPU: Remove dead declarations in tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295757 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 19:31:33 +00:00
Zachary Turner
d48932ae6b Remove svn:eol-style property from 2 files.
There are still over 3400 files remaining with this property set, but there are tens of thousands more with the property not set.  Until we decide what to do on a global scale, this at least unblocks me temporarily.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295756 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 19:29:56 +00:00
Matt Arsenault
d47c3f5b20 AMDGPU: Remove dead declarations from MIR tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295755 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 19:27:36 +00:00
Matt Arsenault
f2616d2fd3 AMDGPU: Remove llvm.AMDGPU.flbit intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295754 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 19:27:33 +00:00
Matt Arsenault
bcb6a77aca AMDGPU: Don't use stack space for SGPR->VGPR spills
Before frame offsets are calculated, try to eliminate the
frame indexes used by SGPR spills. Then we can delete them
after.

I think for now we can be sure that no other instruction
will be re-using the same frame indexes. It should be easy
to notice if this assumption ever breaks since everything
asserts if it tries to use a dead frame index later.

The unused emergency stack slot seems to still be left behind,
so an additional 4 bytes is still wasted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295753 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 19:12:08 +00:00
Xin Tong
141d242f5a [LoopSimplify] Simplify how we compute UniqueExit
Summary: Simplify how we compute UniqueExit. Reuse ExitBlockSet.

Reviewers: sanjoy, efriedma, hfinkel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295751 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 19:10:58 +00:00
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