41994 Commits

Author SHA1 Message Date
Simon Pilgrim
50d76a80ed [InstCombine][SSE] Tests showing missed opportunities to pass demanded elts through a packss/packus truncation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292144 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 17:26:23 +00:00
Chad Rosier
a7959e565a [AArch64] Falkor supports Rounding Double Multiply Add/Subtract instructions.
Falkor only partially implements the ARMv8.1a extensions, so this patch
refactors the support for the SQRDML[A|S]H instruction into a separate
feature.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292142 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 16:28:43 +00:00
Tony Jiang
748e859f36 Revert "[PowerPC] Expand ISEL instruction into if-then-else sequence."
This reverts commit 1d0e0374438ca6e153844c683826ba9b82486bb1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292131 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 15:01:07 +00:00
Simon Pilgrim
1f7c0c9364 [SelectionDAG] Add knownbits support for BITREVERSE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292130 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 14:49:26 +00:00
Tony Jiang
541103a1c6 [PowerPC] Expand ISEL instruction into if-then-else sequence.
Generally, the ISEL is expanded into if-then-else sequence, in some
cases (like when the destination register is the same with the true
or false value register), it may just be expanded into just the if
or else sequence.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292128 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 14:43:12 +00:00
Simon Pilgrim
2abcd78f2b [X86][SSE] Test showing missing BITREVERSE knownbits support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292118 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 13:59:42 +00:00
Simon Dardis
dcca2bf437 [mips] Correct c.cond.fmt instruction definition.
Permit explicit $fcc<X> operand in c.cond.fmt instruction.

Add c.cond.fmt to the MIPS to microMIPS instruction mapping table.

Check that $fcc1 - $fcc7 are unusable for MIPS-I to MIPS-III for
c.cond.fmt, bc1t, bc1f.

Reviewers: seanbruno, zoran.jovanovic, vkalintiris

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292117 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 13:55:58 +00:00
Simon Pilgrim
b648fac5ca [SelectionDAG] Add support for BITREVERSE constant folding
We were relying on constant folding of the legalized instructions to do what constant folding we had previously

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292114 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 13:39:00 +00:00
Simon Pilgrim
e6bbb863e1 [X86][SSE] Tests showing missing BITREVERSE constant folding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292111 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 13:18:07 +00:00
Simon Pilgrim
07d3c0f01c [InstCombine][SSE] Add DemandedElts support for PSHUFB instructions
Simplify a pshufb shuffle mask based on the elements of the mask that are actually demanded.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292101 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 11:30:41 +00:00
Craig Topper
d925138fc6 [AVX-512] Teach the disassembler about all of the EVEX gather and scatter instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292094 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 05:44:33 +00:00
Craig Topper
ead90cd47c [AVX-512] Add more gather/scatter encoding test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292089 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 00:58:20 +00:00
Craig Topper
00915333a9 [AVX-512] Correct memory operand size for VPGATHERQPS and VPGATHERQD
with ZMM index. Similar for SCATTER and the prefetch gather and scatter
instructions.

Fixes PR31618.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292088 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 00:55:58 +00:00
Sanjay Patel
5ec1d71357 [InstCombine] add tests to show missed vector folds; NFC
Also, add comments and remove bogus comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292082 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 23:45:03 +00:00
Simon Pilgrim
0016b62b09 [CostModel][X86] Fix AVX512BW vector shift costs for vXi16 types
We already have patterns in place to support 128/256-bit shifts without AVX512VL

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292077 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 20:44:00 +00:00
Simon Pilgrim
3a60120921 [CostModel][X86] Drop separate AVX512VL checks - they match existing AVX512 costs
Keep the tests though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292076 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 20:19:28 +00:00
Simon Pilgrim
43b72e4d01 [CostModel][X86] Update vector shift tests to correctly check by non-constant uniform values.
Use shuffle( scslar_to_vector, zeroinitializer) pattern instead of shuffle( vec, zeroinitializer)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292075 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 20:10:28 +00:00
Simon Pilgrim
4354d8859a [InstCombine][SSE] Tests showing missed opportunities to pass demanded elts through a pshufb shuffle mask
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292072 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 17:49:04 +00:00
Justin Lebar
f4556e7ece [NVPTX] Add fptosi tests to convert-fp.ll.
These seem to have been left off by accident.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292071 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 16:55:54 +00:00
Justin Lebar
164f3ff43b [NVPTX] Add codegen tests for llvm.fma.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292070 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 16:55:37 +00:00
Justin Lebar
be5157f530 [NVPTX] Modernize intrinics.ll test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292069 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 16:54:57 +00:00
Justin Lebar
352f7fdadc [NVPTX] Let there be One True Way to set NVVMReflect params.
Summary:
Previously there were three ways to inform the NVVMReflect pass whether
you wanted to flush denormals to zero:

  * An LLVM command-line option
  * Parameters to the NVVMReflect constructor
  * Metadata on the module itself.

This change removes the first two, leaving only the third.

The motivation for this change, aside from simplifying things, is that
we want LLVM to be aware of whether it's operating in FTZ mode, so other
passes can use this information.  Ideally we'd have a target-generic
piece of metadata on the module.  This change moves us in that
direction.

Reviewers: tra

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292068 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 16:54:35 +00:00
Michael Zuckerman
50520f329a Fix blend mask by switch the side of the operand since Blend node uses opposite mask then Select NODE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292066 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 16:43:14 +00:00
Sanjay Patel
f6be6abb81 [InstCombine] use m_APInt to allow ashr folds for vectors with splat constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292064 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 16:38:19 +00:00
Sanjay Patel
b41dc00dd6 [InstCombine] add explanatory comments to tests; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292063 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 16:22:26 +00:00
Serge Pavlov
69a1a20613 Reverted: Track validity of pass results
Commits r291882 and related r291887.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292062 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 10:23:18 +00:00
Daniel Jasper
a8933c2b2d Revert "[GlobalISel] track predecessor mapping during switch lowering."
This reverts commit r291973.

The test fails in a Release build with LLVM_BUILD_GLOBAL_ISEL enabled.
AFAICT, llc segfaults. I'll add a few more details to the original
commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292061 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 09:41:49 +00:00
Chandler Carruth
0e327f2e11 [PM] Clean up the testing for IVUsers, especially with the new PM.
First, I've moved a test of IVUsers from the LSR tree to a dedicated
IVUsers test directory. I've also simplified its RUN line now that the
new pass manager's loop PM is providing analyses on their own.

No functionality changed, but it makes subsequent changes cleaner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292060 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 09:29:27 +00:00
Chandler Carruth
d97514d79a [PM] Teach the optimization remarks emitter to handle invalidation
events.

This pass sometimes has a pointer to BlockFrequencyInfo so it needs
custom invalidation logic. It is also otherwise immutable so we can
reduce the number of invalidations that happen substantially.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292058 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 08:20:50 +00:00
Chandler Carruth
15050a4c1e [PM] The assumption cache is fundamentally designed to be self-updating,
mark it as never invalidated in the new PM.

The old PM already required this to work, and after a discussion with
Hal this seems to really be the only sensible answer. The cache
gracefully degrades as the IR is mutated, and most things which do this
should already be incrementally updating the cache.

This gets rid of a bunch of logic preserving and testing the
invalidation of this analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292039 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 00:26:18 +00:00
Chandler Carruth
340ad683c8 [PM] Fix instcombine's analysis preservation in the new pass manager to
cover domtree and alias analysis. These are the pretty clear analyses
that we would always want to survive this pass.

To make these survive, we also need to preserve the assumption cache.

Added a test that verifies the important bits of this preservation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292037 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 23:25:22 +00:00
Sanjay Patel
1849414f3e [InstCombine] add test to show missed vector fold; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292035 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 23:12:29 +00:00
Simon Pilgrim
75f614f4c2 [CostModel][X86] Updated vXi64 ASHR costs on AVX512 targets now that D28604 has landed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292023 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 19:24:23 +00:00
Simon Pilgrim
97658211eb [X86][XOP] Added support for VPMADCSWD 'extend+hadd' IFMA patterns
VPMADCSWD act as VPADDD( VPMADDWD( x, y ), z ) - multiply+extend+hadd and add to v4i32 accumulator

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292021 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 18:52:13 +00:00
Simon Pilgrim
261f559da3 [X86][XOP] Added support for VPMACSDQH/VPMACSDQL 'extension' IFMA patterns
VPMACSDQH/VPMACSDQL act as VPADDQ( VPMULDQ( x, y ), z ) - multiply+extending either the odd/even 4i32 input elements and adding to v2i64 accumulator

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292020 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 18:08:54 +00:00
Simon Pilgrim
08c5cbd394 [X86][XOP] Added support for VPMACSWW/VPMACSDD 'lossy' IFMA patterns
VPMACSWW/VPMACSDD act as add( mul( x, y ), z ) - ignoring any upper bits from both the multiply and add stages

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292019 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 17:13:52 +00:00
Simon Pilgrim
6dbd68e62b [X86][XOP] Add tests for integer fused multiply add
Tests showing missed opportunities to use XOP's integer fma instructions

Some of these are pretty awkward to match as they often have implicit sext/trunc stages but many just ignore overflow bits which makes things pretty straightforward.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292017 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 13:07:22 +00:00
Craig Topper
7b47370e8e [AVX-512] Teach two address instruction pass to replace masked move instructions with blendm instructions when its beneficial.
Isel now selects masked move instructions for vselect instead of blendm. But sometimes it beneficial to register allocation to remove the tied register constraint by using blendm instructions.

This also picks up cases where the masked move was created due to a masked load intrinsic.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292005 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 07:50:52 +00:00
Craig Topper
49a15c1e8e [AVX-512] Replace V_SET0 in AVX-512 patterns with AVX512_128_SET0. Enhance AVX512_128_SET0 expansion to make this possible.
We'll now expand AVX512_128_SET0 to an EVEX VXORD if VLX available. Or if its not, but register allocation has selected a non-extended register we will use VEX VXORPS. And if its an extended register without VLX we'll use a 512-bit XOR. Do the same for AVX512_FsFLD0SS/SD.

This makes it possible for the register allocator to have all 32 registers available to work with.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292004 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 07:29:24 +00:00
Craig Topper
7c24b913f8 [AVX-512] Change blend mask in lowerVectorShuffleAsBlend to a 64-bit value. Also add 32-bit mode command lines to the test case that exercises this just to make sure we sanely handle the 64-bit immediate there.
This fixes a undefined sanitizer failure from r291888.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291994 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 04:19:35 +00:00
Daniel Berlin
ea4e23e5be NewGVN: Fix PR31613 test regex naming
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291979 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 23:54:10 +00:00
Sanjay Patel
3d039197d7 [InstCombine] optimize unsigned icmp of increment
Allows LLVM to optimize sequences like the following:

%add = add nuw i32 %x, 1
%cmp = icmp ugt i32 %add, %y

Into:

%cmp = icmp uge i32 %x, %y

Previously, only signed comparisons were being handled.

Decrements could also be handled, but 'sub nuw %x, 1' is currently canonicalized to
'add %x, -1' in InstCombineAddSub, losing the nuw flag. Removing that canonicalization
seems like it might have far-reaching ramifications so I kept this simple for now.

Patch by Matti Niemenmaa!

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291975 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 23:25:46 +00:00
Tim Northover
b5ead7c450 [GlobalISel] track predecessor mapping during switch lowering.
Correctly populating Machine PHIs relies on knowing exactly how the IR level
CFG was lowered to MachineIR. This needs to be tracked by any translation
phases that meddle (currently only SwitchInst handling).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291973 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 23:11:37 +00:00
Sanjay Patel
534e635d1b [InstCombine] use m_APInt to allow lshr folds for vectors with splat constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291972 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 23:04:10 +00:00
Sanjay Patel
e71a092ac9 [InstCombine / InstSimplify] add and move tests for lshr transforms; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291970 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 22:54:12 +00:00
Daniel Berlin
e782760da1 NewGVN: Move leaders around properly to ensure we have a canonical dominating leader. Fixes PR 31613.
Summary:
This is a testcase where phi node cycling happens, and because we do
not order the leaders by domination or anything similar, the leader
keeps changing.

Using std::set for the members is too expensive, and we actually don't
need them sorted all the time, only at leader changes.

We could keep both a set and a vector, and keep them mostly sorted and
resort as necessary, or use a set and a fibheap, but all of this seems
premature.

After running some statistics, we are able to avoid the vast majority
of sorting by keeping a "next leader" field.  Most congruence classes only have
leader changes once or twice during GVN.

Reviewers: davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291968 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 22:40:01 +00:00
David Majnemer
22eeda1bb9 [LoopStrengthReduce] Don't bother rewriting PHIs in catchswitch blocks
The catchswitch instruction cannot be split, don't bother trying to
rewrite it.

This fixes PR31627.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291966 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 22:24:27 +00:00
Artem Belevich
f53524b4f6 [NVPTX] Added support for half-precision floating point.
Only scalar half-precision operations are supported at the moment.

- Adds general support for 'half' type in NVPTX.
- fp16 math operations are supported on sm_53+ GPUs only
  (can be disabled with --nvptx-no-f16-math).
- Type conversions to/from fp16 are supported on all GPU variants.
- On GPU variants that do not have full fp16 support (or if it's disabled),
  fp16 operations are promoted to fp32 and results are converted back
  to fp16 for storage.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291956 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 20:56:17 +00:00
Konstantin Zhuravlyov
999a6572f3 [AMDGPU] Implement f16 fcopysign and fcopysign(f32, f64)
Differential Revision: https://reviews.llvm.org/D28496


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291954 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 19:49:25 +00:00
James Y Knight
f1ad5e7c9b Check for register clobbers when merging a vreg live range with a
reserved physreg in RegisterCoalescer.

Previously, we only checked for clobbers when merging into a READ of
the physreg, but not when merging from a WRITE to the physreg.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291942 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 19:08:36 +00:00