Commit Graph

23659 Commits

Author SHA1 Message Date
Krzysztof Parzyszek 2dd4edf571 Revert r321894: it requires a part of another commit that is not ready yet
Commit message:
[Hexagon] Add patterns for sext_inreg of HVX vector types


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321904 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 21:57:43 +00:00
Craig Topper c85dd32732 [X86] Stop printing moves between VR64 and GR64 with 'movd' mnemonic. Use 'movq' instead.
This behavior existed to work with an old version of the gnu assembler on MacOS that only accepted this form. Newer versions of GNU assembler and the current LLVM derived version of the assembler on MacOS support movq as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321898 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 20:55:12 +00:00
Krzysztof Parzyszek dcbe415819 [Hexagon] Add patterns for truncating HVX vector types
Only non-bool vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321895 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 20:48:03 +00:00
Krzysztof Parzyszek 3509d6c9b9 [Hexagon] Add patterns for sext_inreg of HVX vector types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321894 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 20:46:41 +00:00
Krzysztof Parzyszek d32592f248 [Hexagon] Add a bitcast to required type in LowerHvxMul
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321893 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 20:45:34 +00:00
Krzysztof Parzyszek 47b41454e7 [Hexagon] Add pattern for vsplat to v8i8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321892 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 20:43:56 +00:00
Simon Pilgrim a3a875b34d [X86] Regenerate illegal move test
Recommitting after fixing case-sensitive issue in the RUN command

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321868 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 14:24:03 +00:00
Florian Hahn 545ec94b43 [AArch64] Fix -mcpu option in aarch64-combine-fmul-fsub.mir (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321865 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 11:17:48 +00:00
Sam Parker 8681051b9e [DAGCombine] Fix for PR37563
While searching for loads to be narrowed, equal sized loads were not
added to the list, resulting in anyext loads not being converted to
zext loads.

https://bugs.llvm.org/show_bug.cgi?id=35763

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321862 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 08:47:23 +00:00
Aditya Nandakumar 09d2d44675 [GISel]: Don't create G_MUL with 1 during translation of GEP
When element size is 1, it's just wasteful to create MUL with 1.
https://reviews.llvm.org/D41738

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321857 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 02:56:28 +00:00
Simon Pilgrim c0fafaac48 [X86] Add srem/udiv/urem by one combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321826 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 22:08:36 +00:00
Evandro Menezes b3a26d8ca6 [AArch64] Improve code generation of vector build
Instead of using, for example, `dup v0.4s, wzr`, which transfers between
register files, use the more efficient `movi v0.4s, #0` instead.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321824 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 21:43:12 +00:00
Simon Pilgrim 8da0e49815 [X86] Add scalar undef sdiv/srem/udiv/urem combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321823 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 21:33:19 +00:00
Alexey Bataev 6072d5d178 [DEBUG] Add initial tests for debug info for NVPTX target, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321822 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 21:07:07 +00:00
Craig Topper d5b26bc052 [X86] Correct the execution domain for AVX1 VBROADCASTF128 to be FP instead of integer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321821 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 20:56:21 +00:00
Amara Emerson 0f0caba04f Revert "[X86] Regenerate test"
This reverts r321814 as it was failing make check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321819 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 20:20:44 +00:00
Simon Pilgrim 6e771122dd [X86] Regenerate test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321814 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 18:48:42 +00:00
Simon Pilgrim 7ad07c388d [X86] Add common CHECK prefix for tests without SSE/AVX codegen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321810 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 18:23:46 +00:00
Simon Pilgrim d3b16b238c Regenerate broadcast constant comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321808 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 18:21:33 +00:00
Simon Pilgrim 2000943126 [X86] Show missed combine for X/X for SDIV/UDIV and X%X for SREM/UREM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321807 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 18:20:46 +00:00
Diana Picus ece975ca81 [ARM GlobalISel] Select G_PHI
Select G_PHI to PHI and manually constrain the result register. This is
very similar to how COPY is handled, so extract and reuse some of that
code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321797 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 13:09:25 +00:00
Diana Picus 07bd08dd75 [ARM GlobalISel] Add RegBankSelect tests for G_PHI
RegBankSelect already handles G_PHI with some generic code. Add a couple
of tests for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321796 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 13:09:20 +00:00
Diana Picus f279d7e5c0 [ARM GlobalISel] Legalize scalar G_PHI
Mark G_PHI as Legal for s32 and p0, and also for s64 if we have hard
float. Widen any smaller types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321795 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 13:09:14 +00:00
Diana Picus 79a984ff1c [ARM GlobalISel] Fix selection of pointer constants
We used to handle G_CONSTANT with pointer type by forcing the type of
the result register to s32 and then letting TableGen handle it.
Unfortunately, setting the type only works for generic virtual
registers, that haven't yet been constrained to a register class (e.g.
those used only by a COPY later on). If the result register has already
been constrained as a use of a previously selected instruction, then
setting the type will assert.

It would be nice to be able to teach TableGen to select pointer
constants the same as integer constants, but since it's such an edge
case (at the moment the only pointer constant that we're generally
interested in is 0, and that is mostly used for comparisons and selects,
which are also not supported by TableGen) it's probably not worth the
effort right now. Instead, handle pointer constants with some trivial
handwritten code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321793 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 10:54:57 +00:00
Sam Parker bbe71a0c6f [X86] Codegen test for PR37563
Adding test to ease review of D41628.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321791 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 09:42:27 +00:00
Simon Pilgrim fed8082832 [DAGCombine] Handle out of range EXTRACT_VECTOR_ELT indices
Handle this in DAGCombiner::visitEXTRACT_VECTOR_ELT the same as we already do in SelectionDAG::getNode and use APInt instead of getZExtValue.

This should also fix oss-fuzz #4910

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321767 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-03 22:42:33 +00:00
Matt Arsenault aca5381bd1 StructurizeCFG: Fix broken backedge detection
The work order was changed in r228186 from SCC order
to RPO with an arbitrary sorting function. The sorting
function attempted to move inner loop nodes earlier. This
was was apparently relying on an assumption that every block
in a given loop / the same loop depth would be seen before
visiting another loop. In the broken testcase, a block
outside of the loop was encountered before moving onto
another block in the same loop. The testcase would then
structurize such that one blocks unconditional successor
could never be reached.

Revert to plain RPO for the analysis phase. This fixes
detecting edges as backedges that aren't really.

The processing phase does use another visited set, and
I'm unclear on whether the order there is as important.
An arbitrary order doesn't work, and triggers some infinite
loops. The reversed RPO list seems to work and is closer
to the order that was used before, minus the arbitary
custom sorting.

A few of the changed tests now produce smaller code,
and a few are slightly worse looking.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321751 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-03 18:45:37 +00:00
Craig Topper 02718c7972 [X86] Use ANY_EXTEND instead of SIGN_EXTEND in lowerMasksToReg
Currently we use SIGN_EXTEND in lowerMasksToReg as part of calling convention setup, but we don't require a specific value for the upper bits.

This patch changes it to ANY_EXTEND which will be lowered as SIGN_EXTEND if it ends up sticking around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321746 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-03 18:11:01 +00:00
Amara Emerson caeab26ff8 [GlobalISel][Legalizer] Fix legalization of llvm.smul.with.overflow
Previously the code for handling G_SMULO didn't properly check for the signed
multiply overflow, instead treating it the same as the unsigned G_UMULO.

Fixes PR35800.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321690 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-03 04:56:56 +00:00
Andrew Kaylor 6ebc5abea9 Handle the case of live 16-bit subregisters in X86FixupBWInsts
Differential Revision: https://reviews.llvm.org/D40524

Change-Id: Ie3a405b28503ceae999f5f3ba07a68fa733a2400

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321674 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-02 21:04:38 +00:00
Sanjay Patel 0a935b3a90 [AArch64] fix typos in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321673 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-02 21:04:08 +00:00
Sanjay Patel db850cf9f4 [ValueTracking] recognize min/max of min/max patterns
This is part of solving PR35717:
https://bugs.llvm.org/show_bug.cgi?id=35717

The larger IR optimization is proposed in D41603, but we can show 
the improvement in ValueTracking using codegen tests because 
SelectionDAG creates min/max nodes based on ValueTracking. 

Any target with min/max ops should show wins here. I chose AArch64
vector ops because they're clean and uniform.

Some Alive proofs for the tests (can't put more than 2 tests in 1 
page currently because the web app says it's too long):
https://rise4fun.com/Alive/WRN
https://rise4fun.com/Alive/iPm
https://rise4fun.com/Alive/HmY
https://rise4fun.com/Alive/CNm
https://rise4fun.com/Alive/LYf



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321672 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-02 20:56:45 +00:00
Sanjay Patel 6ae0f3914e [AArch64] add tests for min/max of min/max (PR35717); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321668 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-02 20:16:45 +00:00
Amara Emerson 7b20f91f4d [AArch64][GlobalISel] Fix assert fail with unknown intrinsic.
A call may have an intrinsic name but not have a valid intrinsic ID,
for example with llvm.invariant.group.barrier. If so, treat it as a
normal call like FastISel does.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321662 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-02 18:56:39 +00:00
Sanjay Patel 8d24966875 [x86] allow pairs of PCMPEQ for vector-sized integer equality comparisons (PR33325)
This is an extension of D31156 with the goal that we'll allow memcmp() == 0 expansion 
for x86 to use 2 pairs of loads per block.

The memcmp expansion pass (formerly part of CGP) will generate this kind of pattern 
with oversized integer compares, so we want to transform these into x86-specific vector
nodes before legalization splits things into scalar chunks.

See PR33325 for more details:
https://bugs.llvm.org/show_bug.cgi?id=33325

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321656 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-02 16:38:29 +00:00
Amara Emerson d8de4cebd9 [AArch64][GlobalISel] Enable GlobalISel at -O0 by default
Tests updated to explicitly use fast-isel at -O0 instead of implicitly.

This change also allows an explicit -fast-isel option to override an
implicitly enabled global-isel. Otherwise -fast-isel would have no effect at -O0.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321655 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-02 16:30:47 +00:00
Krzysztof Parzyszek 6b057a1e60 [Hexagon] Fix generation of vector sign extensions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321650 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-02 15:28:49 +00:00
Daniel Jasper 7f55be51ae Revert r321089: "[DAG] Elide overlapping store" (and subsequent fix in r321204)
Our internal testing has revealed has discovered bugs in PPC builds.
I have forward reproduction instructions to the original author (Nirav).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321649 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-02 14:38:52 +00:00
Sam Parker 2714c01fbb [DAGCombine] Fix for PR35765
Remove the acceptance of ANY_EXTEND nodes while trying to move and
nodes back to loads.

Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=35765

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321641 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-02 10:19:01 +00:00
Sam Parker 884b5fd923 [X86] Codegen test for pr35765
Committing reproducer test for pr35765, fix to follow.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321640 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-02 10:14:00 +00:00
Craig Topper 6bc4edc1ec [SelectionDAG] Teach WidenVecOp_Convert to widen the operation if a widened result type would still be legal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321638 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-02 07:30:53 +00:00
Craig Topper 29708f3c49 [X86] Promote vXi1 fp_to_uint/fp_to_sint to vXi32 to avoid scalarization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321632 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-01 21:12:18 +00:00
Craig Topper 6ceca08163 [X86] Add test cases for vXi1 fptosi/fptoui.
Currently we do a lot of scalarization in these test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321631 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-01 21:12:10 +00:00
Sanjay Patel 5a844cdacb [x86] add runs for more vector variants; NFC
Preliminary step to see what the effects of D41618 look like.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321624 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-01 16:36:47 +00:00
Simon Pilgrim 5ce04a5c35 [X86][SSE] Add test case from PR32160
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321620 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-01 13:04:04 +00:00
Uriel Korach 5a14534711 [X86] Regenerate test checks in sse-intrinsics-x86-upgrade with update-llc
Removing outdated checks.
NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321619 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-01 09:00:13 +00:00
Uriel Korach 31978278b1 [X86] Regenerate test checks in sse2-intrinsics-x86-upgrade with update-llc
Removing outdated checks.
NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321618 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-01 08:47:50 +00:00
Craig Topper ce169cc70e [X86] In LowerTruncateVecI1, don't add SHL if the input is known to be all sign bits.
If the input is all sign bits then the LSB through MSB are all the same so we don't need to be move the LSB to the MSB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321617 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-01 04:52:58 +00:00
Craig Topper d7fa847f77 [X86] Add patterns for using zmm registers for v8i32/v8f32 vselect with the false input being zero.
We can use zmm move with zero masking for this. We already had patterns for using a masked move, but we didn't check for the zero masking case separately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321612 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-01 01:11:29 +00:00
Craig Topper a3b71fc637 [X86] Use CONCAT_VECTORS instead of INSERT_SUBVECTOR for padding v4i1/v2i1 vector to v8i1 pre-legalize.
The CONCAT_VECTORS will be lowered to INSERT_SUBVECTOR later. In the modified cases this seems to be enough to trick a later DAG combine into running in a different order than allows the ANDs to be removed.

I'll admit this is a bit of a hack that happens to work, but using CONCAT_VECTORS is more consistent with other legalization code anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321611 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-31 19:17:52 +00:00