Commit Graph

150898 Commits

Author SHA1 Message Date
Craig Topper
37582000a6 [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
2017-06-25 17:33:46 +00:00
Simon Pilgrim
61b5c7bb8b [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
2017-06-25 17:04:58 +00:00
Simon Pilgrim
90dbf3c865 Strip trailing whitespace. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306247 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-25 16:57:46 +00:00
Simon Pilgrim
d33969c6c7 [X86] Add test case for PR15705
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306246 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-25 16:12:45 +00:00
Sanjay Patel
1e95676e58 [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
2017-06-25 14:15:28 +00:00
Elena Demikhovsky
e8c8f15850 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
2017-06-25 13:36:20 +00:00
Xin Tong
5b97b27fed [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
2017-06-25 12:55:11 +00:00
Igor Breger
17d822b423 [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
2017-06-25 11:42:17 +00:00
Dorit Nuzman
65b3f67e1c [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
2017-06-25 08:26:25 +00:00
Ed Schouten
fc7d8c45e2 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
2017-06-25 08:19:37 +00:00
Craig Topper
750feae3fa [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
2017-06-25 06:56:34 +00:00
Zachary Turner
e7f7e6d72a [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
2017-06-25 03:51:42 +00:00
Xinliang David Li
0a14fbb39c [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
2017-06-25 00:26:43 +00:00
Zachary Turner
f33ec6fb18 [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
2017-06-25 00:00:08 +00:00
Craig Topper
5e4b09c56f [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
2017-06-24 23:34:50 +00:00
Craig Topper
456b664433 [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
2017-06-24 22:59:11 +00:00
Craig Topper
96479ada9c [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
2017-06-24 22:59:10 +00:00
Anton Korobeynikov
472c4c7053 Another test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306224 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-24 21:04:32 +00:00
Tanya Lattner
62a29da117 Remove test commit change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306223 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-24 20:13:32 +00:00
Tanya Lattner
0663649ed3 test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306222 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-24 20:08:28 +00:00
Anton Korobeynikov
0d6b8a0449 Still debugging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306216 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-24 18:07:05 +00:00
Anton Korobeynikov
946178903d Still test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306215 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-24 18:05:08 +00:00
Anton Korobeynikov
90c358f0e8 Another test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306214 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-24 18:01:33 +00:00
Anton Korobeynikov
4ec00d2567 Another test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306213 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-24 17:47:19 +00:00
Anton Korobeynikov
a13c3598b6 Test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306212 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-24 17:35:28 +00:00
Hiroshi Inoue
d64f8eb85d fix trivial typos in comment, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306211 cdac9f57-aa62-4fd3-8940-286f4534e8a0
2017-06-24 16:00:26 +00:00
Hiroshi Inoue
aa970efe79 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
2017-06-24 15:43:33 +00:00
Hiroshi Inoue
059bd0e36c [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
2017-06-24 15:17:38 +00:00
Tobias Grosser
7f3bf01d63 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
2017-06-24 08:09:33 +00:00
Craig Topper
d68b29ae18 [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
2017-06-24 07:02:52 +00:00
Craig Topper
82dfc83ad0 [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
2017-06-24 06:27:14 +00:00
Craig Topper
5f53d1df70 [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
2017-06-24 06:24:04 +00:00
Craig Topper
bd1a80dfb0 [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
2017-06-24 06:24:01 +00:00
Rafael Espindola
64b68b36f5 Simplify the processFixupValue interface. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306202 cdac9f57-aa62-4fd3-8940-286f4534e8a0
2017-06-24 06:00:03 +00:00
Xin Tong
718bab77be Add comments for OrderedInstruction. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306201 cdac9f57-aa62-4fd3-8940-286f4534e8a0
2017-06-24 05:16:12 +00:00
Rafael Espindola
3a48f331ba 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
2017-06-24 05:12:29 +00:00
Rafael Espindola
c88c3632e7 Add missing %s to RUN line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306199 cdac9f57-aa62-4fd3-8940-286f4534e8a0
2017-06-24 04:41:39 +00:00
Rafael Espindola
82693db150 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
2017-06-24 04:31:45 +00:00
Craig Topper
a887b09351 [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
2017-06-24 03:26:01 +00:00
Anton Korobeynikov
9210f44c09 Test commit: update my email
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306196 cdac9f57-aa62-4fd3-8940-286f4534e8a0
2017-06-24 03:12:53 +00:00
Vitaly Buka
739f0de995 [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
2017-06-24 01:35:19 +00:00
Vitaly Buka
2587e3ecef 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
2017-06-24 01:35:13 +00:00
Nirav Dave
5c10c24880 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
2017-06-24 01:29:24 +00:00
Derek Schuff
39844e05ba [WebAssembly] Fix build after r306177
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306190 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-24 01:00:43 +00:00
Rafael Espindola
bfb1e6dd81 Remove redundant argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306189 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-24 00:26:57 +00:00
Rafael Espindola
8eec1b8358 Fix use of uninitialized value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306188 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-24 00:18:15 +00:00
Lang Hames
72786af0ac [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
2017-06-23 23:25:28 +00:00
Zachary Turner
554302ac5b [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
2017-06-23 23:08:57 +00:00
Rafael Espindola
374592322d Move Value adjustment to applyFixup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306178 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-23 23:05:15 +00:00
Rafael Espindola
3d8b65f712 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
2017-06-23 22:52:36 +00:00