45589 Commits

Author SHA1 Message Date
Alexander Timofeev
b0efc4fd66 [AMDGPU] SiFixSGPRCopies should not modify non-divergent PHI
Differential revision: https://reviews.llvm.org/D40556

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319534 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 11:56:34 +00:00
Volkan Keles
af9296a79c GlobalISel: Enable the legalization of G_MERGE_VALUES and G_UNMERGE_VALUES
Summary: LegalizerInfo assumes all G_MERGE_VALUES and G_UNMERGE_VALUES instructions are legal, so it is not possible to legalize vector operations on illegal vector types. This patch fixes the problem by removing the related check and adding default actions for G_MERGE_VALUES and G_UNMERGE_VALUES.

Reviewers: qcolombet, ab, dsanders, aditya_nandakumar, t.p.northover, kristof.beyls

Reviewed By: dsanders

Subscribers: rovka, javed.absar, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319524 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 08:19:10 +00:00
Craig Topper
bf6769b805 [X86] Custom legalize v2i32 gathers via widening rather than promoting.
The default legalization for v2i32 is promotion to v2i64. This results in a gather that reads 64-bit elements rather than 32. If one of the elements is near a page boundary this can cause an illegal access that can fault.

We also miscalculate the scale for the gather which is an even worse problem, but we probably could have found a separate way to fix that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319521 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 06:02:02 +00:00
Craig Topper
74dd5f611c [X86] Add a DAG combine to simplify masks for AVX2 gather instructions.
AVX2 gathers only use the upper bit of the mask allowing us to simplify sign_extend_inreg to a shift left.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319514 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 02:49:07 +00:00
Zachary Turner
9a4e15cb76 Mark all library options as hidden.
These command line options are not intended for public use, and often
don't even make sense in the context of a particular tool anyway. About
90% of them are already hidden, but when people add new options they
forget to hide them, so if you were to make a brand new tool today, link
against one of LLVM's libraries, and run tool -help you would get a
bunch of junk that doesn't make sense for the tool you're writing.

This patch hides these options. The real solution is to not have
libraries defining command line options, but that's a much larger effort
and not something I'm prepared to take on.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319505 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 00:53:10 +00:00
Matt Arsenault
1182bea00f AMDGPU: Use carry-less adds in FI elimination
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319501 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 23:42:30 +00:00
Matt Arsenault
421983a9de AMDGPU: Use gfx9 carry-less add/sub instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319491 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 22:51:26 +00:00
Reid Kleckner
a4d647d52a XOR the frame pointer with the stack cookie when protecting the stack
Summary: This strengthens the guard and matches MSVC.

Reviewers: hans, etienneb

Subscribers: hiraditya, JDevlieghere, vlad.tsyrklevich, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319490 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 22:41:21 +00:00
Krzysztof Parzyszek
c76543620e [Hexagon] Implement HexagonSubtarget::useAA()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319477 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 21:25:28 +00:00
Daniel Sanders
053346db8c [globalisel][tablegen] Add support for relative AtomicOrderings
No test yet because the relevant rules are blocked on the atomic_load,
and atomic_store nodes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319475 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 21:05:59 +00:00
Krzysztof Parzyszek
97c9002f95 [Hexagon] Solo instructions cannot be used with new value jumps
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319470 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 20:32:54 +00:00
Craig Topper
d6aaba3988 [X86] Promote i8 CTPOP to i32 instead of i16 when we have the POPCNT instruction.
The 32-bit version is shorter to encode and the zext we emit for the promotion is likely going to be a 32-bit zero extend anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319468 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 20:15:31 +00:00
Daniel Sanders
0ba92ff15e [aarch64][globalisel] Legalize G_ATOMIC_CMPXCHG_WITH_SUCCESS and G_ATOMICRMW_*
G_ATOMICRMW_* is generally legal on AArch64. The exception is G_ATOMICRMW_NAND.

G_ATOMIC_CMPXCHG_WITH_SUCCESS needs to be lowered to G_ATOMIC_CMPXCHG with an
external comparison.

Note that IRTranslator doesn't generate these instructions yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319466 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 20:11:42 +00:00
Amara Emerson
ff7abc1a3f [GlobalISel][IRTranslator] Fix crash during translation of zero sized loads/stores/args/returns.
This fixes PR35358.

rdar://35619533

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319465 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 20:06:02 +00:00
Dan Gohman
5155d5128a [WebAssembly] Revert r319186 "Support bitcasted function addresses with varargs."
The patch broke Emscripten's EM_ASM macros, which utiltize unprototyped
functions.

See https://bugs.llvm.org/show_bug.cgi?id=35385 for details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319452 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 18:16:49 +00:00
Francis Visoiu Mistrih
e6b89910eb [CodeGen] Always use printReg to print registers in both MIR and debug
output

As part of the unification of the debug format and the MIR format,
always use `printReg` to print all kinds of registers.

Updated the tests using '_' instead of '%noreg' until we decide which
one we want to be the default one.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319445 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 16:12:24 +00:00
Nemanja Ivanovic
b3325ffee4 [PowerPC] Recommit r314244 with refactoring and off by default
This re-commits everything that was pulled in r314244. The transformation
is off by default (patch to enable it to follow). The code is refactored
to have a single entry-point and provide fine-grained control over patterns
that it selects. This patch also fixes the bugs in the original code.

Everything that failed with the original patch has been re-tested with this
patch (with the transformation turned on). So the patch to turn this on is
soon to follow.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319434 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 13:39:10 +00:00
Simon Pilgrim
9e04e3d832 [X86][AVX512] Tag fcmp/ptest/ternlog instructions scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319433 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 13:18:06 +00:00
Diana Picus
11acbdedb4 [ARM GlobalISel] Bail out for byval
Fallback if we have a byval parameter or argument since we don't support
them yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319428 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 12:23:44 +00:00
Francis Visoiu Mistrih
7384652668 [CodeGen] Print "%vreg0" as "%0" in both MIR and debug output
As part of the unification of the debug format and the MIR format, avoid
printing "vreg" for virtual registers (which is one of the current MIR
possibilities).

Basically:

* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E "s/%vreg([0-9]+)/%\1/g"
* grep -nr '%vreg' . and fix if needed
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E "s/ vreg([0-9]+)/ %\1/g"
* grep -nr 'vreg[0-9]\+' . and fix if needed

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319427 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 12:12:19 +00:00
Simon Pilgrim
996d6ddb49 [X86][AVX512] Tag binop/rounding/sae instructions scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319424 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 12:01:52 +00:00
Simon Pilgrim
b785e2618f [X86][AVX512] Tag RCP/RSQRT/GETEXP instructions scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319418 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 10:48:47 +00:00
Jonas Paulsson
431a76fee4 [SystemZ] Bugfix in adjustSubwordCmp.
Csmith generated a program where a store after load to the same address did
not get chained after the new load created during DAG legalizing, and so
performed an illegal overwrite of the expected value.

When the new zero-extending load is created, the chain users of the original
load must be updated, which was not done previously.

A similar case was also found and handled in lowerBITCAST.

Review: Ulrich Weigand
https://reviews.llvm.org/D40542

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319409 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 08:18:50 +00:00
Craig Topper
f6395de026 [X86] Optimize avx2 vgatherqps for v2f32 with v2i64 index type.
Normal type legalization will widen everything. This requires forcing 0s into the mask register. We can instead choose the form that only reads 2 elements without zeroing the mask.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319406 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 07:01:40 +00:00
Craig Topper
d60f6e4a5b [X86] Make sure we don't remove sign extends of masks with AVX2 masked gathers.
We don't use k-registers and instead use the MSB so we need to make sure we sign extend the mask to the msb.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319405 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 06:31:31 +00:00
Matt Arsenault
1de313a465 AMDGPU: Allow negative MUBUF vaddr for gfx9
GFX9 does not enable bounds checking for the resource descriptors
used for private access, so it should be OK to use vaddr with
a potentially negative value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319393 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 00:52:40 +00:00
Craig Topper
0a78cd8e7f [X86] Remove some questionable looking code that seems to be looking through a VZEXT to create a larger VSEXT.
If the input the vzext was signed this would do the wrong thing.

Not sure how to test this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319382 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 23:08:25 +00:00
Joerg Sonnenberger
4ee291ace8 First step towards more human-friendly PPC assembler output:
- add -ppc-reg-with-percent-prefix option to use %r3 etc as register
  names
- split off logic for Darwinish verbose conditional codes into a helper
  function
- be explicit about Darwin vs AIX vs GNUish assembler flavors

Based on the patch from Alexandre Yukio Yamashita

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319381 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 23:05:56 +00:00
Sam Clegg
066e89ae6f [WebAssembly] Update test expectations for gcc torture tests
I believe these were recently fixed by:
https://reviews.llvm.org/rL319186

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319380 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 23:05:50 +00:00
Dan Gohman
685c102164 [WebAssembly] Fix fptoui lowering bounds
To fully avoid trapping on wasm, fptoui needs a second check to ensure that
the operand isn't below the supported range.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319354 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 20:20:11 +00:00
Krzysztof Parzyszek
433d3104b8 [Hexagon] Remove HexagonISD::PACKHL
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319352 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 19:59:29 +00:00
Krzysztof Parzyszek
743fb60a4e [Hexagon] Create helpers extractVector and insertVector in lowering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319351 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 19:58:10 +00:00
Simon Pilgrim
5c698e3437 [X86][AVX512] Tag RCP/RSQRT/GETEXP instructions scheduler classes (REVERSION)
Accidental commit of incomplete patch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319346 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 19:37:38 +00:00
Simon Pilgrim
ae007cec62 [X86][AVX512] Tag RCP/RSQRT/GETEXP instructions scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319338 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 19:19:59 +00:00
Simon Pilgrim
02c5c78684 [X86][AVX512] Tag 3OP (shuffles, double-shifts and GFNI) instructions scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319337 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 18:52:20 +00:00
Nirav Dave
17820125d4 [ARM][DAG] Revert Disable post-legalization store merge for ARM
Partially reverting enabling of post-legalization store merge
(r319036) for just ARM backend as it is causing incorrect code
in some Thumb2 cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319331 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 18:06:13 +00:00
Simon Pilgrim
1c969b0dcc [X86][AVX512] Add itinerary argument to all AVX512_maskable_* wrappers. NFCI
All default to NoItinerary

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319326 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 17:21:15 +00:00
Sander de Smalen
ff77244792 Reverted r319315 because of unused functions (due to PPR not yet being
used by any instructions).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319321 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 15:14:39 +00:00
Simon Pilgrim
bc89401e6c [X86][AVX512] Tag VPERMILV instruction scheduler class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319316 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 14:58:34 +00:00
Sander de Smalen
a150a5ac82 [AArch64][SVE] Asm: Add SVE predicate register definitions and parsing support
Summary: Patch [1/4] in a series to add parsing of predicates and properly parse SVE ZIP1/ZIP2 instructions.

Reviewers: rengolin, kristof.beyls, fhahn, mcrosier, evandro, echristo, efriedma

Reviewed By: fhahn

Subscribers: aemerson, javed.absar, llvm-commits, tschuett

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319315 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 14:34:18 +00:00
Diana Picus
c7436ce110 [ARM GlobalISel] Fix selecting G_BRCOND
When lowering a G_BRCOND, we generate a TSTri of the condition against
1, which sets the flags, and then a Bcc which branches based on the
value of the flags.

Unfortunately, we were using the wrong condition code to check whether
we need to branch (EQ instead of NE), which caused all our branches to
do the opposite of what they were intended to do. This patch fixes the
issue by using the correct condition code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319313 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 14:20:06 +00:00
Simon Pilgrim
abf3849506 [X86][AVX512] Setup unary (PABS/VPLZCNT/VPOPCNT/VPCONFLICT/VMOV*DUP) instruction scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319312 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 13:49:51 +00:00
Dmitry Preobrazhensky
e211444e8b [AMDGPU][MC][GFX9] Corrected mapping of GFX9 v_add/sub/subrev_u32
When translating pseudo to MC, v_add/sub/subrev_u32 shall be mapped via a separate table as GFX8 has opcodes with the same names.
These instructions shall also be labelled as renamed for pseudoToMCOpcode to handle them correctly.

Reviewers: arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319311 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 13:33:40 +00:00
Simon Pilgrim
7dfadbc71c [X86][SSE] Merged sse2_unpack and sse2_unpack PUNPCK instruction templates. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319310 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 12:12:27 +00:00
Simon Pilgrim
7bef62dc08 [X86][SSE] Merged sse2_pack and sse2_pack_y PACKSS/PACKUS instruction templates. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319308 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 11:35:45 +00:00
Oliver Stannard
3aae870071 [ARM] Add support for armv7e-m to the .arch directive
This will allow compilation of assembly files targeting armv7e-m without having
to specify the Tag_CPU_arch attribute as a workaround.

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

Patch by Ian Tessier!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319303 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 10:12:15 +00:00
Craig Topper
acbaefa2f4 [X86] Remove setOperationAction Promote for ISD::SINT_TO_FP MVT::v8i16/v16i8/v16i16.
A DAG combine ensures these ops are always promoted to vXi32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319298 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 08:19:36 +00:00
Sean Fertile
98e460471c [PowerPC] Relax the checking on AND/AND8 in isSignOrZeroExtended.
Separate the handling of AND/AND8 out from PHI/OR/ISEL checking. The reasoning
is the others need all their operands to be sign/zero extended for their output
to also be sign/zero extended. This is true for AND and sign-extension, but for
zero-extension we only need at least one of the input operands to be zero
extended for the result to also be zero extended.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319289 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 04:09:29 +00:00
Matt Arsenault
ff838de892 DAG: Add nuw when splitting loads and stores
The object can't straddle the address space
wrap around, so I think it's OK to assume any
offsets added to the base object pointer can't
overflow. Similar logic already appears to be
applied in SelectionDAGBuilder when lowering
aggregate returns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319272 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 01:25:12 +00:00
Matt Arsenault
9516b8f458 AMDGPU: Select DS insts without m0 initialization
GFX9 stopped using m0 for most DS instructions. Select
a different instruction without the use. I think this will
be less error prone than trying to manually maintain m0
uses as needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319270 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 00:55:57 +00:00