OSDN Git Service

android-x86/external-llvm.git
6 years ago[dsymutil] Generate Apple accelerator tables
Jonas Devlieghere [Mon, 29 Jan 2018 14:52:50 +0000 (14:52 +0000)]
[dsymutil] Generate Apple accelerator tables

This patch adds support for generating accelerator tables in dsymutil.
This feature was already present in our internal repository but not yet
upstreamed because it requires changes to the Apple accelerator table
implementation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323655 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Rename DwarfAccelTable and move header.
Jonas Devlieghere [Mon, 29 Jan 2018 14:52:41 +0000 (14:52 +0000)]
[NFC] Rename DwarfAccelTable and move header.

This patch renames DwarfAccelTable.{h,cpp} to AccelTable.{h,cpp} and
moves the header to the include dir so it is accessible by the
dsymutil implementation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323654 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Refactor Apple Accelerator Tables
Jonas Devlieghere [Mon, 29 Jan 2018 14:52:34 +0000 (14:52 +0000)]
[NFC] Refactor Apple Accelerator Tables

This patch refactors the way data is stored in the accelerator table and
makes them truly generic. There have been several attempts to do this in
the past:

 - D8215 & D8216: Using a union and partial hardcoding.
 - D11805: Using inheritance.
 - D42246: Using a callback.

In the end I didn't like either of them, because for some reason or
another parts of it felt hacky or decreased runtime performance. I
didn't want to completely rewrite them as I was hoping that we could
reuse parts for the successor in the DWARF standard. However, it seems
less and less likely that there will be a lot of opportunities for
sharing code and/or an interface.

Originally I choose to template the whole class, because it introduces
no performance overhead compared to the original implementation.

We ended up settling on a hybrid between a templated method and a
virtual call to emit the data. The motivation is that we don't want to
increase code size for a feature that should soon be superseded by the
DWARFv5 accelerator tables. While the code will continue to be used for
compatibility, it won't be on the hot path. Furthermore this does not
regress performance compared to Apple's internal implementation that
already uses virtual calls for this.

A quick summary for why these changes are necessary: dsymutil likes to
reuse the current implementation of the Apple accelerator tables.
However, LLDB expects a slightly different interface than what is
currently emitted. Additionally, in dsymutil we only have offsets and no
actual DIEs.

Although the patch suggests a lot of code has changed, this change is
pretty straightforward:

 - We created an abstract class `AppleAccelTableData` to serve as an
   interface for the different data classes.
 - We created two implementations of this class, one for type tables and
   one for everything else. There will be a third one for dsymutil that
   takes just the offset.
 - We use the supplied class to deduct the atoms for the header which
   makes the structure of the table fully self contained, although not
   enforced by the interface as was the case for the fully templated
   approach.
 - We renamed the prefix from DWARF- to Apple- to make space for the
   future implementation of .debug_names.

This change is NFC and relies on the existing tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323653 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU][MC] Corrected parsing of image opcode modifiers r128 and d16
Dmitry Preobrazhensky [Mon, 29 Jan 2018 14:20:42 +0000 (14:20 +0000)]
[AMDGPU][MC] Corrected parsing of image opcode modifiers r128 and d16

See bugs 36092, 36093:
    https://bugs.llvm.org/show_bug.cgi?id=36092
    https://bugs.llvm.org/show_bug.cgi?id=36093

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

Reviewers: vpykhtin, artem.tamazov, arsenm

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323651 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix windows test failure caused by r323638
Pavel Labath [Mon, 29 Jan 2018 13:53:48 +0000 (13:53 +0000)]
Fix windows test failure caused by r323638

The test was failing because of an incorrect sizeof check in the name
index parsing code. This code was meant to check that we have enough
input to parse the fixed-size part of the dwarf header, which it did by
comparing the input to sizeof(Header). Originally struct Header only
contained the fixed-size part, but during review, we've moved additional
members into it, which rendered the sizeof check invalid.

I resolve this by moving the fixed-size part to a separate struct and
updating the sizeof-expression to use that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323648 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64][AsmParser] NFC: Generalize LogicalImm[Not](32|64) code
Sander de Smalen [Mon, 29 Jan 2018 13:05:38 +0000 (13:05 +0000)]
[AArch64][AsmParser] NFC: Generalize LogicalImm[Not](32|64) code

Summary:
All variants of isLogicalImm[Not](32|64) can be combined into a single templated function, same for printLogicalImm(32|64).
By making it use a template instead, further SVE patches can use it for other data types as well (e.g. 8, 16 bits).

Reviewers: fhahn, rengolin, aadg, echristo, kristof.beyls, samparker

Reviewed By: samparker

Subscribers: aemerson, javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323646 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Fix fragment offset emission order for symbol locations
Mikael Holmen [Mon, 29 Jan 2018 12:37:30 +0000 (12:37 +0000)]
[DebugInfo] Fix fragment offset emission order for symbol locations

Summary:
When emitting the location for a global variable with fragmented debug
expressions, make sure that the offset pieces, which represent
optimized-out parts of the variable, are emitted before their succeeding
fragments' expressions. Previously, if the succeeding fragment's
location was a symbol, the offset piece was emitted after, rather than
before, that symbol's expression. This effectively meant that the symbols
were associated with the wrong parts of the variable.

This fixes PR36085.

Patch by: David Stenberg

Reviewers: aprantl, probinson, dblaikie

Reviewed By: aprantl

Subscribers: JDevlieghere, llvm-commits

Tags: #debug-info

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323644 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Sparc] Account for bias in stack readjustment
Jonas Devlieghere [Mon, 29 Jan 2018 12:10:32 +0000 (12:10 +0000)]
[Sparc] Account for bias in stack readjustment

Summary: This was broken long ago in D12208, which failed to account for
the fact that 64-bit SPARC uses a stack bias of 2047, and it is the
*unbiased* value which should be aligned, not the biased one. This was
seen to be an issue with Rust.

Patch by: jrtc27 (James Clarke)

Reviewers: jyknight, venkatra

Reviewed By: jyknight

Subscribers: jacob_hansen, JDevlieghere, fhahn, fedor.sergeev, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323643 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix build broken by r323641
Pavel Labath [Mon, 29 Jan 2018 11:53:46 +0000 (11:53 +0000)]
Fix build broken by r323641

The call to ScopedPrinter::printNumber with size_t argument was
ambiguous (I think) on 32-bit builds. Explicitly cast to a 64-bit int to
avoid this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323642 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRefactor dwarfdump -apple-names output
Pavel Labath [Mon, 29 Jan 2018 11:33:17 +0000 (11:33 +0000)]
Refactor dwarfdump -apple-names output

Summary:
This modifies the dwarfdump output to align it with the new .debug_names
dump. It also renames two header fields to match similar fields in the
dwarf5 header.

A couple of tests needed to be updated to match new output. The changes
were fairly straight-forward, although not really automatable.

Reviewers: JDevlieghere, aprantl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323641 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] FP16Pat and FullFP16Pat patterns. NFC.
Sjoerd Meijer [Mon, 29 Jan 2018 11:28:06 +0000 (11:28 +0000)]
[ARM] FP16Pat and FullFP16Pat patterns. NFC.

Create and use FP16Pat FullFP16Pat helper patterns to make the difference
explicit.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323640 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Basic .debug_names dumping support
Pavel Labath [Mon, 29 Jan 2018 11:08:32 +0000 (11:08 +0000)]
[DebugInfo] Basic .debug_names dumping support

Summary:
This commit renames DWARFAcceleratorTable to AppleAcceleratorTable to free up
the first name as an interface for the different accelerator tables.
Then I add a DWARFDebugNames class for the dwarf5 table.

Presently, the only common functionality of the two classes is the dump()
method, because this is the only method that was necessary to implement
dwarfdump -debug-names; and because the rest of the
AppleAcceleratorTable interface does not directly transfer to the dwarf5
tables (the main reason for that is that the present interface assumes
the tables are homogeneous, but the dwarf5 tables can have different
keys associated with each entry).

I expect to make the common interface richer as I add more functionality
to the new class (and invent a way to represent it in generic way).

In terms of sharing the implementation, I found the format of the two
tables sufficiently different to frustrate any attempts to have common
parsing or dumping code, so presently the implementations share just low
level code for formatting dwarf constants.

Reviewers: vleschuk, JDevlieghere, clayborg, aprantl, probinson, echristo, dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323638 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86FixupBWInsts] Fix miscompilation if sibling sub-register is live.
Andrei Elovikov [Mon, 29 Jan 2018 09:26:04 +0000 (09:26 +0000)]
[X86FixupBWInsts] Fix miscompilation if sibling sub-register is live.

Summary: The issues was found during D40524.

Reviewers: andrew.w.kaylor, craig.topper, MatzeB

Reviewed By: andrew.w.kaylor

Subscribers: aivchenk, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323635 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64] Generate the CASP instruction for 128-bit cmpxchg
Oliver Stannard [Mon, 29 Jan 2018 09:18:37 +0000 (09:18 +0000)]
[AArch64] Generate the CASP instruction for 128-bit cmpxchg

The Large System Extension added an atomic compare-and-swap instruction
that operates on a pair of 64-bit registers, which we can use to
implement a 128-bit cmpxchg.

Because i128 is not a legal type for AArch64 we have to do all of the
instruction selection in C++, and the instruction requires even/odd
register pairs, so we have to wrap it in REG_SEQUENCE and EXTRACT_SUBREG
nodes. This is very similar to what we do for 64-bit cmpxchg in the ARM
backend.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323634 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ThinLTO] - Stop internalizing and drop non-prevailing symbols.
George Rimar [Mon, 29 Jan 2018 08:03:30 +0000 (08:03 +0000)]
[ThinLTO] - Stop internalizing and drop non-prevailing symbols.

Implementation marks non-prevailing symbols as not live in the summary.
Then them are dropped in backends.

Fixes https://bugs.llvm.org/show_bug.cgi?id=35938

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323633 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Make foldLogicOfSetCCs work better for vectors pre legal types/operations
Craig Topper [Mon, 29 Jan 2018 07:52:55 +0000 (07:52 +0000)]
[X86] Make foldLogicOfSetCCs work better for vectors pre legal types/operations

Summary:
There's a check in the code to only check getSetCCResultType after LegalOperations or if the type is MVT::i1. But the i1 check is only allowing scalar types through. I think it should check that the scalar type is MVT::i1 so that it will work for vectors.

The changed test already does this combine with AVX512VL where getSetCCResultType returns vXi1. But with avx512f and no VLX getSetCCResultType returns a type matching the width of the input type.

Reviewers: spatel, RKSimon

Reviewed By: spatel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323631 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CVP] Don't Replace incoming values from unreachable blocks with undef.
Davide Italiano [Mon, 29 Jan 2018 05:59:55 +0000 (05:59 +0000)]
[CVP] Don't Replace incoming values from unreachable blocks with undef.

This pretty much reverts r322006, except that we keep the test,
because we work around the issue exposed in a different way (a
recursion limit in value tracking). There's still probably some
sequence that exposes this problem, and the proper way to fix that
for somebody who has time is outlined in the code review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323630 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] fix trivial typos in comments and documents
Hiroshi Inoue [Mon, 29 Jan 2018 05:17:03 +0000 (05:17 +0000)]
[NFC] fix trivial typos in comments and documents

"to to" -> "to"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323628 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InlineCost] Mark functions accessing varargs as not viable.
Florian Hahn [Sun, 28 Jan 2018 19:11:49 +0000 (19:11 +0000)]
[InlineCost] Mark functions accessing varargs as not viable.

This prevents functions accessing varargs from being inlined if they
have the alwaysinline attribute.

Reviewers: efriedma, rnk, davide

Reviewed By: efriedma

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323619 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Support] Move DJB hash to support. NFC
Jonas Devlieghere [Sun, 28 Jan 2018 11:05:10 +0000 (11:05 +0000)]
[Support] Move DJB hash to support. NFC

This patch moves the DJB hash to support. This is consistent with other
hashing algorithms living there. The hash is used by the DWARF
accelerator tables. We're doing this now because the hashing function is
needed by dsymutil and we don't want to link against libBinaryFormat.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323616 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Fix a crash that can occur in combineExtractVectorElt due to not checking the...
Craig Topper [Sun, 28 Jan 2018 07:29:35 +0000 (07:29 +0000)]
[X86] Fix a crash that can occur in combineExtractVectorElt due to not checking the width of a ConstantSDNode before calling getConstantOperandVal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323614 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove VPTESTM/VPTESTNM ISD opcodes. Use isel patterns matching cmpm eq/ne...
Craig Topper [Sun, 28 Jan 2018 00:56:30 +0000 (00:56 +0000)]
[X86] Remove VPTESTM/VPTESTNM ISD opcodes. Use isel patterns matching cmpm eq/ne with immallzeros.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323612 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add patterns for using masked vptestnmd for 256-bit vectors without VLX.
Craig Topper [Sat, 27 Jan 2018 23:49:14 +0000 (23:49 +0000)]
[X86] Add patterns for using masked vptestnmd for 256-bit vectors without VLX.

We can widen the mask and extract it back down.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323610 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add test to demonstrate missed opportunity to merge kand into testnm when using...
Craig Topper [Sat, 27 Jan 2018 23:49:11 +0000 (23:49 +0000)]
[X86] Add test to demonstrate missed opportunity to merge kand into testnm when using 512-bit instruction due to lack of VLX.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323609 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd triples or specify REQUIRES: default_triple to some tests
Justin Bogner [Sat, 27 Jan 2018 23:31:09 +0000 (23:31 +0000)]
Add triples or specify REQUIRES: default_triple to some tests

These were all failing when building the X86 backend but specifying
LLVM_DEFAULT_TARGET_TRIPLE=''.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323608 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX512] Add avx512dq fp2int/int2fp tests (PR31630)
Simon Pilgrim [Sat, 27 Jan 2018 22:08:27 +0000 (22:08 +0000)]
[X86][AVX512] Add avx512dq fp2int/int2fp tests (PR31630)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323607 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Use vptestm/vptestnm for comparisons with zero to avoid creating a zero vector.
Craig Topper [Sat, 27 Jan 2018 20:19:09 +0000 (20:19 +0000)]
[X86] Use vptestm/vptestnm for comparisons with zero to avoid creating a zero vector.

We can use the same input for both operands to get a free compare with zero.

We already use this trick in a couple places where we explicitly create PTESTM with the same input twice. This generalizes it.

I'm hoping to remove the ISD opcodes and move this to isel patterns like we do for scalar cmp/test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323605 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove X86ISD::PCMPGTM/PCMPEQM and instead just use X86ISD::PCMPM and pattern...
Craig Topper [Sat, 27 Jan 2018 20:19:02 +0000 (20:19 +0000)]
[X86] Remove X86ISD::PCMPGTM/PCMPEQM and instead just use X86ISD::PCMPM and pattern match the immediate value during isel.

Legalization is still biased to turn LT compares in to GT by swapping operands to avoid needing extra isel patterns to commute.

I'm hoping to remove TESTM/TESTNM next and this should simplify that by making EQ/NE more similar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323604 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRegenerate test. NFCI
Simon Pilgrim [Sat, 27 Jan 2018 19:49:46 +0000 (19:49 +0000)]
Regenerate test. NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323603 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Simplify demanded elements from BROADCAST shuffle source.
Simon Pilgrim [Sat, 27 Jan 2018 19:48:13 +0000 (19:48 +0000)]
[X86][SSE] Simplify demanded elements from BROADCAST shuffle source.

If broadcasting from another shuffle, attempt to simplify it.

We can probably generalize this a lot more (embedding in combineX86ShufflesRecursively), but BROADCAST is one of the more troublesome as it accepts inputs of different sizes to the result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323602 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd IRBuilder API to create memcpy/memmove calls with differing source and dest align...
Daniel Neilson [Sat, 27 Jan 2018 17:59:10 +0000 (17:59 +0000)]
Add IRBuilder API to create memcpy/memmove calls with differing source and dest alignments

Summary:
  This change is step two in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. Steps:

Step 1) Remove alignment parameter and create alignment parameter attributes for
   memcpy/memmove/memset. ( rL322965 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
   source and dest alignments.
Step 3) Update Clang to use the new IRBuilder API.
Step 4) Update Polly to use the new IRBuilder API.
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
        and those that use use MemIntrinsicInst::[get|set]Alignment() to use
        getDestAlignment() and getSourceAlignment() instead.
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
        MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323597 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRegenerate test result for vastart-defs-eflags.ll. NFC.
Amaury Sechet [Sat, 27 Jan 2018 17:52:32 +0000 (17:52 +0000)]
Regenerate test result for vastart-defs-eflags.ll. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323596 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRegenerate test result for testb-je-fusion.ll. NFC.
Amaury Sechet [Sat, 27 Jan 2018 17:19:16 +0000 (17:19 +0000)]
Regenerate test result for testb-je-fusion.ll. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323595 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRegenerate test result for stateppint-vector.ll. NFC.
Amaury Sechet [Sat, 27 Jan 2018 17:16:26 +0000 (17:16 +0000)]
Regenerate test result for stateppint-vector.ll. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323594 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRegenrate brcond.ll test results. NFC
Amaury Sechet [Sat, 27 Jan 2018 16:57:15 +0000 (16:57 +0000)]
Regenrate brcond.ll test results. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323593 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRegenrate test results for avx-brcond.ll . NFC
Amaury Sechet [Sat, 27 Jan 2018 16:44:00 +0000 (16:44 +0000)]
Regenrate test results for avx-brcond.ll . NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323592 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Regenerate fp2int/int2fp tests
Simon Pilgrim [Sat, 27 Jan 2018 16:39:12 +0000 (16:39 +0000)]
[X86][SSE] Regenerate fp2int/int2fp tests

Cleanup check prefixes and check full codegen

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323591 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRegenerate test results for and-su.ll . NFC
Amaury Sechet [Sat, 27 Jan 2018 16:00:10 +0000 (16:00 +0000)]
Regenerate test results for and-su.ll . NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323588 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Add broadcast from v2i32 memory tests (PR34394)
Simon Pilgrim [Sat, 27 Jan 2018 15:54:57 +0000 (15:54 +0000)]
[X86][SSE] Add broadcast from v2i32 memory tests (PR34394)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323587 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TargetLowering] Teach TargetLowering::SimplifySetCC to simplify setcc of vXi1 vector...
Craig Topper [Sat, 27 Jan 2018 09:10:58 +0000 (09:10 +0000)]
[TargetLowering] Teach TargetLowering::SimplifySetCC to simplify setcc of vXi1 vectors into logic ops.

This transform was already being done for setcc of scalar i1. This extends it to vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323585 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SelectionDAG] Make DAGTypeLegalizer::PromoteSetCCOperands handle SETEQ/SETNE correct...
Craig Topper [Sat, 27 Jan 2018 08:41:03 +0000 (08:41 +0000)]
[SelectionDAG] Make DAGTypeLegalizer::PromoteSetCCOperands handle SETEQ/SETNE correctly for vector types.

The code was using getValueSizeInBits and combining with the result of a call to DAG.ComputeNumSignBits. But for vector types getValueSizeInBits returns the width of the full vector while ComputeNumSignBits is going to give a number no larger than the width of a single element. So we should be using getScalarValueSizeInBits to get the element width.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323583 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[GlobalISel][Legalizer] Convert the FP constants to the right APFloat type for G_FCON...
Amara Emerson [Sat, 27 Jan 2018 07:07:20 +0000 (07:07 +0000)]
[GlobalISel][Legalizer] Convert the FP constants to the right APFloat type for G_FCONSTANT.

We weren't converting the immediate ConstantFP during legalization, which caused
the wrong bit patterns to be emitted for half type FP constants.

Fixes PR36106.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323582 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[SLP] Fix for PR32086: Count InsertElementInstr of the same elements as shuffle."
Alexey Bataev [Sat, 27 Jan 2018 02:42:21 +0000 (02:42 +0000)]
Revert "[SLP] Fix for PR32086: Count InsertElementInstr of the same elements as shuffle."

This reverts commit r323530 to fix possible problems in users code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323581 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[SLP] Removed the warning about unused variable, NFC."
Alexey Bataev [Sat, 27 Jan 2018 02:42:17 +0000 (02:42 +0000)]
Revert "[SLP] Removed the warning about unused variable, NFC."

This reverts commit r323533 to fix possible problems in users code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323580 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstrProfiling] Don't exit early when an unused intrinsic is found
Vedant Kumar [Sat, 27 Jan 2018 00:01:04 +0000 (00:01 +0000)]
[InstrProfiling] Don't exit early when an unused intrinsic is found

This fixes a think-o in r323574.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323576 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LangRef] Update out-of-date instrprof names
Vedant Kumar [Fri, 26 Jan 2018 23:54:25 +0000 (23:54 +0000)]
[LangRef] Update out-of-date instrprof names

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323575 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstrProfiling] Improve compile time when there is no work
Vedant Kumar [Fri, 26 Jan 2018 23:54:24 +0000 (23:54 +0000)]
[InstrProfiling] Improve compile time when there is no work

When there are no uses of profiling intrinsics in a module, and there's
no coverage data to lower, InstrProfiling has no work to do.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323574 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoupdate_mir_test_checks: Accept "." in function names
Justin Bogner [Fri, 26 Jan 2018 22:56:31 +0000 (22:56 +0000)]
update_mir_test_checks: Accept "." in function names

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323573 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Use vpternlog to implement vector not under AVX512.
Craig Topper [Fri, 26 Jan 2018 22:17:40 +0000 (22:17 +0000)]
[X86] Use vpternlog to implement vector not under AVX512.

Previously we had to materialize all 1s in a register using vpternlog or pcmpeq and then xor with that. By using vpternlog directly we can do it in one operation.

This is implemented using isel patterns, but we should maybe consider creating a generalized vpternlog combiner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323572 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[x86] auto-generate complete checks; NFC
Sanjay Patel [Fri, 26 Jan 2018 22:06:07 +0000 (22:06 +0000)]
[x86] auto-generate complete checks; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323571 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] Preserve debug values for eliminable casts
Vedant Kumar [Fri, 26 Jan 2018 22:02:52 +0000 (22:02 +0000)]
[InstCombine] Preserve debug values for eliminable casts

A cast from A to B is eliminable if its result is casted to C, and if
the pair of casts could just be expressed as a single cast. E.g here,
%c1 is eliminable:

  %c1 = zext i16 %A to i32
  %c2 = sext i32 %c1 to i64

InstCombine optimizes away eliminable casts. This patch teaches it to
insert a dbg.value intrinsic pointing to the final result, so that local
variables pointing to the eliminable result are preserved.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323570 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoInline variable only used within assert.
Richard Trieu [Fri, 26 Jan 2018 21:55:13 +0000 (21:55 +0000)]
Inline variable only used within assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323569 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Generate constant splats instead of loads from constant pool
Krzysztof Parzyszek [Fri, 26 Jan 2018 21:54:56 +0000 (21:54 +0000)]
[Hexagon] Generate constant splats instead of loads from constant pool

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323568 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARF] Temporarily removing test to make buildbots happy while investigating.
Wolfgang Pieb [Fri, 26 Jan 2018 21:24:22 +0000 (21:24 +0000)]
[DWARF] Temporarily removing test to make buildbots happy while investigating.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323564 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Make sure that offset on globals matches alignment requirements
Krzysztof Parzyszek [Fri, 26 Jan 2018 21:20:04 +0000 (21:20 +0000)]
[Hexagon] Make sure that offset on globals matches alignment requirements

A correctly aligned address may happen to be separated into a variable
part and a constant part, where the constant part does not match the
alignment needed in a load/store that uses this address. Such a constant
cannot be used as an immediate offset in an indexed instruction.

When lowering a global address, make sure that if there is an offset
folded into the global, the offset is valid for all uses in load/store
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323562 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Replace multiple vector extracts with store-load combinations
Krzysztof Parzyszek [Fri, 26 Jan 2018 21:17:14 +0000 (21:17 +0000)]
[Hexagon] Replace multiple vector extracts with store-load combinations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323561 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARF] Temporarily removing a test that caused an independent failure on the mingw...
Wolfgang Pieb [Fri, 26 Jan 2018 20:47:24 +0000 (20:47 +0000)]
[DWARF] Temporarily removing a test that caused an independent failure on the mingw target.
Will recommit once that is addressed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323560 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LivePhysRegs] Preserve pristine regs in blocks with no successors.
Eli Friedman [Fri, 26 Jan 2018 20:23:00 +0000 (20:23 +0000)]
[LivePhysRegs] Preserve pristine regs in blocks with no successors.

One common source of blocks with no successors is calls to noreturn
functions; we want to preserve pristine registers in case they throw an
exception.

The whole pristine register thing is messy (we should really prefer to
explicitly model registers), but this fills a hole in the model for now.

Fixes https://bugs.llvm.org/show_bug.cgi?id=36073.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323559 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Support] Move PrintEscapedString into the library its declaration is in
Benjamin Kramer [Fri, 26 Jan 2018 20:21:02 +0000 (20:21 +0000)]
[Support] Move PrintEscapedString into the library its declaration is in

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323558 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Unbreak the build.
Benjamin Kramer [Fri, 26 Jan 2018 20:16:43 +0000 (20:16 +0000)]
[X86] Unbreak the build.

X86ISelLowering.cpp:34130:5: error: return type 'llvm::SDValue' must
match previous return type 'const llvm::SDValue' when lambda expression
has unspecified explicit return type

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323557 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SLP] Test for trunc vectorization, NFC.
Alexey Bataev [Fri, 26 Jan 2018 20:07:55 +0000 (20:07 +0000)]
[SLP] Test for trunc vectorization, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323556 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Allow any_extend to be combined with setcc on VLX targets.
Craig Topper [Fri, 26 Jan 2018 20:02:52 +0000 (20:02 +0000)]
[X86] Allow any_extend to be combined with setcc on VLX targets.

For VLX target getSetccResultType returns vXi1 which prevents the target independent DAG combine from doing this tranform itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323555 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX512] Add combining support for X86ISD::VTRUNCS
Simon Pilgrim [Fri, 26 Jan 2018 20:01:12 +0000 (20:01 +0000)]
[X86][AVX512] Add combining support for X86ISD::VTRUNCS

Similar to the existing support for X86ISD::VTRUNCUS.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323553 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SelectionDAGISel] Add a debug print before call to Select. Adjust where blank lines...
Craig Topper [Fri, 26 Jan 2018 19:34:20 +0000 (19:34 +0000)]
[SelectionDAGISel] Add a debug print before call to Select. Adjust where blank lines are printed during isel process to make things more sensibly grouped.

Previously some targets printed their own message at the start of Select to indicate what they were selecting. For the targets that didn't, it means there was no print of the root node before any custom handling in the target executed. So if the target did something custom and never called SelectNodeCommon, no print would be made. For the targets that did print a message in Select, if they didn't custom handle a node SelectNodeCommon would reprint the root node before walking the isel table.

It seems better to just print the message before the call to Select so all targets behave the same. And then remove the root node printing from SelectNodeCommon and just leave a message that says we're starting the table search.

There were also some oddities in blank line behavior. Usually due to a \n after a call to SelectionDAGNode::dump which already inserted a new line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323551 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add 'rdrnd' feature to silvermont to match recent gcc bug fix.
Craig Topper [Fri, 26 Jan 2018 19:34:14 +0000 (19:34 +0000)]
[X86] Add 'rdrnd' feature to silvermont to match recent gcc bug fix.

gcc recently fixed this bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83546

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323550 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Fix an incorrect assertion in HexagonConstExtenders
Krzysztof Parzyszek [Fri, 26 Jan 2018 19:20:50 +0000 (19:20 +0000)]
[Hexagon] Fix an incorrect assertion in HexagonConstExtenders

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323548 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARF] Generate DWARF v5 string offsets tables along with strx* index forms.
Wolfgang Pieb [Fri, 26 Jan 2018 18:52:58 +0000 (18:52 +0000)]
[DWARF] Generate DWARF v5 string offsets tables along with strx* index forms.

Summary: This is the producer side for DWARF v5 string offsets tables. The reader/consumer
side was committed with r321295. All compile and type units in a module share a
contribution to the string offsets table. Indirect strings use the strx{1,2,3,4} index forms.

Reviewers: dblaikie, aprantl, JDevliegehere

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323546 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[x86] fix typo in comment; NFC
Sanjay Patel [Fri, 26 Jan 2018 18:44:32 +0000 (18:44 +0000)]
[x86] fix typo in comment; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323545 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Remove apostrophe to use 'it' in the possessive form.
Matt Davis [Fri, 26 Jan 2018 18:43:57 +0000 (18:43 +0000)]
[NFC] Remove apostrophe to use 'it' in the possessive form.

Summary: This is  a simple change to test commit access with.

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323544 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX] LowerBUILD_VECTORAsVariablePermute - add support for VPERMILPV to v4i32...
Simon Pilgrim [Fri, 26 Jan 2018 17:19:59 +0000 (17:19 +0000)]
[X86][AVX] LowerBUILD_VECTORAsVariablePermute - add support for VPERMILPV to v4i32/v4f32

Extension to D42431, adding support for v4i32/v4f32 as well as v2i64/v2f64 now that D42308 has landed

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323542 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Don't colaesce v4i32 extracts
Simon Pilgrim [Fri, 26 Jan 2018 17:11:34 +0000 (17:11 +0000)]
[X86][SSE] Don't colaesce v4i32 extracts

We currently coalesce v4i32 extracts from all 4 elements to 2 v2i64 extracts + shifts/sign-extends.

This seems to have been added back in the days when we tended to spill vectors and reload scalars, or ended up with repeated shuffles moving everything down to 0'th index. I don't think either of these are likely these days as we have better EXTRACT_VECTOR_ELT and VECTOR_SHUFFLE handling, and the existing code tends to make it very difficult for various vector and load combines.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323541 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Drop PMADDWD in lowerMul
Simon Pilgrim [Fri, 26 Jan 2018 16:57:36 +0000 (16:57 +0000)]
[X86][SSE] Drop PMADDWD in lowerMul

As mentioned in D42258, we don't need this any more

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323540 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAG] Teach findBaseOffset to interpret indexes of indexed memory operations
Nirav Dave [Fri, 26 Jan 2018 16:51:27 +0000 (16:51 +0000)]
[DAG] Teach findBaseOffset to interpret indexes of indexed memory operations

Indexed outputs are addition / subtractions and can be interpreted as such.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323539 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU][MC] Added validation of image dst/data size (must match dmask and tfe)
Dmitry Preobrazhensky [Fri, 26 Jan 2018 16:42:51 +0000 (16:42 +0000)]
[AMDGPU][MC] Added validation of image dst/data size (must match dmask and tfe)

See bug 36000: https://bugs.llvm.org/show_bug.cgi?id=36000

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

Reviewers: vpykhtin, artem.tamazov, arsenm

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323538 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MIPS] Don't crash on unsized extern types with -mgpopt
Alexander Richardson [Fri, 26 Jan 2018 15:56:14 +0000 (15:56 +0000)]
[MIPS] Don't crash on unsized extern types with -mgpopt

Summary: This fixes an assertion when building the FreeBSD MIPS64 kernel.

Reviewers: atanasyan, sdardis, emaste

Reviewed By: sdardis

Subscribers: krytarowski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323536 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAGCombine] reduceBuildVecToShuffle - ensure EXTRACT_VECTOR_ELT index is in range
Simon Pilgrim [Fri, 26 Jan 2018 15:50:20 +0000 (15:50 +0000)]
[DAGCombine] reduceBuildVecToShuffle - ensure EXTRACT_VECTOR_ELT index is in range

From OSS Fuzz Test Case #5688

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323535 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU][MC] Added support of 64-bit image atomics
Dmitry Preobrazhensky [Fri, 26 Jan 2018 15:43:29 +0000 (15:43 +0000)]
[AMDGPU][MC] Added support of 64-bit image atomics

See bug 35998: https://bugs.llvm.org/show_bug.cgi?id=35998

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

Reviewers: vpykhtin, artem.tamazov, arsenm

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323534 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SLP] Removed the warning about unused variable, NFC.
Alexey Bataev [Fri, 26 Jan 2018 15:34:44 +0000 (15:34 +0000)]
[SLP] Removed the warning about unused variable, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323533 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Add tests for vector truncation with PACKUS style signed saturation
Simon Pilgrim [Fri, 26 Jan 2018 14:58:50 +0000 (14:58 +0000)]
[X86][SSE] Add tests for vector truncation with PACKUS style signed saturation

PACKUS - truncates signed value, saturating to [0,unsigned_max_trunc]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323531 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SLP] Fix for PR32086: Count InsertElementInstr of the same elements as shuffle.
Alexey Bataev [Fri, 26 Jan 2018 14:31:09 +0000 (14:31 +0000)]
[SLP] Fix for PR32086: Count InsertElementInstr of the same elements as shuffle.

Summary:
If the same value is going to be vectorized several times in the same
tree entry, this entry is considered to be a gather entry and cost of
this gather is counter as cost of InsertElementInstrs for each gathered
value. But we can consider these elements as ShuffleInstr with
SK_PermuteSingle shuffle kind.

Reviewers: spatel, RKSimon, mkuper, hfinkel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323530 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU][MC] Enabled disassembler for image atomic operations
Dmitry Preobrazhensky [Fri, 26 Jan 2018 14:07:38 +0000 (14:07 +0000)]
[AMDGPU][MC] Enabled disassembler for image atomic operations

See bug 35988: https://bugs.llvm.org/show_bug.cgi?id=35988

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

Reviewers: vpykhtin, artem.tamazov, arsenm

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323527 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Cleanup SDLoc arguments as mentioned on D42544
Simon Pilgrim [Fri, 26 Jan 2018 14:00:01 +0000 (14:00 +0000)]
[X86] Cleanup SDLoc arguments as mentioned on D42544

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323526 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TableGen][NFC]Remove dead variable.
Clement Courbet [Fri, 26 Jan 2018 13:21:43 +0000 (13:21 +0000)]
[TableGen][NFC]Remove dead variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323525 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MIR] Add support for addrspace in MIR
Francis Visoiu Mistrih [Fri, 26 Jan 2018 11:47:28 +0000 (11:47 +0000)]
[MIR] Add support for addrspace in MIR

Add support for printing / parsing the addrspace of a MachineMemOperand.

Fixes PR35970.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323521 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] fix LDS f32 intrinsics
Daniil Fukalov [Fri, 26 Jan 2018 11:09:38 +0000 (11:09 +0000)]
[AMDGPU] fix LDS f32 intrinsics

- using qualified pointer addrspace in intrinsics class to avoid .f32 mangling
- changed too common atomic mangling to ds
- added missing intrinsics to AMDGPUTTIImpl::getTgtMemIntrinsic

Reviewed by: b-sumner

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323516 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CallSiteSplitting] Fix infinite loop when recording conditions.
Florian Hahn [Fri, 26 Jan 2018 10:36:50 +0000 (10:36 +0000)]
[CallSiteSplitting] Fix infinite loop when recording conditions.

Fix infinite loop when recording conditions by correctly marking basic
blocks as visited.

Fixes https://bugs.llvm.org/show_bug.cgi?id=36105

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323515 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Accept a subset of Thumb GPR register class when emitting an SP-relative
Momchil Velikov [Fri, 26 Jan 2018 10:20:58 +0000 (10:20 +0000)]
[ARM] Accept a subset of Thumb GPR register class when emitting an SP-relative
load instruction

The function `Thumb1InstrInfo::loadRegFromStackSlot` accepts only the `tGPR`
register class. The function serves to emit a `tLDRspi` instruction and
certainly any subset of the `tGPR` register class is a valid destination of the
load.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323514 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86FixupBWInsts] Prefer positive checks in the test. NFC
Andrei Elovikov [Fri, 26 Jan 2018 09:50:32 +0000 (09:50 +0000)]
[X86FixupBWInsts] Prefer positive checks in the test. NFC

Reviewers: andrew.w.kaylor, craig.topper, MatzeB

Reviewed By: andrew.w.kaylor

Subscribers: aivchenk, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323513 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Armv8.2-A FP16 code generation (part 1/3)
Sjoerd Meijer [Fri, 26 Jan 2018 09:26:40 +0000 (09:26 +0000)]
[ARM] Armv8.2-A FP16 code generation (part 1/3)

This is the groundwork for Armv8.2-A FP16 code generation .

Clang passes and returns _Float16 values as floats, together with the required
bitconverts and truncs etc. to implement correct AAPCS behaviour, see D42318.
We will implement half-precision argument passing/returning lowering in the ARM
backend soon, but for now this means that this:

_Float16 sub(_Float16 a, _Float16 b) {
  return a + b;
}

gets lowered to this:

define float @sub(float %a.coerce, float %b.coerce) {
entry:
  %0 = bitcast float %a.coerce to i32
  %tmp.0.extract.trunc = trunc i32 %0 to i16
  %1 = bitcast i16 %tmp.0.extract.trunc to half
  <SNIP>
  %add = fadd half %1, %3
  <SNIP>
}

When FullFP16 is *not* supported, we don't make f16 a legal type, and we get
legalization for "free", i.e. nothing changes and everything works as before.
And also f16 argument passing/returning is handled.

When FullFP16 is supported, we do make f16 a legal type, and have 2 places that
we need to patch up: f16 argument passing and returning, which involves minor
tweaks to avoid unnecessary code generation for some bitcasts.

As a "demonstrator" that this works for the different FP16, FullFP16, softfp
modes, etc., I've added match rules to the VSUB instruction description showing
that we can codegen this instruction from IR, but more importantly, also to
some conversion instructions. These conversions were causing issue before in
the FP16 and FullFP16 cases.

I've also added match rules to the VLDRH and VSTRH desriptions, so that we can
actually compile the entire half-precision sub code example above. This showed
that these loads and stores had the wrong addressing mode specified: AddrMode5
instead of AddrMode5FP16, which turned out not be implemented at all, so that
has also been added.

This is the minimal patch that shows all the different moving parts. In patch
2/3 I will add some efficient lowering of bitcasts, and in 2/3 I will add the
remaining Armv8.2-A FP16 instruction descriptions.

Thanks to Sam Parker and Oliver Stannard for their help and reviews!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323512 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] fix trivial typos in comments and documents
Hiroshi Inoue [Fri, 26 Jan 2018 08:15:29 +0000 (08:15 +0000)]
[NFC] fix trivial typos in comments and documents

"in in" -> "in", "on on" -> "on" etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323508 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[RISCV] Encode RISCV specific ELF e_flags to RISCV Binary by RISCVTargetStreamer
Shiva Chen [Fri, 26 Jan 2018 07:53:07 +0000 (07:53 +0000)]
[RISCV] Encode RISCV specific ELF e_flags to RISCV Binary by RISCVTargetStreamer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323507 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove dead code from LowerBUILD_VECTOR that tried to handle i64 element type...
Craig Topper [Fri, 26 Jan 2018 07:30:44 +0000 (07:30 +0000)]
[X86] Remove dead code from LowerBUILD_VECTOR that tried to handle i64 element type in 32-bit mode.

Type legalization would prevent any i64 operands to the build_vector from existing before we get here. The coverage bots show this code as uncovered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323506 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SelectionDAG] Replace a std::vector<SDValue> with a SmallVector.
Craig Topper [Fri, 26 Jan 2018 07:15:22 +0000 (07:15 +0000)]
[SelectionDAG] Replace a std::vector<SDValue> with a SmallVector.

It likely the number of elements in the type we're legalizing here is reasonably small.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323505 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove code from combineBitcastvxi1 that was needed to support the previous...
Craig Topper [Fri, 26 Jan 2018 07:15:21 +0000 (07:15 +0000)]
[X86] Remove code from combineBitcastvxi1 that was needed to support the previous native IR for kunpck intrinsics.

The original autoupgrade for kunpck intrinsics used a bitcasted scalar shift, or, and. This combine would turn this into a concat_vectors. Now the kunpck intrinsics are autoupgraded to a vector shuffle that will become a concat_vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323504 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove unused intrinsic type handling. NFC
Craig Topper [Fri, 26 Jan 2018 07:15:20 +0000 (07:15 +0000)]
[X86] Remove unused intrinsic type handling. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323503 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Simplify condition in VSETCC. NFC
Craig Topper [Fri, 26 Jan 2018 07:15:18 +0000 (07:15 +0000)]
[X86] Simplify condition in VSETCC. NFC

This listed all legal 128-bit integer types individually, but since we already know we have a legal type and its integer, we can just check is128BitVector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323502 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove LowerVSETCC code for handling vXi1 setcc with vXi8/vXi16 input type...
Craig Topper [Fri, 26 Jan 2018 07:15:17 +0000 (07:15 +0000)]
[X86] Remove LowerVSETCC code for handling vXi1 setcc with vXi8/vXi16 input type. NFC

These kinds of setccs are promoted by a DAG combine before they ever get to legalization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323501 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove some dead code from LowerVSETCC. NFC
Craig Topper [Fri, 26 Jan 2018 07:15:16 +0000 (07:15 +0000)]
[X86] Remove some dead code from LowerVSETCC. NFC

This code was added in r321967, but ultimately I fixed the issue in the legalizer and this code was no longer required.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323500 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CGP] Re-enable Select in complex addressing mode.
Serguei Katkov [Fri, 26 Jan 2018 06:26:56 +0000 (06:26 +0000)]
[CGP] Re-enable Select in complex addressing mode.

Switch Select handling on after fixing two bugs: rL323192 and rL323497.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323498 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Fix killed flag handling in X86FixupLea pass
Serguei Katkov [Fri, 26 Jan 2018 04:49:26 +0000 (04:49 +0000)]
[X86] Fix killed flag handling in X86FixupLea pass

When pass creates a MOV instruction for
lea (%base,%index,1), %dst => mov %base,%dst; add %index,%dst
modification it should clean the killed flag for base
if base is equal to index.

Otherwise verifier complains about usage of killed register in add instruction.

Reviewers: lsaba, zvi, zansari, aaboud
Reviewed By: lsaba
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D42522

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323497 91177308-0d34-0410-b5e6-96231b3b80d8