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
Aaron Ballman [Tue, 20 Jan 2015 17:10:45 +0000 (17:10 +0000)]
Silencing a -Wunused-variable warning in non-asserts builds; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226581
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 17:04:56 +0000 (17:04 +0000)]
Revert "IR: Specify underlying type instead of r226570, NFC"
This reverts commit r226571. GCC really doesn't like it [1].
[1]: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/20260
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226579
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Tue, 20 Jan 2015 16:45:27 +0000 (16:45 +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@226577
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Tue, 20 Jan 2015 16:14:02 +0000 (16:14 +0000)]
[mips] Add registers and ALL check prefix to octeon test case.
No functional change.
Reviewed by D. Sanders
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226574
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Tue, 20 Jan 2015 16:10:51 +0000 (16:10 +0000)]
[mips] Add octeon branch instructions bbit0/bbit032/bbit1/bbit132
This commits adds the octeon branch instructions bbit0/bbit032/bbit1/bbit132.
It also includes patterns for instruction selection and test cases.
Reviewed by D. Sanders
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226573
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 16:03:09 +0000 (16:03 +0000)]
IR: Specify underlying type instead of r226570, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226571
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 15:51:14 +0000 (15:51 +0000)]
IR: Store StorageType as an unsigned bitfield
Use `unsigned` instead of `StorageType` for the bitfield to prevent MSVC
from treating the top bit of the bitfield as a sign bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226570
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 20 Jan 2015 15:21:35 +0000 (15:21 +0000)]
[msan] Optimize -msan-check-constant-shadow.
The new code does not create new basic blocks in the case when shadow is a
compile-time constant; it generates either an unconditional __msan_warning
call or nothing instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226569
91177308-0d34-0410-b5e6-
96231b3b80d8
Mohit K. Bhakkad [Tue, 20 Jan 2015 13:05:42 +0000 (13:05 +0000)]
[MSan][LLVM][MIPS] Shadow and Origin offsets for MIPS
Reviewers: kcc, samsonov, petarj, eugenis
Differential Revision: http://reviews.llvm.org/D6146
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226565
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 20 Jan 2015 12:15:30 +0000 (12:15 +0000)]
[x86] Add some mayLoad/hasSideEffects flags. Remove one that was already covered by a pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226562
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 20 Jan 2015 10:58:50 +0000 (10:58 +0000)]
[PM] Port LoopInfo to the new pass manager, adding both a LoopAnalysis
pass and a LoopPrinterPass with the expected associated wiring.
I've added a RUN line to the only test case (!!!) we have that actually
prints loops. Everything seems to be working.
This is somewhat exciting as this is the first analysis using another
analysis to go in for the new pass manager. =D I also believe it is the
last analysis necessary for porting instcombine, but of course I may yet
discover more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226560
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 20 Jan 2015 10:58:38 +0000 (10:58 +0000)]
[PM] Make the LoopInfoBase and LoopInfo objects movable so that they can
be used as results in the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226559
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 20 Jan 2015 10:20:52 +0000 (10:20 +0000)]
[PM] Fix a moderately scary typo in the deleted copy constructor
I noticed when adding move semantics to LoopInfo.
Hopefully not relevant, but still scary. =]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226556
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 20 Jan 2015 10:02:49 +0000 (10:02 +0000)]
[PM] Use range-based for and auto to clean up some of the LoopInfo code.
No functionality changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226555
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 20 Jan 2015 08:57:44 +0000 (08:57 +0000)]
Factor out a splitSwitchCase() function so that it can be reused.
This is in preparation for a fix to llvm.org/PR22262. One of the ideas
here is to first find a good jump table range first and then split
before and after it. Thereby, we don't need to use the
split-based-on-density heuristic at all, which can make the "binary
tree" deteriorate in various cases.
Also some minor cleanups.
No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226551
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 20 Jan 2015 08:35:24 +0000 (08:35 +0000)]
[PM] Move the LoopInfo analysis pointer into the InstCombiner class
along with the other analyses.
The most obvious reason why is because eventually I need to separate out
the pass layer from the rest of the instcombiner. However, it is also
probably a compile time win as every query through the pass manager
layer is pretty slow these days.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226550
91177308-0d34-0410-b5e6-
96231b3b80d8
Karthik Bhat [Tue, 20 Jan 2015 06:11:00 +0000 (06:11 +0000)]
Fix Operandreorder logic in SLPVectorizer to generate longer vectorizable chain.
This patch fixes 2 issues in reorderInputsAccordingToOpcode
1) AllSameOpcodeLeft and AllSameOpcodeRight was being calculated incorrectly resulting in code not being vectorized in few cases.
2) Adds logic to reorder operands if we get longer chain of consecutive loads enabling vectorization. Handled the same for cases were we have AltOpcode.
Thanks Michael for inputs and review.
Review: http://reviews.llvm.org/D6677
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226547
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 20 Jan 2015 05:58:07 +0000 (05:58 +0000)]
Bitcode: Don't create comdats when autoupgrading macho bitcode
Don't infer COMDAT groups from older bitcode if the target is macho,
it doesn't have COMDATs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226546
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 05:02:42 +0000 (05:02 +0000)]
Reapply "IR: Simplify DIBuilder's HeaderBuilder API, NFC"
This reverts commit r226542, effectively reapplying r226540. This time,
initialize `IsEmpty` in the copy and move constructors as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226545
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 03:01:27 +0000 (03:01 +0000)]
Revert "IR: Simplify DIBuilder's HeaderBuilder API, NFC"
This reverts commit r226540, since I hit an unexpected bot failure [1].
I'll investigate.
[1]: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/20244
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226542
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 02:56:57 +0000 (02:56 +0000)]
IR: Move MDNode clone() methods from ValueMapper to MDNode, NFC
Now that the clone methods used by `MapMetadata()` don't do any
remapping (and return a temporary), they make more sense as member
functions on `MDNode` (and subclasses).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226541
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 02:54:07 +0000 (02:54 +0000)]
IR: Simplify DIBuilder's HeaderBuilder API, NFC
Change `HeaderBuilder` API to work well even when it's not starting with
a tag. There's already one case like this, and the tag is moving
elsewhere as part of PR22235.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226540
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 02:42:29 +0000 (02:42 +0000)]
AsmParser: PARSE_MD_FIELD() => ParseMDField(), NFC
Extract most of `PARSE_MD_FIELD()` into a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226539
91177308-0d34-0410-b5e6-
96231b3b80d8