oota-llvm.git
8 years agoMerging r259958:
Hans Wennborg [Mon, 8 Feb 2016 22:15:55 +0000 (22:15 +0000)]
Merging r259958:
------------------------------------------------------------------------
r259958 | evandro | 2016-02-05 16:01:41 -0800 (Fri, 05 Feb 2016) | 11 lines

[AArch64] Add the scheduling model for Exynos-M1

Summary:
Add the core scheduling model for the Samsung Exynos-M1 (ARMv8-A).

Reviewers: jmolloy, rengolin, christof, MinSeongKIM, t.p.northover

Subscribers: aemerson, rengolin, MatzeB

Differential Revision: http://reviews.llvm.org/D16644
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@260156 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r259696:
Hans Wennborg [Mon, 8 Feb 2016 18:31:49 +0000 (18:31 +0000)]
Merging r259696:
------------------------------------------------------------------------
r259696 | kfischer | 2016-02-03 13:13:33 -0800 (Wed, 03 Feb 2016) | 12 lines

[DWARFDebug] Fix another case of overlapping ranges

Summary:
In r257979, I added code to ensure that we wouldn't merge DebugLocEntries if
the pieces they describe overlap. Unfortunately, I failed to cover the case,
where there may have multiple active Expressions in the entry, in which case we
need to make sure that no two values overlap before we can perform the merge.

This fixed PR26148.

Reviewers: aprantl
Differential Revision: http://reviews.llvm.org/D16742
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@260121 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips] Add initial release notes for MIPS32.
Daniel Sanders [Mon, 8 Feb 2016 14:14:18 +0000 (14:14 +0000)]
[mips] Add initial release notes for MIPS32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@260095 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r259381:
Hans Wennborg [Fri, 5 Feb 2016 22:17:38 +0000 (22:17 +0000)]
Merging r259381:
------------------------------------------------------------------------
r259381 | uweigand | 2016-02-01 10:31:19 -0800 (Mon, 01 Feb 2016) | 21 lines

[SystemZ] Fix wrong-code generation for certain always-false conditions

We've found another bug in the code generation logic conditions for a
certain class of always-false conditions, those of the form
   if ((a & 1) < 0)

These only reach the back end when compiling without optimization.

The bug was introduced by the choice of using TEST UNDER MASK
to implement a check for
   if ((a & MASK) < VAL)
as
   if ((a & MASK) == 0)

where VAL is less than the the lowest bit of MASK.  This is correct
in all cases except for VAL == 0, in which case the original
condition is always false, but the replacement isn't.

Fixed by excluding that particular case.

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259940 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r259886 and r259888:
Hans Wennborg [Fri, 5 Feb 2016 16:30:31 +0000 (16:30 +0000)]
Merging r259886 and r259888:

------------------------------------------------------------------------
r259886 | nemanjai | 2016-02-05 06:50:29 -0800 (Fri, 05 Feb 2016) | 5 lines

Fix for PR 26193

This is a simple fix for a PowerPC intrinsic that was incorrectly defined
(the return type was incorrect).
------------------------------------------------------------------------

------------------------------------------------------------------------
r259888 | nemanjai | 2016-02-05 07:03:17 -0800 (Fri, 05 Feb 2016) | 3 lines

Add the missing test case for PR26193
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259891 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r259840 on top of r259178:
Hans Wennborg [Fri, 5 Feb 2016 00:55:39 +0000 (00:55 +0000)]
Merging r259840 on top of r259178:

------------------------------------------------------------------------
r259178 | echristo | 2016-01-28 23:20:30 -0800 (Thu, 28 Jan 2016) | 1 line

Refactor common code for PPC fast isel load immediate selection.
------------------------------------------------------------------------

------------------------------------------------------------------------
r259840 | nemanjai | 2016-02-04 15:14:42 -0800 (Thu, 04 Feb 2016) | 7 lines

Fix for PR 26356

Using the load immediate only when the immediate (whether signed or unsigned)
can fit in a 16-bit signed field. Namely, from -32768 to 32767 for signed and
0 to 65535 for unsigned. This patch also ensures that we sign-extend under the
right conditions.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259858 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r259798, r259835:
Hans Wennborg [Fri, 5 Feb 2016 00:46:12 +0000 (00:46 +0000)]
Merging r259798, r259835:

------------------------------------------------------------------------
r259798 | nemanjai | 2016-02-04 08:18:08 -0800 (Thu, 04 Feb 2016) | 9 lines

Enable the %s modifier in inline asm template string

This patch corresponds to review:
http://reviews.llvm.org/D16847

There are some files in glibc that use the output operand modifier even though
it was deprecated in GCC. This patch just adds support for it to prevent issues
with such files.
------------------------------------------------------------------------

------------------------------------------------------------------------
r259835 | nemanjai | 2016-02-04 14:36:10 -0800 (Thu, 04 Feb 2016) | 3 lines

Provide a test case for rl259798
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259856 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r259695:
Hans Wennborg [Thu, 4 Feb 2016 16:59:45 +0000 (16:59 +0000)]
Merging r259695:
------------------------------------------------------------------------
r259695 | tfiala | 2016-02-03 13:13:23 -0800 (Wed, 03 Feb 2016) | 11 lines

Address NDEBUG-related linkage issues for Value::assertModuleIsMaterialized()

The IR/Value class had a linkage issue present when LLVM was built
as a library, and the LLVM library build time had different settings
for NDEBUG than the client of the LLVM library.  Clients could get
into a state where the LLVM lib expected
Value::assertModuleIsMaterialized() to be inline-defined in the header
but clients expected that method to be defined in the LLVM library.

See this llvm-commits thread for more details:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160201/329667.html
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259801 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r259740:
Hans Wennborg [Thu, 4 Feb 2016 02:16:36 +0000 (02:16 +0000)]
Merging r259740:
------------------------------------------------------------------------
r259740 | nemanjai | 2016-02-03 17:58:20 -0800 (Wed, 03 Feb 2016) | 2 lines

Test case for PR 26381

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259743 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r259177:
Hans Wennborg [Wed, 3 Feb 2016 22:00:13 +0000 (22:00 +0000)]
Merging r259177:
------------------------------------------------------------------------
r259177 | echristo | 2016-01-28 23:20:01 -0800 (Thu, 28 Jan 2016) | 5 lines

Since LI/LIS sign extend the constant passed into the instruction we should
check that the sign extended constant fits into 16-bits if we want a
zero extended value, otherwise go ahead and put it together piecemeal.

Fixes PR26356.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259713 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r259649:
Hans Wennborg [Wed, 3 Feb 2016 21:24:31 +0000 (21:24 +0000)]
Merging r259649:
------------------------------------------------------------------------
r259649 | jamesm | 2016-02-03 07:05:06 -0800 (Wed, 03 Feb 2016) | 11 lines

[DemandedBits] Revert r249687 due to PR26071

This regresses a test in LoopVectorize, so I'll need to go away and think about how to solve this in a way that isn't broken.

From the writeup in PR26071:

What's happening is that ComputeKnownZeroes is telling us that all bits except the LSB are zero. We're then deciding that only the LSB needs to be demanded from the icmp's inputs.

This is where we're wrong - we're assuming that after simplification the bits that were known zero will continue to be known zero. But they're not - during trivialization the upper bits get changed (because an XOR isn't shrunk), so the icmp fails.

The fault is in demandedbits - its contract does clearly state that a non-demanded bit may either be zero or one.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259699 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r259645:
Hans Wennborg [Wed, 3 Feb 2016 21:18:35 +0000 (21:18 +0000)]
Merging r259645:
------------------------------------------------------------------------
r259645 | nemanjai | 2016-02-03 04:53:38 -0800 (Wed, 03 Feb 2016) | 4 lines

Fix for PR 26381

Simple fix - Constant values were not being sign extended in FastIsel.

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259698 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r259346 (with adjustments for r258867):
Hans Wennborg [Tue, 2 Feb 2016 17:41:39 +0000 (17:41 +0000)]
Merging r259346 (with adjustments for r258867):

------------------------------------------------------------------------
r259346 | ibreger | 2016-02-01 01:57:15 -0800 (Mon, 01 Feb 2016) | 3 lines

AVX512: fix mask handling for gather/scatter/prefetch intrinsics.

Differential Revision: http://reviews.llvm.org/D16755
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259536 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r259342 (with s/p2align 4/align 16) because r258750 is not in 3.8.
Hans Wennborg [Tue, 2 Feb 2016 17:35:07 +0000 (17:35 +0000)]
Merging r259342 (with s/p2align 4/align 16) because r258750 is not in 3.8.

------------------------------------------------------------------------
r259342 | ibreger | 2016-01-31 23:56:09 -0800 (Sun, 31 Jan 2016) | 3 lines

AVX512 : Fix SETCCE lowering for KNL 32 bit.

Differential Revision: http://reviews.llvm.org/D16752
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259533 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r259375:
Hans Wennborg [Mon, 1 Feb 2016 19:18:10 +0000 (19:18 +0000)]
Merging r259375:
------------------------------------------------------------------------
r259375 | majnemer | 2016-02-01 09:37:56 -0800 (Mon, 01 Feb 2016) | 6 lines

[InstCombine] Don't transform (X+INT_MAX)>=(Y+INT_MAX) -> (X<=Y)

This miscompile came about because we tried to use a transform which was
only appropriate for xor operators when addition was present.

This fixes PR26407.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259390 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r259228:
Tim Northover [Fri, 29 Jan 2016 22:00:06 +0000 (22:00 +0000)]
Merging r259228:
------------------------------------------------------------------------
r259228 | tnorthover | 2016-01-29 11:18:46 -0800 (Fri, 29 Jan 2016) | 13 lines

ARM: don't mangle DAG constant if it has more than one use

The basic optimisation was to convert (mul $LHS, $complex_constant) into
roughly "(shl (mul $LHS, $simple_constant), $simple_amt)" when it was expected
to be cheaper. The original logic checks that the mul only has one use (since
we're mangling $complex_constant), but when used in even more complex
addressing modes there may be an outer addition that can pick up the wrong
value too.

I *think* the ARM addressing-mode problem is actually unreachable at the
moment, but that depends on complex assessments of the profitability of
pre-increment addressing modes so I've put a real check in there instead of an
assertion.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259247 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r259236:
Hans Wennborg [Fri, 29 Jan 2016 21:33:02 +0000 (21:33 +0000)]
Merging r259236:
------------------------------------------------------------------------
r259236 | spatel | 2016-01-29 12:21:02 -0800 (Fri, 29 Jan 2016) | 8 lines

[InstCombine] avoid an insertelement transformation that induces the opposite extractelement fold (PR26354)

We would infinite loop because we created a shufflevector that was wider than
needed and then failed to combine that with the insertelement. When subsequently
visiting the extractelement from that shuffle, we see that it's unnecessary,
delete it, and trigger another visit to the insertelement.

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259245 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258922:
Tom Stellard [Fri, 29 Jan 2016 16:45:55 +0000 (16:45 +0000)]
Merging r258922:

------------------------------------------------------------------------
r258922 | marek.olsak | 2016-01-27 06:19:45 -0500 (Wed, 27 Jan 2016) |
12 lines

AMDGPU/SI: Stoney has only 16 LDS banks

Summary:
This is a candidate for stable, along with all patches that add the
"stoney"
processor.

Reviewers: tstellarAMD

Subscribers: arsenm

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

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259207 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r257666:
Tom Stellard [Fri, 29 Jan 2016 16:45:52 +0000 (16:45 +0000)]
Merging r257666:

------------------------------------------------------------------------
r257666 | changpeng.fang | 2016-01-13 15:39:25 -0500 (Wed, 13 Jan 2016) | 2 lines

AMDGPU/SI: Update ISA version for FIJI

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259206 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoBring back the test-suite export in test-release without bringing back the build...
Daniel Sanders [Thu, 28 Jan 2016 21:05:40 +0000 (21:05 +0000)]
Bring back the test-suite export in test-release without bringing back the build failures.

Summary:
r257791 disabled the test-suite export since the addition of CMakeLists.txt was
causing build failures. This patch exports the test-suite again but does so
outside the source tree so that it isn't included in the Phase[123] builds.

Reviewers: hans

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259093 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258971:
Hans Wennborg [Thu, 28 Jan 2016 18:23:25 +0000 (18:23 +0000)]
Merging r258971:
------------------------------------------------------------------------
r258971 | spatel | 2016-01-27 11:22:45 -0800 (Wed, 27 Jan 2016) | 26 lines

[SimplifyCFG] limit recursion depth when speculating instructions (PR26308)

This is a fix for:
https://llvm.org/bugs/show_bug.cgi?id=26308

With the switch to using the TTI cost model in:
http://reviews.llvm.org/rL228826
...it became possible to hit a zero-cost cycle of instructions (gep -> phi -> gep...),
so we need a cap for the recursion in DominatesMergePoint().

A recursion depth parameter was already added for a different reason in:
http://reviews.llvm.org/rL255660
...so we can just set a limit for it.

I pulled "10" out of the air and made it an independent parameter that we can play with.
It might be higher than it needs to be given the currently low default value of
PHINodeFoldingThreshold (2). That's the starting cost value that we enter the recursion
with, and most instructions have cost set to TCC_Basic (1), so I don't think we're going
to speculate more than 2 instructions with the current parameters.

As noted in the review and the TODO comment, we can do better than just limiting recursion
depth.

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

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259066 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258471:
Hans Wennborg [Thu, 28 Jan 2016 18:16:55 +0000 (18:16 +0000)]
Merging r258471:
------------------------------------------------------------------------
r258471 | pirama | 2016-01-21 17:16:57 -0800 (Thu, 21 Jan 2016) | 14 lines

Do not lower VSETCC if operand is an f16 vector

Summary:
SETCC with f16 vectors has OperationAction set to Expand but still gets
lowered to FCM* intrinsics based on its result type.  This patch skips
lowering of VSETCC if the operand is an f16 vector.

v4 and v8 tests included.

Reviewers: ab, jmolloy

Subscribers: srhines, llvm-commits

Differential Revision: http://reviews.llvm.org/D15361
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259064 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258891:
Hans Wennborg [Wed, 27 Jan 2016 00:19:52 +0000 (00:19 +0000)]
Merging r258891:
------------------------------------------------------------------------
r258891 | hans | 2016-01-26 16:19:05 -0800 (Tue, 26 Jan 2016) | 25 lines

test-release.sh: Ignore LC_CTYPE in sed invocation on Darwin

Here, sed is used to prepare object files for comparison via cmp. On my Darwin
15.4.0 machine, LC_CTYPE is set to UTF-8 (by default, I believe). Under these
circumstances, anything sed is made to read will be treated as UTF-8, prompting
it to signal an error if it is not, like so:

% sed s/a/b/ <(head -n1 /dev/random) >/dev/null; echo $?
sed: RE error: illegal byte sequence
1
%

To make sed work as expected, I need to set LC_CTYPE to C:

% env LC_CTYPE=C sed s/a/b/ <(head -n1 /dev/random) >/dev/null; echo $?
0
%

Without this change, sed will exit with an error for every single file that it
compares between phase 2 and phase 3, thereby making it look as if the
differences were far larger than they are.

Patch by Elias Pipping!

Differential Revision: http://reviews.llvm.org/D16548
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258892 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258386:
Tom Stellard [Tue, 26 Jan 2016 23:57:01 +0000 (23:57 +0000)]
Merging r258386:

------------------------------------------------------------------------
r258386 | thomas.stellard | 2016-01-20 23:28:34 -0500 (Wed, 20 Jan 2016) | 14 lines

AMDGPU/SI: Pass whether to use the SI scheduler via Target Attribute

Summary:
Currently the SI scheduler can be selected via command line option,
but it turned out it would be better if it was selectable via a Target Attribute.

This patch adds "si-scheduler" attribute to the backend.

Reviewers: tstellarAMD, echristo

Subscribers: echristo, arsenm

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

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258885 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258184:
Sanjoy Das [Tue, 26 Jan 2016 22:29:46 +0000 (22:29 +0000)]
Merging r258184:
------------------------------------------------------------------------
r258184 | sanjoy | 2016-01-19 12:53:51 -0800 (Tue, 19 Jan 2016) | 20 lines

[SCEV] Fix PR26207

In some cases, the max backedge taken count can be more conservative
than the exact backedge taken count (for instance, because
ScalarEvolution::getRange is not control-flow sensitive whereas
computeExitLimitFromICmp can be).  In these cases,
computeExitLimitFromCond (specifically the bit that deals with `and` and
`or` instructions) can create an ExitLimit instance with a
`SCEVCouldNotCompute` max backedge count expression, but a computable
exact backedge count expression.  This violates an implicit SCEV
assumption: a computable exact BE count should imply a computable max BE
count.

This change

 - Makes the above implicit invariant explicit by adding an assert to
   ExitLimit's constructor

 - Changes `computeExitLimitFromCond` to be more robust around
   conservative max backedge counts
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258869 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert accidental changes from r258805
Hans Wennborg [Tue, 26 Jan 2016 19:44:49 +0000 (19:44 +0000)]
Revert accidental changes from r258805

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258844 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258436:
Dimitry Andric [Tue, 26 Jan 2016 19:43:59 +0000 (19:43 +0000)]
Merging r258436:
------------------------------------------------------------------------
r258436 | dim | 2016-01-21 22:57:49 +0100 (Thu, 21 Jan 2016) | 17 lines

Let test-release.sh checkout subprojects directly into the target tree,
instead of using symlinks

Summary:
In the past I have run into several problems with the way
`test-release.sh` creates all the subproject directories as siblings,
and then uses symlinks to stitch them all together.  In some scenarios
this leads to clang not being able to find header files, etc.

This patch changes the script so it directly exports into the correct
target locations for each subproject.

Reviewers: hans

Subscribers: emaste, llvm-commits

Differential Revision: http://reviews.llvm.org/D16420
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258842 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258729:
Hans Wennborg [Tue, 26 Jan 2016 19:31:16 +0000 (19:31 +0000)]
Merging r258729:
------------------------------------------------------------------------
r258729 | matze | 2016-01-25 14:08:25 -0800 (Mon, 25 Jan 2016) | 13 lines

X86ISelLowering: Fix cmov(cmov) special lowering bug

There's a special case in EmitLoweredSelect() that produces an improved
lowering for cmov(cmov) patterns. However this special lowering is
currently broken if the inner cmov has multiple users so this patch
stops using it in this case.

If you wonder why this wasn't fixed by continuing to use the special
lowering and inserting a 2nd PHI for the inner cmov: I believe this
would incur additional copies/register pressure so the special lowering
does not improve upon the normal one anymore in this case.

This fixes http://llvm.org/PR26256 (= rdar://24329747)
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258840 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258690:
James Molloy [Tue, 26 Jan 2016 13:30:49 +0000 (13:30 +0000)]
Merging r258690:
------------------------------------------------------------------------
r258690 | jamesm | 2016-01-25 14:49:36 +0000 (Mon, 25 Jan 2016) | 7 lines

[DemandedBits] Fix computation of demanded bits for ICmps

The computation of ICmp demanded bits is independent of the individual operand being evaluated. We simply return a mask consisting of the minimum leading zeroes of both operands.

We were incorrectly passing "I" to ComputeKnownBits - this should be "UserI->getOperand(0)". In cases where we were evaluating the 1th operand, we were taking the minimum leading zeroes of it and itself.

This should fix PR26266.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258805 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258406:
Hans Wennborg [Mon, 25 Jan 2016 22:24:50 +0000 (22:24 +0000)]
Merging r258406:
------------------------------------------------------------------------
r258406 | vedantk | 2016-01-21 09:04:42 -0800 (Thu, 21 Jan 2016) | 16 lines

[GCOV] Avoid emitting profile arcs for module and skeleton CUs

Do not emit profile arc files and note files for module and skeleton
CU's.

Our users report seeing unexpected *.gcda and *.gcno files in their
projects when using gcov-style profiling with modules or frameworks.
The unwanted files come from these modules. This is not very helpful
for end-users. Further, we've seen reports of instrumented programs
crashing while writing these files out (due to I/O failures).

rdar://problem/22838296

Reviewed-by: aprantl
Differential Revision: http://reviews.llvm.org/D15997
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258731 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258416 and r258428:
Hans Wennborg [Fri, 22 Jan 2016 18:37:31 +0000 (18:37 +0000)]
Merging r258416 and r258428:

------------------------------------------------------------------------
r258416 | spatel | 2016-01-21 10:01:57 -0800 (Thu, 21 Jan 2016) | 2 lines

make helper functions static; NFCI
------------------------------------------------------------------------

------------------------------------------------------------------------
r258428 | spatel | 2016-01-21 12:19:54 -0800 (Thu, 21 Jan 2016) | 15 lines

[LibCallSimplifier] don't get fooled by a fake fmin()

This is similar to the bug/fix:
https://llvm.org/bugs/show_bug.cgi?id=26211
http://reviews.llvm.org/rL258325

The fmin() test case reveals another bug caused by sloppy
code duplication. It will crash without this patch because
fp128 is a valid floating-point type, but we would think
that we had matched a function that used doubles.

The new helper function can be used to replace similar
checks that are used in several other places in this file.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258512 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r257886:
Hans Wennborg [Fri, 22 Jan 2016 18:26:38 +0000 (18:26 +0000)]
Merging r257886:
------------------------------------------------------------------------
r257886 | jamesm | 2016-01-15 02:36:01 -0800 (Fri, 15 Jan 2016) | 3 lines

[CodeGenPrepare] Try and appease sanitizers

dupRetToEnableTailCallOpts(BB) can invalidate BB. It must run *after* we iterate across BB!
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258510 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258325:
Hans Wennborg [Wed, 20 Jan 2016 21:49:02 +0000 (21:49 +0000)]
Merging r258325:
------------------------------------------------------------------------
r258325 | spatel | 2016-01-20 09:41:14 -0800 (Wed, 20 Jan 2016) | 21 lines

[LibCallSimplifier] don't get fooled by a fake sqrt()

The test case will crash without this patch because the subsequent call to
hasUnsafeAlgebra() assumes that the call instruction is an FPMathOperator
(ie, returns an FP type).

This part of the function signature check was omitted for the sqrt() case,
but seems to be in place for all other transforms.

Before:
http://reviews.llvm.org/rL257400
...we would have needlessly continued execution in optimizeSqrt(), but the
bug was harmless because we'd eventually fail some other check and return
without damage.

This should fix:
https://llvm.org/bugs/show_bug.cgi?id=26211

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

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258353 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r257940:
Hans Wennborg [Wed, 20 Jan 2016 21:30:57 +0000 (21:30 +0000)]
Merging r257940:
------------------------------------------------------------------------
r257940 | djg | 2016-01-15 13:56:40 -0800 (Fri, 15 Jan 2016) | 10 lines

[SelectionDAG] CSE nodes with differing SDNodeFlags

In the optimizer (GVN etc.) when eliminating redundant nodes with different
flags, the flags are ignored for the purposes of testing for congruence, and
then intersected for the purposes of producing a result that supports the union
of all the uses. This commit makes SelectionDAG's CSE do the same thing,
allowing it to CSE nodes in more cases. This fixes PR26063.

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

------------------------------------------------------------------------
Merging r257942:
------------------------------------------------------------------------
r257942 | djg | 2016-01-15 14:07:35 -0800 (Fri, 15 Jan 2016) | 2 lines

Remove a now-empty file left behind by r257940.

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258351 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258273:
Hans Wennborg [Wed, 20 Jan 2016 21:14:05 +0000 (21:14 +0000)]
Merging r258273:
------------------------------------------------------------------------
r258273 | josepht | 2016-01-19 18:15:15 -0800 (Tue, 19 Jan 2016) | 37 lines

[Inliner/WinEH] Honor implicit nounwinds

Summary:
Funclet EH tables require that a given funclet have only one unwind
destination for exceptional exits.  The verifier will therefore reject
e.g. two cleanuprets with different unwind dests for the same cleanup, or
two invokes exiting the same funclet but to different unwind dests.
Because catchswitch has no 'nounwind' variant, and because IR producers
are not *required* to annotate calls which will not unwind as 'nounwind',
it is legal to nest a call or an "unwind to caller" catchswitch within a
funclet pad that has an unwind destination other than caller; it is
undefined behavior for such a call or catchswitch to unwind.

Normally when inlining an invoke, calls in the inlined sequence are
rewritten to invokes that unwind to the callsite invoke's unwind
destination, and "unwind to caller" catchswitches in the inlined sequence
are rewritten to unwind to the callsite invoke's unwind destination.
However, if such a call or "unwind to caller" catchswitch is located in a
callee funclet that has another exceptional exit with an unwind
destination within the callee, applying the normal transformation would
give that callee funclet multiple unwind destinations for its exceptional
exits.  There would be no way for EH table generation to determine which
is the "true" exit, and the verifier would reject the function
accordingly.

Add logic to the inliner to detect these cases and leave such calls and
"unwind to caller" catchswitches as calls and "unwind to caller"
catchswitches in the inlined sequence.

This fixes PR26147.

Reviewers: rnk, andrew.w.kaylor, majnemer

Subscribers: alexcrichton, llvm-commits

Differential Revision: http://reviews.llvm.org/D16319
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258349 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258308: [AArch64] Fix two bugs in the .inst directive
Renato Golin [Wed, 20 Jan 2016 18:01:05 +0000 (18:01 +0000)]
Merging r258308: [AArch64] Fix two bugs in the .inst directive

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258326 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258221:
Quentin Colombet [Wed, 20 Jan 2016 01:14:03 +0000 (01:14 +0000)]
Merging r258221:
------------------------------------------------------------------------
r258221 | qcolombet | 2016-01-19 15:29:03 -0800 (Tue, 19 Jan 2016) | 8 lines

[X86] Do not run shrink-wrapping on function with split-stack attribute or HiPE
calling convention.
The implementation of the related callbacks in the x86 backend for such
functions are not ready to deal with a prologue block that is not the entry
block of the function.

This fixes PR26107, but the longer term solution would be to fix those callbacks.

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258269 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258207:
Quentin Colombet [Wed, 20 Jan 2016 01:09:12 +0000 (01:09 +0000)]
Merging r258207:
------------------------------------------------------------------------
r258207 | qcolombet | 2016-01-19 14:31:12 -0800 (Tue, 19 Jan 2016) | 1 line

[MachineFunction] Constify getter. NFC.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258268 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r257977:
Hans Wennborg [Wed, 20 Jan 2016 00:48:30 +0000 (00:48 +0000)]
Merging r257977:
------------------------------------------------------------------------
r257977 | kfischer | 2016-01-15 17:11:33 -0800 (Fri, 15 Jan 2016) | 1 line

[DwarfDebug] Move MergeValues to .cpp, NFC
------------------------------------------------------------------------
Merging r257979:
------------------------------------------------------------------------
r257979 | kfischer | 2016-01-15 17:15:32 -0800 (Fri, 15 Jan 2016) | 11 lines

[DwarfDebug] Don't merge DebugLocEntries if their pieces overlap

Summary:
Later in DWARF emission we check that DebugLocEntries have
non-overlapping pieces, so we should create any such entries
by merging here.

Fixes PR26163.

Reviewers: aprantl
Differential Revision: http://reviews.llvm.org/D16249
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258267 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[r257857] lli: use llvm::utostr() instead of std::to_string().
NAKAMURA Takumi [Wed, 20 Jan 2016 00:32:09 +0000 (00:32 +0000)]
[r257857] lli: use llvm::utostr() instead of std::to_string().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258266 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[r257732] Mark remote-JIT tests as XFAIL, as well as win32, for targeting mingw32.
NAKAMURA Takumi [Wed, 20 Jan 2016 00:28:22 +0000 (00:28 +0000)]
[r257732] Mark remote-JIT tests as XFAIL, as well as win32, for targeting mingw32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258265 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r257875:
Hans Wennborg [Tue, 19 Jan 2016 20:49:25 +0000 (20:49 +0000)]
Merging r257875:
------------------------------------------------------------------------
r257875 | jamesm | 2016-01-15 01:20:19 -0800 (Fri, 15 Jan 2016) | 11 lines

[InstCombine] Rewrite bswap/bitreverse handling completely.

There are several requirements that ended up with this design;
  1. Matching bitreversals is too heavyweight for InstCombine and doesn't really need to be done so early.
  2. Bitreversals and byteswaps are very related in their matching logic.
  3. We want to implement support for matching more advanced bswap/bitreverse patterns like partial bswaps/bitreverses.
  4. Bswaps are best matched early in InstCombine.

The result of these is that a new utility function is created in Transforms/Utils/Local.h that can be configured to search for bswaps, bitreverses or both. InstCombine uses it to find only bswaps, CGP uses it to find only bitreversals.

We can then extend the matching logic in one place only.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258180 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r258168:
Hans Wennborg [Tue, 19 Jan 2016 19:28:41 +0000 (19:28 +0000)]
Merging r258168:
------------------------------------------------------------------------
r258168 | hans | 2016-01-19 11:21:58 -0800 (Tue, 19 Jan 2016) | 3 lines

test-release.sh: Use CMake also for Darwin

This didn't work for 3.7, but hopefully it should work now.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258170 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r257925, r257929, r257930, and r257997:
Hans Wennborg [Tue, 19 Jan 2016 18:53:02 +0000 (18:53 +0000)]
Merging r257925, r257929, r257930, and r257997:
------------------------------------------------------------------------
r257925 | mren | 2016-01-15 11:35:42 -0800 (Fri, 15 Jan 2016) | 10 lines

CXX_FAST_TLS calling convention: fix issue on X86-64.

When we have a single basic block, the explicit copy-back instructions should
be inserted right before the terminator. Before this fix, they were wrongly
placed at the beginning of the basic block.

I will commit fixes to other platforms as well.

PR26136
------------------------------------------------------------------------

------------------------------------------------------------------------
r257929 | mren | 2016-01-15 12:13:28 -0800 (Fri, 15 Jan 2016) | 10 lines

CXX_FAST_TLS calling convention: fix issue on AArch64.

When we have a single basic block, the explicit copy-back instructions should
be inserted right before the terminator. Before this fix, they were wrongly
placed at the beginning of the basic block.

I will commit fixes to other platforms as well.

PR26136
------------------------------------------------------------------------

------------------------------------------------------------------------
r257930 | mren | 2016-01-15 12:24:11 -0800 (Fri, 15 Jan 2016) | 8 lines

CXX_FAST_TLS calling convention: fix issue on ARM.

When we have a single basic block, the explicit copy-back instructions should
be inserted right before the terminator. Before this fix, they were wrongly
placed at the beginning of the basic block.

PR26136
------------------------------------------------------------------------

------------------------------------------------------------------------
r257997 | mren | 2016-01-16 08:39:46 -0800 (Sat, 16 Jan 2016) | 12 lines

CXX_FAST_TLS calling convention: fix issue on x86-64.

%RBP can't be handled explicitly. We generate the following code:
    pushq %rbp
    movq  %rsp, %rbp
    ...
    movq  %rbx, (%rbp)  ## 8-byte Spill
where %rbp will be overwritten by the spilled value.

The fix is to let PEI handle %RBP.
PR26136
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258162 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r257902 (and r257775)
Hans Wennborg [Tue, 19 Jan 2016 18:26:37 +0000 (18:26 +0000)]
Merging r257902 (and r257775)

------------------------------------------------------------------------
r257775 | jyknight | 2016-01-14 08:33:21 -0800 (Thu, 14 Jan 2016) | 3 lines

Revert "Stop increasing alignment of externally-visible globals on ELF platforms."

This reverts commit r257719, due to PR26144.
------------------------------------------------------------------------

------------------------------------------------------------------------
r257902 | jyknight | 2016-01-15 08:33:06 -0800 (Fri, 15 Jan 2016) | 17 lines

Stop increasing alignment of externally-visible globals on ELF
platforms.

With ELF, the alignment of a global variable in a shared library will
get copied into an executables linked against it, if the executable even
accesss the variable. So, it's not possible to implicitly increase
alignment based on access patterns, or you'll break existing binaries.

This happened to affect libc++'s std::cout symbol, for example. See
thread: http://thread.gmane.org/gmane.comp.compilers.clang.devel/45311

(This is a re-commit of r257719, without the bug reported in
PR26144. I've tweaked the code to not assert-fail in
enforceKnownAlignment when computeKnownBits doesn't recurse far enough
to find the underlying Alloca/GlobalObject value.)

Differential Revision: http://reviews.llvm.org/D16145
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258155 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r257905:
Hans Wennborg [Tue, 19 Jan 2016 17:28:24 +0000 (17:28 +0000)]
Merging r257905:
------------------------------------------------------------------------
r257905 | hans | 2016-01-15 09:04:45 -0800 (Fri, 15 Jan 2016) | 3 lines

test-release.sh: Fix clang-tools-extra symlink for CMake build

The CMake and Autoconf builds want the symlink set up differently.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258146 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r257791:
Hans Wennborg [Thu, 14 Jan 2016 23:24:17 +0000 (23:24 +0000)]
Merging r257791:
------------------------------------------------------------------------
r257791 | hans | 2016-01-14 11:21:14 -0800 (Thu, 14 Jan 2016) | 4 lines

Exclude test-suite from CMake builds in test-release.sh

It's broken. In 3.7 there wasn't a CMake build for test-suite at all,
so we're not losing something we had before.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@257836 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r257730:
Hans Wennborg [Thu, 14 Jan 2016 17:52:28 +0000 (17:52 +0000)]
Merging r257730:
------------------------------------------------------------------------
r257730 | majnemer | 2016-01-13 17:20:03 -0800 (Wed, 13 Jan 2016) | 11 lines

[X86] Don't alter HasOpaqueSPAdjustment after we've relied on it

We rely on HasOpaqueSPAdjustment not changing after we've calculated
things based on it.  Things like whether or not we can use 'rep;movs' to
copy bytes around, that sort of thing.  If it changes, invariants in the
backend will quietly break.  This situation arose when we had a call to
memcpy *and* a COPY of the FLAGS register where we would attempt to
reference local variables using %esi, a register that was clobbered by
the 'rep;movs'.

This fixes PR26124.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@257779 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReleaseNotes.rst: a few entries from Rafael
Hans Wennborg [Thu, 14 Jan 2016 00:23:32 +0000 (00:23 +0000)]
ReleaseNotes.rst: a few entries from Rafael

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@257725 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r257648:
Hans Wennborg [Wed, 13 Jan 2016 21:18:59 +0000 (21:18 +0000)]
Merging r257648:
------------------------------------------------------------------------
r257648 | hans | 2016-01-13 10:59:45 -0800 (Wed, 13 Jan 2016) | 1 line

Fix struct/class mismatch for MachineSchedContext
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@257668 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r257645:
Dimitry Andric [Wed, 13 Jan 2016 19:37:51 +0000 (19:37 +0000)]
Merging r257645:
------------------------------------------------------------------------
r257645 | dim | 2016-01-13 19:29:46 +0100 (Wed, 13 Jan 2016) | 22 lines

Avoid undefined behavior in LinkAllPasses.h

The LinkAllPasses.h file is included in several main programs, to force
a large number of passes to be linked in.  However, the ForcePassLinking
constructor uses undefined behavior, since it calls member functions on
`nullptr`, e.g.:

      ((llvm::Function*)nullptr)->viewCFGOnly();
      llvm::RGPassManager RGM;
      ((llvm::RegionPass*)nullptr)->runOnRegion((llvm::Region*)nullptr, RGM);

When the optimization level is -O2 or higher, the code below the first
nullptr dereference is optimized away, and replaced by `ud2` (on x86).

Therefore, the calls after that first dereference are never emitted.  In
my case, I noticed there was no call to `llvm::sys::RunningOnValgrind()`!

Replace instances of dereferencing `nullptr` with either objects on the
stack, or regular function calls.

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

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@257660 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDrop 'svn' suffix from version.
Hans Wennborg [Wed, 13 Jan 2016 19:03:44 +0000 (19:03 +0000)]
Drop 'svn' suffix from version.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@257651 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCreating release_38 branch off revision 257626
Hans Wennborg [Wed, 13 Jan 2016 17:34:56 +0000 (17:34 +0000)]
Creating release_38 branch off revision 257626

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@257630 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agofix typo
Sanjay Patel [Wed, 13 Jan 2016 17:23:52 +0000 (17:23 +0000)]
fix typo

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

8 years agoAMDGPU/SI: Fix a GPU hang with POS_W_FLOAT enabled
Marek Olsak [Wed, 13 Jan 2016 17:23:20 +0000 (17:23 +0000)]
AMDGPU/SI: Fix a GPU hang with POS_W_FLOAT enabled

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm

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

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

8 years agoAMDGPU/SI: Add tests for non-void functions and InitialPSInputAddr
Marek Olsak [Wed, 13 Jan 2016 17:23:15 +0000 (17:23 +0000)]
AMDGPU/SI: Add tests for non-void functions and InitialPSInputAddr

Reviewers: tstellarAMD, arsenm

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

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

8 years agoAMDGPU/SI: Remove ending s_endpgm from non-void functions
Marek Olsak [Wed, 13 Jan 2016 17:23:12 +0000 (17:23 +0000)]
AMDGPU/SI: Remove ending s_endpgm from non-void functions

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm

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

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

8 years agoAMDGPU/SI: Add s_waitcnt at the end of non-void functions
Marek Olsak [Wed, 13 Jan 2016 17:23:09 +0000 (17:23 +0000)]
AMDGPU/SI: Add s_waitcnt at the end of non-void functions

Summary:
v2: Make ReturnsVoid private, so that I can another 8 lines of code and
    look more productive.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm

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

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

8 years agoAMDGPU/SI: Add support for non-void functions
Marek Olsak [Wed, 13 Jan 2016 17:23:04 +0000 (17:23 +0000)]
AMDGPU/SI: Add support for non-void functions

Summary:
Return values can be stored in SGPRs (i32) and VGPRs (f32).

This will be used by functions which expect some bytecode or other binary to
be appended at the end. It allows defining in which registers the return
values will be stored.

v2: don't do this for compute shaders

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm

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

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

8 years ago[WebAssemly] Invalidate liveness in CFG stackifier
Derek Schuff [Wed, 13 Jan 2016 17:10:28 +0000 (17:10 +0000)]
[WebAssemly] Invalidate liveness in CFG stackifier

WebAssemblyCFGStackify does not track liveness for EXPR_STACK, causing
verifier failure if liveness has not already been invalidated.

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

8 years agofix typo
Sanjay Patel [Wed, 13 Jan 2016 16:46:41 +0000 (16:46 +0000)]
fix typo

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

8 years ago[lit] Fix handling of per test timeout when the installed psutil version
Dan Liew [Wed, 13 Jan 2016 16:43:49 +0000 (16:43 +0000)]
[lit] Fix handling of per test timeout when the installed psutil version
is < ``2.0``.

Older versions of psutil (e.g. ``1.2.1`` which is the version shipped with
Ubuntu 14.04) use a different API for retrieving the child processes.
To handle this try the new API first and if that fails try the old API.

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

8 years agofix typo
Sanjay Patel [Wed, 13 Jan 2016 16:34:10 +0000 (16:34 +0000)]
fix typo

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

8 years agofix typo
Sanjay Patel [Wed, 13 Jan 2016 16:30:44 +0000 (16:30 +0000)]
fix typo

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

8 years agoAMDGPU/SI: Add SI Machine Scheduler
Nicolai Haehnle [Wed, 13 Jan 2016 16:10:10 +0000 (16:10 +0000)]
AMDGPU/SI: Add SI Machine Scheduler

Summary:
It is off by default, but can be used
with --misched=si

Patch by: Axel Davy

Reviewers: arsenm, tstellarAMD, nhaehnle

Subscribers: nhaehnle, solenskiner, arsenm, llvm-commits

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

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

8 years agoFixing warning by adding the X86ISD::VROTRI case.
Michael Zuckerman [Wed, 13 Jan 2016 15:48:42 +0000 (15:48 +0000)]
Fixing warning by adding the X86ISD::VROTRI case.

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

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

8 years ago[Hexagon] Do not insert non-phis before phis in bit simplification
Krzysztof Parzyszek [Wed, 13 Jan 2016 15:48:18 +0000 (15:48 +0000)]
[Hexagon] Do not insert non-phis before phis in bit simplification

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

8 years ago[AVX512] Adding PMOVSXBD/W/Q , PMOVZSDQ and PMOVZSWD/Q Intrinsics .
Michael Zuckerman [Wed, 13 Jan 2016 14:59:19 +0000 (14:59 +0000)]
[AVX512] Adding PMOVSXBD/W/Q , PMOVZSDQ and PMOVZSWD/Q Intrinsics .

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

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

8 years ago[AVX512] Adding PMOVZXBD/W/Q , PMOVZXDQ and PMOVZXWD/Q Intrinsics
Michael Zuckerman [Wed, 13 Jan 2016 14:25:21 +0000 (14:25 +0000)]
[AVX512] Adding PMOVZXBD/W/Q , PMOVZXDQ and PMOVZXWD/Q Intrinsics

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

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

8 years ago[PowerPC] Fix large code model with the ELFv2 ABI
Ulrich Weigand [Wed, 13 Jan 2016 13:12:23 +0000 (13:12 +0000)]
[PowerPC] Fix large code model with the ELFv2 ABI

The global entry point prologue currently assumes that the TOC
associated with a function is less than 2GB away from the function
entry point.  This is always true when using the medium or small
code model, but may not be the case when using the large code model.

This patch adds a new variant of the ELFv2 global entry point prologue
that lifts the 2GB restriction when building with -mcmodel=large.
This works by emitting a quadword containing the distance from the
function entry point to its associated TOC immediately before the
entry point, and then using a prologue like:

ld r2,-8(r12)
add r2,r2,r12

Since creation of the entry point prologue is now split across two
separate routines (PPCLinuxAsmPrinter::EmitFunctionEntryLabel emits
the data word, PPCLinuxAsmPrinter::EmitFunctionBodyStart the prolog
code), I've switched to using named labels instead of just temporaries
to indicate the locations of the global and local entry points and the
new TOC offset data word.

These names are provided by new routines in PPCFunctionInfo modeled
after the existing PPCFunctionInfo::getPICOffsetSymbol.

Note that a corresponding change was committed to GCC here:
https://gcc.gnu.org/ml/gcc-patches/2015-12/msg00355.html

Reviewers: hfinkel

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

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

8 years ago[AVX512] adding PRORQ , PRORD , PRORLVQ and PRORLVD Intrinsics
Michael Zuckerman [Wed, 13 Jan 2016 12:39:33 +0000 (12:39 +0000)]
[AVX512] adding PRORQ , PRORD , PRORLVQ and PRORLVD Intrinsics

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

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

8 years agoAMDGPU/SI: Allow more shader inputs
Marek Olsak [Wed, 13 Jan 2016 11:46:48 +0000 (11:46 +0000)]
AMDGPU/SI: Allow more shader inputs

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm

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

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

8 years agoAMDGPU/SI: Allow any number of PS inputs
Marek Olsak [Wed, 13 Jan 2016 11:46:10 +0000 (11:46 +0000)]
AMDGPU/SI: Allow any number of PS inputs

Summary:
With the ability to concatenate shader binaries, the limit of 15 no longer
applies.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm

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

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

8 years agoAMDGPU/SI: Add new target attribute InitialPSInputAddr
Marek Olsak [Wed, 13 Jan 2016 11:45:36 +0000 (11:45 +0000)]
AMDGPU/SI: Add new target attribute InitialPSInputAddr

Summary:
This allows Mesa to pass initial SPI_PS_INPUT_ADDR to LLVM.
The register assigns VGPR locations to PS inputs, while the ENA register
determines whether or not they are loaded.

Mesa needs to set some inputs as not-movable, so that a pixel shader prolog
binary appended at the beginning can assume where some inputs are.

v2: Make PSInputAddr private, because there is never enough silly getters
    and setters for people to read.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm

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

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

8 years agoAMDGPU/SI: Fix a bug in SIFoldOperands
Marek Olsak [Wed, 13 Jan 2016 11:44:29 +0000 (11:44 +0000)]
AMDGPU/SI: Fix a bug in SIFoldOperands

Summary: ret.ll will contain a test for this

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm

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

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

8 years agoLEA code size optimization pass (Part 2): Remove redundant LEA instructions.
Andrey Turetskiy [Wed, 13 Jan 2016 11:30:44 +0000 (11:30 +0000)]
LEA code size optimization pass (Part 2): Remove redundant LEA instructions.

Make x86 OptimizeLEAs pass remove LEA instruction if there is another LEA
(in the same basic block) which calculates address differing only be a
displacement. Works only for -Oz.

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

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

8 years agoAdd test cases that will show the bug that was fixed in r256725.
Craig Topper [Wed, 13 Jan 2016 07:53:11 +0000 (07:53 +0000)]
Add test cases that will show the bug that was fixed in r256725.

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

8 years ago[TableGen] Cleanup output formatting and add llvm_unreachables to the output the...
Craig Topper [Wed, 13 Jan 2016 07:20:13 +0000 (07:20 +0000)]
[TableGen] Cleanup output formatting and add llvm_unreachables to the output the AsmMatcher uses when it overflows the 64-bit tables. No in tree targets use this code, but I tested it with an temporarily reduced table width.

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

8 years ago[TableGen] Replace some hardcoded assumptions that the OpcodeInfo table is 64-bits...
Craig Topper [Wed, 13 Jan 2016 07:20:12 +0000 (07:20 +0000)]
[TableGen] Replace some hardcoded assumptions that the OpcodeInfo table is 64-bits for cleanliness. NFC

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

8 years ago[TableGen] Use std::remove_if instead of an n^2 loop. NFC
Craig Topper [Wed, 13 Jan 2016 07:20:10 +0000 (07:20 +0000)]
[TableGen] Use std::remove_if instead of an n^2 loop. NFC

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

8 years ago[TableGen] Fix up some stale comments in the AsmMatcher. NFC
Craig Topper [Wed, 13 Jan 2016 07:20:07 +0000 (07:20 +0000)]
[TableGen] Fix up some stale comments in the AsmMatcher. NFC

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

8 years ago[TableGen] Move calls to getValueAsInt out of a loop since they aren't simple functio...
Craig Topper [Wed, 13 Jan 2016 07:20:05 +0000 (07:20 +0000)]
[TableGen] Move calls to getValueAsInt out of a loop since they aren't simple functions. NFC

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

8 years agoRemove extra whitespace. NFC.
Junmo Park [Wed, 13 Jan 2016 07:03:42 +0000 (07:03 +0000)]
Remove extra whitespace. NFC.

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

8 years ago[ORC] Add extra debugging output to OrcRemoteTargetServer.
Lang Hames [Wed, 13 Jan 2016 06:34:57 +0000 (06:34 +0000)]
[ORC] Add extra debugging output to OrcRemoteTargetServer.

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

8 years ago[ORC] Fix typo in debugging output.
Lang Hames [Wed, 13 Jan 2016 06:08:07 +0000 (06:08 +0000)]
[ORC] Fix typo in debugging output.

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

8 years ago[Inliner] Merge the attributes of the caller and callee functions
Akira Hatanaka [Wed, 13 Jan 2016 06:02:45 +0000 (06:02 +0000)]
[Inliner] Merge the attributes of the caller and callee functions

This patch turns off the fast-math optimization attribute on the caller
if the callee's fast-math attribute is not turned on.

For example,

- before inlining
 caller: "less-precise-fpmad"="true"
 callee: "less-precise-fpmad"="false"

- after inlining
 caller: "less-precise-fpmad"="false"

Alternatively, it's possible to block inlining if the caller's and
callee's attributes don't match. If this approach is preferable to the
one in this patch, we can discuss post-commit.

rdar://problem/19836465

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

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

8 years agoFix PointerIntPair so that it can use an enum class as its integer template argument.
Michael Gottesman [Wed, 13 Jan 2016 05:59:13 +0000 (05:59 +0000)]
Fix PointerIntPair so that it can use an enum class as its integer template argument.

Summary:
The problem here is that an enum class can not be implicitly converted to an
integer. That assumption snuck back into PointerIntPair. This commit fixes the
issue and more importantly adds some unittests to make sure that we do not break
this again.

rdar://23594806

Reviewers: gribozavr

Subscribers: llvm-commits

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

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

8 years agoDoc fix: code-quote load / store doc the same way
JF Bastien [Wed, 13 Jan 2016 04:52:26 +0000 (04:52 +0000)]
Doc fix: code-quote load / store doc the same way

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

8 years ago[SPARC] Revamp AnalyzeBranch and add ReverseBranchCondition.
James Y Knight [Wed, 13 Jan 2016 04:44:14 +0000 (04:44 +0000)]
[SPARC] Revamp AnalyzeBranch and add ReverseBranchCondition.

AnalyzeBranch on X86 (and, previously, SPARC, which implementation was
copied from X86) tries to modify the branches based on block
layout (e.g. checking isLayoutSuccessor), when AllowModify is true.

The rest of the architectures leave that up to the caller, which can
call InsertBranch, RemoveBranch, and ReverseBranchCondition as
appropriate. That appears to be the preferred way to do it nowadays.

This commit makes SPARC like the rest: replaces AnalyzeBranch with an
implementation cribbed from AArch64, and adds a ReverseBranchCondition
implementation.

Additionally, a test-case has been added (also cribbed from AArch64)
demonstrating that redundant branch sequences no longer get emitted.

E.g., it used to emit code like this:
         bne .LBB1_2
         nop
         ba .LBB1_1
         nop
 .LBB1_2:

And now emits:
        cmp %i0, 42
        be .LBB1_1
        nop

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

8 years ago[Coverage] Refactor coverage mapping reader code
Xinliang David Li [Wed, 13 Jan 2016 04:36:15 +0000 (04:36 +0000)]
[Coverage] Refactor coverage mapping reader code

(Resubmit after fixing a typo that breaks test on big endian
 machines)

In this refactoring, member functions are introduced to access
CovMap header/func record members and hide layout details. This
will enable further code restructuring to support reading multiple
versions of coverage mapping data with shared/templatized code.
(When coveremap format version changes, backward compatibtility
should be preserved).

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

8 years ago[llvm-readobj] Remove dead code. Add an assertion instead.
Davide Italiano [Wed, 13 Jan 2016 04:11:36 +0000 (04:11 +0000)]
[llvm-readobj] Remove dead code. Add an assertion instead.

When we arrive at the end of the function, the validation of
the object has been done already. In theory, so, we should never
arrive here with something broken as the object isn't mutated.
Practice sometimes proves theory to be wrong, so leave an assertion
instead, as suggested by David Blaikie, to catch bugs.

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

8 years agoRollback r257551 -- unexpected test failures TBI
Xinliang David Li [Wed, 13 Jan 2016 02:46:40 +0000 (02:46 +0000)]
Rollback r257551 -- unexpected test failures TBI

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

8 years agoRe-Revert r257105 (Verifier debug info changes)
Keno Fischer [Wed, 13 Jan 2016 02:31:14 +0000 (02:31 +0000)]
Re-Revert r257105 (Verifier debug info changes)

While I investigate some new buildbot failures. This was originally reapplied
as r257550 and r257558.

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

8 years ago[llvm-objdump] Use report_error() and improve error coverage.
Davide Italiano [Wed, 13 Jan 2016 02:03:31 +0000 (02:03 +0000)]
[llvm-objdump] Use report_error() and improve error coverage.

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

8 years ago[libFuzzer] make sure to update CurrentUnit when drilling
Kostya Serebryany [Wed, 13 Jan 2016 01:58:27 +0000 (01:58 +0000)]
[libFuzzer] make sure to update CurrentUnit when drilling

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

8 years agoUse utostr rather than std::to_string
Keno Fischer [Wed, 13 Jan 2016 01:26:57 +0000 (01:26 +0000)]
Use utostr rather than std::to_string

Looks like std::to_string is not available for Android. Hopefully
this fixes the bot.

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

8 years agoAsmPrinter: Fix wrong OS X versions being emitted for darwin triples
Matthias Braun [Wed, 13 Jan 2016 01:18:13 +0000 (01:18 +0000)]
AsmPrinter: Fix wrong OS X versions being emitted for darwin triples

The version numbers of the darwin kernel are different from the version
numbers of OS X, so we need adjustments if we had "*-*-darwin" triples.
Use the existing utility functions in TargetTriple for this.

Fixes rdar://22056966

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

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

8 years ago[CodeView] Mark our lines as statements, not expressions
David Majnemer [Wed, 13 Jan 2016 01:05:23 +0000 (01:05 +0000)]
[CodeView] Mark our lines as statements, not expressions

The line tables for CodeView make a distinction between expressions and
statements.  As it turns out, MSVC always emits them as statements and
we always emit them as expressions.  Let's switch to statements to match
the CodeView that they emit.

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

8 years ago[CodeView] Improve the line table dumper
David Majnemer [Wed, 13 Jan 2016 01:05:16 +0000 (01:05 +0000)]
[CodeView] Improve the line table dumper

This change has us print out fields we didn't previously understand.  To
improve readability, we now group column information with it's
respective line.

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

8 years ago[Coverage] Refactor coverage mapping reader code /NFC
Xinliang David Li [Wed, 13 Jan 2016 00:53:46 +0000 (00:53 +0000)]
[Coverage] Refactor coverage mapping reader code /NFC

(Resubmit after fixing build bot failures)

In this refactoring, member functions are introduced to access
CovMap header/func record members and hide layout details. This
will enable further code restructuring to support reading multiple
versions of coverage mapping data with shared/templatized code.
(When coveremap format version changes, backward compatibtility
should be preserved).

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