OSDN Git Service

android-x86/external-llvm.git
7 years agoRevert "[LoopSimplify] Factor the logic to form dedicated exits into a utility."
Daniel Jasper [Sun, 25 Jun 2017 17:58:25 +0000 (17:58 +0000)]
Revert "[LoopSimplify] Factor the logic to form dedicated exits into a utility."

This leads to a segfault. Chandler already has a test case and should be
able to recommit with a fix soon.

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

7 years ago[TableGen] Remove some copies around PatternToMatch.
Craig Topper [Sun, 25 Jun 2017 17:33:49 +0000 (17:33 +0000)]
[TableGen] Remove some copies around PatternToMatch.

Summary:
This patch does a few things that should remove some copies around PatternsToMatch. These were noticed while reviewing code for D34341.

Change constructor to take Dstregs by value and move it into the class. Change one of the callers to add std::move to the argument so that it gets moved.

Make AddPatternToMatch take PatternToMatch by rvalue reference so we can move it into the PatternsToMatch vector. I believe we should have a implicit default move constructor available on PatternToMatch. I chose rvalue reference because both callers call it with temporaries already.

Reviewers: RKSimon, aymanmus, spatel

Reviewed By: aymanmus

Subscribers: llvm-commits

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

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

7 years ago[IR] Use isIntOrIntVectorTy instead of writing it out the long way. NFC
Craig Topper [Sun, 25 Jun 2017 17:33:48 +0000 (17:33 +0000)]
[IR] Use isIntOrIntVectorTy instead of writing it out the long way. NFC

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

7 years ago[IR] Move repeated asserts in FCmpInst constructor to a helper method like we do...
Craig Topper [Sun, 25 Jun 2017 17:33:46 +0000 (17:33 +0000)]
[IR] Move repeated asserts in FCmpInst constructor to a helper method like we do for ICmpInst and other classes. NFC

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

7 years ago[X86][SSE] Remove unused memopfsf32_128/memopfsf64_128 scalar memops
Simon Pilgrim [Sun, 25 Jun 2017 17:04:58 +0000 (17:04 +0000)]
[X86][SSE] Remove unused memopfsf32_128/memopfsf64_128 scalar memops

The 'scalar' simd bitops were dropped a while ago

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

7 years agoStrip trailing whitespace. NFCI.
Simon Pilgrim [Sun, 25 Jun 2017 16:57:46 +0000 (16:57 +0000)]
Strip trailing whitespace. NFCI.

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

7 years ago[X86] Add test case for PR15705
Simon Pilgrim [Sun, 25 Jun 2017 16:12:45 +0000 (16:12 +0000)]
[X86] Add test case for PR15705

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

7 years ago[InstCombine] add (sext i1 X), 1 --> zext (not X)
Sanjay Patel [Sun, 25 Jun 2017 14:15:28 +0000 (14:15 +0000)]
[InstCombine] add (sext i1 X), 1 --> zext (not X)

http://rise4fun.com/Alive/i8Q

A narrow bitwise logic op is obviously better than math for value tracking,
and zext is better than sext. Typically, the 'not' will be folded into an
icmp predicate.

The IR difference would even survive through codegen for x86, so we would see
worse code:

https://godbolt.org/g/C14HMF

one_or_zero(int, int):                      # @one_or_zero(int, int)
        xorl    %eax, %eax
        cmpl    %esi, %edi
        setle   %al
        retq

one_or_zero_alt(int, int):                  # @one_or_zero_alt(int, int)
        xorl    %ecx, %ecx
        cmpl    %esi, %edi
        setg    %cl
        movl    $1, %eax
        subl    %ecx, %eax
        retq

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

7 years agoAVX-512: Fixed a crash during legalization of <3 x i8> type
Elena Demikhovsky [Sun, 25 Jun 2017 13:36:20 +0000 (13:36 +0000)]
AVX-512: Fixed a crash during legalization of <3 x i8> type

The compiler fails with assertion during legalization of SETCC for <3 x i8> operands.
The result is extended to <4 x i8> and then truncated <4 x i1>. It does not happen on AVX2, because the final result of SETCC is <4 x i32>.

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

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

7 years ago[AST] Fix a bug in aliasesUnknownInst. Make sure we are comparing the unknown instruc...
Xin Tong [Sun, 25 Jun 2017 12:55:11 +0000 (12:55 +0000)]
[AST] Fix a bug in aliasesUnknownInst. Make sure we are comparing the unknown instructions in the alias set and the instruction interested in.

Summary:
Make sure we are comparing the unknown instructions in the alias set and the instruction interested in.
I believe this is clearly a bug (missed opportunity). I can also add some test cases if desired.

Reviewers: hfinkel, davide, dberlin

Subscribers: llvm-commits

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

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

7 years ago[GlobalISel][X86] Support vector type G_EXTRACT selection.
Igor Breger [Sun, 25 Jun 2017 11:42:17 +0000 (11:42 +0000)]
[GlobalISel][X86] Support vector type G_EXTRACT selection.

Summary:
Support vector type G_EXTRACT selection. For now G_EXTRACT marked as legal for any type, so nothing to do in legalizer.
Split from https://reviews.llvm.org/D33665

Reviewers: qcolombet, t.p.northover, zvi, guyblank

Reviewed By: guyblank

Subscribers: guyblank, rovka, llvm-commits, kristof.beyls

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

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

7 years ago[AVX2] [TTI CostModel] Add cost of interleaved loads/stores for AVX2
Dorit Nuzman [Sun, 25 Jun 2017 08:26:25 +0000 (08:26 +0000)]
[AVX2] [TTI CostModel] Add cost of interleaved loads/stores for AVX2

The cost of an interleaved access was only implemented for AVX512. For other
X86 targets an overly conservative Base cost was returned, resulting in
avoiding vectorization where it is actually profitable to vectorize.
This patch starts to add costs for AVX2 for most prominent cases of
interleaved accesses (stride 3,4 chars, for now).

Note1: Improvements of up to ~4x were observed in some of EEMBC's rgb
workloads; There is also a known issue of 15-30% degradations on some of these
workloads, associated with an interleaved access followed by type
promotion/widening; the resulting shuffle sequence is currently inefficient and
will be improved by a series of patches that extend the X86InterleavedAccess pass
(such as D34601 and more to follow).

Note 2: The costs in this patch do not reflect port pressure penalties which can
be very dominant in the case of interleaved accesses since most of the shuffle
operations are restricted to a single port. Further tuning, that may incorporate
these considerations, will be done on top of the upcoming improved shuffle
sequences (that is, along with the abovementioned work to extend
X86InterleavedAccess pass).

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

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

7 years agoAdd support for Ananas platform
Ed Schouten [Sun, 25 Jun 2017 08:19:37 +0000 (08:19 +0000)]
Add support for Ananas platform

Ananas is a home-brew operating system, mainly for amd64 machines. After
using GCC for quite some time, it has switched to clang and never looked
back - yet, having to manually patch things is annoying, so it'd be much
nicer if this was in the official tree.

More information:

https://github.com/zhmu/ananas/
https://rink.nu/projects/ananas.html

Submitted by: Rink Springer
Differential Revision: https://reviews.llvm.org/D32937

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

7 years ago[PatternMatch] Just check if value is a Constant before calling isAllOnesValue for...
Craig Topper [Sun, 25 Jun 2017 06:56:34 +0000 (06:56 +0000)]
[PatternMatch] Just check if value is a Constant before calling isAllOnesValue for not_match. We don't really need to check for a specific subclass of Constant. NFC

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

7 years ago[pdb] Fix reading of llvm-generated PDBs by cvdump.
Zachary Turner [Sun, 25 Jun 2017 03:51:42 +0000 (03:51 +0000)]
[pdb] Fix reading of llvm-generated PDBs by cvdump.

If you dump a pdb to yaml, and then round-trip it back to a pdb,
and run cvdump -l <file> on the new pdb, cvdump will generate
output such as this.

*** LINES

** Module: "d:\src\llvm\test\DebugInfo\PDB\Inputs\empty.obj"

Error: Line number corrupted: invalid file id 0
  <Unknown> (MD5), 0001:00000010-0000001A, line/addr pairs = 3

        5 00000010      6 00000013      7 00000018

Note the error message about the corrupted line number.

It turns out that the problem is that cvdump cannot find the
/names stream (e.g. the global string table), and the reason it
can't find the /names stream is because it doesn't understand
the NameMap that we serialize which tells pdb consumers which
stream has the string table.

Some experimentation shows that if we add items to the hash
table in a specific order before serializing it, cvdump can read
it. This suggests that either we're using the wrong hash function,
or we're serializing something incorrectly, but it will take some
deeper investigation to figure out how / why.  For now, this at
least allows cvdump to read our line information (and incidentally,
produces an identical byte sequence to what Microsoft tools
produce when writing the named stream map).

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

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

7 years ago[PGO] Implementate profile counter regiser promotion
Xinliang David Li [Sun, 25 Jun 2017 00:26:43 +0000 (00:26 +0000)]
[PGO] Implementate profile counter regiser promotion

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

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

7 years ago[Support] Don't use std::iterator, it's deprecated in C++17.
Zachary Turner [Sun, 25 Jun 2017 00:00:08 +0000 (00:00 +0000)]
[Support] Don't use std::iterator, it's deprecated in C++17.

In converting this over to iterator_facade_base, some member
operators and methods are no longer needed since iterator_facade
implements them in the base class using CRTP.

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

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

7 years ago[SCEV] Avoid copying ConstantRange just to get the min/max value
Craig Topper [Sat, 24 Jun 2017 23:34:50 +0000 (23:34 +0000)]
[SCEV] Avoid copying ConstantRange just to get the min/max value

Summary:
This patch changes getRange to getRangeRef and returns a reference to the ConstantRange object stored inside the DenseMap caches. We then take advantage of that to add new helper methods that can return min/max value of a signed or unsigned ConstantRange using that reference without first copying the ConstantRange.

getRangeRef calls itself recursively and I believe the reference return is fine for those calls.

I've left getSignedRange and getUnsignedRange returning a ConstantRange object so they will make a copy now. This is to ensure safety since the reference will be invalidated if the DenseMap changes.

I'm sure there are still more places that can take advantage of the reference and I'll submit future patches as I find them.

Reviewers: sanjoy, davide

Reviewed By: sanjoy

Subscribers: zzheng, llvm-commits, mzolotukhin

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

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

7 years ago[PatternMatch] Use ConstantFP::isNan instead of getting the APFloat and calling isNaN...
Craig Topper [Sat, 24 Jun 2017 22:59:11 +0000 (22:59 +0000)]
[PatternMatch] Use ConstantFP::isNan instead of getting the APFloat and calling isNaN on that. NFC

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

7 years ago[IR] Implement commutable matchers without using combineOr
Craig Topper [Sat, 24 Jun 2017 22:59:10 +0000 (22:59 +0000)]
[IR] Implement commutable matchers without using combineOr

Summary:
Turns out creating matchers with combineOr isn't very efficient as we have to build matcher objects for both sides of the OR. Those objects aren't free, the trees usually contain several objects that contain a reference to a Value *, ConstantInt *, APInt * or some such thing. The compiler isn't always willing to inline all the matcher code to get rid of these member variables. Thus we end up loads and stores of these variables.

Using combineOR ends up creating two complete copies of the tree and the associated stores. I believe we're also paying for the opcode check twice.

This patch adds a commutable mode to several of the matcher objects as a bool template parameter that can be used to enable  commutable support directly in the match functions of the corresponding objects. This avoids the duplicate object creation and the opcode checks.

This shows about an ~7-8k reduction in the opt binary size on my local build.

Reviewers: spatel, majnemer, davide

Reviewed By: majnemer

Subscribers: llvm-commits

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

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

7 years agoAnother test commit
Anton Korobeynikov [Sat, 24 Jun 2017 21:04:32 +0000 (21:04 +0000)]
Another test commit

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

7 years agoRemove test commit change.
Tanya Lattner [Sat, 24 Jun 2017 20:13:32 +0000 (20:13 +0000)]
Remove test commit change.

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

7 years agotest commit
Tanya Lattner [Sat, 24 Jun 2017 20:08:28 +0000 (20:08 +0000)]
test commit

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

7 years agoStill debugging
Anton Korobeynikov [Sat, 24 Jun 2017 18:07:05 +0000 (18:07 +0000)]
Still debugging

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

7 years agoStill test commit
Anton Korobeynikov [Sat, 24 Jun 2017 18:05:08 +0000 (18:05 +0000)]
Still test commit

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

7 years agoAnother test commit
Anton Korobeynikov [Sat, 24 Jun 2017 18:01:33 +0000 (18:01 +0000)]
Another test commit

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

7 years agoAnother test commit
Anton Korobeynikov [Sat, 24 Jun 2017 17:47:19 +0000 (17:47 +0000)]
Another test commit

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

7 years agoTest commit
Anton Korobeynikov [Sat, 24 Jun 2017 17:35:28 +0000 (17:35 +0000)]
Test commit

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

7 years agofix trivial typos in comment, NFC
Hiroshi Inoue [Sat, 24 Jun 2017 16:00:26 +0000 (16:00 +0000)]
fix trivial typos in comment, NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306211 cdac9f57-aa62-4fd3-8940-286f4534e8a0

7 years agofix trivial typos in comment, NFC
Hiroshi Inoue [Sat, 24 Jun 2017 15:43:33 +0000 (15:43 +0000)]
fix trivial typos in comment, NFC

dereferencable -> dereferenceable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306210 cdac9f57-aa62-4fd3-8940-286f4534e8a0

7 years ago[SelectionDAG] set dereferenceable flag when expanding memcpy/memmove
Hiroshi Inoue [Sat, 24 Jun 2017 15:17:38 +0000 (15:17 +0000)]
[SelectionDAG] set dereferenceable flag when expanding memcpy/memmove

When SelectionDAG expands memcpy (or memmove) call into a sequence of load and store instructions, it disregards dereferenceable flag even the source pointer is known to be dereferenceable.
This results in an assertion failure if SelectionDAG commonizes a load instruction generated for memcpy with another load instruction for the source pointer.
This patch makes SelectionDAG to set the dereferenceable flag for the load instructions properly to avoid the assertion failure.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306209 cdac9f57-aa62-4fd3-8940-286f4534e8a0

7 years agoEnsure backends available in 'opt' are also available in 'bugpoint'
Tobias Grosser [Sat, 24 Jun 2017 08:09:33 +0000 (08:09 +0000)]
Ensure backends available in 'opt' are also available in 'bugpoint'

This patch links LLVM back-ends into bugpoint the same way they are already
available in 'opt' and 'clang'. This resolves an inconsistency that allowed the
use of LLVM backends in loadable modules that run in 'opt', but that would
prevent the debugging of these modules with bugpoint due to unavailable /
unresolved symbols.

For e.g. In D31859, Polly requires the NVPTX back-end.

Reviewers: hfinkel, bogner, chandlerc, grosser, Meinersbur

Subscribers: bollu, mgorny, grosser, Meinersbur

Tags: #polly

Contributed by: Singapuram Sanjay

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306208 cdac9f57-aa62-4fd3-8940-286f4534e8a0

7 years ago[IR] Remove BinOp2_match and replace its usage with the more capable BinOpPred_match.
Craig Topper [Sat, 24 Jun 2017 07:02:52 +0000 (07:02 +0000)]
[IR] Remove BinOp2_match and replace its usage with the more capable BinOpPred_match.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306207 cdac9f57-aa62-4fd3-8940-286f4534e8a0

7 years ago[IR][AssumptionCache] Add m_Shift and m_BitwiseLogic matchers to replace a couple...
Craig Topper [Sat, 24 Jun 2017 06:27:14 +0000 (06:27 +0000)]
[IR][AssumptionCache] Add m_Shift and m_BitwiseLogic matchers to replace a couple m_CombineOr

Summary:
m_CombineOr isn't very efficient. The code using it is also quite verbose.

This patch adds m_Shift and m_BitwiseLogic matchers to make the using code more concise and improve the match efficiency.

Reviewers: spatel, davide

Reviewed By: davide

Subscribers: davide, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306206 cdac9f57-aa62-4fd3-8940-286f4534e8a0

7 years ago[ValueTracking][InstCombine] Use m_Shr instead m_CombineOr(m_LShr, m_AShr). NFC
Craig Topper [Sat, 24 Jun 2017 06:24:04 +0000 (06:24 +0000)]
[ValueTracking][InstCombine] Use m_Shr instead m_CombineOr(m_LShr, m_AShr). NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306205 cdac9f57-aa62-4fd3-8940-286f4534e8a0

7 years ago[Analysis][Transforms] Use commutable matchers instead of m_CombineOr in a few places...
Craig Topper [Sat, 24 Jun 2017 06:24:01 +0000 (06:24 +0000)]
[Analysis][Transforms] Use commutable matchers instead of m_CombineOr in a few places. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306204 cdac9f57-aa62-4fd3-8940-286f4534e8a0

7 years agoSimplify the processFixupValue interface. NFC.
Rafael Espindola [Sat, 24 Jun 2017 06:00:03 +0000 (06:00 +0000)]
Simplify the processFixupValue interface. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306202 cdac9f57-aa62-4fd3-8940-286f4534e8a0

7 years agoAdd comments for OrderedInstruction. NFC
Xin Tong [Sat, 24 Jun 2017 05:16:12 +0000 (05:16 +0000)]
Add comments for OrderedInstruction. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306201 cdac9f57-aa62-4fd3-8940-286f4534e8a0

7 years agoRemove a processFixupValue hack.
Rafael Espindola [Sat, 24 Jun 2017 05:12:29 +0000 (05:12 +0000)]
Remove a processFixupValue hack.

The intention of processFixupValue is not to redefine the semantics of
MCExpr. It is odd enough that a expression lowers to a PCRel MCExpr or
not depending on what it looks like. At least it is a local hack now.

I left a fix for anyone trying to figure out what producers should be
producing a different expression.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306200 cdac9f57-aa62-4fd3-8940-286f4534e8a0

7 years agoAdd missing %s to RUN line.
Rafael Espindola [Sat, 24 Jun 2017 04:41:39 +0000 (04:41 +0000)]
Add missing %s to RUN line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306199 cdac9f57-aa62-4fd3-8940-286f4534e8a0

7 years agoTest the object file creation too.
Rafael Espindola [Sat, 24 Jun 2017 04:31:45 +0000 (04:31 +0000)]
Test the object file creation too.

This should *really* be a llvm-mc test, but the parser is broken.
See PR33579 for the parser bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306198 cdac9f57-aa62-4fd3-8940-286f4534e8a0

7 years ago[CODE_OWNERS] Add my other email address since my commits are now using my work email.
Craig Topper [Sat, 24 Jun 2017 03:26:01 +0000 (03:26 +0000)]
[CODE_OWNERS] Add my other email address since my commits are now using my work email.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306197 cdac9f57-aa62-4fd3-8940-286f4534e8a0

7 years agoTest commit: update my email
Anton Korobeynikov [Sat, 24 Jun 2017 03:12:53 +0000 (03:12 +0000)]
Test commit: update my email

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306196 cdac9f57-aa62-4fd3-8940-286f4534e8a0

7 years ago[InstCombine] Don't replace allocas with smaller globals
Vitaly Buka [Sat, 24 Jun 2017 01:35:19 +0000 (01:35 +0000)]
[InstCombine] Don't replace allocas with smaller globals

Summary:
InstCombine replaces large allocas with small globals consts causing buffer overflows
on valid code, see PR33372.

This fix permits this optimization only if the global is dereference for alloca size.

Fixes PR33372

Reviewers: eugenis, majnemer, chandlerc

Subscribers: llvm-commits

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

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

7 years agoMake visible isDereferenceableAndAlignedPointer(..., const APInt &Size, ...)
Vitaly Buka [Sat, 24 Jun 2017 01:35:13 +0000 (01:35 +0000)]
Make visible isDereferenceableAndAlignedPointer(..., const APInt &Size, ...)

Summary: Used by D34311 and D34467

Reviewers: hfinkel, efriedma

Subscribers: llvm-commits

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

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

7 years agoUpdate constants in complex-return test to prevent reduction to smaller constants
Nirav Dave [Sat, 24 Jun 2017 01:29:24 +0000 (01:29 +0000)]
Update constants in complex-return test to prevent reduction to smaller constants

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

7 years ago[WebAssembly] Fix build after r306177
Derek Schuff [Sat, 24 Jun 2017 01:00:43 +0000 (01:00 +0000)]
[WebAssembly] Fix build after r306177

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

7 years agoRemove redundant argument.
Rafael Espindola [Sat, 24 Jun 2017 00:26:57 +0000 (00:26 +0000)]
Remove redundant argument.

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

7 years agoFix use of uninitialized value.
Rafael Espindola [Sat, 24 Jun 2017 00:18:15 +0000 (00:18 +0000)]
Fix use of uninitialized value.

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

7 years ago[ORC] Re-apply r306166 and r306168 with fix for regression test.
Lang Hames [Fri, 23 Jun 2017 23:25:28 +0000 (23:25 +0000)]
[ORC] Re-apply r306166 and r306168 with fix for regression test.

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

7 years ago[llvm-pdbutil] Dump raw bytes of module symbols and debug chunks.
Zachary Turner [Fri, 23 Jun 2017 23:08:57 +0000 (23:08 +0000)]
[llvm-pdbutil] Dump raw bytes of module symbols and debug chunks.

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

7 years agoMove Value adjustment to applyFixup. NFC.
Rafael Espindola [Fri, 23 Jun 2017 23:05:15 +0000 (23:05 +0000)]
Move Value adjustment to applyFixup. NFC.

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

7 years agoARM: move some logic from processFixupValue to applyFixup.
Rafael Espindola [Fri, 23 Jun 2017 22:52:36 +0000 (22:52 +0000)]
ARM: move some logic from processFixupValue to applyFixup.

processFixupValue is called on every relaxation iteration. applyFixup
is only called once at the very end. applyFixup is then the correct
place to do last minute changes and value checks.

While here, do proper range checks again for fixup_arm_thumb_bl. We
used to do it, but dropped because of thumb2. We now do it again, but
use the thumb2 range.

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

7 years agoThis reverts commit r306166 and r306168.
Rafael Espindola [Fri, 23 Jun 2017 22:50:24 +0000 (22:50 +0000)]
This reverts commit r306166 and r306168.

Revert "[ORC] Remove redundant semicolons from DEFINE_SIMPLE_CONVERSION_FUNCTIONS uses."
Revert "[ORC] Move ORC IR layer interface from addModuleSet to addModule and fix the module type as std::shared_ptr<Module>."

They broke ExecutionEngine/OrcMCJIT/test-global-ctors.ll on linux.

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

7 years agoReland r306095: [mips] Fix reg positions in the aui/daui instructions
Petar Jovanovic [Fri, 23 Jun 2017 22:37:19 +0000 (22:37 +0000)]
Reland r306095: [mips] Fix reg positions in the aui/daui instructions

After fixing (r306173) a failing test in the lld test suite (r306173),
reland r306095.

Original commit message:

  [mips] Fix register positions in the aui/daui instructions

  Swapped the position of the rt and rs register in the aui/daui
  instructions for mips32r6 and mips64r6. With this change, the format of
  the generated instructions complies with specifications and GCC.
  Patch by Milos Stojanovic.

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

7 years ago[llvm-readobj] Fix COFF RVA table dumping bug
Reid Kleckner [Fri, 23 Jun 2017 22:12:11 +0000 (22:12 +0000)]
[llvm-readobj] Fix COFF RVA table dumping bug

We would return an error in getVaPtr if the RVA table being dumped was
the last data in the .rdata section. Avoid the issue by subtracting one
from the offset and adding it back to get an open interval again.

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

7 years ago[AArch64][Falkor] Remove some non-existent opcodes from sched detail regexes. NFC.
Geoff Berry [Fri, 23 Jun 2017 21:59:09 +0000 (21:59 +0000)]
[AArch64][Falkor] Remove some non-existent opcodes from sched detail regexes. NFC.

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

7 years ago[DebugInfo] Fix some Clang-tidy modernize-use-using and Include What You Use warnings...
Eugene Zelenko [Fri, 23 Jun 2017 21:57:40 +0000 (21:57 +0000)]
[DebugInfo] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

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

7 years ago[ORC] Remove redundant semicolons from DEFINE_SIMPLE_CONVERSION_FUNCTIONS uses.
Lang Hames [Fri, 23 Jun 2017 21:56:09 +0000 (21:56 +0000)]
[ORC] Remove redundant semicolons from DEFINE_SIMPLE_CONVERSION_FUNCTIONS uses.

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

7 years ago[llvm-pdbutil] Dump raw bytes of type and id records.
Zachary Turner [Fri, 23 Jun 2017 21:50:54 +0000 (21:50 +0000)]
[llvm-pdbutil] Dump raw bytes of type and id records.

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

7 years ago[ORC] Move ORC IR layer interface from addModuleSet to addModule and fix the
Lang Hames [Fri, 23 Jun 2017 21:45:29 +0000 (21:45 +0000)]
[ORC] Move ORC IR layer interface from addModuleSet to addModule and fix the
module type as std::shared_ptr<Module>.

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

7 years agoRevert "[LoopDeletion] NFC: Move phi node value setting into prepass"
Anna Thomas [Fri, 23 Jun 2017 21:30:48 +0000 (21:30 +0000)]
Revert "[LoopDeletion] NFC: Move phi node value setting into prepass"

This reverts commit r306157.
It caused some timeouts in clang tests. Perhaps unreachable loops have
far too many phi nodes.
Reverting and investigating.

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

7 years ago[llvm-pdbutil] Dump raw bytes of various DBI stream subsections.
Zachary Turner [Fri, 23 Jun 2017 21:11:54 +0000 (21:11 +0000)]
[llvm-pdbutil] Dump raw bytes of various DBI stream subsections.

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

7 years ago[MSP430] Fix data layout string.
Vadzim Dambrouski [Fri, 23 Jun 2017 21:11:45 +0000 (21:11 +0000)]
[MSP430] Fix data layout string.

Summary:
Without this patch some types have incorrect size and/or alignment
according to the MSP430 EABI.

Reviewers: asl, awygle

Reviewed By: asl

Subscribers: llvm-commits

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

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

7 years agoAdd bitcast store-merge test.
Nirav Dave [Fri, 23 Jun 2017 20:52:14 +0000 (20:52 +0000)]
Add bitcast store-merge test.

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

7 years ago[LoopDeletion] NFC: Move phi node value setting into prepass
Anna Thomas [Fri, 23 Jun 2017 20:38:50 +0000 (20:38 +0000)]
[LoopDeletion] NFC: Move phi node value setting into prepass

Currently, the implementation of delete dead loops has a special case
when the loop being deleted is never executed. This special case
(updating of exit block's incoming values for phis) can be
run as a prepass for non-executable loops before performing
the actual deletion.

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

7 years ago[APInt] Make the single word cases of isMaxSignedValue/isMinSignedValue just compare...
Craig Topper [Fri, 23 Jun 2017 20:28:52 +0000 (20:28 +0000)]
[APInt] Make the single word cases of isMaxSignedValue/isMinSignedValue just compare with the expected value rather than counting bits. NFCI

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

7 years ago[APInt] Use trailing bit counting methods instead of population count method in isAll...
Craig Topper [Fri, 23 Jun 2017 20:28:49 +0000 (20:28 +0000)]
[APInt] Use trailing bit counting methods instead of population count method in isAllOnesValue, isMaxSigendValue, and isMinSignedValue. NFCI

The trailing bit methods will early out if they find a bit of the opposite while popcount must always look at all bits. I also assume that more CPUs implement trailing bit counting with native instructions than population count.

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

7 years ago[APInt] Move the single word cases of countTrailingZeros and countLeadingOnes inline...
Craig Topper [Fri, 23 Jun 2017 20:28:45 +0000 (20:28 +0000)]
[APInt] Move the single word cases of countTrailingZeros and countLeadingOnes inline for consistency with countTrailingOnes and countLeadingZeros. NFCI

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

7 years ago[CorrelatedValuePropagation] Fix typo in comment sense->since. NFC
Craig Topper [Fri, 23 Jun 2017 20:28:40 +0000 (20:28 +0000)]
[CorrelatedValuePropagation] Fix typo in comment sense->since. NFC

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

7 years ago[CorrelatedValuePropagation] Remove comment about iterating switch cases in reverse...
Craig Topper [Fri, 23 Jun 2017 20:28:35 +0000 (20:28 +0000)]
[CorrelatedValuePropagation] Remove comment about iterating switch cases in reverse order. This is no longer being done after r298791. NFC

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

7 years ago[llvm-pdbutil] Show what blocks a stream occupies.
Zachary Turner [Fri, 23 Jun 2017 20:28:14 +0000 (20:28 +0000)]
[llvm-pdbutil] Show what blocks a stream occupies.

This is useful when you want to look at a specific chunk of a
stream or look for discontinuities, and you need to know the
list of blocks occupied by a stream.

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

7 years ago[llvm-pdbutil] Dump raw bytes of pdb name map.
Zachary Turner [Fri, 23 Jun 2017 20:18:38 +0000 (20:18 +0000)]
[llvm-pdbutil] Dump raw bytes of pdb name map.

This patch dumps the raw bytes of the pdb name map which contains
the mapping of stream name to stream index for the string table
and other reserved streams.

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

7 years ago[opt-viewer] Remove positional arg checks (NFC)
Brian Gesiak [Fri, 23 Jun 2017 20:06:34 +0000 (20:06 +0000)]
[opt-viewer] Remove positional arg checks (NFC)

Summary:
opt-stats.py and opt-viewer.py's argument parsers both take a positional
argument 'yaml_files'. Positional arguments in Python's argparse module are
required by default, so the subsequent checks for `len(args.yaml_files) == 0`
are unnecessary -- if the length was zero, then the call to
`parser.parse_args()` would have thrown an error already.

Because there is no way for `len(args.yaml_files)` to be zero at these
points, removing the code is NFC.

Reviewers: anemet, davidxl

Reviewed By: anemet

Subscribers: llvm-commits, fhahn

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

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

7 years ago[llvm-pdbutil] Add the ability to dump raw bytes from the file.
Zachary Turner [Fri, 23 Jun 2017 19:54:44 +0000 (19:54 +0000)]
[llvm-pdbutil] Add the ability to dump raw bytes from the file.

Normally we can only make sense of the content of a PDB in terms
of streams and blocks, but in some cases it may be useful to dump
bytes at a specific absolute file offset.  For example, if you
know that some interesting data is at a particular location and
you want to see some surrounding data.

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

7 years agoRevert "[Hexagon] Handle decreasing of stack alignment in frame lowering"
Krzysztof Parzyszek [Fri, 23 Jun 2017 19:47:04 +0000 (19:47 +0000)]
Revert "[Hexagon] Handle decreasing of stack alignment in frame lowering"

This breaks passing of aligned function arguments.

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

7 years ago[AArch64] Prefer Bcc to CBZ/CBNZ/TBZ/TBNZ when NZCV flags can be set for "free".
Chad Rosier [Fri, 23 Jun 2017 19:20:12 +0000 (19:20 +0000)]
[AArch64] Prefer Bcc to CBZ/CBNZ/TBZ/TBNZ when NZCV flags can be set for "free".

This patch contains a pass that transforms CBZ/CBNZ/TBZ/TBNZ instructions into a
conditional branch (Bcc), when the NZCV flags can be set for "free". This is
preferred on targets that have more flexibility when scheduling Bcc
instructions as compared to CBZ/CBNZ/TBZ/TBNZ (assuming all other variables are
equal). This can reduce register pressure and is also the default behavior for
GCC.

A few examples:

 add w8, w0, w1  -> cmn w0, w1             ; CMN is an alias of ADDS.
 cbz w8, .LBB_2  -> b.eq .LBB0_2           ; single def/use of w8 removed.

 add w8, w0, w1  -> adds w8, w0, w1        ; w8 has multiple uses.
 cbz w8, .LBB1_2 -> b.eq .LBB1_2

 sub w8, w0, w1       -> subs w8, w0, w1   ; w8 has multiple uses.
 tbz w8, #31, .LBB6_2 -> b.ge .LBB6_2

In looking at all current sub-target machine descriptions, this transformation
appears to be either positive or neutral.

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

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

7 years ago[X86] Fix SP adjustment in stack probes emitted on 32-bit Windows.
whitequark [Fri, 23 Jun 2017 18:58:10 +0000 (18:58 +0000)]
[X86] Fix SP adjustment in stack probes emitted on 32-bit Windows.

Commit r306010 adjusted the condition as follows:

-  if (Is64Bit) {
+  if (!STI.isTargetWin32()) {

The intent was to preserve the behavior on all Windows platforms
but extend the behavior on 64-bit Windows platforms to every
other one. (Before r306010, emitStackProbeCall only ever executed
when emitting code for Windows triples.)

Unfortunately,
  if (Is64Bit && STI.isOSWindows())
is not the same as
  if (!STI.isTargetWin32())
because of the way isTargetWin32() is defined:

  bool isTargetWin32() const {
    return !In64BitMode && (isTargetCygMing() ||
                            isTargetKnownWindowsMSVC());
  }

In practice this broke the JIT tests on 32-bit Windows, which did not
satisfy the new condition:

    LLVM :: ExecutionEngine/MCJIT/2003-01-15-AlignmentTest.ll
    LLVM :: ExecutionEngine/MCJIT/2003-08-15-AllocaAssertion.ll
    LLVM :: ExecutionEngine/MCJIT/2003-08-23-RegisterAllocatePhysReg.ll
    LLVM :: ExecutionEngine/MCJIT/test-loadstore.ll
    LLVM :: ExecutionEngine/OrcMCJIT/2003-01-15-AlignmentTest.ll
    LLVM :: ExecutionEngine/OrcMCJIT/2003-08-15-AllocaAssertion.ll
    LLVM :: ExecutionEngine/OrcMCJIT/2003-08-23-RegisterAllocatePhysReg.ll
    LLVM :: ExecutionEngine/OrcMCJIT/test-loadstore.ll

because %esp was not updated correctly. The failures are only visible
on a MSVC 2017 Debug build, for which we do not have bots.

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

7 years ago[llvm-pdbutil] Add a function for formatting MSF data.
Zachary Turner [Fri, 23 Jun 2017 18:52:13 +0000 (18:52 +0000)]
[llvm-pdbutil] Add a function for formatting MSF data.

The goal here is to make it possible to display absolute
file offsets when dumping byets from an MSF.  The problem is
that when dumping bytes from an MSF, often the bytes will
cross a block boundary and encounter a discontinuity.  We
can't use the normal formatBinary() function for this because
this would just treat the sequence as entirely ascending, and
not account out-of-order blocks.

This patch adds a formatMsfData() function to our printer, and
then uses this function to improve the output of the -stream-data
command line option for dumping bytes from a particular stream.

Test coverage is also expanded to make sure to include all possible
scenarios of offsets, sizes, and crossing block boundaries.

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

7 years ago[Hexagon] Remove call to printAndVerify from HexagonPassConfig
Krzysztof Parzyszek [Fri, 23 Jun 2017 18:47:55 +0000 (18:47 +0000)]
[Hexagon] Remove call to printAndVerify from HexagonPassConfig

It causes an extra pass of the machine verifier to be added to the pass
manager, and causes test/CodeGen/Generic/llc-start-stop.ll to fail.

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

7 years ago[x86] fix value types for SBB transform (PR33560)
Sanjay Patel [Fri, 23 Jun 2017 18:42:15 +0000 (18:42 +0000)]
[x86] fix value types for SBB transform (PR33560)

I'm not sure yet why this wouldn't fail in the simple case,
but clearly I used the wrong value type with:
https://reviews.llvm.org/rL306040

...and the bug manifests with:
https://bugs.llvm.org/show_bug.cgi?id=33560

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

7 years ago[X86][AVX] Regenerate i256 bitcasted store test
Simon Pilgrim [Fri, 23 Jun 2017 18:34:56 +0000 (18:34 +0000)]
[X86][AVX] Regenerate i256 bitcasted store test

Check on slow/fast unaligned memory targets

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

7 years agoFix Wdocumentation warning.
Simon Pilgrim [Fri, 23 Jun 2017 18:03:04 +0000 (18:03 +0000)]
Fix Wdocumentation warning.

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

7 years agoRegenerate extract-store.ll tests
Simon Pilgrim [Fri, 23 Jun 2017 17:19:44 +0000 (17:19 +0000)]
Regenerate extract-store.ll tests

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

7 years agoFix a misleading indentation warning.
Peter Collingbourne [Fri, 23 Jun 2017 17:17:47 +0000 (17:17 +0000)]
Fix a misleading indentation warning.

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

7 years agoMake the size specification for cache_size_bytes case insensitive.
Peter Collingbourne [Fri, 23 Jun 2017 17:13:51 +0000 (17:13 +0000)]
Make the size specification for cache_size_bytes case insensitive.

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

7 years agoAdd a ThinLTO cache policy for controlling the maximum cache size in bytes.
Peter Collingbourne [Fri, 23 Jun 2017 17:05:03 +0000 (17:05 +0000)]
Add a ThinLTO cache policy for controlling the maximum cache size in bytes.

This is useful when an upper limit on the cache size needs to be
controlled independently of the amount of the amount of free space.

One use case is a machine with a large number of cache directories
(e.g. a buildbot slave hosting a large number of independent build
jobs). By imposing an upper size limit on each cache directory,
users can more easily estimate the server's capacity.

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

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

7 years ago[Hexagon] Handle decreasing of stack alignment in frame lowering
Krzysztof Parzyszek [Fri, 23 Jun 2017 16:53:59 +0000 (16:53 +0000)]
[Hexagon] Handle decreasing of stack alignment in frame lowering

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

7 years agoAdd a BinarySubstreamRef, and a method to read one.
Zachary Turner [Fri, 23 Jun 2017 16:38:40 +0000 (16:38 +0000)]
Add a BinarySubstreamRef, and a method to read one.

This is essentially just a BinaryStreamRef packaged with an
offset and the logic for reading one is no different than the
logic for reading a BinaryStreamRef, except that we save the
current offset.

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

7 years agoRemove trailing whitespace. NFCI.
Simon Pilgrim [Fri, 23 Jun 2017 16:35:32 +0000 (16:35 +0000)]
Remove trailing whitespace. NFCI.

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

7 years agoGlobalISel: remove G_SEQUENCE instruction.
Tim Northover [Fri, 23 Jun 2017 16:15:55 +0000 (16:15 +0000)]
GlobalISel: remove G_SEQUENCE instruction.

It was trying to do too many things. The basic lumping together of values for
legalization purposes is now handled by G_MERGE_VALUES. More complex things
involving gaps and odd sizes are handled by G_INSERT sequences.

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

7 years agoGlobalISel: convert buildSequence to use non-deprecated instructions.
Tim Northover [Fri, 23 Jun 2017 16:15:37 +0000 (16:15 +0000)]
GlobalISel: convert buildSequence to use non-deprecated instructions.

G_SEQUENCE is going away soon so as a first step the MachineIRBuilder needs to
be taught how to emulate it with alternatives. We use G_MERGE_VALUES where
possible, and a sequence of G_INSERTs if not.

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

7 years ago[InlineCost] Do not take INT_MAX when Cost is negative
Jun Bum Lim [Fri, 23 Jun 2017 16:12:37 +0000 (16:12 +0000)]
[InlineCost] Do not take INT_MAX when Cost is negative

Summary: visitSwitchInst should not take INT_MAX when Cost is negative. Instead of INT_MAX , we also use a valid upperbound cost when overflow occurs in Cost.

Reviewers: hans, echristo, dmgreen

Reviewed By: dmgreen

Subscribers: mcrosier, javed.absar, llvm-commits, eraman

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

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

7 years ago[SystemZ] Remove unnecessary serialization before volatile loads
Ulrich Weigand [Fri, 23 Jun 2017 15:56:14 +0000 (15:56 +0000)]
[SystemZ] Remove unnecessary serialization before volatile loads

This reverts the use of TargetLowering::prepareVolatileOrAtomicLoad
introduced by r196905.  Nothing in the semantics of the "volatile"
keyword or the definition of the z/Architecture actually requires
that volatile loads are preceded by a serialization operation, and
no other compiler on the platform actually implements this.

Since we've now seen a use case where this additional serialization
causes noticable performance degradation, this patch removes it.

The patch still leaves in the serialization before atomic loads,
which is now implemented directly in lowerATOMIC_LOAD.  (This also
seems overkill, but that can be addressed separately.)

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

7 years ago[x86] auto-generate complete checks; NFC
Sanjay Patel [Fri, 23 Jun 2017 15:29:49 +0000 (15:29 +0000)]
[x86] auto-generate complete checks; NFC

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

7 years ago[x86] auto-generate complete checks; NFC
Sanjay Patel [Fri, 23 Jun 2017 15:22:27 +0000 (15:22 +0000)]
[x86] auto-generate complete checks; NFC

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

7 years agoAMDGPU/GlobalISel: Mark 32-bit G_AND as legal
Tom Stellard [Fri, 23 Jun 2017 15:17:17 +0000 (15:17 +0000)]
AMDGPU/GlobalISel: Mark 32-bit G_AND as legal

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, t-tye, llvm-commits

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

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

7 years ago[x86] remove overridden target settings in test; NFC
Sanjay Patel [Fri, 23 Jun 2017 15:06:30 +0000 (15:06 +0000)]
[x86] remove overridden target settings in test; NFC

r306109 was supposed to make this change, but I committed the wrong version.

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

7 years ago[x86] rename test file and auto-generate complete checks; NFC
Sanjay Patel [Fri, 23 Jun 2017 14:58:21 +0000 (14:58 +0000)]
[x86] rename test file and auto-generate complete checks; NFC

The command-line params override the target setting in the file itself, so delete that.
Also, remove the cpu and arch because those don't matter and neither does the OS specification in the triple.

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

7 years ago[X86][AVX] Extended vector average tests
Simon Pilgrim [Fri, 23 Jun 2017 14:38:00 +0000 (14:38 +0000)]
[X86][AVX] Extended vector average tests

Added AVX1 tests and merged AVX1/AVX2/AVX512 checks where possible

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