Commit Graph

38142 Commits

Author SHA1 Message Date
Chad Rosier
ae7c8ddf94 [AArch64 ] Generate a BFXIL from 'or (and X, Mask0Imm),(and Y, Mask1Imm)'.
Mask0Imm and ~Mask1Imm must be equivalent and one of the MaskImms is a shifted
mask (e.g., 0x000ffff0).  Both 'and's must have a single use.

This changes code like:

  and w8, w0, #0xffff000f
  and w9, w1, #0x0000fff0
  orr w0, w9, w8

into

  lsr w8, w1, #4
  bfi w0, w8, #4, #12

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270063 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 14:19:47 +00:00
Ranjeet Singh
8f225b96ad Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270056 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 12:44:39 +00:00
Artem Tamazov
d8bb9ecd8c [AMDGPU][llvm-mc] Fixes to support buffer atomics.
Fixes for MUBUF_Atomic instructions to make operand list valid:
 - For RTN insns, make a copy of $vdata_in operand as $vdata.
 - Do not add operand for GLC, it is hardcoded and comes as a token.
Workaround to avoid adding multiple default optional operands.
Tests added.

Differential Revision: http://reviews.llvm.org/D20257

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270049 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 12:22:39 +00:00
Zoran Jovanovic
785d7f7fbf ps][microMIPS] Add R_MICROMIPS_PC21_S1 relocation
Differential Revision: http://reviews.llvm.org/D15526


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 12:20:40 +00:00
Daniel Sanders
7b27dc2e11 [mips][mips16] Fix ZERO is not a CPU16Regs register error from the machine verifier.
Summary: Partially fixes PR27458

Reviewers: sdardis

Subscribers: dsanders, llvm-commits, sdardis

Differential Revision: http://reviews.llvm.org/D20330

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270037 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 10:42:14 +00:00
Andrey Turetskiy
7e9b79653d [X86] Enable RRL part of the LEA optimization pass for -O2.
Enable "Remove Redundant LEAs" part of the LEA optimization pass for -O2.
This gives 6.4% performance improve on Broadwell on nnet benchmark from Coremark-pro.
There is no significant effect on other benchmarks (Geekbench, Spec2000, Spec2006).

Differential Revision: http://reviews.llvm.org/D19659


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270036 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 10:18:29 +00:00
Zlatko Buljan
f68477089e [mips][microMIPS] Implement BC1EQZC, BC1NEZC, BC2EQZC and BC2NEZC instructions
Differential Revision: http://reviews.llvm.org/D18352


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270030 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 07:31:28 +00:00
Craig Topper
ad8832da71 [X86] Generalize and combine some similar type constraints and node types. No changes to the isel table size so the separation wasn't buying us anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270026 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 06:13:58 +00:00
Craig Topper
ac890c2769 [X86] Simplify some type constraints by removing parts that were already implied.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270025 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 06:13:48 +00:00
Dan Gohman
62dec0fa6b [WebAssembly] Update WebAssembly target for r269988.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 03:00:05 +00:00
Craig Topper
ab2007fdaa [X86] Remove some type constraint classes and use already existing stricter classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270013 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 02:05:58 +00:00
Craig Topper
2928467217 [AVX512] Strengthen type constraints for VFIXUPIMM patterns and combine the type constraints for vector and scalar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270012 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 02:05:55 +00:00
Chad Rosier
d6995c8dcf [AArch64] Push comment into function. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270003 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 23:51:17 +00:00
Matt Arsenault
221ed41e35 AMDGPU: Fix verifier error when spilling undef subreg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270002 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 23:35:53 +00:00
Matt Arsenault
44aaff08ed AMDGPU: Fix promote alloca for pointer loads
If the load has a pointer type, we don't want to change
its type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270000 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 23:20:24 +00:00
Rafael Espindola
ac8db59598 Delete Reloc::Default.
Having an enum member named Default is quite confusing: Is it distinct
from the others?

This patch removes that member and instead uses Optional<Reloc> in
places where we have a user input that still hasn't been maped to the
default value, which is now clear has no be one of the remaining 3
options.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269988 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 22:04:49 +00:00
Jacques Pienaar
57380a7dcf [lanai] Change the way flag setting instructions are checked.
isReturn() was returning different values with and without -g which led to
different code being generated. Change isFlagSettingInstruction to query
an instruction's effect on SR instead.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269986 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 21:31:37 +00:00
Dan Gohman
b3b1972f26 [WebAssembly] Disable the MachineScheduler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269976 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 20:19:02 +00:00
Jan Vesely
c8ee6f35bc AMDGPU: Fix incorrect simm check
Use signed division otherwise all back jumps fail the check
Fixes regression introduced in r269951

Differential Revision: http://reviews.llvm.org/D20380

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269972 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 19:07:58 +00:00
Chad Rosier
de2a437afc [AArch64] Minor refactoring. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269963 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 17:43:11 +00:00
Sanjay Patel
7d1364e974 clean up; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269962 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 17:23:38 +00:00
Matt Arsenault
76e32dfbc0 AMDGPU: Error if branch distance exceeds limit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269951 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 16:10:24 +00:00
Matt Arsenault
3cd52aec7c AMDGPU: Other sizes of popcnt are fast
We can chain bcnt instructions together, so
any width popcnt is pretty fast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269950 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 16:10:19 +00:00
Hans Wennborg
a9355d3c68 Re-commit r269828 "X86: Avoid using _chkstk when lowering WIN_ALLOCA instructions"
with an additional fix to make RegAllocFast ignore undef physreg uses. It would
previously get confused about the "push %eax" instruction's use of eax. That
method for adjusting the stack pointer is used in X86FrameLowering::emitSPUpdate
as well, but since that runs after register-allocation, we didn't run into the
RegAllocFast issue before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269949 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 16:10:17 +00:00
Matt Arsenault
5d9f8fb9d4 AMDGPU: Fix assert when erroring on a call
For some reason an assert is now hit when a valid chain
is not returned, so return the entry chain.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269948 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 16:10:11 +00:00
Rafael Espindola
c023b23341 Trivial cleanups.
This just clang formats and cleans comments in an area I am about to
post a patch for review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269946 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 16:00:24 +00:00
Matt Arsenault
41cf920df5 AMDGPU: Handle alloca promoting with null operands
If the second pointer in a multi-pointer instruction is
a constant, we can replace the type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269945 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 15:57:21 +00:00
Matt Arsenault
39107ccf80 AMDGPU: Don't run passes that aren't useful
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269943 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 15:41:07 +00:00
Matt Arsenault
71a492ec1e AMDGPU: Fix assert on ttmp registers
Use register class that does not include them when looking
for unallocated registers.

This is hit by the udiv v8i64 test in the opencl integer
conformance test, and takes a few seconds to compile in
a debug build so no test included.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 15:19:50 +00:00
Krzysztof Parzyszek
8b8fb6b298 [Hexagon] Recognize "q" and "v" in inline-asm as register constraints
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269933 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 14:34:51 +00:00
Dan Gohman
da38a6d070 [WebAssembly] Don't expand divisions by constants.
Don't expand divisions by constants if it would require multiple instructions.
The current assumption is that engines will perform the desired optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269930 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 14:29:42 +00:00
Bryan Chan
5137cfa191 [SystemZ] Fix register ordering for BinaryRRF instructions
Summary:
The ordering of registers in BinaryRRF instructions are wrong, and
affects the copysign instruction (CPSDR). This results in the wrong
magnitude and sign being set.

Author: zhanjunl

Reviewers: kbarton, uweigand

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D20308



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269922 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 13:24:57 +00:00
Ashutosh Nema
1db659ede4 Add new flag and intrinsic support for MWAITX and MONITORX instructions
Summary:

MONITORX/MWAITX instructions provide similar capability to the MONITOR/MWAIT
pair while adding a timer function, such that another termination of the MWAITX
instruction occurs when the timer expires. The presence of the MONITORX and
MWAITX instructions is indicated by CPUID 8000_0001, ECX, bit 29.

The MONITORX and MWAITX instructions are intercepted by the same bits that
intercept MONITOR and MWAIT. MONITORX instruction establishes a range to be
monitored. MWAITX instruction causes the processor to stop instruction execution
and enter an implementation-dependent optimized state until occurrence of a
class of events.

Opcode of MONITORX instruction is "0F 01 FA". Opcode of MWAITX instruction is
"0F 01 FB". These opcode information is used in adding tests for the
disassembler.

These instructions are enabled for AMD's bdver4 architecture.

Patch by Ganesh Gopalasubramanian!

Reviewers: echristo, craig.topper, RKSimon
Subscribers: RKSimon, joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D19795


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 11:59:12 +00:00
Rafael Espindola
2dc637165b Don't pass a Reloc::Model to MC.
MC only needs to know if the output is PIC or not. It never has to
decide about creating GOTs and PLTs for example. The only thing that
MC itself uses this information for is expanding "macros" in sparc and
mips. The rest I am pretty sure could be moved to CodeGen.

This is a cleanup and isolates the code from future changes to
Reloc::Model.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269909 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 11:58:50 +00:00
Dylan McKay
f313ca4a81 [AVR] Remove the 'AVRConfig.h' header
It defined the LLVM_AVR_GCC_COMPAT constant, which would enable/disable
certain GCC-specific behaviours.

There is no point conditionally turning it on/off, as it will always be
turned on, and we have to maintain both code paths anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269904 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 11:20:48 +00:00
Dylan McKay
ea9e0d46c4 [AVR] Add missing CMake dependencies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 11:11:51 +00:00
Dylan McKay
af292693ca [AVR] Fix a few compile errors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269900 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 11:11:38 +00:00
Simon Dardis
2366631516 [PATCH] [mips] Restrict the creation of compact branches
Restrict the creation of compact branches so that they do meet the ISA
requirements. Notably do not permit $zero to be used as a operand for compact
branches and ensure that some other branches fulfil the requirement that
rs != rt.

Fixup cases where $rs > $rt for bnec and beqc.

Recommit of rL269893 with reviewers comments.

Reviewers: dsanders, vkalintiris

Differential Review: http://reviews.llvm.org/D20284



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269899 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 10:38:01 +00:00
Simon Dardis
c0a6ad42eb Revert "[mips] Restrict the creation of compact branches"
This reverts commit rL269893.

Incorrect patch applied.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269897 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 09:51:37 +00:00
Dylan McKay
6a867d0312 [AVR] Convert C style comments to C++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 09:43:01 +00:00
Simon Dardis
79149b9fae [mips] Restrict the creation of compact branches
Restrict the creation of compact branches so that they meet the ISA encoding
requirements. Notably do not permit $zero to be used as a operand for compact
branches and ensure that some other branches fulfil the requirement that
rs != rt.

Fixup cases where $rs > $rt for bnec and beqc.

Reviewers: dsanders, vkalintiris

Differential Review: http://reviews.llvm.org/D20284


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269893 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 09:21:44 +00:00
Chris Dewhurst
06dac21852 [Sparc] Add Soft Float support
This change adds support for software floating point operations for Sparc targets.

This is the first in a set of patches to enable software floating point on Sparc. The next patch will enable the option to be used with Clang.

Differential Revision: http://reviews.llvm.org/D19265

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 09:14:13 +00:00
Craig Topper
4e48490d80 [AVX512] Strengthen type constraints on my rounding mode inputs and some immediate inputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269886 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 06:56:01 +00:00
Craig Topper
87b374bca7 [AVX512] Strengthen type checks on the X86ISD::SELECT node. Saves over 800 bytes in the DAG isel table by removing type checks for the condition operand which is always a vector or scalar of i1 matching the the number of elements in the other operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269885 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 06:55:59 +00:00
Zlatko Buljan
4b34e977df [mips][microMIPS] Implement LH, LHE, LHU and LHUE instructions and add CodeGen support
Differential Revision: http://reviews.llvm.org/D15418


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269883 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 06:54:59 +00:00
Dan Gohman
51510adcfa [WebAssembly] Rename $discard to $drop in the assembly output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269862 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:19:03 +00:00
Dan Gohman
b9fa981c8a [WebAssembly] Model the stack evaluation order more precisely.
We currently don't represent get_local and set_local explicitly; they
are just implied by virtual register use and def. This avoids a lot of
clutter, but it does complicate stackifying: get_locals read their
operands at their position in the stack evaluation order, rather than
at their parent instruction. This patch adds code to walk the stack to
determine the precise ordering, when needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269854 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 22:24:18 +00:00
Dan Gohman
e5abbb2bf0 [WebAssembly] Don't stackify calls past stack pointer modifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269843 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 21:14:26 +00:00
Hans Wennborg
fc99ce0062 Revert r269828 "X86: Avoid using _chkstk when lowering WIN_ALLOCA instructions"
Seems to have broken the Windows ASan bot. Reverting while investigating.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269833 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 20:38:56 +00:00
Dan Gohman
f9336ec145 [WebAssembly] Stackify induction variable increment instructions.
This handles instructions where the defined register is also used, as in
"x = x + 1".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 20:19:47 +00:00