134587 Commits

Author SHA1 Message Date
James Molloy
298a9a8a84 Revert "[Thumb] Reapply r272251 with a fix for PR28348"
This reverts commit r274510 - it made green dragon unhappy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274512 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-04 17:14:24 +00:00
James Molloy
eb181e82b8 [Thumb] Reapply r272251 with a fix for PR28348
We were using DAG->getConstant instead of DAG->getTargetConstant. This meant that we could inadvertently increase the use count of a constant if stars aligned, which it did in this testcase. Increasing the use count of the constant could cause ISel to fall over (because DAGToDAG lowering assumed the constant had only one use!)

Original commit message:
  [Thumb] Select a BIC instead of AND if the immediate can be encoded more optimally negated

  If an immediate is only used in an AND node, it is possible that the immediate can be more optimally materialized when negated. If this is the case, we can negate the immediate and use a BIC instead;

    int i(int a) {
      return a & 0xfffffeec;
    }

  Used to produce:
      ldr r1, [CONSTPOOL]
      ands r0, r1
    CONSTPOOL: 0xfffffeec

  And now produces:
      movs    r1, #255
      adds    r1, #20  ; Less costly immediate generation
      bics    r0, r1

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274510 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-04 16:35:41 +00:00
Simon Pilgrim
f371eaddb2 [X86][AVX512] Autoupgrade the VPERMPD/VPERMQ intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274506 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-04 14:19:05 +00:00
Simon Pilgrim
79fc52e39b [X86][AVX512] Added VPERMPD/VPERMQ intrinsics fast-isel generic IR tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-04 13:43:10 +00:00
Simon Pilgrim
53af872aac [X86][AVX512] Autoupgrade the VPERMILPD/VPERMILPS intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274498 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-04 12:40:54 +00:00
Eric Liu
d32de81c25 Fixed warning caused by r274402.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274497 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-04 12:10:08 +00:00
Simon Pilgrim
e13dc30d29 [X86][AVX512] Added VPERMILPD/VPERMILPS intrinsics fast-isel generic IR tests
Added PSHUFD tests as well

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274493 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-04 11:07:50 +00:00
Nicolai Haehnle
b07f540456 Add writeonly IR attribute
Summary:
This complements the earlier addition of IntrWriteMem and IntrWriteArgMem
LLVM intrinsic properties, see D18291.

Also start using the attribute for memset, memcpy, and memmove intrinsics,
and remove their special-casing in BasicAliasAnalysis.

Reviewers: reames, joker.eph

Subscribers: joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274485 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-04 08:01:29 +00:00
Craig Topper
061feda889 [CodeGen] Make the code that detects a if a shuffle is really a concatenation of the inputs more general purpose.
We can now handle concatenation of each source multiple times. The previous code just checked for each source to appear once in either order.

This also now handles an entire source vector sized piece having undef indices correctly. We now concat with UNDEF instead of using one of the sources. This is responsible for the test case change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274483 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-04 06:19:35 +00:00
NAKAMURA Takumi
283ee8181a Reformat blank lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274481 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-04 01:26:33 +00:00
NAKAMURA Takumi
6f439639f1 Reformat comment lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274480 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-04 01:26:27 +00:00
NAKAMURA Takumi
ef2b8e71c3 Untabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274479 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-04 01:26:21 +00:00
NAKAMURA Takumi
7810e667e7 Reformat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274478 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-04 01:26:14 +00:00
Simon Pilgrim
e52fac8db4 [X86] Add shuffle mask rescaling helper function. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274476 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 21:28:17 +00:00
Simon Pilgrim
e22e44a85c [X86][AVX2] Merge unary permute matching behind the same V2.isUndef() condition. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274474 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 20:39:42 +00:00
Simon Pilgrim
41188e6fc5 [X86][AVX512] Add support for 512-bit shuffle lowering to VPERMPD/VPERMQ
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274473 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 19:50:06 +00:00
Craig Topper
4eca4cb556 [CodeGen] Teach OR combine of shuffles involving zero vectors to better handle undef indices.
Undef indices can now be treated as zeros. Or if its undef ORed with zero, we will keep the undef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274472 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 19:37:12 +00:00
Craig Topper
410b9a9dac [X86] Add tests to show that the DAG combine for OR of shuffles with zero vectors doesn't handle undefs as well as it could. Fix coming in another commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274471 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 19:37:10 +00:00
Haicheng Wu
e2d151c924 [MBB] add a missing corner case in UpdateTerminator()
After the block placement, if a block ends with a conditional branch, but the
next block is not its successor. The conditional branch should be changed to
unconditional branch.  This patch fixes PR28307, PR28297, PR28402.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274470 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 19:14:17 +00:00
Simon Pilgrim
4ad0017d61 [X86][AVX512] Add support for VPERMPD/VPERMQ masked shuffle comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274469 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 18:40:24 +00:00
Simon Pilgrim
7a63dcfa73 [X86][AVX512] Add support for 512-bit shuffle decoding of VPERMPD/VPERMQ
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274468 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 18:27:37 +00:00
Simon Pilgrim
91d79de045 [X86][AVX] Renamed VPERMILPI shuffle comment macros to be more specific
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274467 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 18:02:43 +00:00
Simon Pilgrim
260d596443 [X86][AVX512] Add support for VPALIGNR/PSHUFD/PSHUFHW/PSHUFLW masked shuffle comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274466 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 15:00:51 +00:00
Sanjay Patel
a9403e9f0e [InstCombine] enable vector select of bools -> logic folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274465 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 14:34:39 +00:00
Simon Pilgrim
b7dea04f9b [X86][AVX512] Add support for UNPCK masked shuffle comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274464 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 14:26:21 +00:00
Sanjay Patel
d9a17d1f93 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274463 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 14:08:19 +00:00
Simon Pilgrim
2f0ee9010f [X86][AVX512] Add support for VPERM/VSHUF masked shuffle comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274462 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 13:55:41 +00:00
Simon Pilgrim
a145cca4d9 [X86][AVX512] Add support for PMOVZX masked shuffle comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274461 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 13:33:28 +00:00
Sanjay Patel
b4d7428f8a add vector bool select tests and regenerate checks for scalar bool select tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274460 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 13:26:02 +00:00
Simon Pilgrim
50f3e3a607 [X86][AVX512] Add support for masked shuffle comments
This patch adds support for including the avx512 mask register information in the mask/maskz versions of shuffle instruction comments.

This initial version just adds support for MOVDDUP/MOVSHDUP/MOVSLDUP to reduce the mass of test regenerations, other shuffle instructions can be added in due course.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274459 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 13:08:29 +00:00
Simon Pilgrim
66251d4075 [X86][AVX512] Add support for lowering shuffles to VPERMILPS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274458 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 12:47:21 +00:00
Sean Silva
9cbcb75a8a PR28400: Partly undo r274440 to bring test-suite back to life with the new PM
PR28400 seems to be not an isolated issue, but a general problem related
to caching analyses. We will need to discuss on llvm-dev.

A test case is in the PR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274457 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 03:35:06 +00:00
Sean Silva
ad5ea26278 [PM] Some preparatory refactoring to minimize the diff of D21921
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274456 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03 03:35:03 +00:00
Sean Silva
e82e4ddb87 Remove dead TLI arg of isKnownNonNull and propagate deadness. NFC.
This actually uncovered a surprisingly large chain of ultimately unused
TLI args.
From what I can gather, this argument is a remnant of when
isKnownNonNull would look at the TLI directly.
The current approach seems to be that InferFunctionAttrs runs early in
the pipeline and uses TLI to annotate the TLI-dependent non-null
information as return attributes.

This also removes the dependence of functionattrs on TLI altogether.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274455 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 23:47:27 +00:00
Xinliang David Li
6f6a939a2e Fix wrong comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274453 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 21:25:12 +00:00
Xinliang David Li
10b22c8894 [PM] Port LoopAccessInfo analysis to new PM
It is implemented as a LoopAnalysis pass as 
discussed and agreed upon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 21:18:40 +00:00
Simon Pilgrim
bbe7316521 Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274451 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 20:21:39 +00:00
Simon Pilgrim
c032badeb4 [X86][AVX512] Add support for lowering shuffles to VPERMILPD
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274450 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 20:20:12 +00:00
Sylvestre Ledru
e0f2f6011e fix some various typos in the doc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 19:28:40 +00:00
Simon Pilgrim
3e60eeae91 [X86][AVX512VL] Add fast-isel MOVDDUP/MOVSLDUP/MOVSHDUP shuffle tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274448 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 19:22:46 +00:00
Sean Silva
2cea4e67ba [PM] Some preparatory refactoring to minimize the diff of D21921
The main change here is just moving stuff to static functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274446 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 19:12:56 +00:00
Sean Silva
197a7516a3 [PM] Preparatory cleanups to ArgumentPromotion.
This pulls some obvious changes out of http://reviews.llvm.org/D21921 to
minimize the diff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274445 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 18:59:51 +00:00
Simon Pilgrim
91a1df2c0b [X86][AVX512] Add support for 512-bit PSHUFB lowering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274444 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 18:14:31 +00:00
Simon Pilgrim
1dcb078502 [X86][AVX512] Converted the MOVDDUP/MOVSLDUP/MOVSHDUP masked intrinsics to generic IR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274443 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 17:16:41 +00:00
Wilfred Hughes
f9c643b6e0 New Kaleidoscope chapter: Creating object files
This new chapter describes compiling LLVM IR to object files.

The new chaper is chapter 8, so later chapters have been renumbered.
Since this brings us to 10 chapters total, I've also needed to rename
the other chapters to use two digit numbering.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274441 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 17:01:59 +00:00
Sean Silva
ea9886a590 [PM] Fix a small typo from when I ported JumpThreading
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274440 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 16:16:44 +00:00
Simon Pilgrim
c964a30adf [X86][AVX512] Autoupgrade the MOVDDUP/MOVSLDUP/MOVSHDUP intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274439 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 14:42:35 +00:00
Benjamin Kramer
cced733fa5 [DIBuilder] Remove dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274438 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 13:18:38 +00:00
Benjamin Kramer
b4e53350f9 [Hexagon] Create global std::map lazily.
This could of course be a simple binary search with no global state
involved at all if someone cares enough. Just don't make everyone
linking the hexagon backend pay for it on process startup and shutdown.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274437 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 13:05:12 +00:00
Simon Pilgrim
2e1720f455 [X86][AVX512] Add support for lowering shuffles to MOVDDUP/MOVSLDUP/MOVSHDUP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274436 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 12:45:03 +00:00