Michael Kuperstein [Thu, 22 Jan 2015 12:48:07 +0000 (12:48 +0000)]
Revert r226811, MSVC accepts code sane compilers don't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226814
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Thu, 22 Jan 2015 12:37:23 +0000 (12:37 +0000)]
[DAGCombine] Produce better code for constant splats
This solves PR22276.
Splats of constants would sometimes produce redundant shuffles, sometimes ridiculously so (see the PR for details). Fold these shuffles into BUILD_VECTORs early on instead.
Differential Revision: http://reviews.llvm.org/D7093
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226811
91177308-0d34-0410-b5e6-
96231b3b80d8
Timur Iskhodzhanov [Thu, 22 Jan 2015 12:24:21 +0000 (12:24 +0000)]
[ASan/Win] Move the shadow to 0x30000000
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226809
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Thu, 22 Jan 2015 12:07:59 +0000 (12:07 +0000)]
Fixed a bug in type legalizer for masked load/store intrinsics.
The problem occurs when after vectorization we have type
<2 x i32>. This type is promoted to <2 x i64> and then requires
additional efforts for expanding loads and truncating stores.
I added EXPAND / TRUNCATE attributes to the masked load/store
SDNodes. The code now contains additional shuffles.
I've prepared changes in the cost estimation for masked memory
operations, it will be submitted separately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226808
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Thu, 22 Jan 2015 10:01:36 +0000 (10:01 +0000)]
Fixed a comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226806
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Thu, 22 Jan 2015 09:39:08 +0000 (09:39 +0000)]
Fixed a bug in narrowing store operation.
Type MVT::i1 became legal in KNL, but store operation can't be narrowed to this type,
since the size of VT (1 bit) is not equal to its actual store size(8 bits).
Added a test provided by David (dag@cray.com)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226805
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Thu, 22 Jan 2015 09:32:02 +0000 (09:32 +0000)]
[NFC] Introduce a 'struct Range' for IRCE
Use the struct instead of a std::pair<Value *, Value *>. This makes a
Range an obviously immutable object, and we can now assert that a
range is well-typed (Begin->getType() == End->getType()) on its
construction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226804
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 22 Jan 2015 09:01:20 +0000 (09:01 +0000)]
Revert r226798. Guess I missed the patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226802
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 22 Jan 2015 08:53:11 +0000 (08:53 +0000)]
Use u8imm instead of i32i8imm on a couple instructions that have no patterns and thus no reason to use a larger operand size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226798
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 22 Jan 2015 08:53:08 +0000 (08:53 +0000)]
[X86] Remove some unused multiclasses from AVX512 instruction file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226797
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Thu, 22 Jan 2015 08:29:18 +0000 (08:29 +0000)]
Fix crashes in IRCE caused by mismatched types
There are places where the inductive range check elimination pass
depends on two llvm::Values or llvm::SCEVs to be of the same
llvm::Type when they do not need to be. This patch relaxes those
restrictions (by bailing out of the optimization if the types
mismatch), and adds test cases to trigger those paths.
These issues were found by bootstrapping clang with IRCE running in
the -O3 pass ordering.
Differential Revision: http://reviews.llvm.org/D7082
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226793
91177308-0d34-0410-b5e6-
96231b3b80d8
Erik Eckstein [Thu, 22 Jan 2015 08:20:51 +0000 (08:20 +0000)]
SLPVectorizer: add a second limit for the number of alias checks.
Even with the current limit on the number of alias checks, the containing loop has quadratic complexity.
This begins to hurt for blocks containing > 1K load/store instructions.
This commit introduces a limit for the loop count. It reduces the runtime for such very large blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226792
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Thu, 22 Jan 2015 08:20:06 +0000 (08:20 +0000)]
Fixed a bug in masked load/store in reversed loop.
Added a test.
The bug was submitted to bugzilla:
http://llvm.org/bugs/show_bug.cgi?id=22225
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226791
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 22 Jan 2015 05:25:13 +0000 (05:25 +0000)]
[PM] Rename InstCombine.h to InstCombineInternal.h in preparation for
creating a non-internal header file for the InstCombine pass.
I thought about calling this InstCombiner.h or in some way more clearly
associating it with the InstCombiner clas that it is primarily defining,
but there are several other utility interfaces defined within this for
InstCombine. If, in the course of refactoring, those end up moving
elsewhere or going away, it might make more sense to make this the
combiner's header alone.
Naturally, this is a bikeshed to a certain degree, so feel free to lobby
for a different shade of paint if this name just doesn't suit you.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226783
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 22 Jan 2015 05:08:12 +0000 (05:08 +0000)]
[canonicalize] Teach InstCombine to canonicalize loads which are only
ever stored to always use a legal integer type if one is available.
Regardless of whether this particular type is good or bad, it ensures we
don't get weird differences in generated code (and resulting
performance) from "equivalent" patterns that happen to end up using
a slightly different type.
After some discussion on llvmdev it seems everyone generally likes this
canonicalization. However, there may be some parts of LLVM that handle
it poorly and need to be fixed. I have at least verified that this
doesn't impede GVN and instcombine's store-to-load forwarding powers in
any obvious cases. Subtle cases are exactly what we need te flush out if
they remain.
Also note that this IR pattern should already be hitting LLVM from Clang
at least because it is exactly the IR which would be produced if you
used memcpy to copy a pointer or floating point between memory instead
of a variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226781
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Thu, 22 Jan 2015 04:03:32 +0000 (04:03 +0000)]
ARM: fail less catastrophically on invalid Windows input
Windows supports a restricted set of relocations (compared to ARM ELF). In some
cases, we may end up generating an unsupported relocation. This can occur with
bad input to the assembler in particular (the frontend should never generate
code that cannot be compiled). Generate an error rather than just aborting.
The change in the API is driven by the desire to provide a slightly more helpful
message for debugging purposes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226779
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 22 Jan 2015 03:34:54 +0000 (03:34 +0000)]
[canonicalize] Move a helper function further up the file so it can be
used earlier. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226777
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 03:20:09 +0000 (03:20 +0000)]
DIBuilder: Make header iterator constructor explicit, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226775
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 03:17:43 +0000 (03:17 +0000)]
DIBuilder: Extract header_begin() and header_end(), NFC
Use begin/end functions so that users don't need to know how these weird
things work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226774
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 03:13:35 +0000 (03:13 +0000)]
DIBuilder: Stop abusing DIExpressionIterator::operator*(), NFC
This code was confusing, since it created a `DIExpressionIterator` from
an invalid start point (although it wasn't wrong: it never actually
iterated). Now that the underlying iterator has `getNumber()`, just use
it directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226773
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 03:11:13 +0000 (03:11 +0000)]
DIBuilder: Extract DIHeaderFieldIterator::getNumber(), NFC
Reduce code duplication between `DIBuilder` and `DIExpressionIterator`
by implementing a `getNumber()` directly in the iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226772
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 03:00:01 +0000 (03:00 +0000)]
DIBuilder: Create a getHeaderIterator() helper, NFC
Extract this so it can be reused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226770
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 22 Jan 2015 02:51:33 +0000 (02:51 +0000)]
Making deleted copy constructors and operators to be private for better diagnostics when deleted is not available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226769
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 22 Jan 2015 02:31:09 +0000 (02:31 +0000)]
SEH: Finish writing the catch-all test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226768
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 22 Jan 2015 02:27:44 +0000 (02:27 +0000)]
Win64 SEH: Emit the constant 1 for catch-all into xdata
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226767
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 22 Jan 2015 01:49:59 +0000 (01:49 +0000)]
Assigning and copying command line option objects shouldn't be allowed.
Summary:
The default copy and assignment operators for these objects probably don't actually do what the clients intend, so they should be deleted.
Places using the assignment operator to set the value of an option should cast to the option's data type first to call into the override for operator=. Places using the copy constructor just need to be changed to not copy (i.e. passing by const reference instead of value).
Reviewers: dexonsmith, chandlerc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7114
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226762
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Thu, 22 Jan 2015 00:48:47 +0000 (00:48 +0000)]
Make ScalarEvolution less aggressive with respect to no-wrap flags.
ScalarEvolution currently lowers a subtraction recurrence to an add
recurrence with the same no-wrap flags as the subtraction. This is
incorrect because `sub nsw X, Y` is not the same as `add nsw X, -Y`
and `sub nuw X, Y` is not the same as `add nuw X, -Y`. This patch
fixes the issue, and adds two test cases demonstrating the bug.
Differential Revision: http://reviews.llvm.org/D7081
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226755
91177308-0d34-0410-b5e6-
96231b3b80d8
Paul Robinson [Thu, 22 Jan 2015 00:19:56 +0000 (00:19 +0000)]
Explicitly describe '///' versus '//' comment delimiters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226750
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 22 Jan 2015 00:00:59 +0000 (00:00 +0000)]
Make DwarfExpression use the new DIExpressionIterator. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226748
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 22 Jan 2015 00:00:52 +0000 (00:00 +0000)]
Rewrite DIExpression::Verify() using an iterator. NFC.
Addresses review comments for r226627.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226747
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 21 Jan 2015 23:45:01 +0000 (23:45 +0000)]
[canonicalization] Refactor how we create new stores into a helper
function. This is a bit tidier anyways and will make a subsquent patch
simpler as I want to add another case to this combine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226746
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 21 Jan 2015 23:43:30 +0000 (23:43 +0000)]
[X86][SSE] Missing SSE/AVX1 memory folding integer instructions
Added most of the missing integer vector folding patterns for SSE (to SSE42) and AVX1.
The most useful of these are probably the i32/i64 extraction, i8/i16/i32/i64 insertions, zero/sign extension, unsigned saturation subtractions, i64 subtractions and the variable mask blends (pblendvb) - others include CLMUL, SSE42 string comparisons and bit tests.
Differential Revision: http://reviews.llvm.org/D7094
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226745
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 21 Jan 2015 23:17:19 +0000 (23:17 +0000)]
DAGCombine: fold (or (and X, M), (and X, N)) -> (and X, (or M, N))
It can help with argument juggling on some targets, and is generally a good
idea.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226740
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 21 Jan 2015 22:57:29 +0000 (22:57 +0000)]
DebugInfo: Use distinct inlinedAt MDLocations to avoid separate inlined calls being coalesced
When two calls from the same MDLocation are inlined they currently get
treated as one inlined function call (creating difficulty debugging,
duplicate variables, etc).
Clang worked around this by including column information on inline calls
which doesn't address LTO inlining or calls to the same function from
the same line and column (such as through a macro). It also didn't
address ctor and member function calls.
By making the inlinedAt locations distinct, every call site has an
explicitly distinct location that cannot be coalesced with any other
call.
This can produce linearly (2x in the worst case where every call is
inlined and the call instruction has a non-call instruction at the same
location) more debug locations. Any increase beyond that are in cases
where the Clang workaround was insufficient and the new scheme is
creating necessary distinct nodes that were being erroneously coalesced
previously.
After this change to LLVM the incomplete workarounds in Clang. That
should reduce the number of debug locations (in a build without column
info, the default on Darwin, not the default on Linux) by not creating
pseudo-distinct locations for every call to an inline function.
(oh, and I made the inlined-at chain rebuilding iterative instead of
recursive because I was having trouble wrapping my head around it the
way it was - open to discussion on the right design for that function
(including going back to a recursive solution))
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226736
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 21 Jan 2015 22:56:15 +0000 (22:56 +0000)]
R600: Add checks for urem/srem by a constant
Make sure this uses the faster expansion using magic constants
to avoid the full division path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226734
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 21 Jan 2015 22:55:13 +0000 (22:55 +0000)]
LiveIntervalAnalysis: Mark subregister defs as undef when we determined they are only reading a dead superregister value
This was not necessary before as this case can only be detected when the
liveness analysis is at subregister level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226733
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 21 Jan 2015 22:45:52 +0000 (22:45 +0000)]
Adding a new cl::HideUnrelatedOptions API to allow clang to migrate off cl::getRegisteredOptions.
Summary: cl::getRegisteredOptions really exposes some of the innards of how command line parsing is implemented. Exposing new APIs that allow us to disentangle client code from implementation details will allow us to make more extensive changes to command line parsing.
Reviewers: chandlerc, dexonsmith, beanz
Reviewed By: dexonsmith
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7100
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226729
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 21 Jan 2015 22:44:35 +0000 (22:44 +0000)]
[X86][SSE] Added support for SSE3 lane duplication shuffle instructions
This patch adds shuffle matching for the SSE3 MOVDDUP, MOVSLDUP and MOVSHDUP instructions. The big use of these being that they avoid many single source shuffles from needing to use (pre-AVX) dual source instructions such as SHUFPD/SHUFPS: causing extra moves and preventing load folds.
Adding these instructions uncovered an issue in XFormVExtractWithShuffleIntoLoad which crashed on single operand shuffle instructions (now fixed). It also involved fixing getTargetShuffleMask to correctly identify theses instructions as unary shuffles.
Also adds a missing tablegen pattern for MOVDDUP.
Differential Revision: http://reviews.llvm.org/D7042
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226716
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 21 Jan 2015 22:43:19 +0000 (22:43 +0000)]
R600: Add missing tests for i64 srem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226713
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonathan Roelofs [Wed, 21 Jan 2015 22:39:43 +0000 (22:39 +0000)]
Fix load-store optimizer on thumbv4t
Thumbv4t does not have lo->lo copies other than MOVS,
and that can't be predicated. So emit MOVS when needed
and bail if there's a predicate.
http://reviews.llvm.org/D6592
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226711
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Wed, 21 Jan 2015 22:39:35 +0000 (22:39 +0000)]
Added test to cover the CFLAA bitset indexing bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226710
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 21 Jan 2015 22:32:04 +0000 (22:32 +0000)]
InstCombine: Don't strip bitcasts off of callsites marked 'thunk'
The return type of a thunk is meaningless, we just want the arguments
and return value to be forwarded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226708
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 21 Jan 2015 22:02:30 +0000 (22:02 +0000)]
[X86][SSE] movddup shuffle mask decodes
Patch to provide shuffle decodes and asm comments for the SSE3/AVX1 movddup double duplication instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226705
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 21 Jan 2015 21:23:35 +0000 (21:23 +0000)]
simplify expression
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226701
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 21 Jan 2015 19:25:35 +0000 (19:25 +0000)]
Fix a compile issue on MSVC and call finalize().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226694
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 21 Jan 2015 19:02:30 +0000 (19:02 +0000)]
LiveIntervalAnalysis: Factor out code to update liveness on vreg def removal
This cleans up code and is more in line with the general philosophy of
modifying LiveIntervals through LiveIntervalAnalysis instead of changing
them directly.
This also fixes a case where SplitEditor::removeBackCopies() would miss
the subregister ranges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226690
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 21 Jan 2015 19:02:26 +0000 (19:02 +0000)]
LiveIntervalAnalysis: document removePhysRegDefAt() function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226689
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 21 Jan 2015 18:50:21 +0000 (18:50 +0000)]
LiveIntervalAnalysis: Factor out code to update liveness on physreg def removal
This cleans up code and is more in line with the general philosophy of
modifying LiveIntervals through LiveIntervalAnalysis instead of changing
them directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226687
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 21 Jan 2015 18:45:57 +0000 (18:45 +0000)]
LiveIntervalAnalysis: Remove unused pruneValue() variant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226686
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 21 Jan 2015 18:32:56 +0000 (18:32 +0000)]
Let subprograms with instructions without parent scopes fail the
verification. Tested via a unit test.
Follow-up to r226616.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226684
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 21 Jan 2015 18:18:25 +0000 (18:18 +0000)]
R600/SI: Custom lower fround
This fixes it for SI. It also removes the pattern
used previously for Evergreen for f32. I'm not sure
if the the new R600 output is better or not, but it uses
1 fewer instructions if BFI is available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226682
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Wed, 21 Jan 2015 18:13:15 +0000 (18:13 +0000)]
[Hexagon] Converting multiply and accumulate with immediate intrinsics to patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226681
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Wed, 21 Jan 2015 17:07:06 +0000 (17:07 +0000)]
[X86] Declare SSE4.1/AVX2 vector extloads covered by PMOV[SZ]X legal.
Now that we can fully specify extload legality, we can declare them
legal for the PMOVSX/PMOVZX instructions. This for instance enables
a DAGCombine to fire on code such as
(and (<zextload-equivalent> ...), <redundant mask>)
to turn it into:
(zextload ...)
as seen in the testcase changes.
There is one regression, in widen_load-2.ll: we're no longer able
to do store-to-load forwarding with illegal extload memory types.
This will be addressed separately.
Differential Revision: http://reviews.llvm.org/D6533
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226676
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Fiselier [Wed, 21 Jan 2015 16:38:31 +0000 (16:38 +0000)]
[lit] Format JSONMetricValue strings better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226672
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Wed, 21 Jan 2015 16:37:21 +0000 (16:37 +0000)]
Fixed a bug with how we determine bitset indices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226671
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Wed, 21 Jan 2015 16:20:38 +0000 (16:20 +0000)]
Add missing include guards to WindowsSupport.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226669
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 21 Jan 2015 15:48:52 +0000 (15:48 +0000)]
Revert "DAGCombine: fold (or (and X, M), (and X, N)) -> (and X, (or M, N))"
It hadn't gone through review yet, but was still on my local copy.
This reverts commit r226663
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226665
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 21 Jan 2015 15:43:31 +0000 (15:43 +0000)]
AArch64: add backend option to reserve x18 (platform register)
AAPCS64 says that it's up to the platform to specify whether x18 is
reserved, and a first step on that way is to add a flag controlling
it.
From: Andrew Turner <andrew@fubar.geek.nz>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226664
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 21 Jan 2015 15:43:28 +0000 (15:43 +0000)]
DAGCombine: fold (or (and X, M), (and X, N)) -> (and X, (or M, N))
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226663
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Wed, 21 Jan 2015 14:44:05 +0000 (14:44 +0000)]
[x32] Fast ISel should use LEA64_32r instead of LEA32r to adjust addresses in x32 mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226661
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Potapenko [Wed, 21 Jan 2015 13:52:02 +0000 (13:52 +0000)]
Use a smaller pragma unroll threshold to reduce test execution time.
When opt is compiled with AddressSanitizer it takes more than 30 seconds
to unroll the loop in unroll_1M().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226660
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Wed, 21 Jan 2015 13:21:31 +0000 (13:21 +0000)]
[msan] Update origin for the entire destination range on memory store.
Previously we always stored 4 bytes of origin at the destination address
even for 8-byte (and longer) stores.
This should fix rare missing, or incorrect, origin stacks in MSan reports.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226658
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Wed, 21 Jan 2015 12:39:30 +0000 (12:39 +0000)]
[mips][microMIPS] MicroMIPS 16-bit unconditional branch instruction B
Implement microMIPS 16-bit unconditional branch instruction B.
Implemented 16-bit microMIPS unconditional instruction has real name B16, and
B is an alias which expands to either B16 or BEQ according to the rules:
b 256 --> b16 256 # R_MICROMIPS_PC10_S1
b 12256 --> beq $zero, $zero, 12256 # R_MICROMIPS_PC16_S1
b label --> beq $zero, $zero, label # R_MICROMIPS_PC16_S1
Differential Revision: http://reviews.llvm.org/D3514
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226657
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Wed, 21 Jan 2015 12:10:11 +0000 (12:10 +0000)]
[mips][microMIPS] Implement ADDIUPC instruction
Differential Revision: http://reviews.llvm.org/D6582
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226656
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 21 Jan 2015 11:38:17 +0000 (11:38 +0000)]
[PM] Refactor the InstCombiner interface to use an external worklist.
Because in its primary function pass the combiner is run repeatedly over
the same function until doing so produces no changes, it is essentially
to not re-allocate the worklist. However, as a utility, the more common
pattern would be to put a limited set of instructions in the worklist
rather than the entire function body. That is also the more likely
pattern when used by the new pass manager.
The result is a very light weight combiner that does the visiting with
a separable worklist. This can then be wrapped up in a helper function
for users that want a combiner utility, or as I have here it can be
wrapped up in a pass which manages the iterations used when combining an
entire function's instructions.
Hopefully this removes some of the worst of the interface warts that
became apparant with the last patch here. However, there is clearly more
work. I've again left some FIXMEs for the most egregious. The ones that
stick out to me are the exposure of the worklist and IR builder as
public members, and the use of pointers rather than references. However,
fixing these is likely to be much more mechanical and less interesting
so I didn't want to touch them in this patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226655
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 21 Jan 2015 11:23:40 +0000 (11:23 +0000)]
[PM] Simplify (ha! ha!) the way that instcombine calls the
SimplifyLibCalls utility by sinking it into the specific call part of
the combiner.
This will avoid us needing to do any contortions to build this object in
a subsequent refactoring I'm doing and seems generally better factored.
We don't need this utility everywhere and it carries no interesting
state so we might as well build it on demand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226654
91177308-0d34-0410-b5e6-
96231b3b80d8
Vladimir Medic [Wed, 21 Jan 2015 10:47:36 +0000 (10:47 +0000)]
[Mips][Disassembler]When disassembler meets load/store from coprocessor 2 instructions for mips r6 it crashes as the access to operands array is out of range. This patch adds dedicated decoder method that properly handles decoding of these instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226652
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 21 Jan 2015 08:43:57 +0000 (08:43 +0000)]
[x86] Remove some unnecessary and slightly confusing typecasts from some patterns. I think it actually went i32->iPtr->i32 in some of these cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226647
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 21 Jan 2015 08:43:49 +0000 (08:43 +0000)]
[X86] Convert all the i8imm used by AVX512 and MMX instructions to u8imm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226646
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 21 Jan 2015 08:15:54 +0000 (08:15 +0000)]
[X86] Convert all the i8imm used by SSE and AVX instructions to u8imm.
This makes the assembler check their size and removes a hack from the disassembler to avoid sign extending the immediate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226645
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 21 Jan 2015 06:07:53 +0000 (06:07 +0000)]
[x86] Add assembly parser bounds checking to the immediate value for cmpss/cmpsd/cmpps/cmppd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226642
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 21 Jan 2015 02:11:59 +0000 (02:11 +0000)]
[PM] Replace an abuse of inheritance to override a single function with
a more direct approach: a type-erased glorified function pointer. Now we
can pass a function pointer into this for the easy case and we can even
pass a lambda into it in the interesting case in the instruction
combiner.
I'll be using this shortly to simplify the interfaces to InstCombiner,
but this helps pave the way and seems like a better design for the
libcall simplifier utility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226640
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 21 Jan 2015 00:59:20 +0000 (00:59 +0000)]
Make DIExpression::Verify() stricter by checking that the number of
elements and the ordering is sane and cleanup the accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226627
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 21 Jan 2015 00:02:13 +0000 (00:02 +0000)]
[X86][AVX] Simplified diff between AVX1 and SSE42 fp stack folding tests. NFC.
Changed the AVX1 tests register spill tail call to return a xmm like the SSE42 version - makes doing diffs between them a lot easier without affecting the spills themselves.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226623
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 20 Jan 2015 23:54:17 +0000 (23:54 +0000)]
[X86][SSE] Added SSE/AVX1 integer stack folding tests.
Some folding patterns + tests are missing (marked as TODO) - these will be added in a future patch for review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226622
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 20 Jan 2015 23:50:18 +0000 (23:50 +0000)]
[X86][SSE] Added SSE fp stack folding tests.
Some folding patterns + tests are missing (marked as TODO) - these will be added in a future patch for review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226621
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 20 Jan 2015 23:45:50 +0000 (23:45 +0000)]
[X86][AVX] Renamed AVX1 fp stack folding tests. NFC.
The SSE42 version of the AVX1 float stack folding tests will be added shortly, this renames the AVX1 file so that the files will be near each other in a directory listing to help ensure they are kept in sync.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226620
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 20 Jan 2015 22:44:35 +0000 (22:44 +0000)]
[PM] Separate the InstCombiner from its pass.
This creates a small internal pass which runs the InstCombiner over
a function. This is the hard part of porting InstCombine to the new pass
manager, as at this point none of the code in InstCombine has access to
a Pass object any longer.
The resulting interface for the InstCombiner is pretty terrible. I'm not
planning on leaving it that way. The key thing missing is that we need
to separate the worklist from the combiner a touch more. Once that's
done, it should be possible for *any* part of LLVM to just create
a worklist with instructions, populate it, and then combine it until
empty. The pass will just be the (obvious and important) special case of
doing that for an entire function body.
For now, this is the first increment of factoring to make all of this
work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226618
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 20 Jan 2015 22:37:25 +0000 (22:37 +0000)]
DebugLocs without a scope should fail the verification.
Follow-up to r226588.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226616
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 20 Jan 2015 22:08:20 +0000 (22:08 +0000)]
Don't pass -Wl,z,defs for now.
It broke the msan build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226613
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Tue, 20 Jan 2015 21:47:46 +0000 (21:47 +0000)]
For llvm-objdump, hook up existing options to work when using -macho (the Mach-O parser).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226612
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 20 Jan 2015 21:23:15 +0000 (21:23 +0000)]
Use -Wl,defs when linking.
ELF linkers by default allow shared libraries to contain undefined references
and it is up to the dynamic linker to look for them.
On COFF and MachO, that is not the case.
This creates a situation where a .so might build on an ELF system, but the build
of the corresponding .dylib or .dll will fail.
This patch changes the cmake build to use -Wl,-z,defs when linking and updates
the dependencies so that -DBUILD_SHARED_LIBS=ON build still works.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226611
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 20 Jan 2015 21:10:35 +0000 (21:10 +0000)]
[PM] Reformat this code with clang-format so that subsequent changes
don't get muddied up by formatting changes.
Some of these don't really seem like improvements to me, but they also
don't seem any worse and I care much more about not formatting them
manually than I do about the particular formatting. =]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226610
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 20 Jan 2015 20:45:05 +0000 (20:45 +0000)]
[Hexagon] Adding intrinsics for doubleword ALU operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226606
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 20 Jan 2015 19:46:07 +0000 (19:46 +0000)]
[Hexagon] Removing unnecessary clutter in intrinsic tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226602
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 20 Jan 2015 19:43:33 +0000 (19:43 +0000)]
Prevent binary-tree deterioration in sparse switch statements.
This addresses part of llvm.org/PR22262. Specifically, it prevents
considering the densities of sub-ranges that have fewer than
TLI.getMinimumJumpTableEntries() elements. Those densities won't help
jump tables.
This is not a complete solution but works around the most pressing
issue.
Review: http://reviews.llvm.org/D7070
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226600
91177308-0d34-0410-b5e6-
96231b3b80d8
Ramkumar Ramachandra [Tue, 20 Jan 2015 19:42:46 +0000 (19:42 +0000)]
[GC] Verify-pass void vararg functions in gc.statepoint
With the appropriate Verifier changes, exactracting the result out of a
statepoint wrapping a vararg function crashes. However, a void vararg
function works fine: commit this first step.
Differential Revision: http://reviews.llvm.org/D7071
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226599
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 20 Jan 2015 19:42:22 +0000 (19:42 +0000)]
Reapply: Teach SROA how to update debug info for fragmented variables.
This reapplies r225379.
ChangeLog:
- The assertion that this commit previously ran into about the inability
to handle indirect variables has since been removed and the backend
can handle this now.
- Testcases were upgrade to the new MDLocation format.
- Instead of keeping a DebugDeclares map, we now use
llvm::FindAllocaDbgDeclare().
Original commit message follows.
Debug info: Teach SROA how to update debug info for fragmented variables.
This allows us to generate debug info for extremely advanced code such as
typedef struct { long int a; int b;} S;
int foo(S s) {
return s.b;
}
which at -O1 on x86_64 is codegen'd into
define i32 @foo(i64 %s.coerce0, i32 %s.coerce1) #0 {
ret i32 %s.coerce1, !dbg !24
}
with this patch we emit the following debug info for this
TAG_formal_parameter [3]
AT_location( 0x00000000
0x0000000000000000 - 0x0000000000000006: rdi, piece 0x00000008, rsi, piece 0x00000004
0x0000000000000006 - 0x0000000000000008: rdi, piece 0x00000008, rax, piece 0x00000004 )
AT_name( "s" )
AT_decl_file( "/Volumes/Data/llvm/_build.ninja.release/test.c" )
Thanks to chandlerc, dblaikie, and echristo for their feedback on all
previous iterations of this patch!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226598
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 20 Jan 2015 19:33:04 +0000 (19:33 +0000)]
R600/SI: Add subtarget feature to enable VGPR spilling for all shader types
This is disabled by default, but can be enabled with the subtarget
feature: 'vgpr-spilling'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226597
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 20 Jan 2015 19:33:02 +0000 (19:33 +0000)]
R600/SI: Fix simple-loop.ll test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226596
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Tue, 20 Jan 2015 19:29:28 +0000 (19:29 +0000)]
Reverted revision 226577.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226595
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 20 Jan 2015 19:27:58 +0000 (19:27 +0000)]
[PM] Clean up a bunch of the doxygen / API docs on the InstCombiner pass
prior to refactoring it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226594
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Tue, 20 Jan 2015 19:24:59 +0000 (19:24 +0000)]
[llvm link] Destroy ConstantArrays in LLVMContext if they are not used.
ConstantArrays constructed during linking can cause quadratic memory
explosion. An example is the ConstantArrays constructed when linking in
GlobalVariables with appending linkage.
Releasing all unused constants can cause a 20% LTO compile-time
slowdown for a large application. So this commit releases unused ConstantArrays
only.
rdar://
19040716. It reduces memory footprint from 20+G to 6+G.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226592
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 20 Jan 2015 19:24:31 +0000 (19:24 +0000)]
R600/SI: Remove stray debugging code from r226586
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226591
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 20 Jan 2015 18:54:16 +0000 (18:54 +0000)]
[PM] Don't spend time making self moves no-ops. They're allowed to leave
the object in a moved-from state, and its simpler to write the code that
way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226589
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 20 Jan 2015 18:03:37 +0000 (18:03 +0000)]
Add an assertion and prefer a crash over an infinite loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226588
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 20 Jan 2015 17:49:47 +0000 (17:49 +0000)]
R600/SI: Use external symbols for scratch buffer
We were passing the scratch buffer address to the shaders via user sgprs,
but now we use external symbols and have the driver patch the shader
using reloc information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226586
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 20 Jan 2015 17:49:45 +0000 (17:49 +0000)]
R600/SI: Add kill flag when copying scratch offset to a register
This allows us to re-use the same register for the scratch offset
when accessing large private arrays.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226585
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 20 Jan 2015 17:49:43 +0000 (17:49 +0000)]
R600/SI: Don't store scratch buffer frame index in MUBUF offset field
We don't have a good way of legalizing this if the frame index offset
is more than the 12-bits, which is size of MUBUF's offset field, so
now we store the frame index in the vaddr field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226584
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 20 Jan 2015 17:49:41 +0000 (17:49 +0000)]
R600/SI: Update SIInstrInfo:verifyInstruction() after r225662
Now that we have our own custom register operand types, we need
to handle them in the verifiier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226583
91177308-0d34-0410-b5e6-
96231b3b80d8