1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 05:52:53 +02:00
Commit Graph

2303 Commits

Author SHA1 Message Date
Alexey Bataev
e1de13f3ac [InstCombine] Add test for insertelementinsts with constants.
Added a tests that shows that several insertelementinsts with constant
indexes/data are not folded into a single shuffleinst.

llvm-svn: 280474
2016-09-02 09:00:53 +00:00
Sanjay Patel
8f415558bc [InstCombine] add tests to show potential shuffle+insert folds
llvm-svn: 280403
2016-09-01 19:14:19 +00:00
Sanjay Patel
e65f7b0df0 [InstCombine] remove fold of an icmp pattern that should never happen
While removing a scalar shackle from an icmp fold, I noticed that I couldn't find any tests to trigger
this code path.

The 'and' shrinking transform should be handled by InstCombiner::foldCastedBitwiseLogic()
or eliminated with InstSimplify. The icmp narrowing is part of InstCombiner::foldICmpWithCastAndCast().

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

llvm-svn: 280370
2016-09-01 14:20:43 +00:00
Sanjay Patel
2518f817be [InstCombine] allow icmp (shr exact X, C2), C fold for splat constant vectors
The enhancement to foldICmpDivConstant ( http://llvm.org/viewvc/llvm-project?view=revision&revision=280299 )
allows us to remove the ConstantInt check; no other changes needed.

llvm-svn: 280300
2016-08-31 22:18:43 +00:00
Sanjay Patel
002c7088e9 [InstCombine] allow icmp (div X, Y), C folds for splat constant vectors
Converting all of the overflow ops to APInt looked risky, so I've left that as a TODO.

llvm-svn: 280299
2016-08-31 21:57:21 +00:00
Sanjay Patel
0b7546dcd3 [InstCombine] add tests to show type limitations of InsertRangeTest and callers
llvm-svn: 280175
2016-08-30 23:16:59 +00:00
Sanjay Patel
d4c3ab24ab [InstCombine] use m_APInt to allow icmp (and X, Y), C folds for splat constant vectors
llvm-svn: 279937
2016-08-28 18:18:00 +00:00
Xinliang David Li
69ca8eb5f7 [Profile] Propagate branch metadata properly in instcombine
Differential Revision: http://reviews.llvm.org/D23590

llvm-svn: 279693
2016-08-25 00:26:32 +00:00
Sanjay Patel
2f27429f46 [InstCombine] use m_APInt to allow icmp eq/ne (shr X, C2), C folds for splat constant vectors
llvm-svn: 279677
2016-08-24 22:22:06 +00:00
Sanjay Patel
1634b27769 [InstCombine] use m_APInt to allow icmp (shr exact X, Y), 0 folds for splat constant vectors
llvm-svn: 279472
2016-08-22 20:45:06 +00:00
Jun Bum Lim
3135fa5afa [InstCombine] Allow sinking from unique predecessor with multiple edges
Summary: We can allow sinking if the single user block has only one unique predecessor, regardless of the number of edges. Note that a switch statement with multiple cases can have the same destination.

Reviewers: mcrosier, majnemer, spatel, reames

Subscribers: reames, mcrosier, llvm-commits

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

llvm-svn: 279448
2016-08-22 18:21:56 +00:00
Sanjay Patel
2cb8482306 [InstCombine] use m_APInt to allow icmp (shl X, Y), C folds for splat constant vectors, part 4
This concludes the fixes for icmp+shl in this series:
https://reviews.llvm.org/rL279339
https://reviews.llvm.org/rL279398
https://reviews.llvm.org/rL279399

llvm-svn: 279401
2016-08-21 17:10:07 +00:00
Sanjay Patel
bacc188770 remove FIXME comment; fixed by previous commit
llvm-svn: 279400
2016-08-21 16:40:42 +00:00
Sanjay Patel
25a1bab6f9 [InstCombine] use m_APInt to allow icmp (shl X, Y), C folds for splat constant vectors, part 3
This is a partial enablement (move the ConstantInt guard down).

llvm-svn: 279399
2016-08-21 16:35:34 +00:00
Sanjay Patel
8c8ad66cc3 [InstCombine] use m_APInt to allow icmp (shl X, Y), C folds for splat constant vectors, part 2
This is a partial enablement (move the ConstantInt guard down).

llvm-svn: 279398
2016-08-21 16:28:22 +00:00
Sanjay Patel
8dbd727c17 [InstCombine] use m_APInt to allow icmp (shl X, Y), C folds for splat constant vectors, part 1
This is a partial enablement (move the ConstantInt guard down) because there are many
different folds here and one of the later ones will require reworking 'isSignBitCheck'.

llvm-svn: 279339
2016-08-19 22:33:26 +00:00
Reid Kleckner
689f5edc33 Fix regression in InstCombine introduced by r278944
The intended transform is:
  // Simplify icmp eq (or (ptrtoint P), (ptrtoint Q)), 0
  // -> and (icmp eq P, null), (icmp eq Q, null).

P and Q are both pointer types, but may have different types. We need
two calls to getNullValue() to make the icmps.

llvm-svn: 279271
2016-08-19 16:53:18 +00:00
Sanjay Patel
4be04d1b32 [InstCombine] use m_APInt to allow icmp (shl 1, Y), C folds for splat constant vectors
llvm-svn: 279266
2016-08-19 16:12:16 +00:00
Sanjay Patel
e8714eaca2 [InstCombine] use m_APInt to allow icmp X, C folds for splat constant vectors
Of course, we really need to refactor and fix all of the cmp predicates, 
but this one is interesting because without it, we later perform an 
information-losing transform of icmp (shl 1, Y), C, and we can't recover
the better fold.

llvm-svn: 279263
2016-08-19 15:40:44 +00:00
Sanjay Patel
d37eac4ff4 [InstCombine] add tests for missing vector icmp folds
llvm-svn: 279259
2016-08-19 15:27:28 +00:00
Sanjay Patel
3ee6ef6d51 [InstCombine] add missing tests for basic icmp folds
These are implicitly included as part of larger test cases, but they don't 
exist stand-alone (and don't happen for vectors...).

llvm-svn: 279257
2016-08-19 15:21:45 +00:00
Amaury Sechet
c5f63d0dfc Make cltz and cttz zero undef when the operand cannot be zero in InstCombine
Summary: Also add popcount(n) == bitsize(n)  -> n == -1 transformation.

Reviewers: majnemer, spatel

Subscribers: llvm-commits

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

llvm-svn: 279141
2016-08-18 20:43:50 +00:00
Sanjay Patel
f315654cc5 [InstCombine] use m_APInt to allow icmp (trunc X, Y), C folds for splat constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859
https://reviews.llvm.org/rL278935
https://reviews.llvm.org/rL278945
https://reviews.llvm.org/rL279066
https://reviews.llvm.org/rL279077
https://reviews.llvm.org/rL279101

llvm-svn: 279133
2016-08-18 20:28:54 +00:00
Sanjay Patel
d1314859b2 [InstCombine] use m_APInt to allow icmp (udiv X, Y), C folds for splat constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859
https://reviews.llvm.org/rL278935
https://reviews.llvm.org/rL278945
https://reviews.llvm.org/rL279066
https://reviews.llvm.org/rL279077

llvm-svn: 279101
2016-08-18 17:55:59 +00:00
Sanjay Patel
96b9e6a3c8 [InstCombine] use m_APInt to allow icmp (mul X, Y), C folds for splat constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859
https://reviews.llvm.org/rL278935
https://reviews.llvm.org/rL278945
https://reviews.llvm.org/rL279066

llvm-svn: 279077
2016-08-18 15:44:44 +00:00
Sanjay Patel
53db341560 [InstCombine] use m_APInt to allow icmp (xor X, Y), C folds for splat constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859
https://reviews.llvm.org/rL278935
https://reviews.llvm.org/rL278945

llvm-svn: 279066
2016-08-18 14:10:48 +00:00
Sanjay Patel
3fbaa35727 [InstCombine] add test for missing vector icmp fold
Also, add a scalar test to demonstrate one of the intermediate folds that
is necessary to accomplish the existing, multi-step test. And simplify
the vector tests to only check the final piece of that multi-step transform.

llvm-svn: 278995
2016-08-17 22:18:57 +00:00
Sanjay Patel
193a85966d [InstCombine] minimize tests and autogenerate checks
llvm-svn: 278960
2016-08-17 19:56:10 +00:00
Sanjay Patel
f9493c21eb [InstCombine] use m_APInt to allow icmp (or X, Y), C folds for splat constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859
https://reviews.llvm.org/rL278935

llvm-svn: 278945
2016-08-17 16:38:57 +00:00
Sanjay Patel
24c1e6517e [InstCombine] add tests for missing vector icmp folds
llvm-svn: 278943
2016-08-17 16:23:15 +00:00
Sanjay Patel
f6dffe904b [InstCombine] use m_APInt to allow icmp (add X, Y), C folds for splat constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859

llvm-svn: 278935
2016-08-17 15:24:30 +00:00
Sanjay Patel
836fb2c9e4 [InstCombine] add tests for fold with no coverage and missing vector fold
llvm-svn: 278867
2016-08-16 23:18:42 +00:00
Sanjay Patel
110b6da1b2 [InstCombine] use m_APInt to allow icmp (sub X, Y), C folds for splat constant vectors
llvm-svn: 278859
2016-08-16 21:53:19 +00:00
David Majnemer
eb18f1195e Don't passively concatenate MDNodes
I have audited all the callers of concatenate and none require duplicate
entries to service concatenation.
These duplicates serve no purpose but to needlessly embiggen the IR.

N.B. Layering getMostGenericAliasScope on top of concatenate makes it
O(nlogn + mlogm) instead of O(n*m).

llvm-svn: 278836
2016-08-16 18:48:34 +00:00
Sanjay Patel
8812bdbcf4 [InstCombine] add tests for missing vector icmp folds
llvm-svn: 278768
2016-08-16 00:48:38 +00:00
Sanjay Patel
51d59ac664 [InstCombine] add tests for missing vector icmp folds
llvm-svn: 278765
2016-08-16 00:27:12 +00:00
Sanjay Patel
e77fd8052f [InstCombine] add tests for missing vector icmp folds
llvm-svn: 278757
2016-08-15 22:43:52 +00:00
Sanjay Patel
662b4927af [InstCombine] add tests for missing vector icmp folds
llvm-svn: 278751
2016-08-15 21:47:50 +00:00
Sanjay Patel
b6b1df4fc2 [InstCombine] add tests for missing vector icmp folds
llvm-svn: 278747
2016-08-15 21:37:24 +00:00
Sanjay Patel
7fe8825678 update tests to use FileCheck and exact checking
llvm-svn: 278741
2016-08-15 21:02:25 +00:00
Sanjay Patel
15e2f3b44b [InstCombine] add tests for missing vector icmp folds
llvm-svn: 278737
2016-08-15 20:56:11 +00:00
Sanjay Patel
e73dc8d89a [InstCombine] add test for missing vector icmp fold
llvm-svn: 278727
2016-08-15 20:02:40 +00:00
Sanjay Patel
fb03d43314 [InstCombine] add tests for vector icmp folds
llvm-svn: 278726
2016-08-15 19:58:21 +00:00
Sanjay Patel
5e82d03d8a [InstCombine] add tests for missing vector icmp folds
llvm-svn: 278717
2016-08-15 19:16:33 +00:00
Sanjay Patel
f11cb3970e update test to use FileCheck and autogenerated checks
llvm-svn: 278714
2016-08-15 18:56:10 +00:00
Sanjay Patel
fed91af079 [InstCombine] add tests for missing vector icmp folds
llvm-svn: 278709
2016-08-15 18:45:10 +00:00
Sanjay Patel
13ec2e4fa5 [InstCombine] add test for missing vector icmp fold
llvm-svn: 278708
2016-08-15 18:39:54 +00:00
Sanjay Patel
9a99e24c55 minimize test
llvm-svn: 278707
2016-08-15 18:35:44 +00:00
Sanjay Patel
28217a8c68 remove unnecessary IR comments about uses
llvm-svn: 278705
2016-08-15 18:32:50 +00:00
Sanjay Patel
48b0887762 [InstCombine] add tests for missing vector icmp folds
llvm-svn: 278704
2016-08-15 18:26:56 +00:00