Commit Graph

132145 Commits

Author SHA1 Message Date
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
c33f9cd287 AMDGPU: Fix a few slightly broken tests
Fix minor bugs and uses of undef which break when
pointer related optimization passes are run.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269944 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 15:48:44 +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
Davide Italiano
d77d4c07fb [PM] Port per-function SCCP to the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269937 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 15:18:25 +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
Simon Pilgrim
7cea10a7cf [X86][SSE42] Added fast-isel tests to sync with clang/test/CodeGen/sse42-builtins.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269929 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 14:28:54 +00:00
Simon Pilgrim
d6f9ab1e40 [X86][SSE41] Sync with clang/test/CodeGen/sse41-builtins.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269925 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 13:46:10 +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
Simon Pilgrim
ddbf9200f0 [X86][SSE3] Sync with clang/test/CodeGen/sse3-builtins.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269920 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 13:16:31 +00:00
Rafael Espindola
ae88dc47a7 White space cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 13:10:27 +00:00
Aaron Ballman
3b69c0e412 Removing an unused variable introduced in r269911; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269915 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 12:52:04 +00:00
Daniel Sanders
8d706cc7df Try again to fix pdbdump-headers.test on big-endian hosts after r269861.
r269898 fixed the problem with HashBuckets but the same issue occurred with
AddressMap and ThunkMap too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 12:36:25 +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
James Molloy
9c1a0c965c [VectorUtils] Fix nasty use-after-free
In truncateToMinimalBitwidths() we were RAUW'ing an instruction then erasing it. However, that intruction could be cached in the map we're iterating over. The first check is "I->use_empty()" which in most cases would return true, as the (deleted) object was RAUW'd first so would have zero use count. However in some cases the object could have been polluted or written over and this wouldn't be the case. Also it makes valgrind, asan and traditionalists who don't like their compiler to crash sad.

No testcase as there are no externally visible symptoms apart from a crash if the stars align.

Fixes PR26509.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 11:57:58 +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
Simon Pilgrim
d097069506 [X86][SSSE3] Sync with clang/test/CodeGen/ssse3-builtins.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 11:19:17 +00:00
Simon Pilgrim
adac53f19e [X86][SSE4A] Sync with clang/test/CodeGen/sse4a-builtins.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 11:14:58 +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
Daniel Sanders
adcd739c2e Attempt to fix pdbdump-headers.test on big-endian hosts after r269861.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 09:59:14 +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
Igor Kudrin
24466cded7 [Coverage] Ensure that coverage mapping data has an expected alignment in 'covmapping' files.
Coverage mapping data is organized in a sequence of blocks, each of which is expected
to be aligned by 8 bytes. This feature is used when reading those blocks, see
VersionedCovMapFuncRecordReader::readFunctionRecords(). If a misaligned covearge
mapping data has more than one block, it causes llvm-cov to fail.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269887 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 07:43:27 +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
Craig Topper
d20d564523 Strengthen type assertion for ISD::VSELECT ensuring that the condition has the name number of elements as the destination type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269884 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 06:55:55 +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
Lang Hames
1c01e2defe [RuntimeDyld] Thread Error through some APIs, remove calls to report_fatal_error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269881 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 05:31:24 +00:00
Craig Topper
f673dcd8f1 [X86] Remove GCC builtin from add/sub/mul/div ss/sd intrinsics. These haven't been used as builtins in clang for a long time.
Can probably remove the intrinsics entirely, but that will require more work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 01:36:25 +00:00
Rafael Espindola
36f243d8fa Delete default in fully covered switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 00:31:06 +00:00
Rafael Espindola
214e8d3f06 Don't pass relocation-model= to tests that don't need it.
Very few things in MC itself use the option. Most of the code that that
uses it could be move to CodeGen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 00:27:17 +00:00
Zachary Turner
6f44b1d369 [codeview] Move Symbol / Type enum defs into CodeView.h
This fixes a build breakage that would otherwise only be fixable
through a circular header dependency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:57:10 +00:00
Zachary Turner
60ce11fcce [codeview] Some cleanup of Symbol Records.
* Reworks the CVSymbolTypes.def to work similarly to TypeRecords.def.
* Moves some enums from SymbolRecords.h to CodeView.h to maintain
  consistency with how we do type records.
* Generalize a few simple things like the record prefix
* Define the leaf enum and the kind enum similar to how we do with tyep
  records.

Differential Revision: http://reviews.llvm.org/D20342
Reviewed By: amccarth, rnk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:50:21 +00:00
David Blaikie
f84af69256 llvm-dwp: remove some unused error handling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:44:13 +00:00
Zachary Turner
8e5ffc9803 Revert "[obj2yaml] [yaml2obj] Support MachO section and section_64
structs"

This reverts commits r269845, r269846, and r269850 as they
introduce a crash in obj2yaml when trying to do a roundtrip.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:38:22 +00:00
David Blaikie
34ab13fd25 llvm-dwp: Move error handling code closer to use
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269864 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:37:44 +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
Rui Ueyama
dce33b5457 pdbdump: Print out more strcutures.
I don't yet fully understand the meaning of these data strcutures,
but at least it seems that their sizes and types are correct.
With this change, we can read publics streams till end.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:07:48 +00:00
Paul Robinson
329de212c7 [DwarfDebug] Make tuning predicates private, should be used only in ctor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269859 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 22:53:20 +00:00
Peter Collingbourne
e6b948e54d docs: Update and clean up BitCodeFormat.rst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269857 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 22:30:58 +00:00