Commit Graph

18450 Commits

Author SHA1 Message Date
Sanjay Patel
8e372b2022 [x86] auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283812 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 22:04:12 +00:00
Sanjay Patel
1a78cfa49c [x86] auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283811 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 22:01:42 +00:00
Tim Northover
b725b3cddf GlobalISel: select G_GLOBAL_VALUE uses on AArch64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 21:50:00 +00:00
Tim Northover
138850bfa1 GlobalISel: allow G_GLOBAL_VALUEs in AArch64 legalization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283808 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 21:49:53 +00:00
Tim Northover
f3542eee12 GlobalISel: support selecting G_GEP instructions.
They're basically just an alias for G_ADD on AArch64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283807 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 21:49:49 +00:00
Tim Northover
4344a2817f GlobalISel: support selecting constants on AArch64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283806 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 21:49:42 +00:00
Hal Finkel
779825d20e [SelectionDAGBuilder] Support llvm.flt.rounds on targets where i32 is not legal
Add integer expansion for FLT_ROUNDS_ for targets where i32 is not a legal
type.

Patch by Edward Jones, thanks!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283797 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 20:45:15 +00:00
Alexandros Lamprineas
e587b6cff8 [ARM] Fix invalid VLDM/VSTM access when targeting Big Endian with NEON
The instructions VLDM/VSTM can only access word-aligned memory
locations and produce alignment fault if the condition is not met.

The compiler currently generates VLDM/VSTM for v2f64 load/store
regardless the alignment of the memory access. Instead, if a v2f64
load/store is not word-aligned, the compiler should generate
VLD1/VST1. For each non double-word-aligned VLD1/VST1, a VREV
instruction should be generated when targeting Big Endian.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 16:01:54 +00:00
Zvi Rackover
bca70faf12 [X86] Prefer rotate by 1 over rotate by imm
Summary:
Rotate by 1 is translated to 1 micro-op, while rotate with imm8 is translated to 2 micro-ops.

Fixes pr30644.

Reviewers: delena, igorb, craig.topper, spatel, RKSimon

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 14:43:55 +00:00
Simon Pilgrim
5d0ca9b5b0 Fixed windows stdout/stderr redirection in inline asm constraint tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283741 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 11:11:27 +00:00
Chris Dewhurst
2bf22e30a5 This pass, fixing an erratum in some LEON 2 processors ensures that the SDIV instruction is not issued, but replaced by SDIVcc instead, which does not exhibit the error. Unit test included.
Differential Review: https://reviews.llvm.org/D24660

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283727 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 08:53:06 +00:00
Craig Topper
a9268c4935 [AVX-512] Add missing pattern sext or zext from bytes to quad words with a 128-bit load as input.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283720 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 06:25:48 +00:00
Craig Topper
21c40c6e83 [AVX-512] Add test cases for AVX512 sign/zero extend instructions derived from the sse41 and avx2 test cases. Code will be improved in future commits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283719 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 06:25:45 +00:00
Craig Topper
115e76c7e7 [AVX-512] Add an AVX512VL/BW command line to sse41-pmovxrm.ll and avx2-pmovxrm.ll. Also disable peephole so we really test pattern matching.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283718 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 06:25:42 +00:00
Michael Zuckerman
a6c37a901a [x86][inline-asm][llvm] accept 'v' constraint
Commit in the name of:Coby Tayree
1.'v' constraint for (x86) non-avx arch imitates the already implemented 'x' constraint, i.e. allows XMM{0-15} & YMM{0-15} depending on the apparent arch & mode (32/64).
2.for the avx512 arch it allows [X,Y,Z]MM{0-31} (mode dependent)

This patch applies the needed changes to clang
 clang patch: https://reviews.llvm.org/D25004

Differential Revision: D25005
 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283717 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 05:48:56 +00:00
Craig Topper
7cdcbfeac7 [AVX-512] Port 128 and 256-bit memory->register sign/zero extend patterns from SSE file. Also add a minimal set for 512-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283704 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-09 23:08:39 +00:00
Zvi Rackover
3dbf19e936 [X86] Adding the 'nounwind' attribute to test functions for cleaner generated code
Thanks to RKSimon for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283696 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-09 13:33:51 +00:00
Zvi Rackover
203696cee1 [X86] Improve the rotate ISel test
Summary:
- Added 64-bit target testing.
- Added 64-bit operand test cases.
- Added cases that demonstrate pr30644

Reviewers: RKSimon, craig.topper, igorb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283695 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-09 13:07:25 +00:00
Elena Demikhovsky
23bd7de392 DAG: Setting Masked-Expand-Load as a variant of Masked-Load node
Masked-expand-load node represents load operation that loads a variable amount of elements from memory according to amount of "true" bits in the mask and expands the loaded elements according to their position in the mask vector.
Right now, the node is used in intrinsics for VEXPAND* instructions. 
The work is done towards implementation of masked.expandload and masked.compressstore intrinsics.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283694 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-09 10:48:52 +00:00
Craig Topper
993d492ceb [AVX-512] Fix execution domain for EVEX encoded VINSERTPS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283692 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-09 06:41:47 +00:00
Craig Topper
f1bd24e068 [AVX-512] Add subvector insert and extract to load/store folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283689 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-09 03:54:13 +00:00
Craig Topper
7f2459e919 [AVX-512] Add avx512dq to the fp stack folding test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283688 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-09 03:54:09 +00:00
Craig Topper
3e9af522ba [AVX-512] Add the vector down convert instructions to the store folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283687 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-09 03:54:05 +00:00
Simon Pilgrim
bc45733110 [X86][SSE] Regenerate select tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283674 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 21:17:44 +00:00
Zvi Rackover
97486b9462 Revert "[X86] Apply the Update LLC Test Checks tool on the rotate tests."
This reverts commit 283667.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283673 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 20:54:20 +00:00
Simon Pilgrim
e5a054e91c [X86][SSE] Regenerate and add 32-bit tests to widening tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283672 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 19:54:28 +00:00
Simon Pilgrim
49695dd279 Fix comment typos - full update script path in assertions note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283670 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 18:51:55 +00:00
Craig Topper
7e9334418c [AVX-512] Add test case for PR30430 that I should have added in r281959.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283669 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 18:50:00 +00:00
Craig Topper
9230befd90 [AVX-512] Fix a bug in getLargestLegalSuperClass where we inflated to VR128X/VR256X even when VLX isn't supported.
This seems to have been responsible for the XMM16-31 spills observed in PR29112. With this fixed the test case has been modified to no longer have a spill of XMM16.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283668 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 18:49:57 +00:00
Zvi Rackover
1ee8d60a35 [X86] Apply the Update LLC Test Checks tool on the rotate tests.
Also added cases demonstrating pr30644.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283667 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 18:44:47 +00:00
Simon Pilgrim
ba555e4e3e [X86][AVX2] Regenerate and add 32-bit tests to core tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283666 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 18:36:57 +00:00
Sebastian Pop
a3cf93ab26 [AArch64] Avoid generating indexed vector instructions for Exynos
Avoid generating indexed vector instructions for Exynos. This is needed for
fmla/fmls/fmul/fmulx. For example, the instruction

  fmla v0.4s, v1.4s, v2.s[1]

is less efficient than the instructions

  dup v2.4s, v2.s[1]
  fmla v0.4s, v1.4s, v2.4s

Patch written by Abderrazek Zaafrani.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283663 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 12:30:07 +00:00
Mehdi Amini
7c9eed7e83 Requires the AVR backend for running test/CodeGen/AVR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283653 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 04:39:34 +00:00
Kyle Butt
473ebca2dd Revert "Codegen: Tail-duplicate during placement."
This reverts commit 71c312652c.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283647 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 01:47:05 +00:00
Dylan McKay
942ffca25d Allow a maximum of 64 bits to be returned in registers
The rest spills to the stack

Authored by Jake Goulding

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283635 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 01:05:09 +00:00
Dylan McKay
2884d8d5ee [AVR] Expand MULHS for all types
Once MULHS was expanded, this exposed an issue where the condition
register was thought to be 16-bit. This caused an attempt to copy a
16-bit register to an 8-bit register.

Authored by Jake Goulding

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283634 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 01:01:49 +00:00
Tom Stellard
4e0ea1b72b AMDGPU/SI: Handle div_fmas hazard in GCNHazardRecognizer
Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283622 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 23:42:48 +00:00
Kyle Butt
71c312652c Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication
decisions. This is fine, but passes up duplication opportunities that
may arise when blocks are outlined. Because we want the updated CFG to
affect subsequent placement decisions, this change must occur during
placement.

In order to achieve this goal, TailDuplicationPass is split into a
utility class, TailDuplicator, and the pass itself. The pass delegates
nearly everything to the TailDuplicator object, except for looping over
the blocks in a function. This allows the same code to be used for tail
duplication in both places.

This change, in concert with outlining optional branches, allows
triangle shaped code to perform much better, esepecially when the
taken/untaken branches are correlated, as it creates a second spine when
the tests are small enough.

Issue from previous rollback fixed, and a new test was added for that
case as well. Issue was worklist/scheduling/taildup issue in layout.

Issue from 2nd rollback fixed, with 2 additional tests. Issue was
tail merging/loop info/tail-duplication causing issue with loops that share
a header block.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283619 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 22:33:20 +00:00
Arnold Schwaighofer
c4f04d9726 swifterror: Don't compute swifterror vregs during instruction selection
The code used llvm basic block predecessors to decided where to insert phi
nodes. Instruction selection can and will liberally insert new machine basic
block predecessors. There is not a guaranteed one-to-one mapping from pred.
llvm basic blocks and machine basic blocks.

Therefore the current approach does not work as it assumes we can mark
predecessor machine basic block as needing a copy, and needs to know the set of
all predecessor machine basic blocks to decide when to insert phis.

Instead of computing the swifterror vregs as we select instructions, propagate
them at the end of instruction selection when the MBB CFG is complete.

When an instruction needs a swifterror vreg and we don't know the value yet,
generate a new vreg and remember this "upward exposed" use, and reconcile this
at the end of instruction selection.

This will only happen if the target supports promoting swifterror parameters to
registers and the swifterror attribute is used.

rdar://28300923

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283617 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 22:06:55 +00:00
Simon Pilgrim
8a6c2f92ba [X86][SSE] Reapplied: Add vector fcopysign combine tests
Now with better lowering and fix for PR30443

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283569 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 16:00:59 +00:00
Simon Pilgrim
64cb9919ee [X86][SSE] Tidied up tests - use standard check prefixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283559 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 14:42:22 +00:00
Konstantin Zhuravlyov
2d50d3f3c9 [AMDGPU] Promote uniform (i1, i16] operations to i32
Differential Revision: https://reviews.llvm.org/D25302


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283555 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 14:22:58 +00:00
Martin Storsjo
c3339a54ac [ARM] Reapply: Use __rt_div functions for divrem on Windows
Reapplying r283383 after revert in r283442. The additional fix
is a getting rid of a stray space in a function name, in the
refactoring part of the commit.

This avoids falling back to calling out to the GCC rem functions
(__moddi3, __umoddi3) when targeting Windows.

The __rt_div functions have flipped the two arguments compared
to the __aeabi_divmod functions. To match MSVC, we emit a
check for division by zero before actually calling the library
function (even if the library function itself also might do
the same check).

Not all calls to __rt_div functions for division are currently
merged with calls to the same function with the same parameters
for the remainder. This is more wasteful than a div + mls as before,
but avoids calls to __moddi3.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283550 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 13:28:53 +00:00
Javed Absar
a297939a6a [ARM]: Add Cortex-R52 target to LLVM
This patch adds Cortex-R52, the new ARM real-time processor, to LLVM. 
Cortex-R52 implements the ARMv8-R architecture.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283542 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 12:06:40 +00:00
Simon Pilgrim
c5606f9b0b [X86][SSE] Update register class during MOVSD/MOVSS - BLENDPD/BLENDPS commutation
MOVSD/MOVSS take a 128-bit register and a FR32/FR64 register input, the commutation code wasn't taking this into account leading to verification errors.

This patch inserts a vreg copy mi to ensure that the registers are correct.

Fix for PR30607

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283539 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 11:18:38 +00:00
Nicolai Haehnle
f3907ede55 AMDGPU: Fix use-after-free in SIOptimizeExecMasking
Summary:
There was a bug with sequences like

   s_mov_b64 s[0:1], exec
   s_and_b64 s[2:3]<def>, s[0:1], s[2:3]<kill>
   ...
   s_mov_b64_term exec, s[2:3]

because s[2:3] was defined and used in the same instruction, ending up with
SaveExecInst inside OtherUseInsts.

Note that the test case also exposes an unrelated bug.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98028

Reviewers: tstellarAMD, arsenm

Subscribers: kzhuravl, wdng, yaxunl, llvm-commits, tony-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283528 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 08:40:14 +00:00
Matt Arsenault
0b0321b9a7 AMDGPU: Change check prefix in test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283521 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 03:55:04 +00:00
Dan Gohman
12bd3d1963 [WebAssemby] Implement block signatures.
Per spec changes, this implements block signatures, and adds just enough
logic to produce correct block signatures at the ends of functions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 22:29:32 +00:00
Dan Gohman
d8d953ef76 [WebAssembly] Remove loop's bottom label.
Per spec changes, loop constructs no longer have a bottom label.

https://reviews.llvm.org/D25118


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 22:10:23 +00:00
Dan Gohman
a5e77a0215 [WebAssembly] Remove the output operand from stores.
Per spec changes, store instructions in WebAssembly no longer have a return
value. Update the instruction descriptions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 22:08:28 +00:00