]> granicus.if.org Git - llvm/log
llvm
8 years ago[Hexagon] Fix lowering of formal arguments of type i1
Krzysztof Parzyszek [Wed, 1 Mar 2017 17:30:10 +0000 (17:30 +0000)]
[Hexagon] Fix lowering of formal arguments of type i1

On Hexagon, values of type i1 are passed in registers of type i32,
even though i1 is not a legal value for these registers. This is a
special case and needs special handling to maintain consistency of
the lowering information.

This fixes PR32089.

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

8 years ago[PDB] Re-add BinaryStreamTest.
Zachary Turner [Wed, 1 Mar 2017 17:22:36 +0000 (17:22 +0000)]
[PDB] Re-add BinaryStreamTest.

This re-adds all the binary stream tests.  This was reverted due
to some misaligned reads.  For now the offending test is
disabled while I investigate.

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

8 years ago[GVNHoist] Don't hoist unsafe scalars at -Oz (PR31729)
Hans Wennborg [Wed, 1 Mar 2017 17:15:08 +0000 (17:15 +0000)]
[GVNHoist] Don't hoist unsafe scalars at -Oz (PR31729)

Based on Aditya Kumar's patch:

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

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

8 years agoRemove unittests/DebugInfo/PDB/BinaryStreamTest.cpp (from r296555)
Vedant Kumar [Wed, 1 Mar 2017 17:10:03 +0000 (17:10 +0000)]
Remove unittests/DebugInfo/PDB/BinaryStreamTest.cpp (from r296555)

It breaks the ToT UBSan bots:

/Users/vk/Desktop/llvm/include/llvm/DebugInfo/MSF/BinaryStreamArray.h:246:12: runtime error: reference binding to misaligned address 0x7f925540939a for type 'const int', which requires 4 byte alignment
0x7f925540939a: note: pointer points here
 05 00  00 00 01 00 00 00 02 00  00 00 03 00 00 00 00 00  00 00 00 00 00 00 00 00  70 98 50 06 01 00
              ^
0  DebugInfoPDBTests                   0x0000000106263cbd llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 45
1  DebugInfoPDBTests                   0x00000001062628ff llvm::sys::RunSignalHandlers() + 159
2  DebugInfoPDBTests                   0x0000000106264593 SignalHandler(int) + 179
3  libsystem_platform.dylib            0x0000000107bb3fba _sigtramp + 26
4  libsystem_pthread.dylib             0x0000000107bd82c8 _pthread_keys + 9720
5  libsystem_c.dylib                   0x0000000107947f83 abort + 127
6  libclang_rt.ubsan_osx_dynamic.dylib 0x0000000106bb5fc2 __sanitizer::Abort() + 66
7  DebugInfoPDBTests                   0x000000010613f880 llvm::FixedStreamArrayIterator<int>::operator+=(long) + 0
8  DebugInfoPDBTests                   0x000000010613f615 llvm::FixedStreamArrayIterator<int>::operator*() const + 37
9  DebugInfoPDBTests                   0x000000010613f3cb std::__1::enable_if<__is_forward_iterator<llvm::FixedStreamArrayIterator<int> >::value, void>::type std::__1::vector<int, std::__1::allocator<int> >::__construct_at_end<llvm::FixedStreamArrayIterator<int> >(llvm::FixedStreamArrayIterator<int>, llvm::FixedStreamArrayIterator<int>, unsigned long) + 251
10 DebugInfoPDBTests                   0x000000010613f292 std::__1::vector<int, std::__1::allocator<int> >::vector<llvm::FixedStreamArrayIterator<int> >(llvm::FixedStreamArrayIterator<int>, std::__1::enable_if<(__is_forward_iterator<llvm::FixedStreamArrayIterator<int> >::value) && (is_constructible<int, std::__1::iterator_traits<llvm::FixedStreamArrayIterator<int> >::reference>::value), llvm::FixedStreamArrayIterator<int> >::type) + 226
11 DebugInfoPDBTests                   0x000000010613ddb7 std::__1::vector<int, std::__1::allocator<int> >::vector<llvm::FixedStreamArrayIterator<int> >(llvm::FixedStreamArrayIterator<int>, std::__1::enable_if<(__is_forward_iterator<llvm::FixedStreamArrayIterator<int> >::value) && (is_constructible<int, std::__1::iterator_traits<llvm::FixedStreamArrayIterator<int> >::reference>::value), llvm::FixedStreamArrayIterator<int> >::type) + 87
12 DebugInfoPDBTests                   0x000000010613d4af (anonymous namespace)::BinaryStreamTest_StreamReaderIntegerArray_Test::TestBody() + 1279
13 DebugInfoPDBTests                   0x00000001062780f3 testing::Test::Run() + 179
14 DebugInfoPDBTests                   0x0000000106279594 testing::TestInfo::Run() + 308
15 DebugInfoPDBTests                   0x000000010627a6a3 testing::TestCase::Run() + 307
16 DebugInfoPDBTests                   0x00000001062849d4 testing::internal::UnitTestImpl::RunAllTests() + 756
17 DebugInfoPDBTests                   0x0000000106284558 testing::UnitTest::Run() + 152
18 DebugInfoPDBTests                   0x0000000106266fa5 main + 117
19 libdyld.dylib                       0x00000001078506a5 start + 1
zsh: abort      ./unittests/DebugInfo/PDB/DebugInfoPDBTests

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

8 years ago[PDB] Remove use of std error codes.
Zachary Turner [Wed, 1 Mar 2017 17:02:41 +0000 (17:02 +0000)]
[PDB] Remove use of std error codes.

I already created a BinaryStreamError class for this purpose,
so update the code to use that on the remaining occurrences
of errc values.

This should also address the issue which led to r296583.

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

8 years agoclang-format r296631
Diana Picus [Wed, 1 Mar 2017 15:54:21 +0000 (15:54 +0000)]
clang-format r296631

Apparently I forgot to run it after fixing up some things...

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

8 years ago[ARM] GlobalISel: Lower call params that need extensions
Diana Picus [Wed, 1 Mar 2017 15:35:14 +0000 (15:35 +0000)]
[ARM] GlobalISel: Lower call params that need extensions

Lower i1, i8 and i16 call parameters by extending them before storing them on
the stack. Also make sure we encode the correct, extended size in the
corresponding memory operand, and that we compute the correct stack size in the
end.

The latter is a bit more complicated because we used to compute the stack size
in the getStackAddress method, based on the Size and Offset of the parameters.
However, if the last parameter is sign extended, we'd be using the wrong,
non-extended size, and we'd end up with a smaller stack than we need to hold the
extended value. Instead of hacking this up based on the value of Size in
getStackAddress, we move our stack size handling logic to assignArg, where we
have access to the CCState which knows everything we could possibly want to know
about the stack. This way we don't need to duplicate any knowledge or resort to
any ugly hacks.

On this same occasion, update the IRTranslator test to check the sizes of the
stores everywhere, not just for sign extended paramteres.

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

8 years ago[x86] auto-generate checks; NFC
Sanjay Patel [Wed, 1 Mar 2017 14:46:59 +0000 (14:46 +0000)]
[x86] auto-generate checks; NFC

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

8 years ago[x86] regenerate checks; NFC
Sanjay Patel [Wed, 1 Mar 2017 14:41:57 +0000 (14:41 +0000)]
[x86] regenerate checks; NFC

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

8 years ago[DeadStoreElimination] Check function modref behavior before considering memory clobbered
Igor Laevsky [Wed, 1 Mar 2017 14:38:29 +0000 (14:38 +0000)]
[DeadStoreElimination] Check function modref behavior before considering memory clobbered

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

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

8 years ago[mips] Drop unneeded REQUIRES line in test. NFCI
Simon Dardis [Wed, 1 Mar 2017 14:31:09 +0000 (14:31 +0000)]
[mips] Drop unneeded REQUIRES line in test. NFCI

rL296111 provides the proper fix.

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

8 years ago[PPC] add tests for select-of-constants with binop; NFC
Sanjay Patel [Wed, 1 Mar 2017 14:26:49 +0000 (14:26 +0000)]
[PPC] add tests for select-of-constants with binop; NFC

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

8 years ago[BasicAA] Take attributes into account when requesting modref info for a call site
Igor Laevsky [Wed, 1 Mar 2017 13:19:51 +0000 (13:19 +0000)]
[BasicAA] Take attributes into account when requesting modref info for a call site

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

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

8 years ago[SLP] Preserve IR flags when vectorizing horizontal reductions.
Alexey Bataev [Wed, 1 Mar 2017 12:43:39 +0000 (12:43 +0000)]
[SLP] Preserve IR flags when vectorizing horizontal reductions.

Summary:
The SLP vectorizer should propagate IR-level optimization hints/flags
(nsw, nuw, exact, fast-math) when converting scalar horizontal
reductions instructions into vectors, just like for other vectorized
instructions.
It doe not include IR propagation for extra arguments, we need to handle
original scalar operations for extra args to propagate correct flags.

Reviewers: mkuper, mzolotukhin, hfinkel

Subscribers: llvm-commits

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

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

8 years ago[SLP] Preserve IR flags for extra args.
Alexey Bataev [Wed, 1 Mar 2017 12:22:33 +0000 (12:22 +0000)]
[SLP] Preserve IR flags for extra args.

Summary:
We should preserve IR flags for extra args. These IR flags should be
taken from original scalar operations, not from the reduction
operations.

Reviewers: mkuper, mzolotukhin, hfinkel

Subscribers: llvm-commits

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

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

8 years ago[ARM] Fix bash-ism in test
Oliver Stannard [Wed, 1 Mar 2017 11:11:06 +0000 (11:11 +0000)]
[ARM] Fix bash-ism in test

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

8 years ago[ARM] Fix parsing of special register masks
Oliver Stannard [Wed, 1 Mar 2017 10:51:04 +0000 (10:51 +0000)]
[ARM] Fix parsing of special register masks

This parsing code was incorrectly checking for invalid characters, so an
invalid instruction like:
  msr spsr_w, r0
would be emitted as:
  msr spsr_cxsf, r0

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

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

8 years ago[SLP] Fix for PR32038: extra add of PHI node when it is not required.
Alexey Bataev [Wed, 1 Mar 2017 10:50:44 +0000 (10:50 +0000)]
[SLP] Fix for PR32038: extra add of PHI node when it is not required.

Summary:
If horizontal reduction tree starts from the binary operation that is
used in PHI node, but this PHI is not used in horizontal reduction, we
may end up with extra addition of this PHI node after vectorization.
Here is an example:
```
%phi = phi i32 [ %tmp, %end], ...
...
%tmp = add i32 %tmp1, %tmp2
end:
```
after vectorization we always have something like:

```
%phi = phi i32 [ %tmp, %end], ...
...
%red = extractelement <8 x 32> %vec.red, 0
%tmp = add i32 %red, %phi
end:
```
even if `%phi` is not used in reduction tree. Patch considers these PHI
nodes as extra arguments and considers them in the final result iff they
really used in reduction.

Reviewers: mkuper, hfinkel, mzolotukhin

Subscribers: llvm-commits

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

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

8 years ago[X86] Fix creating vreg def after use.
Ayman Musa [Wed, 1 Mar 2017 10:20:48 +0000 (10:20 +0000)]
[X86] Fix creating vreg def after use.

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

8 years agoProcess tilde in llvm::sys::path::native
Serge Pavlov [Wed, 1 Mar 2017 09:38:15 +0000 (09:38 +0000)]
Process tilde in llvm::sys::path::native

Windows does not treat `~` as a reference to home directory, so the call
to `llvm::sys::path::native` on, say, `~/somedir` produces `~\somedir`,
which has different meaning than the original path. With this change
tilde is expanded on Windows to user profile directory. Such behavior
keeps original meaning of the path and is consistent with the algorithm
of `llvm::sys::path::home_directory`.

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

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

8 years agoRemove sometimes faulty rewrite of memcpy in instcombine.
Mikael Holmen [Wed, 1 Mar 2017 06:45:20 +0000 (06:45 +0000)]
Remove sometimes faulty rewrite of memcpy in instcombine.

Summary:
Solves PR 31990.

The bad rewrite could replace a memcpy of one word with
 store i4 -1
while it should actually be
 store i8 -1

Hopefully opt and llc has improved enough so the original optimization
done by the code isn't needed anymore.

One already existing testcase is affected. It originally tested that
the memcpy was replaced with
 load double
but since we now remove that rewrite it will be
 load i64
instead.

Patch suggestion by Eli Friedman.

Reviewers: eli.friedman, majnemer, efriedma

Reviewed By: efriedma

Subscribers: efriedma, llvm-commits

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

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

8 years ago(Rewroking r296581) PDB/BinaryStreamTest.cpp: Appease mingw to avoid std::errc::no_bu...
NAKAMURA Takumi [Wed, 1 Mar 2017 05:11:41 +0000 (05:11 +0000)]
(Rewroking r296581) PDB/BinaryStreamTest.cpp: Appease mingw to avoid std::errc::no_buffer_space.

Unfortunately, mingw's libstdc++ doesn't provide winsock2 errors.
That said, we should avoid raising OS-oriented error code in our code.

For now, I suggest to define custom error from std::error_category.
See also; https://reviews.llvm.org/D20592

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

8 years agoRevert r296581, "PDB/BinaryStreamTest.cpp: Appease mingw to avoid std::errc::no_buffe...
NAKAMURA Takumi [Wed, 1 Mar 2017 05:11:37 +0000 (05:11 +0000)]
Revert r296581, "PDB/BinaryStreamTest.cpp: Appease mingw to avoid std::errc::no_buffer_space."

Wrong commit -- I have unstaged changes.

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

8 years agoPDB/BinaryStreamTest.cpp: Appease mingw to avoid std::errc::no_buffer_space.
NAKAMURA Takumi [Wed, 1 Mar 2017 05:06:31 +0000 (05:06 +0000)]
PDB/BinaryStreamTest.cpp: Appease mingw to avoid std::errc::no_buffer_space.

Unfortunately, mingw's libstdc++ doesn't provide winsock2 errors.
That said, we should avoid raising OS-oriented error code in our code.

For now, I suggest to define custom error from std::error_category.
See also; https://reviews.llvm.org/D20592

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

8 years ago[LV] These remark should have been missed remarks
Adam Nemet [Wed, 1 Mar 2017 04:31:15 +0000 (04:31 +0000)]
[LV] These remark should have been missed remarks

The practice in LV is that we emit analysis remarks and then finally report
either a missed or applied remark on the final decision whether vectorization
is taking place.  On this code path, we were closing with an analysis remark.

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

8 years ago[SLP] Fixes the bug due to absence of in order uses of scalars which needs to be...
Mohammad Shahid [Wed, 1 Mar 2017 03:51:54 +0000 (03:51 +0000)]
[SLP] Fixes the bug due to absence of in order uses of scalars which needs to be available
for VectorizeTree() API.This API uses it for proper mask computation to be used in shufflevector IR.
The fix is to compute the mask for out of order memory accesses while building the vectorizable tree
instead of actual vectorization of vectorizable tree.

Reviewers: mkuper

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

Change-Id: Id1e287f073fa4959713ba545fa4254db5da8b40d

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

8 years agoAMDGPU: Re-do update for branch-relaxation test
Matt Arsenault [Wed, 1 Mar 2017 03:36:04 +0000 (03:36 +0000)]
AMDGPU: Re-do update for branch-relaxation test

Modify the test so that it is still testing something
closer to what it was intended to originally.

I think the original intent was to test the situation where
there was a branch on execz and then unconditional branch
required relaxing.With the change in r296539,
there was no longer and execz branch.

Change the test so that there is now an execz branch inserted.
There is no longer an unconditional branch after the execz branch,
so this might need to be tricked in some other way to keep that
there.

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

8 years agoclang-format GenericDomTreeConstruction.h, since the current formatting makes it...
Daniel Berlin [Wed, 1 Mar 2017 02:50:46 +0000 (02:50 +0000)]
clang-format GenericDomTreeConstruction.h, since the current formatting makes it look like their is a bug in the loop indentation, and there is not

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

8 years agoOnly run the overloaded-intrinsic-name.ll test once, with FileCheck.
Daniel Berlin [Wed, 1 Mar 2017 01:56:41 +0000 (01:56 +0000)]
Only run the overloaded-intrinsic-name.ll test once, with FileCheck.

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

8 years agoKeep attributes, calling convention, etc, when remangling intrinsic
Daniel Berlin [Wed, 1 Mar 2017 01:49:13 +0000 (01:49 +0000)]
Keep attributes, calling convention, etc, when remangling intrinsic

Summary: Fix issue reported where intrinsic calling convention is dropped after r295253.

Reviewers: sanjoy

Subscribers: materi, llvm-commits

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

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

8 years agoMove constexpr arrays out of class definition.
Zachary Turner [Wed, 1 Mar 2017 01:17:31 +0000 (01:17 +0000)]
Move constexpr arrays out of class definition.

GCC Linker doesn't seem to like this.

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

8 years ago[DebugInfo] Fix some Include What You Use warnings; other minor fixes (NFC).
Eugene Zelenko [Wed, 1 Mar 2017 01:14:23 +0000 (01:14 +0000)]
[DebugInfo] Fix some Include What You Use warnings; other minor fixes (NFC).

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

8 years agoFix signed / unsigned comparison warning.
Zachary Turner [Wed, 1 Mar 2017 01:07:10 +0000 (01:07 +0000)]
Fix signed / unsigned comparison warning.

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

8 years ago[PDB] Add an additional test for BinaryStreamRef.
Zachary Turner [Wed, 1 Mar 2017 01:04:16 +0000 (01:04 +0000)]
[PDB] Add an additional test for BinaryStreamRef.

A bug was uncovered where if you have a StreamRef whose ViewOffset
is > 0, then when you call readLongestContiguousChunk it will
succeed even when it shouldn't, and it always return you a
buffer that was taken as if the ViewOffset was 0.

Fixed this bug and added a test for it.

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

8 years ago[PDB] Add tests for BinaryStream.
Zachary Turner [Wed, 1 Mar 2017 01:03:53 +0000 (01:03 +0000)]
[PDB] Add tests for BinaryStream.

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

8 years ago[opt-viewer] Suggest installing the faster parser (libYAML)
Adam Nemet [Wed, 1 Mar 2017 00:54:40 +0000 (00:54 +0000)]
[opt-viewer] Suggest installing the faster parser (libYAML)

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

8 years ago[CodeGen] Remove dead FastISel code after SDAG emitted a tailcall.
Ahmed Bougacha [Wed, 1 Mar 2017 00:43:42 +0000 (00:43 +0000)]
[CodeGen] Remove dead FastISel code after SDAG emitted a tailcall.

When SDAGISel (top-down) selects a tail-call, it skips the remainder
of the block.

If, before that, FastISel (bottom-up) selected some of the (no-op) next
few instructions, we can end up with dead instructions following the
terminator (selected by SDAGISel).

We need to erase them, as we know they aren't necessary (in addition to
being incorrect).

We already do this when FastISel falls back on the tail-call itself.
Also remove the FastISel-emitted code if we fallback on the
instructions between the tail-call and the return.

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

8 years ago[GlobalISel] Replace all combined G_EXTRACT uses.
Ahmed Bougacha [Wed, 1 Mar 2017 00:43:39 +0000 (00:43 +0000)]
[GlobalISel] Replace all combined G_EXTRACT uses.

Iterating on the use-list we're modifying doesn't work: after the first
iteration, the use-list iterator will point to a MachineOperand
referencing the new register.  This caused us to skip the other uses to
replace.

Instead, use MRI.replaceRegWith(), which accounts for this behavior.

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

8 years agoAdd missing module/license header. NFC.
Paul Robinson [Wed, 1 Mar 2017 00:14:42 +0000 (00:14 +0000)]
Add missing module/license header. NFC.

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

8 years ago[opt-viewer] Handle column number 0
Adam Nemet [Tue, 28 Feb 2017 23:59:46 +0000 (23:59 +0000)]
[opt-viewer] Handle column number 0

The asm-printer now emits remarks with function location which have
unspecified (0) source column number.

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

8 years agoRevert "(HEAD, origin/master, origin/HEAD, master) [LV] These should missed remarks"
Adam Nemet [Tue, 28 Feb 2017 23:54:27 +0000 (23:54 +0000)]
Revert "(HEAD, origin/master, origin/HEAD, master) [LV] These should missed remarks"

This reverts commit r296544.

This got committed by accident.

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

8 years ago[LV] These should missed remarks
Adam Nemet [Tue, 28 Feb 2017 23:48:58 +0000 (23:48 +0000)]
[LV] These should missed remarks

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

8 years agoTeach the IR verifier to reject conflicting debug info for function arguments.
Adrian Prantl [Tue, 28 Feb 2017 23:48:42 +0000 (23:48 +0000)]
Teach the IR verifier to reject conflicting debug info for function arguments.

Conflicting debug info for function arguments causes hard-to-debug
assertions in the DWARF backend, so the Verifier should reject it.
For performance reasons this only checks function arguments from
non-inlined debug intrinsics for now.

rdar://problem/30520286

This reapplies r295749 after fixing PR32042.

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

8 years ago[DWARFv5] llvm-mc support for new unit header.
Paul Robinson [Tue, 28 Feb 2017 23:40:46 +0000 (23:40 +0000)]
[DWARFv5] llvm-mc support for new unit header.

This is for running the assembler with -g (to emit DWARF describing
the assembler source).

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

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

8 years ago[WebAssembly] Convert the remaining unit tests to the new wasm-object-file target.
Dan Gohman [Tue, 28 Feb 2017 23:37:04 +0000 (23:37 +0000)]
[WebAssembly] Convert the remaining unit tests to the new wasm-object-file target.

To facilitate this, add a new hidden command-line option to disable
the explicit-locals pass. That causes llc to emit invalid code that doesn't
have all locals converted to get_local/set_local, however it simplifies
testwriting in many cases.

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

8 years agoUpdate AMDGPU test branch-relaxation.ll for changes after post-dom fixes
Daniel Berlin [Tue, 28 Feb 2017 23:35:24 +0000 (23:35 +0000)]
Update AMDGPU test branch-relaxation.ll for changes after post-dom fixes

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

8 years ago[ARM] Don't generate deprecated T1 STM.
Eli Friedman [Tue, 28 Feb 2017 23:32:55 +0000 (23:32 +0000)]
[ARM] Don't generate deprecated T1 STM.

This prevents generating stm r1!, {r0, r1} on Thumb1, where value
stored for r1 is UNKONWN.

Patch by Zhaoshi Zheng.

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

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

8 years ago[Hexagon] Generate extract instructions more aggressively
Krzysztof Parzyszek [Tue, 28 Feb 2017 23:27:33 +0000 (23:27 +0000)]
[Hexagon] Generate extract instructions more aggressively

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

8 years ago[libFuzzer] remove usage of the old coverage instrumentation
Kostya Serebryany [Tue, 28 Feb 2017 23:23:48 +0000 (23:23 +0000)]
[libFuzzer] remove usage of the old coverage instrumentation

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

8 years agoFix PR 24415 (at least), by making our post-dominator tree behavior sane.
Daniel Berlin [Tue, 28 Feb 2017 22:57:50 +0000 (22:57 +0000)]
Fix PR 24415 (at least), by making our post-dominator tree behavior sane.

Summary:
Currently, our post-dom tree tries to ignore and remove the effects of
infinite loops.  It fails miserably at this, because it tries to do it
ahead of time, and thus can only detect self-loops, and any other type
of infinite loop, it pretends doesn't exist at all.

This can, in a bunch of cases, lead to wrong answers and a completely
empty post-dom tree.

Wrong answer:

```
declare void foo()
define internal void @f() {
entry:
  br i1 undef, label %bb35, label %bb3.i

bb3.i:
  call void @foo()
  br label %bb3.i

bb35.loopexit3:
  br label %bb35

bb35:
  ret void
}
```
We get:
```
Inorder PostDominator Tree:
  [1]  <<exit node>> {0,7}
    [2] %bb35 {1,6}
      [3] %bb35.loopexit3 {2,3}
      [3] %entry {4,5}
```

This is a trivial modification of the testcase for PR 6047
Note that we pretend bb3.i doesn't exist.
We also pretend that bb35 post-dominates entry.

While it's true that it does not exit in a theoretical sense, it's not
really helpful to try to ignore the effect and pretend that bb35
post-dominates entry.  Worse, we pretend the infinite loop does
nothing (it's usually considered a side-effect), and doesn't even
exist, even when it calls a function.  Sadly, this makes it impossible
to use when you are trying to move code safely.  All compilers also
create virtual or real single exit nodes (including us), and connect
infinite loops there (which this patch does).  In fact, others have
worked around our behavior here, to the point of building their own
post-dom trees:
https://zneak.github.io/fcd/2016/02/17/structuring.html and pointing
out the region infrastructure is near-useless for them with postdom in
this state :(

Completely empty post-dom tree:
```
define void @spam() #0 {
bb:
  br label %bb1

bb1:                                              ; preds = %bb1, %bb
  br label %bb1

bb2:                                              ; No predecessors!
  ret void
}
```
Printing analysis 'Post-Dominator Tree Construction' for function 'foo':
=============================--------------------------------
Inorder PostDominator Tree:
  [1]  <<exit node>> {0,1}

:(

(note that even if you ignore the effects of infinite loops, bb2
should be present as an exit node that post-dominates nothing).

This patch changes post-dom to properly handle infinite loops and does
root finding during calculation to prevent empty tress in such cases.

We match gcc's (and the canonical theoretical) behavior for infinite
loops (find the backedge, connect it to the exit block).

Testcases coming as soon as i finish running this on a ton of random graphs :)

Reviewers: chandlerc, davide

Subscribers: bryant, llvm-commits

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

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

8 years agogold-plugin: Remove unused variable.
Peter Collingbourne [Tue, 28 Feb 2017 22:40:30 +0000 (22:40 +0000)]
gold-plugin: Remove unused variable.

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

8 years ago[Hexagon] Fix instruction selection for sign-extending i1 to i64
Krzysztof Parzyszek [Tue, 28 Feb 2017 22:37:01 +0000 (22:37 +0000)]
[Hexagon] Fix instruction selection for sign-extending i1 to i64

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

8 years ago[XRay][Docs] Update the XRay documentation
Dean Michael Berris [Tue, 28 Feb 2017 22:01:26 +0000 (22:01 +0000)]
[XRay][Docs] Update the XRay documentation

Summary:
Update the XRay docs to mention new subcomands to the llvm-xray tool,
and details on FDR mode logging. Also list down available libraries for
use part of the LLVM distribution.

Reviewers: rSerge, pelikan, echristo, timshen, sdardis, rengolin

Subscribers: mehdi_amini, llvm-commits

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

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

8 years agoActually add error handling to unpacking the dyld compact bind and
Kevin Enderby [Tue, 28 Feb 2017 21:47:07 +0000 (21:47 +0000)]
Actually add error handling to unpacking the dyld compact bind and
other tables.  Providing a helpful error message to what the error is and
where the error occurred based on which opcode it was associated with.

There have been handful of bug fixes dealing with bad bind info in
object files, r294021 and r249845, which only put a band aid on the
problem after a bad bind table was created after unpacking from
its compact info.  In these cases a bind table should have never been
created and an error should have simply been generated.

This change puts in place the plumbing to allow checking and returning
of an error when the compact info is unpacked.  This follows the model
of iterators that can fail that Lang Hanes designed when fixing the problem
for bad archives r275316 (or r275361).

This change uses one of the existing test cases that now causes an
error instead of printing <<bad library ordinal>> after a bad bind table
is created.  The error uses the offset into the opcode table as shown with
the macOS dyldinfo(1) tool to indicate where the error is and which
opcode and which parameter is in error.

For example the exiting test case has this lazy binding opcode table:

% dyldinfo -opcodes test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64
…
lazy binding opcodes:
0x0000 BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(0x02, 0x00000010)
0x0002 BIND_OPCODE_SET_DYLIB_ORDINAL_IMM(2)

In the test case the binary only has one library so setting the library
ordinal to the value of 2 in the BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
opcode at 0x0002 above is an error.  This now produces this error message:

% llvm-objdump -lazy-bind bad-ordinal.macho-x86_64
…
llvm-objdump: 'bad-ordinal.macho-x86_64': truncated or malformed object (for BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB bad library ordinal: 2 (max 1) for opcode at: 0x2)

This change provides the plumbing for the error handling and one example
of an error message.  Other error checks and test cases will be added in follow
on commits.

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

8 years agoMark some libFuzzer tests as XFAIL'd on Darwin
Mehdi Amini [Tue, 28 Feb 2017 21:45:59 +0000 (21:45 +0000)]
Mark some libFuzzer tests as XFAIL'd on Darwin

We're bringing up a bot on Green Dragon right now:

http://green.lab.llvm.org/green/view/Experimental/job/libFuzzer

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

8 years agoAMDGPU: Fix types for VOP_I16_I16_I16
Matt Arsenault [Tue, 28 Feb 2017 21:31:45 +0000 (21:31 +0000)]
AMDGPU: Fix types for VOP_I16_I16_I16

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

8 years agoAMDGPU: Add definition for v_swap_b32
Matt Arsenault [Tue, 28 Feb 2017 21:09:04 +0000 (21:09 +0000)]
AMDGPU: Add definition for v_swap_b32

This is somewhat tricky because there are two
pairs of tied operands, and it isn't allowed to be
VOP3 encoded.

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

8 years agoAMDGPU: Add definition for v_xad_u32
Matt Arsenault [Tue, 28 Feb 2017 20:27:30 +0000 (20:27 +0000)]
AMDGPU: Add definition for v_xad_u32

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

8 years ago[DWARFv5] Emit new unit header format.
Paul Robinson [Tue, 28 Feb 2017 20:24:55 +0000 (20:24 +0000)]
[DWARFv5] Emit new unit header format.

Requesting DWARF v5 will now get you the new compile-unit and
type-unit headers.  llvm-dwarfdump will also recognize them.

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

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

8 years agoAMDGPU: Add ds_nop to assembler
Matt Arsenault [Tue, 28 Feb 2017 20:15:46 +0000 (20:15 +0000)]
AMDGPU: Add ds_nop to assembler

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

8 years agoAMDGPU: Add definitions for ds_{read|write}_b{96|128}
Matt Arsenault [Tue, 28 Feb 2017 20:15:43 +0000 (20:15 +0000)]
AMDGPU: Add definitions for ds_{read|write}_b{96|128}

It's not clear to me if this is always better than
doing ds_write2_b64 This adds the constraint of
a 128-bit register input instead of a pair of
64-bit.

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

8 years ago[AMDGPU] Add second pass of the scheduler
Stanislav Mekhanoshin [Tue, 28 Feb 2017 19:20:33 +0000 (19:20 +0000)]
[AMDGPU] Add second pass of the scheduler

If during scheduling we have identified that we cannot keep optimistic
occupancy increase critical register pressure limit and try scheduling
of the whole function again. In this case blocks with smaller pressure
will have a chance for better scheduling.

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

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

8 years ago[DAGCombiner] use dyn_cast values in foldSelectOfConstants(); NFC
Sanjay Patel [Tue, 28 Feb 2017 18:41:49 +0000 (18:41 +0000)]
[DAGCombiner] use dyn_cast values in foldSelectOfConstants(); NFC

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

8 years agoFix -Wcovered-switch-default warning.
Zachary Turner [Tue, 28 Feb 2017 18:35:40 +0000 (18:35 +0000)]
Fix -Wcovered-switch-default warning.

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

8 years ago[LCG] Fix EXPENSIVE_CHECKS typo. NFC
Francis Visoiu Mistrih [Tue, 28 Feb 2017 18:34:55 +0000 (18:34 +0000)]
[LCG] Fix EXPENSIVE_CHECKS typo. NFC

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

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

8 years agoAdd function importing info from samplepgo profile to the module summary.
Dehao Chen [Tue, 28 Feb 2017 18:09:44 +0000 (18:09 +0000)]
Add function importing info from samplepgo profile to the module summary.

Summary: For SamplePGO, the profile may contain cross-module inline stacks. As we need to make sure the profile annotation happens when all the hot inline stacks are expanded, we need to pass this info to the module importer so that it can import proper functions if necessary. This patch implemented this feature by emitting cross-module targets as part of function entry metadata. In the module-summary phase, the metadata is used to build call edges that points to functions need to be imported.

Reviewers: mehdi_amini, tejohnson

Reviewed By: tejohnson

Subscribers: davidxl, llvm-commits

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

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

8 years agoWorkaround MSVC bug when using TrailingObjects from a template.
James Y Knight [Tue, 28 Feb 2017 18:05:41 +0000 (18:05 +0000)]
Workaround MSVC bug when using TrailingObjects from a template.

MSVC appears to be getting confused as to whether OverloadToken is
supposed to be public or not.

This was discovered by code in Swift, and has been reported to
microsoft by hughbe:
https://connect.microsoft.com/VisualStudio/feedback/details/3116517

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

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

8 years ago[x86] add alternate IR tests for select of constants; NFC
Sanjay Patel [Tue, 28 Feb 2017 18:02:38 +0000 (18:02 +0000)]
[x86] add alternate IR tests for select of constants; NFC

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

8 years ago[PDB] Add BinaryStreamError.
Zachary Turner [Tue, 28 Feb 2017 17:49:34 +0000 (17:49 +0000)]
[PDB] Add BinaryStreamError.

This migrates the stream code away from MSFError to using its
own custom Error class.

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

8 years agoSet default CPU for OpenBSD/arm to Cortex-A8
Brad Smith [Tue, 28 Feb 2017 17:28:35 +0000 (17:28 +0000)]
Set default CPU for OpenBSD/arm to Cortex-A8

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

8 years agoFix issue with test case. Make test x86_64 specific
David Bozier [Tue, 28 Feb 2017 17:25:38 +0000 (17:25 +0000)]
Fix issue with test case. Make test x86_64 specific

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

8 years ago[AMDGPU] New method to estimate register pressure
Stanislav Mekhanoshin [Tue, 28 Feb 2017 17:22:39 +0000 (17:22 +0000)]
[AMDGPU] New method to estimate register pressure

This change introduces new method to estimate register pressure in
GCNScheduler. Standard RPTracker gives huge error due to the following
reasons:

1. It does not account for live-ins or live-outs if value is not used
in the region itself. That creates a huge error in a very common case
if there are a lot of live-thu registers.
2. It does not properly count subregs.
3. It assumes a register used as an input operand can be reused as an
output. This is not always possible by itself, this is not what RA
will finally do in many cases for various reasons not limited to RA's
inability to do so, and this is not so if the value is actually a
live-thu.

In addition we can now see clear separation between live-in pressure
which we cannot change with the scheduling and tentative pressure
which we can change.

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

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

8 years ago[AMDGPU] Change amd_kernel_code_t's minor version to 1
Konstantin Zhuravlyov [Tue, 28 Feb 2017 17:17:52 +0000 (17:17 +0000)]
[AMDGPU] Change amd_kernel_code_t's minor version to 1
  - We do emit amd_kernel_code_t v1.1

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

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

8 years agoStrip debug info when inlining into a nodebug function.
Adrian Prantl [Tue, 28 Feb 2017 16:58:13 +0000 (16:58 +0000)]
Strip debug info when inlining into a nodebug function.

The LLVM backend cannot produce any debug info for an llvm::Function
without a DISubprogram attachment. When inlining a debug-info-carrying
function into a nodebug function, there is therefore no reason to keep
any debug info intrinsic calls or debug locations on the instructions.

This fixes a problem discovered in PR32042.

rdar://problem/30679307

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

8 years ago[llvm-cov] Error-out when an unsupported format is used (PR32087)
Vedant Kumar [Tue, 28 Feb 2017 16:57:28 +0000 (16:57 +0000)]
[llvm-cov] Error-out when an unsupported format is used (PR32087)

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

8 years ago[DAGISel] When checking if chain node is foldable, make sure the intermediate nodes...
Craig Topper [Tue, 28 Feb 2017 16:52:05 +0000 (16:52 +0000)]
[DAGISel] When checking if chain node is foldable, make sure the intermediate nodes have a single use across all results not just the result that was used to reach the chain node.

This recovers a test case that was severely broken by r296476, my making sure we don't create ADD/ADC that loads and stores when there is also a flag dependency.

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

8 years ago[AMDGPU] Fix read-undef flags when schedule is reverted
Stanislav Mekhanoshin [Tue, 28 Feb 2017 16:26:27 +0000 (16:26 +0000)]
[AMDGPU] Fix read-undef flags when schedule is reverted

If two subregs of the same register are defined and we need to revert
schedule changing def order, we will end up with both instructions
having def,read-undef flags because adjustLaneLiveness() will only set
this flag but will not remove it.

Fix this by removing read-undef flags before calling adjustLaneLiveness.

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

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

8 years ago[Stack Protection] Add diagnostic information for why stack protection was applied...
David Bozier [Tue, 28 Feb 2017 16:02:37 +0000 (16:02 +0000)]
[Stack Protection] Add diagnostic information for why stack protection was applied to a function

Stack Smash Protection is not completely free, so in hot code, the overhead it causes can cause performance issues. By adding diagnostic information for which functions have SSP and why, a user can quickly determine what they can do to stop SSP being applied to a specific hot function.

This change adds a remark that is reported by the stack protection code when an instruction or attribute is encountered that causes SSP to be applied.

Patch by: James Henderson

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

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

8 years ago[mips] Fix 64bit slt/sltu/nor with immediates
Simon Dardis [Tue, 28 Feb 2017 15:55:23 +0000 (15:55 +0000)]
[mips] Fix 64bit slt/sltu/nor with immediates

Patch By: Alexander Richardson

Reviewers: atanasyan, theraven, sdardis

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

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

8 years agoRevert r296474 - [globalisel] Change LLT constructor string into an LLT subclass...
Daniel Sanders [Tue, 28 Feb 2017 15:00:27 +0000 (15:00 +0000)]
Revert r296474 - [globalisel] Change LLT constructor string into an LLT subclass that knows how to generate it.

There's a circular dependency that's only revealed when LLVM_ENABLE_MODULES=1.

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

8 years agoIn visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled.
Nirav Dave [Tue, 28 Feb 2017 14:24:15 +0000 (14:24 +0000)]
In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled.

    Recommiting after fixup of 32-bit aliasing sign offset bug in DAGCombiner.

    * Simplify Consecutive Merge Store Candidate Search

    Now that address aliasing is much less conservative, push through
    simplified store merging search and chain alias analysis which only
    checks for parallel stores through the chain subgraph. This is cleaner
    as the separation of non-interfering loads/stores from the
    store-merging logic.

    When merging stores search up the chain through a single load, and
    finds all possible stores by looking down from through a load and a
    TokenFactor to all stores visited.

    This improves the quality of the output SelectionDAG and the output
    Codegen (save perhaps for some ARM cases where we correctly constructs
    wider loads, but then promotes them to float operations which appear
    but requires more expensive constant generation).

    Some minor peephole optimizations to deal with improved SubDAG shapes (listed below)

    Additional Minor Changes:

      1. Finishes removing unused AliasLoad code

      2. Unifies the chain aggregation in the merged stores across code
         paths

      3. Re-add the Store node to the worklist after calling
         SimplifyDemandedBits.

      4. Increase GatherAllAliasesMaxDepth from 6 to 18. That number is
         arbitrary, but seems sufficient to not cause regressions in
         tests.

      5. Remove Chain dependencies of Memory operations on CopyfromReg
         nodes as these are captured by data dependence

      6. Forward loads-store values through tokenfactors containing
          {CopyToReg,CopyFromReg} Values.

      7. Peephole to convert buildvector of extract_vector_elt to
         extract_subvector if possible (see
         CodeGen/AArch64/store-merge.ll)

      8. Store merging for the ARM target is restricted to 32-bit as
         some in some contexts invalid 64-bit operations are being
         generated. This can be removed once appropriate checks are
         added.

    This finishes the change Matt Arsenault started in r246307 and
    jyknight's original patch.

    Many tests required some changes as memory operations are now
    reorderable, improving load-store forwarding. One test in
    particular is worth noting:

      CodeGen/PowerPC/ppc64-align-long-double.ll - Improved load-store
      forwarding converts a load-store pair into a parallel store and
      a memory-realized bitcast of the same value. However, because we
      lose the sharing of the explicit and implicit store values we
      must create another local store. A similar transformation
      happens before SelectionDAG as well.

    Reviewers: arsenm, hfinkel, tstellarAMD, jyknight, nhaehnle

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

8 years ago[globalisel] Change LLT constructor string into an LLT subclass that knows how to...
Daniel Sanders [Tue, 28 Feb 2017 14:21:31 +0000 (14:21 +0000)]
[globalisel] Change LLT constructor string into an LLT subclass that knows how to generate it.

Summary:
This will allow future patches to inspect the details of the LLT. The implementation is now split between
the Support and CodeGen libraries to allow TableGen to use this class without introducing layering concerns.

Thanks to Ahmed Bougacha for finding a reasonable way to avoid the layering issue and providing the version of this patch without that problem.

Reviewers: t.p.northover, qcolombet, rovka, aditya_nandakumar, ab, javed.absar

Subscribers: arsenm, nhaehnle, mgorny, dberris, llvm-commits, kristof.beyls

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

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

8 years ago[ARM] GlobalISel: Lower i32 and fp call parameters on the stack
Diana Picus [Tue, 28 Feb 2017 14:17:53 +0000 (14:17 +0000)]
[ARM] GlobalISel: Lower i32 and fp call parameters on the stack

Lower i32, float and double parameters that need to live on the stack. This
boils down to creating some G_GEPs starting from the stack pointer and storing
the values there. During the process we also keep track of the stack size and
use the final value in the ADJCALLSTACKDOWN/UP instructions.

We currently assert for smaller types, since they usually require extensions.
They will be handled in a separate patch.

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

8 years ago[ARM] GlobalISel: Select 32-bit G_CONSTANT
Diana Picus [Tue, 28 Feb 2017 13:05:42 +0000 (13:05 +0000)]
[ARM] GlobalISel: Select 32-bit G_CONSTANT

Put it into a register by means of a MOVi.

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

8 years ago[ARM] GlobalISel: Add mapping for G_CONSTANT
Diana Picus [Tue, 28 Feb 2017 12:13:58 +0000 (12:13 +0000)]
[ARM] GlobalISel: Add mapping for G_CONSTANT

Like G_FRAME_INDEX, G_CONSTANT has one register operand and one non-register
operand.

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

8 years ago[ARM] GlobalISel: Legalize 32-bit constants
Diana Picus [Tue, 28 Feb 2017 11:33:46 +0000 (11:33 +0000)]
[ARM] GlobalISel: Legalize 32-bit constants

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

8 years ago[Assembler] Add test for !srcloc references in assembler diags
Sanne Wouda [Tue, 28 Feb 2017 10:34:48 +0000 (10:34 +0000)]
[Assembler] Add test for !srcloc references in assembler diags

Summary:
clang adds !srcloc metadata to inline assembly in LLVM bitcode generated
for inline assembly in C.  The value of this !srcloc is passed to the
diagnostics handler if the inline assembly generates a diagnostic.
clang is able to turn this cookie back to a location in the C source
file.

To test this functionality without a dependency, make llc print the
!srcloc metadata if it is present.  The added test uses this mechanism
to test that the correct !srclocs are passed to the diag handler.

Reviewers: rengolin, rnk, echristo, grosbach, mehdi_amini

Reviewed By: mehdi_amini

Subscribers: mehdi_amini, llvm-commits

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

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

8 years agoReformat a blank line.
NAKAMURA Takumi [Tue, 28 Feb 2017 10:15:25 +0000 (10:15 +0000)]
Reformat a blank line.

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

8 years agoRevert r296442 (and r296443), "Allow externally dlopen-ed libraries to be registered...
NAKAMURA Takumi [Tue, 28 Feb 2017 10:15:18 +0000 (10:15 +0000)]
Revert r296442 (and r296443), "Allow externally dlopen-ed libraries to be registered as permanent libraries."

It broke clang/test/Analysis/checker-plugins.c

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

8 years ago[ARM] GlobalISel: Select G_GEP
Diana Picus [Tue, 28 Feb 2017 10:14:38 +0000 (10:14 +0000)]
[ARM] GlobalISel: Select G_GEP

At this point, G_GEP is just an add, so we treat it exactly like a G_ADD.

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

8 years ago[ARM] Diagnose PC-writing instructions in IT blocks
Oliver Stannard [Tue, 28 Feb 2017 10:04:36 +0000 (10:04 +0000)]
[ARM] Diagnose PC-writing instructions in IT blocks

In Thumb2, instructions which write to the PC are UNPREDICTABLE if they are in
an IT block but not the last instruction in the block.

Previously, we only diagnosed this for LDM instructions, this patch extends the
diagnostic to cover all of the relevant instructions.

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

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

8 years ago[ARM] GlobalISel: Add reg bank mapping for G_GEP
Diana Picus [Tue, 28 Feb 2017 09:35:10 +0000 (09:35 +0000)]
[ARM] GlobalISel: Add reg bank mapping for G_GEP

This should be the same as the mapping for G_ADD etc.

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

8 years ago[ARM] GlobalISel: Legalize G_GEP with 32-bit offsets
Diana Picus [Tue, 28 Feb 2017 09:02:42 +0000 (09:02 +0000)]
[ARM] GlobalISel: Legalize G_GEP with 32-bit offsets

At the moment we're only interested in GEPs for putting call parameters on the
stack, so we'll stick to 32-bit offsets.

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

8 years agoRelate the CHECK: lines to the functions that they're checking [NFC]
Artyom Skrobov [Tue, 28 Feb 2017 08:58:40 +0000 (08:58 +0000)]
Relate the CHECK: lines to the functions that they're checking [NFC]

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

8 years agoTest commit, fix typo, NFC.
Vadzim Dambrouski [Tue, 28 Feb 2017 08:27:43 +0000 (08:27 +0000)]
Test commit, fix typo, NFC.

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

8 years ago[IR] Add range accessors for the indices of a GEP instruction.
Chandler Carruth [Tue, 28 Feb 2017 08:04:20 +0000 (08:04 +0000)]
[IR] Add range accessors for the indices of a GEP instruction.

These were noticed as missing in a code review. Add them and the boring
unit test to make sure they compile and DTRT.

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

8 years agoFix Win bots.
Vassil Vassilev [Tue, 28 Feb 2017 07:26:21 +0000 (07:26 +0000)]
Fix Win bots.

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

8 years agoAllow externally dlopen-ed libraries to be registered as permanent libraries.
Vassil Vassilev [Tue, 28 Feb 2017 07:11:59 +0000 (07:11 +0000)]
Allow externally dlopen-ed libraries to be registered as permanent libraries.

This is also useful in cases when llvm is in a shared library. First we dlopen
the llvm shared library and then we register it as a permanent library in order
to keep the JIT and other services working.

Patch reviewed by Vedant Kumar (D29955)!

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

8 years ago[ImplicitNullCheck] Add alias analysis usage
Sanjoy Das [Tue, 28 Feb 2017 07:04:49 +0000 (07:04 +0000)]
[ImplicitNullCheck] Add alias analysis usage

Summary:
With this change ImplicitNullCheck optimization uses alias analysis
and can use load/store memory access for implicit null check if there
are other load/store before but memory accesses do not alias.

Patch by Serguei Katkov!

Reviewers: sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

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

8 years agoEmpty line. NFCI
Xin Tong [Tue, 28 Feb 2017 05:30:48 +0000 (05:30 +0000)]
Empty line. NFCI

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