Commit Graph

21810 Commits

Author SHA1 Message Date
Stanislav Mekhanoshin ddb10d2e51 [AMDGPU] Optimize SI_IF lowering for simple if regions
Currently SI_IF results in a s_and_saveexec_b64 followed by s_xor_b64.
The xor is used to extract only the changed bits. In case of a simple
if region where the only use of that value is in the SI_END_CF to
restore the old exec mask, we can omit the xor and perform an or of
the exec mask with the original exec value saved by the
s_and_saveexec_b64.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309185 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 21:29:15 +00:00
Wei Ding af7be0d4b0 AMDGPU : Widen extending scalar loads to 32-bits.
Differential Revision: http://reviews.llvm.org/D35146

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309178 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 21:07:28 +00:00
Matt Arsenault b485eb2278 AMDGPU: Fix using SMRD instructions for argument loads in functions
These are not actually uniform values except in kernels.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309172 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 20:39:42 +00:00
Tom Stellard 9f8f952c9a AMDGPU/GlobalISel: Mark 32-bit G_OR as legal
Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, t-tye, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309165 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 20:00:53 +00:00
Andrew V. Tischenko 69469a788b This patch returns proper value to indicate the case when instruction throughput can't be calculated.
Differential revision https://reviews.llvm.org/D35831


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309156 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 18:55:14 +00:00
Simon Pilgrim 9a93ff1d26 [X86][AVX512] Regenerated and cleaned up extension tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309139 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 16:47:00 +00:00
Simon Pilgrim 8233f0bfd7 [X86] Regenerate setcc tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309138 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 16:45:57 +00:00
Simon Pilgrim a0063c8b8e [X86][AVX512] Regenerate shuffle tests with broadcast comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309137 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 16:41:18 +00:00
Simon Pilgrim e4524fedb0 [X86] Regenerate memset tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309136 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 16:39:07 +00:00
Simon Pilgrim 9930182bd0 [X86] Add combineBT test failure because bits have multiple uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309124 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 15:41:57 +00:00
Zvi Rackover 8ec224a8e2 DAGCombiner: Extend reduceBuildVecToTrunc to handle non-zero offset
Summary:
Adding support for combining power2-strided build_vector's where the
first build_vectori's operand is extracted from a non-zero index.

Example:

 v4i32 build_vector((extract_elt V, 1),
                    (extract_elt V, 3),
                    (extract_elt V, 5),
                    (extract_elt V, 7))
 -->
 v4i32 truncate (bitcast (shuffle<1,u,3,u,5,u,7,u> V, u) to v4i64)

Reviewers: delena, RKSimon, guyblank

Reviewed By: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309108 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 12:57:03 +00:00
Simon Pilgrim 4f035605eb [X86] Regenerated BT tests
Test on 32/64 bit targets where appropriate 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309107 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 12:49:20 +00:00
Simon Pilgrim b04f6b41eb [X86] Add urem vector test for non-uniform pow2 constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309104 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 11:07:45 +00:00
Simon Pilgrim 12f578821e [X86] Regenerated urem pow2 tests on 32/64 bit targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309103 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 11:05:16 +00:00
Simon Pilgrim 2de0193858 [X86] Regenerated umul overflow tests on 32/64 bit targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309102 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 11:04:18 +00:00
Diana Picus 66e03aa7cd [ARM] GlobalISel: Map G_GLOBAL_VALUE to GPR
A G_GLOBAL_VALUE is basically a pointer, so it should live in the GPR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309101 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 11:01:13 +00:00
Simon Pilgrim 4fb2044b27 [X86][AVX] Regenerated and cleaned up AVX1 intrinsic tests.
Cleaned up triple settings, added 32-bit/64-bit targets where useful, added broadcast comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309100 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 10:54:51 +00:00
Simon Pilgrim ba7df5db10 [X86][AVX2] Regenerated and cleaned up broadcast tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309099 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 10:47:51 +00:00
Simon Pilgrim 5e0a85b8f0 [X86][AVX512] Regenerated and added 32-bit targets to select tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309098 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 10:39:55 +00:00
Simon Pilgrim b21d450265 [X86][AVX] Regenerated and cleaned up masked gather/scatter tests.
Remove unused KNL checks and triple settings, added broadcast comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309097 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 10:37:12 +00:00
Simon Pilgrim a4990da0de [X86][AVX] Regenerate lzcnt test.
Tidied up triples and checks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309095 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 10:22:56 +00:00
Simon Pilgrim 44a9a971ae [X86][FMA] Regenerate test with broadcast comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309093 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 10:20:49 +00:00
Diana Picus 631b4a2588 [ARM] GlobalISel: Mark G_GLOBAL_VALUE as legal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309090 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 09:25:15 +00:00
Michael Zuckerman 9d7507a837 [X86][LLVM]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess.
This patch expands the support of lowerInterleavedStore to 32x8i stride 4.

LLVM creates suboptimal shuffle code-gen for AVX2. In overall, this patch is a specific fix for the pattern (Strid=4 VF=32) and we plan to include more patterns in the future. To reach our goal of "more patterns". We include two mask creators. The first function creates shuffle's mask equivalent to unpacklo/unpackhi instructions. The other creator creates mask equivalent to a concat of two half vectors(high/low).

The patch goal is to optimize the following sequence:
At the end of the computation, we have ymm2, ymm0, ymm12 and ymm3 holding
each 32 chars:

c0, c1, , c31
m0, m1, , m31
y0, y1, , y31
k0, k1, ., k31

And these need to be transposed/interleaved and stored like so:

c0 m0 y0 k0 c1 m1 y1 k1 c2 m2 y2 k2 c3 m3 y3 k3 ....

Reviewers:
dorit
Farhana
RKSimon
guyblank
DavidKreitzer

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309086 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 08:10:14 +00:00
Craig Topper e9291037d6 [X86] Prevent selecting masked aligned load instructions if the load should be non-temporal
Summary: The aligned load predicates don't  suppress themselves if the load is non-temporal the way the unaligned predicates do. For the most part this isn't a problem because the aligned predicates are mostly used for instructions that only load the the non-temporal loads have priority over those. The exception are masked loads.

Reviewers: RKSimon, zvi

Reviewed By: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309079 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 04:31:04 +00:00
Martin Storsjo d4147fa3ab [AArch64] Add a test for float argument passing to win64 vararg functions
The existing tests only tested how a va_start is lowered.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309015 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 19:57:22 +00:00
Nemanja Ivanovic 57a32cdffd [PowerPC] Pretty-print CR bits the way the binutils disassembler does
This patch just adds printing of CR bit registers in a more human-readable
form akin to that used by the GNU binutils.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309001 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 18:26:35 +00:00
Nemanja Ivanovic 84cbf60689 [PowerPC] - Recommit r304907 now that the issue has been fixed
This is just a recommit since the issue that the commit exposed is now
resolved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308995 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 17:54:51 +00:00
Simon Pilgrim 902fe6e6a0 [X86][CGP] Reduce memcmp() expansion to 2 load pairs (PR33914)
D35067/rL308322 attempted to support up to 4 load pairs for memcmp inlining which resulted in regressions for some optimized libc memcmp implementations (PR33914).

Until we can match these more optimal cases, this patch reduces the memcmp expansion to a maximum of 2 load pairs (which matches what we do for -Os).

This patch should be considered for the 5.0.0 release branch as well

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308986 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 17:04:37 +00:00
Simon Pilgrim 7d8deb856a [X86] Regenerate test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308981 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 16:10:32 +00:00
Simon Pilgrim a7461f4539 [X86] Regenerate test with broadcast comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308980 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 16:09:56 +00:00
Simon Pilgrim ee5c36fd59 [X86] Add 24-byte memcmp tests (PR33914)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308963 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 10:33:36 +00:00
Francois Pichet 12b7f90cfc Fix endianness bug in DAGCombiner::visitTRUNCATE and visitEXTRACT_VECTOR_ELT
Summary:
Do not assume little endian architecture in DAGCombiner::visitTRUNCATE and DAGCombiner::visitEXTRACT_VECTOR_ELT.
PR33682

Reviewers: hfinkel, sdardis, RKSimon

Reviewed By: sdardis, RKSimon

Subscribers: uabelho, RKSimon, sdardis, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308960 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 09:40:35 +00:00
Martin Storsjo a663d7321b [AArch64] Reserve a 16 byte aligned amount of fixed stack for win64 varargs
Create a dummy 8 byte fixed object for the unused slot below the first
stored vararg.

Alternative ideas tested but skipped: One could try to align the whole
fixed object to 16, but I haven't found how to add an offset to the stack
frame used in LowerWin64_VASTART.

If only the size of the fixed stack object size is padded but not the offset, via
MFI.CreateFixedObject(alignTo(GPRSaveSize, 16), -(int)GPRSaveSize, false),
PrologEpilogInserter crashes due to "Attempted to reset backwards range!".

This fixes misconceptions about where registers are spilled, since
AArch64FrameLowering.cpp assumes the offset from fixed objects is
aligned to 16 bytes (and the Win64 case there already manually aligns
the offset to 16 bytes).

This fixes cases where local stack allocations could overwrite callee
saved registers on the stack.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308950 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 05:20:01 +00:00
Krzysztof Parzyszek 1aa3f8dfbc [Hexagon] Recognize C4_cmpneqi, C4_cmpltei and C4_cmplteui in NewValueJump
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308914 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-24 19:35:48 +00:00
Michael Zuckerman 52f43a94dd Adding base test for interleave store VF16 and expand the test for AVX512
This patch doesn't modifay any non test file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308909 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-24 18:29:56 +00:00
Ayman Musa 06484d9e4e [X86][AVX512] Add patterns for masked AVX512 floating point compare instructions that were missing.
patterns were missed by D33188. Adding for completion.
+Updating test.

Differential Revesion: https://reviews.llvm.org/D35179



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308868 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-24 08:10:32 +00:00
Dylan McKay 6b35304807 [AVR] Remove the instrumentation pass
I have a much better way of running integration tests now.

https://github.com/dylanmckay/avr-test-suite

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308857 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-23 23:39:11 +00:00
Dylan McKay 747535c69e [AVR] Improve the 'icall-func-pointer-correct-addr-space.ll' test
Patch by Carl Peto.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-23 23:00:55 +00:00
Petr Hosek b12c7b1974 [CodeGen][X86] Fuchsia supports sincos* libcalls and sin+cos->sincos optimization
Patch by Roland McGrath

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-23 22:30:00 +00:00
Florian Hahn b979e0a51d [AArch64] Add test for function alignment for a optsize function (NFC).
Reviewers: dblaikie, t.p.northover, rengolin

Reviewed By: rengolin

Subscribers: aemerson, rengolin, javed.absar, llvm-commits, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308852 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-23 21:15:10 +00:00
Chad Rosier da549096f8 [AArch64] Redundant Copy Elimination - remove more zero copies.
This patch removes unnecessary zero copies in BBs that are targets of b.eq/b.ne
and we know the result of the compare instruction is zero.  For example,

BB#0:
  subs w0, w1, w2
  str w0, [x1]
  b.ne .LBB0_2
BB#1:
  mov w0, wzr  ; <-- redundant
  str w0, [x2]
.LBB0_2

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308849 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-23 16:38:08 +00:00
Craig Topper 92804425f5 [X86] Add patterns for memory forms of SARX/SHLX/SHRX with careful complexity adjustment to keep shift by immediate using the legacy instructions.
These patterns were only missing to favor using the legacy instructions when the shift was a constant. With careful adjustment of the pattern complexity we can make sure the immediate instructions still have priority over these patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308834 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-23 03:59:37 +00:00
Nirav Dave 484f483ab4 [DAG] Fix typo preventing some stores merges to truncated stores.
Check the actual memory type stored and not the extended value size
when considering if truncated store merge is worthwhile.

Reviewers: efriedma, RKSimon, spatel, jyknight

Reviewed By: efriedma

Subscribers: llvm-commits, nhaehnle

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308833 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-23 02:06:28 +00:00
Matt Arsenault f3c728a9f1 RA: Remove another assert on empty intervals
This case is similar to the one fixed in r308808,
except when rematerializing.

Fixes bug 33884.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308813 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-22 00:24:01 +00:00
Matt Arsenault e59b7e46c1 RA: Remove assert on empty live intervals
This is possible if there is an undef use when
splitting the vreg during spilling.

Fixes bug 33620.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308808 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-21 23:56:13 +00:00
Erich Keane cc55cc2451 Remove Bitrig: LLVM Changes
Bitrig code has been merged back to OpenBSD, thus the OS has been abandoned.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308799 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-21 22:48:47 +00:00
Konstantin Zhuravlyov 4c49579c51 AMDGPU: Implement memory model
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308781 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-21 21:19:23 +00:00
Krzysztof Parzyszek bcf10065bb [Hexagon] Add inline-asm constraint 'a' for modifier register class
For example
  asm ("memw(%0++%1) = %2" : : "r"(addr),"a"(mod),"r"(val) : "memory")


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308761 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-21 17:51:27 +00:00
Simon Dardis abccd7d6bc [mips] Support -membedded-data and fix a related bug
-membedded-data changes the location of constant data from the .sdata to
the .rodata section. Previously it was (incorrectly) always located in the
.rodata section.

Reviewers: atanasyan

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308758 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-21 17:19:00 +00:00