Commit Graph

142649 Commits

Author SHA1 Message Date
Craig Topper
3900e637a2 [AVX-512][InstCombine] Teach InstCombine to turn packed add/sub/mul/div with rounding intrinsics into normal IR operations if the rounding mode is CUR_DIRECTION.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290559 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-27 00:23:16 +00:00
Chandler Carruth
0b88030fbe [PM] Teach the always inliner in the new pass manager to support
removing fully-dead comdats without removing dead entries in comdats
with live members.

This factors the core logic out of the current inliner's internals to
a reusable utility and leverages that in both places. The factored out
code should also be (minorly) more efficient in cases where we have very
few dead functions or dead comdats to consider.

I've added a test case to cover this behavior of the always inliner.
This is the last significant bug in the new PM's always inliner I've
found (so far).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290557 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 23:43:27 +00:00
Mehdi Amini
390d667cee [doc] Add mention of the difference in optimization level between Release and RelWithDebInfo in Cmake.rst
This is surprising to many people.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290556 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 23:42:12 +00:00
Chandler Carruth
5c40bafcc7 [ADT] Add an llvm::erase_if utility to make the standard erase+remove_if
pattern easier to write.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290555 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 23:30:44 +00:00
Simon Pilgrim
915b45f09f [InstCombine][X86] Add DemandedElts support for PMULDQ/PMULUDQ instructions
PMULDQ/PMULUDQ vXi64 instructions only use the even numbered v2Xi32 input elements which SimplifyDemandedVectorElts should try and use.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290554 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 23:28:17 +00:00
Chandler Carruth
85419112c1 [ADT] Add a boring std::partition wrapper similar to our std::remove_if
wrapper.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290553 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 23:10:40 +00:00
Daniel Berlin
7870484ec8 clang-format NewGVN files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290551 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 20:06:58 +00:00
Daniel Berlin
4650a04e6e Misc cleanups and simplifications for NewGVN.
Mostly use a bit more idiomatic C++ where we can,
so we can combine some things later.

Reviewers: davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290550 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 19:57:25 +00:00
Daniel Berlin
7784ce32b4 Don't use our own incorrect version of isTriviallyDeadInstruction in NewGVN. Fixes PR/31472
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 18:44:36 +00:00
Davide Italiano
2d42f75ba5 [NewGVN] Add a flag to enable the pass via -mllvm.
NewGVN can be tested passing `-mllvm -enable-newgvn` to clang.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290548 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 18:26:19 +00:00
Davide Italiano
b777bdea41 [NewGVN] Change test to reflect difference between GVN and NewGVN.
The current GVN algorithm folds unconditional branches to, it claims,
expose more PRE oportunities. The folding, if really needed,
(which is not sure, as it's not really proved it improves analysis)
can be done by an earlier cleanup pass instead of GVN itself.
Ack'ed/SGTM'd by Daniel Berlin.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290546 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 18:10:09 +00:00
Simon Pilgrim
355b26ba86 Wdocumentation fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290545 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 17:48:19 +00:00
Simon Pilgrim
857b60cc8b [X86][AVX512] Added v64i8 reverse shuffle test (PR31470)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290544 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 17:38:58 +00:00
Davide Italiano
1597cd40ac [NewGVN] Fold lookupOperandLeader() when there's only one use. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290543 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 16:19:34 +00:00
Bryant Wong
5825ccc67d [InstCombiner] Simplify lib calls to round{,f}
Differential Revision: https://reviews.llvm.org/D28110

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290542 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 14:29:29 +00:00
Chandler Carruth
28c1ee71f3 Test the different scenarios of GlobalDCE and comdats more
systematically and document in the test what all is going on.

This replaces the PR-named test that was the only coverage for GlobalDCE
and comdats previously. I wrote this because I wasn't certain how
comdat DCE was supposed to work and wanted to step through what
GlobalDCE did to fully understand it. After talking to folks and reading
the code and really staring at things it all makes sense but it seemed
good to help write down some of this in a more explicit and fully
covering test case.

For example, it seemed like a bug that GlobalDCE didn't consider comdat
participation of ifuncs. Specifically it seemed like an accident because
testing didn't really cover that case. But in fact, ifuncs specifically
cannot participate in a comdat despite having that API. The new test
case covers this and explicitly documents that DCE gets to fire here
even though there are comdats involved.

Also, we didn't have any positive tests for the challenging cases such
as usage cycles between comdat participants that might make them seem
alive except that there is no external edge into the cycle.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290537 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 08:54:01 +00:00
Craig Topper
02926157aa [AVX-512] Fix some patterns to use extended register classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290536 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 07:26:07 +00:00
Craig Topper
a7c4539a02 [AVX-512][InstCombine] Teach InstCombine to turn scalar add/sub/mul/div with rounding intrinsics into normal IR operations if the rounding mode is CUR_DIRECTION.
Summary:
I only do this for unmasked cases for now because isel is failing to fold the mask. I'll try to fix that soon.

I'll do the same thing for packed add/sub/mul/div in a future patch.

Reviewers: delena, RKSimon, zvi, craig.topper

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290535 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 06:33:19 +00:00
Craig Topper
ebe631e071 [AVX-512] Don't assume that the rounding mode argument to intrinsics is a constant. While clang will guarantee this, nothing in the backend will.
A non-constant value will now result in an isel error instead of just asserting or crashing due to a bad cast during lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290532 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 01:40:17 +00:00
Chandler Carruth
379e0ca4b8 Fix some bad indentation that I or another introduced somehow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290531 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 01:20:59 +00:00
Craig Topper
e6e82fb3ab [AVX-512][InstCombine] Teach InstCombine to converted masked vpermv intrinsics into shufflevector instructions
Summary:
This patch adds support for converting the masked vpermv intrinsics into shufflevector instructions if the indices are constants.

We also need to wrap a select instruction around the shuffle to take care of the masking part. InstCombine will take care of optimizing the select if the mask is constant so I didn't bother checking for that.

Reviewers: zvi, delena, spatel, RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290530 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 23:58:57 +00:00
Bryant Wong
efdef29733 Fix update_test_checks.py bug that incorrectly truncates IR body.
Differential Revision: https://reviews.llvm.org/D26619

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290529 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 23:46:55 +00:00
Chandler Carruth
1e976309c1 [ADT] Add a generic concatenating iterator and range (take 2).
This recommits r290512 that was reverted when MSVC failed to compile it. Since
then I've played with various approaches using rextester.com (where I was able
to reproduce the failure) and think that I have a solution thanks in part to
the help of Dave Blaikie! It seems MSVC just has a defective `decltype` in this
version. Manually writing out the type seems to do the trick, even though it is
.... quite complicated.

Original commit message:
This allows both defining convenience iterator/range accessors on types
which walk across N different independent ranges within the object, and
more direct and simple usages with range based for loops such as shown
in the unittest. The same facilities are used for both. They end up
quite small and simple as it happens.

I've also switched an iterator on `Module` to use this. I would like to
add another convenience iterator that includes even more sequences as
part of it and seeing this one already present motivated me to actually
abstract it away and introduce a general utility.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290528 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 23:41:14 +00:00
Bryant Wong
5b27f1a97f [MemorySSA] Define a restricted upward AccessList splice.
Differential Revision: https://reviews.llvm.org/D26661

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290527 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 23:34:07 +00:00
Bryant Wong
f7285121c8 [AliasAnalysis] Teach BasicAA about memcpy.
Differential Revision: https://reviews.llvm.org/D27034

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290526 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 22:42:27 +00:00
Daniel Berlin
21fb5a7f8d Value number stores and memory states so we can detect when memory states are equivalent (IE store of same value to memory).
Reviewers: davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290525 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 22:23:49 +00:00
Daniel Berlin
c6e5fa688a Rename GVNExpression *ops_ members to *op_* to match conventions in the rest of LLVM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290524 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 22:10:37 +00:00
Lang Hames
6cc32b3b42 [Orc][RPC] Add a ParallelCallGroup utility for dispatching and waiting on
multiple asynchronous RPC calls.

ParallelCallGroup allows multiple asynchronous calls to be dispatched,
and provides a wait method that blocks until all asynchronous calls have
been executed on the remote and all return value handlers run on the
local machine.

This will allow, for example, the JIT client to issue memory allocation calls
for all sections in parallel, then block until all memory has been allocated
on the remote and the allocated addresses registered with the client, at which
point the JIT client can proceed to applying relocations.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290523 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 21:55:05 +00:00
Lang Hames
45372538ae [Orc][RPC] Clang-format RPCUtils header.
Some of the recent RPC call type-checking changes weren't formatted prior to
commit.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290520 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 19:55:59 +00:00
Greg Clayton
9ac1183f9e Add newline to end of file to quiet warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290519 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 18:41:47 +00:00
Michael Zuckerman
1f4996f763 revert commit 290516
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290517 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 12:45:18 +00:00
Michael Zuckerman
e89382badb Commit try added new empty line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290516 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 12:01:34 +00:00
Amjad Aboud
4e2e80b609 [DebugInfo] Added support for Checksum debug info feature.
Differential Revision: https://reviews.llvm.org/D27642

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290514 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 10:12:09 +00:00
Chandler Carruth
43bc0ecc82 Revert r290512: [ADT] Add a generic concatenating iterator and range.
This code doesn't work on MSVC for reasons that elude me and I've not
yet covinced a workaround to compile cleanly so reverting for now while
I play with it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290513 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 09:36:24 +00:00
Chandler Carruth
ffd2617d2d [ADT] Add a generic concatenating iterator and range.
This allows both defining convenience iterator/range accessors on types
which walk across N different independent ranges within the object, and
more direct and simple usages with range based for loops such as shown
in the unittest. The same facilities are used for both. They end up
quite small and simple as it happens.

I've also switched an iterator on `Module` to use this. I would like to
add another convenience iterator that includes even more sequences as
part of it and seeing this one already present motivated me to actually
abstract it away and introduce a general utility.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290512 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 08:22:50 +00:00
Mehdi Amini
3116661386 MetadataLoader: replace the tracking of ForwardReferences and UnresolvedNodes with a set-based solution (NFC)
This makes it explicit what is the exact list to handle, and it
looks much more easy to manipulate and understand that the
previous custom tracking of min/max to express the range where
to look for.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290507 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 04:22:54 +00:00
Mehdi Amini
172025bbab MetadataLoader: add an extra assertion in Placeholders flush (NFC)
We don't expect any forward reference at this point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290506 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 03:55:53 +00:00
Daniel Berlin
f8f8d10eb0 Add range iterator for blocks in MemoryPhi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290504 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 21:52:10 +00:00
Simon Pilgrim
8ebe3e8df4 [InstCombine][X86] Add tests showing missed opportunities to simplify PMULUDQ/PMULDQ inputs.
PMULUDQ/PMULDQ - only the even elements (0, 2, 4, 6) of the vXi32 inputs are required.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 17:30:19 +00:00
Bryant Wong
8830eb8360 Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 17:26:38 +00:00
Davide Italiano
b9072a62d0 [NewGVN] Prefer auto to explicit type when the latter is obvious.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290499 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 17:17:21 +00:00
Davide Italiano
65b85989f6 [NewGVN] Simplify several equals() member functions. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290498 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 17:14:19 +00:00
Davide Italiano
2e0351ada9 [PM] Remove vestiges of NoAA. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290496 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 16:14:05 +00:00
Ed Maste
82c36cf6c5 llvm-objdump: sort phdr type strings in advance of adding new ones
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290494 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 14:53:45 +00:00
Simon Pilgrim
a3ff10f4aa [SelectionDAG] Early out from computeKnownBits when we know we will have no common bits.
Avoid extra (recursive) calls to computeKnownBits if we already know that there are no common known bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290490 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 12:59:35 +00:00
Chandler Carruth
356e45bf08 [PM] Try to improve the comments here to make what's going on more
clear.

Based on post-commit review suggestion from Sean. (Thanks!)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290488 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 05:11:17 +00:00
Daniel Berlin
d49f798558 Mark isOnlyReachableViaThisEdge as const
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290468 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 00:04:07 +00:00
Mehdi Amini
65dbfb31c8 Add an assertion for cl::opt names: they can't start with '-'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290467 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-23 23:55:26 +00:00
Mehdi Amini
8e3d0e728e llvm-size: remove leading dash in '-radix' option
cl::opt does not accept such option

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290466 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-23 23:55:08 +00:00
Mehdi Amini
5142beb6ca llvm-readobj: remove leading dash in '-a' option (ARMAttributesShort)
cl::opt does not accept such option

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290465 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-23 23:54:52 +00:00