915 Commits

Author SHA1 Message Date
Simon Pilgrim
e6913f371a [TargetLowering] expandUnalignedStore - cleanup EVT variables. NFCI.
Avoid duplicated EVTs and rename Store/Load VTs to avoid -Wshadow warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359877 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-03 12:55:25 +00:00
Sjoerd Meijer
88adfde779 [TargetLowering] findOptimalMemOpLowering. NFCI.
This was a local static funtion in SelectionDAG, which I've promoted to
TargetLowering so that I can reuse it to estimate the cost of a memory
operation in D59787.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359543 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 10:09:15 +00:00
Simon Pilgrim
524491cf14 [TargetLowering][AMDGPU][X86] Improve SimplifyDemandedBits bitcast handling
This patch adds support for BigBitWidth -> SmallBitWidth bitcasts, splitting the DemandedBits/Elts accordingly.

The AMDGPU backend needed an extra  (srl (and x, c1 << c2), c2) -> (and (srl(x, c2), c1) combine to encourage BFE creation, I investigated putting this in DAGCombine but it caused a lot of noise on other targets - some improvements, some regressions.

The X86 changes are all definite wins.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358887 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-22 14:04:35 +00:00
Craig Topper
3f8580a865 [TargetLowering][X86] Teach SimplifyDemandedBits to use ShrinkDemandedOp on ISD::SHL nodes.
If the upper bits of the SHL result aren't used, we might be able to use a narrower shift. For example, on X86 this can turn a 64-bit into 32-bit enabling a smaller encoding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358257 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 06:49:28 +00:00
Simon Pilgrim
0c7bc1e6bb [TargetLowering] SimplifyDemandedBits - add ISD::INSERT_SUBVECTOR support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358019 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 16:52:21 +00:00
Simon Pilgrim
f312d38896 [TargetLowering] SimplifyDemandedBits - Remove GetDemandedSrcMask lambda. NFCI.
An older version of this could return false but now that this always succeeds we can just inline and simplify it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357999 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 12:29:26 +00:00
Simon Pilgrim
6aaa856e17 [TargetLowering] SimplifyDemandedBits - call SimplifyDemandedBits in bitcast handling
When bitcasting from a source op to a larger bitwidth op, split the demanded bits and OR them on top of one another and demand those merged bits in the SimplifyDemandedBits call on the source op.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357992 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 10:27:59 +00:00
Simon Pilgrim
a2b71f96a9 [TargetLowering] SimplifyDemandedBits - use DemandedElts in bitcast handling
Be more selective in the SimplifyDemandedBits -> SimplifyDemandedVectorElts bitcast call based on the demanded elts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357942 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 20:59:38 +00:00
Simon Pilgrim
3ae5d6c4c4 [DAG] Pull out ComputeNumSignBits call to make debugging easier. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357861 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-07 11:49:33 +00:00
Simon Pilgrim
3ae58c3794 [TargetLowering] Add SimplifyDemandedBits support for ISD::INSERT_VECTOR_ELT
This helps us relax the extension of a lot of scalar elements before they are inserted into a vector.

Its exposes an issue in DAGCombiner::convertBuildVecZextToZext as some/all the zero-extensions may be relaxed to ANY_EXTEND, so we need to handle that case to avoid a couple of AVX2 VPMOVZX test regressions.

Once this is in it should be easier to fix a number of remaining failures to fold loads into VBROADCAST nodes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356989 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-26 12:32:01 +00:00
Simon Pilgrim
ac90f79174 [TargetLowering] SimplifyDemandedBits trunc(srl(x, C1)) - early out for out of range C1. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356810 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 20:53:49 +00:00
Sanjay Patel
939c6145a9 [TargetLowering] improve the default expansion of uaddsat/usubsat
This is a subset of what was proposed in:
D59006
...and may overlap with test changes from:
D59174
...but it seems like a good general optimization to turn selects
into bitwise-logic when possible because we never know exactly
what can happen at this stage of DAG combining depending on how
the target has defined things.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356332 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-17 14:57:40 +00:00
Simon Pilgrim
4c0f218c93 [SelectionDAG] Add SimplifyDemandedBits handling for ISD::SCALAR_TO_VECTOR
Fixes a lot of constant folding mismatches between i686 and x86_64

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356273 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-15 17:00:55 +00:00
Simon Pilgrim
5fd3b9019a [DAG] Move integer setcc %x, %x folding into FoldSetCC
First step towards PR40800 - I intend to move the float case in a separate future patch.

I had to tweak the (overly reduced) thumb2 test and the x86 widening test change is annoying (no longer rematerializable) but we should address this separately.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356040 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-13 11:08:57 +00:00
Nikita Popov
f7a652c414 [SDAG] Expand pow2 mulo using shifts
Expand MULO with constant power of two operand into a shift. The
overflow is checked with (x << shift) >> shift == x, where the right
shift will be logical for umulo and arithmetic for smulo (with
exception for multiplications by signed_min).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355937 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-12 16:57:25 +00:00
Nikita Popov
802a6632d5 [SDAG][AArch64] Legalize VECREDUCE
Fixes https://bugs.llvm.org/show_bug.cgi?id=36796.

Implement basic legalizations (PromoteIntRes, PromoteIntOp,
ExpandIntRes, ScalarizeVecOp, WidenVecOp) for VECREDUCE opcodes.
There are more legalizations missing (esp float legalizations),
but there's no way to test them right now, so I'm not adding them.

This also includes a few more changes to make this work somewhat
reasonably:

 * Add support for expanding VECREDUCE in SDAG. Usually
   experimental.vector.reduce is expanded prior to codegen, but if the
   target does have native vector reduce, it may of course still be
   necessary to expand due to legalization issues. This uses a shuffle
   reduction if possible, followed by a naive scalar reduction.
 * Allow the result type of integer VECREDUCE to be larger than the
   vector element type. For example we need to be able to reduce a v8i8
   into an (nominally) i32 result type on AArch64.
 * Use the vector operand type rather than the scalar result type to
   determine the action, so we can control exactly which vector types are
   supported. Also change the legalize vector op code to handle
   operations that only have vector operands, but no vector results, as
   is the case for VECREDUCE.
 * Default VECREDUCE to Expand. On AArch64 (only target using VECREDUCE),
   explicitly specify for which vector types the reductions are supported.

This does not handle anything related to VECREDUCE_STRICT_*.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355860 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-11 20:22:13 +00:00
Simon Pilgrim
4e3754ce69 [DAG] Move SetCC NaN handling into FoldSetCC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355845 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-11 17:43:10 +00:00
Simon Pilgrim
71dcb3c210 [DAG] TargetLowering::SimplifySetCC - call FoldSetCC early to handle constant/commute folds.
Noticed while looking at PR40800 (and also D57921)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355828 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-11 15:01:31 +00:00
Sanjay Patel
7d2b43bd7c [TargetLowering] simplify code for uaddsat/usubsat expansion; NFC
We had 2 local variable names for the same type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355516 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 16:06:27 +00:00
Sanjay Patel
6328488e88 [TargetLowering] simplify code for uaddsat/usubsat expansion; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355508 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 14:34:59 +00:00
Simon Pilgrim
a53711984d Use SDValue::getConstantOperandAPInt helper where possible. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355267 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-02 11:11:22 +00:00
Bjorn Pettersson
85de1fd399 Add support for computing "zext of value" in KnownBits. NFCI
Summary:
The description of KnownBits::zext() and
KnownBits::zextOrTrunc() has confusingly been telling
that the operation is equivalent to zero extending the
value we're tracking. That has not been true, instead
the user has been forced to explicitly set the extended
bits as known zero afterwards.

This patch adds a second argument to KnownBits::zext()
and KnownBits::zextOrTrunc() to control if the extended
bits should be considered as known zero or as unknown.

Reviewers: craig.topper, RKSimon

Reviewed By: RKSimon

Subscribers: javed.absar, hiraditya, jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355099 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-28 15:45:29 +00:00
Nikita Popov
8781462495 [SDAG] Support vector UMULO/SMULO
Second part of https://bugs.llvm.org/show_bug.cgi?id=40442.

This adds an extra UnrollVectorOverflowOp() method to SDAG, because
the general UnrollOverflowOp() method can't deal with multiple results.

Additionally we need to expand UMULO/SMULO during vector op
legalization, as it may result in unrolling, which may need additional
type legalization.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354513 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-20 20:41:44 +00:00
Nikita Popov
c6134a921b [SelectionDAG] Extract [US]MULO expansion into TL method; NFC
In preparation for supporting vector expansion.

Add an isPostTypeLegalization flag to makeLibCall(), because this
expansion relies on the legalized form using MERGE_VALUES. Drop
the corresponding variant of ExpandLibCall, which is no longer used.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354226 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-17 17:40:47 +00:00
Nirav Dave
45ef910a26 [X86] Fix LowerAsmOutputForConstraint.
Summary:
Update Flag when generating cc output.

Fixes PR40737.

Reviewers: rnk, nickdesaulniers, craig.topper, spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354163 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-15 20:01:55 +00:00
Simon Pilgrim
dadc89d53f Fix 80-column limit in SimplifyDemandedBits/SimplifyDemandedVectorElts. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354152 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-15 18:15:58 +00:00
Chandler Carruth
8677a19763 [CallSite removal] Migrate the statepoint GC infrastructure to use the
`CallBase` class rather than `CallSite` wrappers.

I pushed this change down through most of the statepoint infrastructure,
completely removing the use of CallSite where I could reasonably do so.
I ended up making a couple of cut-points: generic call handling
(instcombine, TLI, SDAG). As soon as it hit truly generic handling with
users outside the immediate code, I simply transitioned into or out of
a `CallSite` to make this a reasonable sized chunk.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353660 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11 07:42:30 +00:00
Nikita Popov
fdfe10a58f [CodeGen][X86] Don't scalarize vector saturating add/sub
Now that we have vector support for [US](ADD|SUB)O we no longer
need to scalarize when expanding [US](ADD|SUB)SAT.

This matches what the cost model already does.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353651 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-10 19:06:38 +00:00
Sanjay Patel
0c9f4335a3 [TargetLowering] refactor setcc folds to fix another miscompile (PR40657)
SimplifySetCC still has much room for improvement, but this should
fix the remaining problem examples from:
https://bugs.llvm.org/show_bug.cgi?id=40657

The initial fix for this problem was rL353615.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353639 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-10 14:29:57 +00:00
Sanjay Patel
70a10441b9 [TargetLowering] add tests to show effect of setcc sub->shift; NFC
There's effectively no difference for the cases with variables.
We just trade a sub for an add on those. But the case with a
subtract from constant would require an extra move instruction
on x86, so this looks like a reasonable generic combine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353619 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-09 17:03:59 +00:00
Sanjay Patel
af9730abe5 [TargetLowering] avoid miscompile in setcc transform (PR40657)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353615 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-09 15:59:02 +00:00
Nikita Popov
b58596f863 Revert "[SelectionDAG] Extract [US]MULO expansion into TL method; NFC"
This reverts commit r353611.

Triggers an assertion during the libcall expansion on ARM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353612 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-09 13:54:02 +00:00
Nikita Popov
fe7822a4a2 [SelectionDAG] Extract [US]MULO expansion into TL method; NFC
In preparation for supporting vector expansion.

Also drop a variant of ExpandLibCall, of which the MULO expansions
were the only user.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353611 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-09 13:29:22 +00:00
Craig Topper
e3696113b6 Implementation of asm-goto support in LLVM
This patch accompanies the RFC posted here:
http://lists.llvm.org/pipermail/llvm-dev/2018-October/127239.html

This patch adds a new CallBr IR instruction to support asm-goto
inline assembly like gcc as used by the linux kernel. This
instruction is both a call instruction and a terminator
instruction with multiple successors. Only inline assembly
usage is supported today.

This also adds a new INLINEASM_BR opcode to SelectionDAG and
MachineIR to represent an INLINEASM block that is also
considered a terminator instruction.

There will likely be more bug fixes and optimizations to follow
this, but we felt it had reached a point where we would like to
switch to an incremental development model.

Patch by Craig Topper, Alexander Ivchenko, Mikhail Dvoretckii

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353563 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-08 20:48:56 +00:00
Simon Pilgrim
d5cf0c957e [TargetLowering] Use ISD::FSHR in expandFixedPointMul
Replace OR(SHL,SRL) pattern with ISD::FSHR (legalization expands this later if necessary) - this helps with the scale == 0 'undefined' drop-through case that was discussed on D55720.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353546 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-08 18:57:38 +00:00
Simon Pilgrim
de0c5e9f25 [TargetLowering] Add SimplifyDemandedBits funnel shift support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353539 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-08 17:19:01 +00:00
Nirav Dave
ae502dc0ce [InlineAsm][X86] Add backend support for X86 flag output parameters.
Allow custom handling of inline assembly output parameters and add X86
flag parameter support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353307 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-06 15:26:29 +00:00
Leonard Chan
18c82e623e [Intrinsic] Unsigned Fixed Point Multiplication Intrinsic
Add an intrinsic that takes 2 unsigned integers with the scale of them
provided as the third argument and performs fixed point multiplication on
them.

This is a part of implementing fixed point arithmetic in clang where some of
the more complex operations will be implemented as intrinsics.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353059 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-04 17:18:11 +00:00
Sanjay Patel
e9dc79169d [TargetLowering] try harder to determine undef elements of vector binops
This might be the start of tracking all vector element constants generally if we take it to its 
logical conclusion, but let's stop here and make sure this is correct/beneficial so far.

The affected tests require a convoluted path before they get simplified currently because we 
don't call SimplifyDemandedVectorElts() from binops directly and don't modify the binop operands 
directly in SimplifyDemandedVectorElts().

That's why the tests all have a trailing shuffle to induce a chain reaction of transforms. So 
something like this is happening:

1. Improve the knowledge of undefs in the binop via a SimplifyDemandedVectorElts() call that 
   originates from a shuffle.
2. Transfer that undef knowledge back to the shuffle mask user as more undef lanes.
3. Combine the modified shuffle by calling SimplifyDemandedVectorElts() again.
4. Translate the improved shuffle mask as undemanded lanes of build vector constants causing 
   those to become full undef constants.
5. Simplify the binop now that it has a full undef operand.

As we can see from the unchanged 'and' and 'or' tests, tracking undefs alone isn't a full solution. 
We would need to track zero and all-ones constants to improve those opcodes. We'd probably need to 
track NaN for FP ops too (assuming we don't have fast-math-flags set).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352880 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-01 15:35:12 +00:00
Leonard Chan
d68d001a2c [Intrinsic] Expand SMULFIX to MUL, MULH[US], or [US]MUL_LOHI on vector arguments
r zero scale SMULFIX, expand into MUL which produces better code for X86.

For vector arguments, expand into MUL if SMULFIX is provided with a zero scale.
Otherwise, expand into MULH[US] or [US]MUL_LOHI.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352783 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31 19:15:37 +00:00
James Y Knight
b21d80e08f Adjust documentation for git migration.
This fixes most references to the paths:
 llvm.org/svn/
 llvm.org/git/
 llvm.org/viewvc/
 github.com/llvm-mirror/
 github.com/llvm-project/
 reviews.llvm.org/diffusion/

to instead point to https://github.com/llvm/llvm-project.

This is *not* a trivial substitution, because additionally, all the
checkout instructions had to be migrated to instruct users on how to
use the monorepo layout, setting LLVM_ENABLE_PROJECTS instead of
checking out various projects into various subdirectories.

I've attempted to not change any scripts here, only documentation. The
scripts will have to be addressed separately.

Additionally, I've deleted one document which appeared to be outdated
and unneeded:
  lldb/docs/building-with-debug-llvm.txt

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352514 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-29 16:37:27 +00:00
Nikita Popov
98d9d8b1f1 [CodeGen][X86] Expand UADDSAT to NOT+UMIN+ADD
Followup to D56636, this time handling the UADDSAT case by expanding
uadd.sat(a, b) to umin(a, ~b) + b.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352409 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-28 19:19:09 +00:00
Simon Pilgrim
827ebc9db7 [TargetLowering] Rename getExpandedFixedPointMultiplication to expandFixedPointMul. NFCI.
Match the (much shorter) name used in various legalization methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352056 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-24 15:46:54 +00:00
Chandler Carruth
6b547686c5 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 08:50:56 +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
Nikita Popov
f0a0953bb6 Revert "[CodeGen][X86] Expand USUBSAT to UMAX+SUB, also for vectors"
This reverts commit r351125.

I missed test changes in an SLPVectorizer test, due to the cost model
changes. Reverting for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351129 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-14 22:18:39 +00:00
Nikita Popov
ec124e9d4d [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.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351125 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-14 21:43:30 +00:00
Nikita Popov
b1e7adfcfe [X86] Rename overly verbose method; NFC
As suggested on D56636.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351021 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-13 16:41:26 +00:00
Simon Pilgrim
019755c53e Use getShiftAmountTy for shift amounts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351005 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-12 12:00:43 +00:00
Simon Pilgrim
927c2b0273 [X86][AARCH64] Improve ISD::ABS support
This patch takes some of the code from D49837 to allow us to enable ISD::ABS support for all SSE vector types.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350998 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-12 09:59:32 +00:00