Commit Graph

562 Commits

Author SHA1 Message Date
Sanjay Patel
0e28b658d8 [SLP] add tests for bitcasted vector pointer load; NFC
I'm not sure if this falls within the scope of SLP,
but we could create vector loads for some of these
patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365055 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-03 16:46:14 +00:00
Vasileios Porpodas
7ea3099c0c [SLP] Recommit: Look-ahead operand reordering heuristic.
Summary: This patch introduces a new heuristic for guiding operand reordering. The new "look-ahead" heuristic can look beyond the immediate predecessors. This helps break ties when the immediate predecessors have identical opcodes (see lit test for an example).

Reviewers: RKSimon, ABataev, dtemirbulatov, Ayal, hfinkel, rnk

Reviewed By: RKSimon, dtemirbulatov

Subscribers: hiraditya, phosek, rnk, rcorcs, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364964 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-02 20:20:28 +00:00
Jordan Rupprecht
5cc6baa230 Revert [SLP] Look-ahead operand reordering heuristic.
This reverts r364478 (git commit 574cb0eb3a7ac95e62d223a60bef891171dfe321)

The patch is causing compilation timeouts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364846 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-01 21:10:43 +00:00
Vasileios Porpodas
e39d2a4630 [SLP] Look-ahead operand reordering heuristic.
Summary: This patch introduces a new heuristic for guiding operand reordering. The new "look-ahead" heuristic can look beyond the immediate predecessors. This helps break ties when the immediate predecessors have identical opcodes (see lit test for an example).

Reviewers: RKSimon, ABataev, dtemirbulatov, Ayal, hfinkel, rnk

Reviewed By: RKSimon, dtemirbulatov

Subscribers: rnk, rcorcs, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364478 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-26 21:25:24 +00:00
Simon Pilgrim
0b9e0228e5 [SLPVectorizer] Precommit of supernode.ll test for D63661
This is a pre-commit of the tests introduced by the SuperNode SLP patch D63661.

Committed on behalf of @vporpo (Vasileios Porpodas)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364320 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-25 14:58:20 +00:00
Cameron McInally
9960990081 [SLP] Support unary FNeg vectorization
Differential Revision: https://reviews.llvm.org/D63609

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364219 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-24 19:24:23 +00:00
Reid Kleckner
344be134f7 Revert [SLP] Look-ahead operand reordering heuristic.
This reverts r364084 (git commit 5698921be2d567f6abf925479ac9f5a376d6d74f)

It caused crashes while compiling a file in Chrome. Reduction
forthcoming.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364111 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-21 23:10:25 +00:00
Simon Pilgrim
bb99915428 [SLP] Look-ahead operand reordering heuristic.
This patch introduces a new heuristic for guiding operand reordering. The new "look-ahead" heuristic can look beyond the immediate predecessors. This helps break ties when the immediate predecessors have identical opcodes (see lit test for an example).

Committed on behalf of @vporpo (Vasileios Porpodas)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364084 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-21 17:57:01 +00:00
Cameron McInally
24d7880147 [NFC][SLP] Pre-commit unary FNeg test to X86/propagate_ir_flags.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363978 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-20 20:53:51 +00:00
Cameron McInally
7925bcfc92 [NFC][SLP] Pre-commit unary FNeg test to X86/phi3.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363937 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-20 15:17:17 +00:00
Simon Pilgrim
add3956b3f [SLP][X86] Add lookahead reordering tests from D60897
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363925 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-20 12:52:58 +00:00
Fangrui Song
1002960b9d [lit] Delete empty lines at the end of lit.local.cfg NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363538 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-17 09:51:07 +00:00
Sander de Smalen
cdca5bb4d5 Improve reduction intrinsics by overloading result value.
This patch uses the mechanism from D62995 to strengthen the
definitions of the reduction intrinsics by letting the scalar
result/accumulator type be overloaded from the vector element type.

For example:

  ; The LLVM LangRef specifies that the scalar result must equal the
  ; vector element type, but this is not checked/enforced by LLVM.
  declare i32 @llvm.experimental.vector.reduce.or.i32.v4i32(<4 x i32> %a)

This patch changes that into:

  declare i32 @llvm.experimental.vector.reduce.or.v4i32(<4 x i32> %a)

Which has the type-constraint more explicit and causes LLVM to check
the result type with the vector element type.

Reviewers: RKSimon, arsenm, rnk, greened, aemerson

Reviewed By: arsenm

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363240 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-13 09:37:38 +00:00
Dinar Temirbulatov
ffe57b5e41 [SLP] Update propagate_ir_flags.ll test to check that we do retain the common subset, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363218 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-13 00:19:50 +00:00
Dinar Temirbulatov
5172f404c3 [SLP] Fix regression in broadcasts caused by operand reordering patch D59973.
This patch fixes a regression caused by the operand reordering refactoring patch https://reviews.llvm.org/D59973 .
The fix changes the strategy to Splat instead of Opcode, if broadcast opportunities are found.
Please see the lit test for some examples.

Committed on behalf of @vporpo (Vasileios Porpodas)
    
Differential Revision: https://reviews.llvm.org/D62427


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362613 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-05 15:26:28 +00:00
Simon Pilgrim
0ea813a1e5 [SLPVectorizer][X86] Add other tests described in PR28474
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362297 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-01 12:35:03 +00:00
Simon Pilgrim
51c8e674ad [SLPVectorizer][X86] This test was from PR28474
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362296 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-01 12:10:29 +00:00
Simon Pilgrim
8bdaa8fafd [SLPVectorizer][X86] Add broadcast test case from D62427
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361805 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-28 11:10:56 +00:00
Simon Pilgrim
ab39cf6afa [CostModel][X86] Add min/max reduction costs for all SSE targets
The original costs stopped at SSE42, I've added conservative estimates for everything down to SSE1/SSE2 and moved some of the SSE42 costs to SSE41 (really only the addition of PCMPGT makes any difference).

I've also added missing vXi8 costs (we use PHMINPOSUW for i8/i16 for scarily quick results) and 256-bit vector costs for AVX1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360528 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-11 17:12:52 +00:00
Simon Pilgrim
f9c960409f [SLP] Lit test that cannot get vectorized due to lack of look-ahead operand reordering heuristic.
The code in this test is not vectorized by SLP because its operand reordering cannot look beyond the immediate predecessors.
This will get fixed in a follow-up patch that introduces the look-ahead operand reordering heuristic.

Committed on behalf of @vporpo (Vasileios Porpodas)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359553 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 11:03:09 +00:00
Alexey Bataev
e4f3b1f220 [SLP] Fix crash after r358519, by V. Porpodas.
Summary: The code did not check if operand was undef before casting it to Instruction.

Reviewers: RKSimon, ABataev, dtemirbulatov

Reviewed By: ABataev

Subscribers: uabelho

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359136 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 20:21:32 +00:00
Eric Christopher
598198edbc Revert "Temporarily Revert "Add basic loop fusion pass.""
The reversion apparently deleted the test/Transforms directory.

Will be re-reverting again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358552 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 04:52:47 +00:00
Eric Christopher
02cc44c1b9 Temporarily Revert "Add basic loop fusion pass."
As it's causing some bot failures (and per request from kbarton).

This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358546 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 02:12:23 +00:00
Simon Pilgrim
e7b71e08c1 [SLP] Refactoring of the operand reordering code.
This is a refactoring patch which should have all the functionality of the current code. Its goal is twofold:
i. Cleanup and simplify the reordering code, and
ii. Generalize reordering so that it will work for an arbitrary number of operands, not just 2.

This is the second patch in a series of patches that will enable operand reordering across chains of operations. An example of this was presented in EuroLLVM'18 https://www.youtube.com/watch?v=gIEn34LvyNo .

Committed on behalf of @vporpo (Vasileios Porpodas)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358519 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-16 19:27:00 +00:00
Simon Pilgrim
4fbffbd5f6 [SLP][X86] Regenerate operandorder tests with arguments on same line. NFCI.
Stops update_test_checks.py from splitting the later arguments after the CHECKs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357679 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-04 09:31:12 +00:00
Sanjay Patel
3a12f8f3d2 [InstCombine] canonicalize select shuffles by commuting
In PR41304:
https://bugs.llvm.org/show_bug.cgi?id=41304
...we have a case where we want to fold a binop of select-shuffle (blended) values.

Rather than try to match commuted variants of the pattern, we can canonicalize the
shuffles and check for mask equality with commuted operands.

We don't produce arbitrary shuffle masks in instcombine, but select-shuffles are a
special case that the backend is required to handle because we already canonicalize
vector select to this shuffle form.

So there should be no codegen difference from this change. It's possible that this
improves CSE in IR though.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357366 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-31 15:01:30 +00:00
Simon Pilgrim
8678b08600 [SLP] Add support for commutative icmp/fcmp predicates
For the cases where the icmp/fcmp predicate is commutative, use reorderInputsAccordingToOpcode to collect and commute the operands.

This requires a helper to recognise commutativity in both general Instruction and CmpInstr types - the CmpInst::isCommutative doesn't overload the Instruction::isCommutative method for reasons I'm not clear on (maybe because its based on predicate not opcode?!?).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357266 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 15:28:25 +00:00
Simon Pilgrim
8c3557f6d7 [SLP] Add support for swapping icmp/fcmp predicates to permit vectorization
We should be able to match elements with the swapped predicate as well - as long as we commute the source operands.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357243 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 10:41:00 +00:00
Simon Pilgrim
7cf515b63a [SLP][X86] Add tests showing failure to commute icmp/fcmp by swapping predicate
By swapping icmp/fcmp predicates we can commute their operands to improve vectorization

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357204 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-28 19:13:38 +00:00
Simon Pilgrim
079ca3ecab [SLP][X86] Add tests showing failure to commute icmp/fcmp operands
Some predicates are fully commutative - we should be able to easily commute their operands to improve vectorization

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357202 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-28 19:03:53 +00:00
Simon Pilgrim
f36ee139a4 [SLPVectorizer] Merge reorderAltShuffleOperands into reorderInputsAccordingToOpcode
As discussed on D59738, this generalizes reorderInputsAccordingToOpcode to handle multiple + non-commutative instructions so we can get rid of reorderAltShuffleOperands and make use of the extra canonicalizations that reorderInputsAccordingToOpcode brings.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356939 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-25 20:05:27 +00:00
Simon Pilgrim
acd323e334 [SLPVectorizer] Update file missed in rL356913
Differential Revision: https://reviews.llvm.org/D59738

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356915 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-25 16:14:21 +00:00
Simon Pilgrim
ce23689b40 [SLPVectorizer] reorderInputsAccordingToOpcode - remove non-Instruction canonicalization
Remove attempts to commute non-Instructions to the LHS - the codegen changes appear to rely on chance more than anything else and also have a tendency to fight existing instcombine canonicalization which moves constants to the RHS of commutable binary ops.

This is prep work towards:
(a) reusing reorderInputsAccordingToOpcode for alt-shuffles and removing the similar reorderAltShuffleOperands
(b) improving reordering to optimized cases with commutable and non-commutable instructions to still find splat/consecutive ops.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356913 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-25 15:53:55 +00:00
Simon Pilgrim
6feb429bab [X86][SLP] Show example of failure to uniformly commute splats for 'alt' shuffles.
If either the main/alt opcodes isn't commutable we may end up with the splats not correctly commuted to the same side.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356837 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-23 16:14:04 +00:00
Sanjay Patel
765f2feb7a [SLP] fix variables names in test; NFC
'tmpXXX' conflicts with the auto-generated script regex names.
That could cause mask a bug or fail if the output changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356790 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 18:33:11 +00:00
Dinar Temirbulatov
158b5b6e51 [SLPVectorizer] Add test related to SLP Throttling support, NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356754 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 14:50:53 +00:00
Florian Hahn
dabf82a18f [SLP] Fix invalid triple in X86 tests
x86-64 is an invalid architecture in triples. Changing it to the correct
triple (x86_64) changes some tests, because SLP is not deemed profitable
any more.

Reviewers: ABataev, RKSimon, spatel

Reviewed By: RKSimon

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355420 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 17:56:35 +00:00
Simon Pilgrim
563ff5441e [Vectorizer] Add vectorization support for fixed smul/umul intrinsics
This requires a couple of tweaks to existing vectorization functions as they were assuming that only the second call argument (ctlz/cttz/powi) could ever be the 'always scalar' argument, but for smul.fix + umul.fix its the third argument.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354790 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-25 15:42:02 +00:00
Simon Pilgrim
de8628ec6b [SLPVectorizer][X86] Add fixed smul/umul tests
Baseline tests - fixed mul intrinsics aren't flagged as vectorizable yet

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354783 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-25 13:26:30 +00:00
Simon Pilgrim
51ab92cb99 [SLPVectorizer][X86] Add add/sub/mul overflow tests
Baseline tests - overflow intrinsics aren't flagged as vectorizable yet

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354454 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-20 12:04:54 +00:00
Eric Christopher
46f8c8ccf1 Temporarily Revert "[X86][SLP] Enable SLP vectorization for 128-bit horizontal X86 instructions (add, sub)"
As this has broken the lto bootstrap build for 3 days and is
showing a significant regression on the Dither_benchmark results (from
the LLVM benchmark suite) -- specifically, on the
BENCHMARK_FLOYD_DITHER_128, BENCHMARK_FLOYD_DITHER_256, and
BENCHMARK_FLOYD_DITHER_512; the others are unchanged.  These have
regressed by about 28% on Skylake, 34% on Haswell, and over 40% on
Sandybridge.

This reverts commit r353923.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354434 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-20 04:42:07 +00:00
Anton Afanasyev
74c86f7499 [X86][SLP] Enable SLP vectorization for 128-bit horizontal X86 instructions (add, sub)
Try to use 64-bit SLP vectorization. In addition to horizontal instrs
this change triggers optimizations for partial vector operations (for instance,
using low halfs of 128-bit registers xmm0 and xmm1 to multiply <2 x float> by
<2 x float>).

Fixes llvm.org/PR32433

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353923 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13 08:26:43 +00:00
Simon Pilgrim
06a647df6d [TTI] Add generic SADDSAT/SSUBSAT costs
Add generic costs calculation for SADDSAT/SSUBSAT intrinsics, this uses generic costs for sadd_with_overflow/ssub_with_overflow, an extra sign comparison + a selects based on the sign/overflow.

This completes PR40316

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352315 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-27 13:51:59 +00:00
Nemanja Ivanovic
8c69b6f74f [PowerPC] Update Vector Costs for P9
For the power9 CPU, vector operations consume a pair of execution units rather
than one execution unit like a scalar operation. Update the target transform
cost functions to reflect the higher cost of vector operations when targeting
Power9.

Patch by RolandF.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352261 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-26 01:18:48 +00:00
Simon Pilgrim
2e5edf4b8d [TTI] Add generic UADDSAT/USUBSAT costs
Add generic costs calculation for UADDSAT/USUBSAT intrinsics, this fallbacks to using generic costs for uadd_with_overflow/usub_with_overflow + a select.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352044 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-24 12:27:10 +00:00
Simon Pilgrim
21d100aff8 [CostModel][X86] Add explicit vector select costs
Prior to SSE41 (and sometimes on AVX1), vector select has to be performed as a ((X & C)|(Y & ~C)) bit select.

Exposes a couple of issues with the min/max reduction costs (which only go down to SSE42 for some reason).

The increase pre-SSE41 selection costs also prevent a couple of tests from firing any longer, so I've either tweaked the target or added AVX tests as well to the existing SSE2 tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351685 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-20 13:55:01 +00:00
Simon Pilgrim
38ece52d64 [CostModel][X86] Add explicit fcmp costs for pre-SSE42 targets
Typical throughputs: cmpss/cmpps = 1cy and cmpsd/cmppd = 2cy before the Core2 era

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351684 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-20 13:21:43 +00:00
Alexey Bataev
43448ef0fe [SLP] Fix PR40310: The reduction nodes should stay scalar.
Summary:
Sometimes the SLP vectorizer tries to vectorize the horizontal reduction
nodes during regular vectorization. This may happen inside of the loops,
when there are some vectorizable PHIs. Patch fixes this by checking if
the node is the reduction node and thus it must not be vectorized, it must
be gathered.

Reviewers: RKSimon, spatel, hfinkel, fedor.sergeev

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351349 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-16 15:39:52 +00:00
Alexey Bataev
d33fbc19a2 [SLP] Added test for PR40310, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351240 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-15 20:54:44 +00:00
Nikita Popov
b96b37dc8f Reapply "[CodeGen][X86] Expand USUBSAT to UMAX+SUB, also for vectors"
Related to https://bugs.llvm.org/show_bug.cgi?id=40123.

Rather than scalarizing, expand a vector USUBSAT into UMAX+SUB,
which produces much better code for X86.

Reapplying with updated SLPVectorizer tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351219 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-15 18:43:41 +00:00