45598 Commits

Author SHA1 Message Date
Simon Pilgrim
31eff6b5ee Fix line endings. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319559 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 17:24:15 +00:00
Simon Pilgrim
53305ce424 [X86][AVX512] Tag VPERM2I/VPERM2T instructions scheduler class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319558 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 17:23:06 +00:00
Simon Pilgrim
54b4cc42db [X86][AVX512] Tag VFPCLASS instructions scheduler class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319554 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 16:51:48 +00:00
Simon Pilgrim
7feb598d4f [X86][AVX512] Tag VPSHUFBITQMB instructions scheduler class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319553 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 16:35:57 +00:00
Simon Pilgrim
0577bf3294 [X86][AVX512] Tag VPCOMRESS/VPEXPAND instructions scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319551 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 16:20:03 +00:00
Nirav Dave
5e0d780951 [ARM][DAG] Reenable post-legalize store merge
Summary: Reenable post-legalize stores with constant merging computation and cofrresponding test case.

Reviewers: eastig, efriedma

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319547 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 14:49:26 +00:00
Jatin Bhateja
f5040aa4c6 [X86] Improvement in CodeGen instruction selection for LEAs.
Summary:
1/  Operand folding during complex pattern matching for LEAs has been extended, such that it promotes Scale to
     accommodate similar operand appearing in the DAG  e.g.
                 T1 = A + B
                 T2 = T1 + 10
                 T3 = T2 + A
    For above DAG rooted at T3, X86AddressMode will now look like
                Base = B , Index = A , Scale = 2 , Disp = 10

2/  During OptimizeLEAPass down the pipeline factorization is now performed over LEAs so that if there is an opportunity
     then complex LEAs (having 3 operands) could be factored out  e.g.
                 leal 1(%rax,%rcx,1), %rdx
                 leal 1(%rax,%rcx,2), %rcx
     will be factored as following
                 leal 1(%rax,%rcx,1), %rdx
                 leal (%rdx,%rcx)   , %edx

3/ Aggressive operand folding for AM based selection for LEAs is sensitive to loops, thus avoiding creation of any complex LEAs within a loop.

4/ Simplify LEA converts (lea (BASE,1,INDEX,0)  --> add (BASE, INDEX) which offers better through put.

PR32755 will be taken care of by this pathc.

Previous patch revisions : r313343 , r314886

Reviewers: lsaba, RKSimon, craig.topper, qcolombet, jmolloy, jbhateja

Reviewed By: lsaba, RKSimon, jbhateja

Subscribers: jmolloy, spatel, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319543 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 14:07:38 +00:00
Simon Pilgrim
3c97b65dca [X86][AVX512] Tag vshift/vpermv/pshufd/pshufb instructions scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319540 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 13:25:54 +00:00
Nemanja Ivanovic
a2040d55d7 Follow-up to r319434 to turn the pass on by default
Now that the patch has gone through the buildbot cycle,
turn it on by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319535 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 12:02:59 +00:00
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