oota-llvm.git
10 years agoCostmodel: Add support for horizontal vector reductions
Arnold Schwaighofer [Tue, 17 Sep 2013 18:06:50 +0000 (18:06 +0000)]
Costmodel: Add support for horizontal vector reductions

Upcoming SLP vectorization improvements will want to be able to estimate costs
of horizontal reductions. Add infrastructure to support this.

We model reductions as a series of (shufflevector,add) tuples ultimately
followed by an extractelement. For example, for an add-reduction of <4 x float>
we could generate the following sequence:

 (v0, v1, v2, v3)
   \   \  /  /
     \  \  /
       +  +

 (v0+v2, v1+v3, undef, undef)
    \      /
 ((v0+v2) + (v1+v3), undef, undef)

 %rdx.shuf = shufflevector <4 x float> %rdx, <4 x float> undef,
                           <4 x i32> <i32 2, i32 3, i32 undef, i32 undef>
 %bin.rdx = fadd <4 x float> %rdx, %rdx.shuf
 %rdx.shuf7 = shufflevector <4 x float> %bin.rdx, <4 x float> undef,
                          <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
 %bin.rdx8 = fadd <4 x float> %bin.rdx, %rdx.shuf7
 %r = extractelement <4 x float> %bin.rdx8, i32 0

This commit adds a cost model interface "getReductionCost(Opcode, Ty, Pairwise)"
that will allow clients to ask for the cost of such a reduction (as backends
might generate more efficient code than the cost of the individual instructions
summed up). This interface is excercised by the CostModel analysis pass which
looks for reduction patterns like the one above - starting at extractelements -
and if it sees a matching sequence will call the cost model interface.

We will also support a second form of pairwise reduction that is well supported
on common architectures (haddps, vpadd, faddp).

 (v0, v1, v2, v3)
  \   /    \  /
 (v0+v1, v2+v3, undef, undef)
    \     /
 ((v0+v1)+(v2+v3), undef, undef, undef)

  %rdx.shuf.0.0 = shufflevector <4 x float> %rdx, <4 x float> undef,
        <4 x i32> <i32 0, i32 2 , i32 undef, i32 undef>
  %rdx.shuf.0.1 = shufflevector <4 x float> %rdx, <4 x float> undef,
        <4 x i32> <i32 1, i32 3, i32 undef, i32 undef>
  %bin.rdx.0 = fadd <4 x float> %rdx.shuf.0.0, %rdx.shuf.0.1
  %rdx.shuf.1.0 = shufflevector <4 x float> %bin.rdx.0, <4 x float> undef,
        <4 x i32> <i32 0, i32 undef, i32 undef, i32 undef>
  %rdx.shuf.1.1 = shufflevector <4 x float> %bin.rdx.0, <4 x float> undef,
        <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
  %bin.rdx.1 = fadd <4 x float> %rdx.shuf.1.0, %rdx.shuf.1.1
  %r = extractelement <4 x float> %bin.rdx.1, i32 0

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

10 years agoSLPVectorizer: Don't vectorize phi nodes that use invoke values
Arnold Schwaighofer [Tue, 17 Sep 2013 17:03:29 +0000 (17:03 +0000)]
SLPVectorizer: Don't vectorize phi nodes that use invoke values

We can't insert an insertelement after an invoke. We would have to split a
critical edge. So when we see a phi node that uses an invoke we just give up.

radar://14990770

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

10 years ago[InstCombiner] Slice a big load in two loads when the elements are next to each
Quentin Colombet [Tue, 17 Sep 2013 16:57:34 +0000 (16:57 +0000)]
[InstCombiner] Slice a big load in two loads when the elements are next to each
other in memory.

The motivation was to get rid of truncate and shift right instructions that get
in the way of paired load or floating point load.
E.g.,
Consider the following example:
struct Complex {
  float real;
  float imm;
};

When accessing a complex, llvm was generating a 64-bits load and the imm field
was obtained by a trunc(lshr) sequence, resulting in poor code generation, at
least for x86.

The idea is to declare that two load instructions is the canonical form for
loading two arithmetic type, which are next to each other in memory.

Two scalar loads at a constant offset from each other are pretty
easy to detect for the sorts of passes that like to mess with loads.

<rdar://problem/14477220>

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

10 years agoRemove unused code, which had been commented out.
Preston Gurd [Tue, 17 Sep 2013 16:53:36 +0000 (16:53 +0000)]
Remove unused code, which had been commented out.

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

10 years agoAdded documentation to getMemsetStores.
Serge Pavlov [Tue, 17 Sep 2013 16:24:42 +0000 (16:24 +0000)]
Added documentation to getMemsetStores.

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

10 years agoAdd llvm.x86.* intrinsics for Intel SHA Extensions
Ben Langmuir [Tue, 17 Sep 2013 13:44:39 +0000 (13:44 +0000)]
Add llvm.x86.* intrinsics for Intel SHA Extensions

Add llvm.x86.* intrinsics for all of the Intel SHA Extensions instructions, as
well as tests. Also remove mayLoad and hasSideEffects, which can be inferred
from the instruction patterns.

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

10 years ago[asan] inline the calls to __asan_stack_free_* with small sizes. Yet another 10%...
Kostya Serebryany [Tue, 17 Sep 2013 12:14:50 +0000 (12:14 +0000)]
[asan] inline the calls to __asan_stack_free_* with small sizes. Yet another 10%-20% speedup for use-after-return

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

10 years ago[ARM] Fix the deprecation of MCR encodings that map to CP15{ISB,DSB,DMB}.
Joey Gouly [Tue, 17 Sep 2013 09:54:57 +0000 (09:54 +0000)]
[ARM] Fix the deprecation of MCR encodings that map to CP15{ISB,DSB,DMB}.

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

10 years agoBugfix for PR17099:
Stepan Dyatkovskiy [Tue, 17 Sep 2013 09:36:11 +0000 (09:36 +0000)]
Bugfix for PR17099:
Wrong cast operation.
MergeFunctions emits Bitcast instead of pointer-to-integer operation.
Patch fixes MergeFunctions::writeThunk function. It replaces
unconditional Bitcast creation with "Value* createCast(...)" method, that
checks operand types and selects proper instruction.
See unit-test as example.

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

10 years agoAVX-512: Converted to Unix style
Elena Demikhovsky [Tue, 17 Sep 2013 07:34:34 +0000 (07:34 +0000)]
AVX-512: Converted to Unix style

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

10 years agoAdd AES and SHA instructions to the load folding tables.
Craig Topper [Tue, 17 Sep 2013 06:50:11 +0000 (06:50 +0000)]
Add AES and SHA instructions to the load folding tables.

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

10 years agoFix column alignment. No functional change.
Craig Topper [Tue, 17 Sep 2013 06:05:17 +0000 (06:05 +0000)]
Fix column alignment. No functional change.

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

10 years agoMake a more clear AVX-512 section header that matches similar in the file.
Craig Topper [Tue, 17 Sep 2013 03:34:09 +0000 (03:34 +0000)]
Make a more clear AVX-512 section header that matches similar in the file.

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

10 years agoImplement 3 AArch64 neon instructions : umov smov ins.
Kevin Qin [Tue, 17 Sep 2013 02:21:02 +0000 (02:21 +0000)]
Implement 3 AArch64 neon instructions : umov smov ins.

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

10 years ago[SelectionDAG] Teach the vector scalarizer about TRUNCATE.
Quentin Colombet [Tue, 17 Sep 2013 00:26:56 +0000 (00:26 +0000)]
[SelectionDAG] Teach the vector scalarizer about TRUNCATE.

When a truncate node defines a legal vector type but uses an illegal
vector type, the legalization process was splitting the vector until
<1 x vector> type, but then it was failing to scalarize the node because
it did not know how to handle TRUNCATE.

<rdar://problem/14989896>

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

10 years agomention command line parameters
Adrian Prantl [Tue, 17 Sep 2013 00:15:36 +0000 (00:15 +0000)]
mention command line parameters

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

10 years agosimplify expression
Adrian Prantl [Tue, 17 Sep 2013 00:15:33 +0000 (00:15 +0000)]
simplify expression

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

10 years agoBe sure we run ARM tests only when an ARM backend is present.
Adrian Prantl [Mon, 16 Sep 2013 23:48:45 +0000 (23:48 +0000)]
Be sure we run ARM tests only when an ARM backend is present.

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

10 years agoDebug info: Fix PR16736 and rdar://problem/14990587.
Adrian Prantl [Mon, 16 Sep 2013 23:29:03 +0000 (23:29 +0000)]
Debug info: Fix PR16736 and rdar://problem/14990587.
A DBG_VALUE is register-indirect iff the first operand is a register
_and_ the second operand is an immediate.

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

10 years agoMemCpyOptimizer: Use max legal int size instead of pointer size
Matt Arsenault [Mon, 16 Sep 2013 22:43:16 +0000 (22:43 +0000)]
MemCpyOptimizer: Use max legal int size instead of pointer size

If there are no legal integers, assume 1 byte.

This makes more sense than using the pointer size as
a guess for the maximum GPR width.

It is conceivable to want to use some 64-bit pointers
on a target where 64-bit integers aren't legal.

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

10 years agoAdd Atom Silvermont (slm) tests
Preston Gurd [Mon, 16 Sep 2013 22:22:07 +0000 (22:22 +0000)]
Add Atom Silvermont (slm) tests

- check that -mcpu=slm uses the call register indirect optimization
- check that -mcpu=slm runs the scheduler
- check that -mcpu=slm supports the movbe instruction

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

10 years agoUse reference instead of copy.
Jakub Staszak [Mon, 16 Sep 2013 22:03:38 +0000 (22:03 +0000)]
Use reference instead of copy.

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

10 years ago[CMake] Hack GetSVN.cmake to handle unusual terminals.
Jordan Rose [Mon, 16 Sep 2013 21:38:01 +0000 (21:38 +0000)]
[CMake] Hack GetSVN.cmake to handle unusual terminals.

I got a report of a hang in git's helper functions trying to figure out
how to display results of "git svn info" when run inside ninja, even though
the result is immediately piped to grep. This seems to avoid that.

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

10 years agoAdd testcase for r190631
Krzysztof Parzyszek [Mon, 16 Sep 2013 21:24:30 +0000 (21:24 +0000)]
Add testcase for r190631

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

10 years agoTableGen: fix constness of new comparison function.
Tim Northover [Mon, 16 Sep 2013 17:33:40 +0000 (17:33 +0000)]
TableGen: fix constness of new comparison function.

libc++ didn't seem to like a non-const call operator.

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

10 years ago[PowerPC] Fix PR17155 - Ignore COPY_TO_REGCLASS during emit.
Bill Schmidt [Mon, 16 Sep 2013 17:25:12 +0000 (17:25 +0000)]
[PowerPC] Fix PR17155 - Ignore COPY_TO_REGCLASS during emit.

Fast-isel generates a COPY_TO_REGCLASS for widening f32 to f64, which
is a nop on PPC64.  This is needed to keep the register class system
happy, but on the fast-isel path it is not removed before emit as it
is for DAG select.  Ignore this op when emitting instructions.

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

10 years agoTableGen: give asm match classes deterministic order.
Tim Northover [Mon, 16 Sep 2013 16:43:19 +0000 (16:43 +0000)]
TableGen: give asm match classes deterministic order.

TableGen was sorting the entries in some of its internal data
structures by pointer. This order filtered through to the final
matching table and affected the diagnostics produced on bad assembly
occasionally.

It also turns out STL algorithms are ridiculously easy to misuse on
containers with custom order methods. (No bugs before, or now that I
know of, but plenty in the middle).

This should fix the sanitizer bot, which ends up with weird pointers.

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

10 years agoAsmMatcher: emit subtarget feature enum in deterministic order.
Tim Northover [Mon, 16 Sep 2013 16:43:16 +0000 (16:43 +0000)]
AsmMatcher: emit subtarget feature enum in deterministic order.

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

10 years agoDon't vectorize if there are outside loop users of the induction variable.
Arnold Schwaighofer [Mon, 16 Sep 2013 16:17:24 +0000 (16:17 +0000)]
Don't vectorize if there are outside loop users of the induction variable.

We would have to compute the pre increment value, either by computing it on
every loop iteration or by splitting the edge out of the loop and inserting a
computation for it there.

For now, just give up vectorizing such loops.

Fixes PR17179.

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

10 years ago[msan] Check return value of main().
Evgeniy Stepanov [Mon, 16 Sep 2013 13:24:32 +0000 (13:24 +0000)]
[msan] Check return value of main().

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

10 years agoThis patch implements Mips load/store instructions from/to coprocessor 2. Test cases...
Vladimir Medic [Mon, 16 Sep 2013 10:29:42 +0000 (10:29 +0000)]
This patch implements Mips load/store instructions from/to coprocessor 2. Test cases are added.

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

10 years agoARM: Deduplicate ConstantPoolValues.
Benjamin Kramer [Mon, 16 Sep 2013 10:17:31 +0000 (10:17 +0000)]
ARM: Deduplicate ConstantPoolValues.

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

10 years agoFix the build for git repositories with multiple remotes.
Daniel Sanders [Mon, 16 Sep 2013 09:25:49 +0000 (09:25 +0000)]
Fix the build for git repositories with multiple remotes.

Summary:
When a git repository had multiple remotes, ${repository} will be set to a multiline string. This causes compilation errors in SVNVersion.inc.

Fix this by limiting the output of utils/GetRepositoryPath to the first remote (which is reasonably likely to be 'origin').

Reviewers: jordan_rose

CC: llvm-commits, t.p.northover
Differential Revision: http://llvm-reviews.chandlerc.com/D1659

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

10 years ago[SystemZ] Improve extload handling
Richard Sandiford [Mon, 16 Sep 2013 09:03:10 +0000 (09:03 +0000)]
[SystemZ] Improve extload handling

The port originally had special patterns for extload, mapping them to the
same instructions as sextload.  It seemed neater to have patterns that
match "an extension that is allowed to be signed" and "an extension that
is allowed to be unsigned".

This was originally meant to be a clean-up, but it does improve the handling
of promoted integers a little, as shown by args-06.ll.

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

10 years agoMake F16C feature flag imply AVX rather than just checking both at the patterns.
Craig Topper [Mon, 16 Sep 2013 04:29:58 +0000 (04:29 +0000)]
Make F16C feature flag imply AVX rather than just checking both at the patterns.

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

10 years agoImplement function prefix data as an IR feature.
Peter Collingbourne [Mon, 16 Sep 2013 01:08:15 +0000 (01:08 +0000)]
Implement function prefix data as an IR feature.

Previous discussion:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/063909.html

Differential Revision: http://llvm-reviews.chandlerc.com/D1191

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

10 years agoPPC: Don't restrict lvsl generation to after type legalization
Hal Finkel [Sun, 15 Sep 2013 22:09:58 +0000 (22:09 +0000)]
PPC: Don't restrict lvsl generation to after type legalization

This is a re-commit of r190764, with an extra check to make sure that we're not
performing the transformation on illegal types (a small test case has been
added for this as well).

Original commit message:

The PPC backend uses a target-specific DAG combine to turn unaligned Altivec
loads into a permutation-based sequence when possible. Unfortunately, the
target-specific DAG combine is not always called on all loads of interest
(sometimes the routines in DAGCombine call CombineTo such that the new node and
users are not added to the worklist); allowing the combine to trigger early
(before type legalization) mitigates this problem. Because the autovectorizers
only create legal vector types, I don't expect a lot of cases where this
optimization is enabled by type legalization in practice.

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

10 years agoReplace some unnecessary vector copies with references.
Benjamin Kramer [Sun, 15 Sep 2013 22:04:42 +0000 (22:04 +0000)]
Replace some unnecessary vector copies with references.

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

10 years agoELF: Add support for the exclude section bit for gas compat.
Benjamin Kramer [Sun, 15 Sep 2013 19:53:20 +0000 (19:53 +0000)]
ELF: Add support for the exclude section bit for gas compat.

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

10 years agoMC: Add support for '?' flags in .section directives
David Majnemer [Sun, 15 Sep 2013 19:24:16 +0000 (19:24 +0000)]
MC: Add support for '?' flags in .section directives

Summary:
The '?' flag uses the last section group if the last had a section
group.  We treat combining an explicit section group and the '?' as a
hard error.

This fixes PR17198.

Reviewers: rafael, bkramer

Reviewed By: bkramer

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1686

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

10 years agoFix alignment of unwind data.
Kai Nacke [Sun, 15 Sep 2013 18:01:09 +0000 (18:01 +0000)]
Fix alignment of unwind data.

For alignment purposes, the instruction array will always have an even
number of entries, with the final entry potentially unused (in which
case the array will be one longer than indicated by the count of unwind
codes field).

Reviewed by Anton Korobeynikov, Charles Davis and Nico Rieck.

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

10 years agoGenerate IMAGE_REL_AMD64_ADDR32NB relocations for SEH
Kai Nacke [Sun, 15 Sep 2013 17:46:46 +0000 (17:46 +0000)]
Generate IMAGE_REL_AMD64_ADDR32NB relocations for SEH
 data structures.

The Win64 EH data structures must be of type IMAGE_REL_AMD64_ADDR32NB
instead of IMAGE_REL_AMD64_ADDR32. This is easiely achieved by adding
the VK_COFF_IMGREL32 modifier to the symbol reference.
Change also references to start and end of the SEH range of a function
as offsets to start of the function.

Reviewed by Jim Grosbach, Charles Davis and Nico Rieck.

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

10 years agoRevert r190764: PPC: Don't restrict lvsl generation to after type legalization
Hal Finkel [Sun, 15 Sep 2013 15:41:11 +0000 (15:41 +0000)]
Revert r190764: PPC: Don't restrict lvsl generation to after type legalization

This is causing test-suite failures.

Original commit message:

The PPC backend uses a target-specific DAG combine to turn unaligned Altivec
loads into a permutation-based sequence when possible. Unfortunately, the
target-specific DAG combine is not always called on all loads of interest
(sometimes the routines in DAGCombine call CombineTo such that the new node and
users are not added to the worklist); allowing the combine to trigger early
(before type legalization) mitigates this problem. Because the autovectorizers
only create legal vector types, I don't expect a lot of cases where this
optimization is enabled by type legalization in practice.

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

10 years agoPPC: Don't restrict lvsl generation to after type legalization
Hal Finkel [Sun, 15 Sep 2013 15:20:54 +0000 (15:20 +0000)]
PPC: Don't restrict lvsl generation to after type legalization

The PPC backend uses a target-specific DAG combine to turn unaligned Altivec
loads into a permutation-based sequence when possible. Unfortunately, the
target-specific DAG combine is not always called on all loads of interest
(sometimes the routines in DAGCombine call CombineTo such that the new node and
users are not added to the worklist); allowing the combine to trigger early
(before type legalization) mitigates this problem. Because the autovectorizers
only create legal vector types, I don't expect a lot of cases where this
optimization is enabled by type legalization in practice.

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

10 years agoPrevent assert in CombinerGlobalAA with null values
Hal Finkel [Sun, 15 Sep 2013 02:19:49 +0000 (02:19 +0000)]
Prevent assert in CombinerGlobalAA with null values

DAGCombiner::isAlias can be called with SrcValue1 or SrcValue2 null, and we
can't use AA in this case (if we try, then the casting code in AA will assert).

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

10 years agoExpand the mask capability for deciding which functions are mips16 and mips32
Reed Kotler [Sun, 15 Sep 2013 02:09:08 +0000 (02:09 +0000)]
Expand the mask capability for deciding which functions are mips16 and mips32
so it can be better used for general interoperability testing between mips32
and mips16.

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

10 years agoRemove unused StringRef that no compiler warned about, I wonder why.
Benjamin Kramer [Sat, 14 Sep 2013 22:55:54 +0000 (22:55 +0000)]
Remove unused StringRef that no compiler warned about, I wonder why.

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

10 years agoAdd the remaining Intel SHA instructions
Ben Langmuir [Sat, 14 Sep 2013 15:03:21 +0000 (15:03 +0000)]
Add the remaining Intel SHA instructions

Also assembly/disassembly tests, and for sha256rnds2, aliases with an explicit
xmm0 dependency.

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

10 years agoFix spelling.
Robert Wilhelm [Sat, 14 Sep 2013 09:34:59 +0000 (09:34 +0000)]
Fix spelling.

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

10 years agoFix spelling.
Robert Wilhelm [Sat, 14 Sep 2013 09:34:24 +0000 (09:34 +0000)]
Fix spelling.

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

10 years agoRemove the long, long defunct IR block placement pass.
Chandler Carruth [Sat, 14 Sep 2013 09:28:14 +0000 (09:28 +0000)]
Remove the long, long defunct IR block placement pass.

This pass was based on the previous (essentially unused) profiling
infrastructure and the assumption that by ordering the basic blocks at
the IR level in a particular way, the correct layout would happen in the
end. This sometimes worked, and mostly didn't. It also was a really
naive implementation of the classical paper that dates from when branch
predictors were primarily directional and when loop structure wasn't
commonly available. It also didn't factor into the equation
non-fallthrough branches and other machine level details.

Anyways, for all of these reasons and more, I wrote
MachineBlockPlacement, which completely supercedes this pass. It both
uses modern profile information infrastructure, and actually works. =]

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

10 years agoFixed bug when generating Load Upper Immediate microMIPS instruction.
Zoran Jovanovic [Sat, 14 Sep 2013 07:35:41 +0000 (07:35 +0000)]
Fixed bug when generating Load Upper Immediate microMIPS instruction.

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

10 years agoSupport for microMIPS DIV instructions.
Zoran Jovanovic [Sat, 14 Sep 2013 07:15:21 +0000 (07:15 +0000)]
Support for microMIPS DIV instructions.

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

10 years agoSupport for misc microMIPS instructions.
Zoran Jovanovic [Sat, 14 Sep 2013 06:49:25 +0000 (06:49 +0000)]
Support for misc microMIPS instructions.

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

10 years agoAdd missing CHECK-LABEL
Matt Arsenault [Sat, 14 Sep 2013 02:44:06 +0000 (02:44 +0000)]
Add missing CHECK-LABEL

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

10 years agoAdd test for untested path in SimplifyCFG
Matt Arsenault [Sat, 14 Sep 2013 02:44:02 +0000 (02:44 +0000)]
Add test for untested path in SimplifyCFG

This case wasn't checked with a pointer condition.

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

10 years ago[lit] Add an --output option, for writing results in a machine readable form.
Daniel Dunbar [Sat, 14 Sep 2013 01:19:17 +0000 (01:19 +0000)]
[lit] Add an --output option, for writing results in a machine readable form.

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

10 years agoMake PrettyStackTraceEntry use ManagedStatic for its ThreadLocal.
Filip Pizlo [Fri, 13 Sep 2013 22:59:47 +0000 (22:59 +0000)]
Make PrettyStackTraceEntry use ManagedStatic for its ThreadLocal.

This was somewhat tricky because ~PrettyStackTraceEntry() may run after
llvm_shutdown() has been called. This is rare and only happens for a common idiom
used in the main() functions of command-line tools. This works around the idiom by
skipping the stack clean-up if the PrettyStackTraceHead ManagedStatic is not
constructed (i.e. llvm_shutdown() has been called).

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

10 years agoAdd missing break statement in PPCISelLowering
Hal Finkel [Fri, 13 Sep 2013 20:09:02 +0000 (20:09 +0000)]
Add missing break statement in PPCISelLowering

As it turns out, not a problem in practice, but it should be there.

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

10 years agoAdds support for Atom Silvermont (SLM) - -march=slm
Preston Gurd [Fri, 13 Sep 2013 19:23:28 +0000 (19:23 +0000)]
Adds support for Atom Silvermont (SLM) - -march=slm

Implements Instruction scheduler latencies for Silvermont,
using latencies from the Intel Silvermont Optimization Guide.

Auto detects SLM.

Turns on post RA scheduler when generating code for SLM.

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

10 years ago[Peephole] Rewrite copies to avoid cross register banks copies.
Quentin Colombet [Fri, 13 Sep 2013 18:26:31 +0000 (18:26 +0000)]
[Peephole] Rewrite copies to avoid cross register banks copies.

By definition copies across register banks are not coalescable. Still, it may be
possible to get rid of such a copy when the value is available in another
register of the same register file.
Consider the following example, where capital and lower letters denote different
register file:
b = copy A <-- cross-bank copy
...
C = copy b <-- cross-bank copy

This could have been optimized this way:
b = copy A  <-- cross-bank copy
...
C = copy A <-- same-bank copy

Note: b and C's definitions may be in different basic blocks.

This patch adds a peephole optimization that looks through a chain of copies
leading to a cross-bank copy and reuses a source that is on the same register
file if available.

This solution could also be used to get rid of some copies (e.g., A could have
been used instead of C). However, we do not do so because:
- It may over constrain the coloring of the source register for coalescing.
- The register allocator may not be able to find a nice split point for the
  longer live-range, leading to more spill.

<rdar://problem/14742333>

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

10 years agoAdd warn_unused_result to empty() on various containers.
Benjamin Kramer [Fri, 13 Sep 2013 17:33:24 +0000 (17:33 +0000)]
Add warn_unused_result to empty() on various containers.

empty() doesn't actually empty out the container, making this a common typo.

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

10 years agotypo fix: use BUILD_ARCHIVE to build .a libs and not ARCHIVE_LIBRARY
Nuno Lopes [Fri, 13 Sep 2013 15:01:54 +0000 (15:01 +0000)]
typo fix: use BUILD_ARCHIVE to build .a libs and not ARCHIVE_LIBRARY

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

10 years agoFix tests for hasFPARMv8 name change (r190692)
Amaury de la Vieuville [Fri, 13 Sep 2013 14:37:52 +0000 (14:37 +0000)]
Fix tests for hasFPARMv8 name change (r190692)

Patch by Bradley Smith

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

10 years ago[ARMv8] Change hasV8Fp to hasFPARMv8, and other command line options
Joey Gouly [Fri, 13 Sep 2013 13:46:57 +0000 (13:46 +0000)]
[ARMv8] Change hasV8Fp to hasFPARMv8, and other command line options
to be more consistent.

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

10 years ago[msan] Add source file:line to stack origin reports.
Evgeniy Stepanov [Fri, 13 Sep 2013 12:54:49 +0000 (12:54 +0000)]
[msan] Add source file:line to stack origin reports.

Compiler part.

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

10 years agoFix build failure reported by Tobias Markmann in bug 17203.
Daniel Sanders [Fri, 13 Sep 2013 12:41:38 +0000 (12:41 +0000)]
Fix build failure reported by Tobias Markmann in bug 17203.

svn 1.8.0 emits an additional line matching 'URL:' in its 'svn info' command
('Relative URL:').
Changed the grep to match only the intended line so that a valid SVNVersion.inc
is generated.

The problem doesnt occur with the svn version I'm using (1.7.5) but Tobias has
confirmed that the change fixes the problem.

See http://llvm.org/bugs/show_bug.cgi?id=17203

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

10 years ago[ARMv8] Emit the proper .fpu directive.
Joey Gouly [Fri, 13 Sep 2013 11:51:52 +0000 (11:51 +0000)]
[ARMv8] Emit the proper .fpu directive.

Patch by Bradley Smith!

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

10 years agoAdd "native" to config.available_features, to make it easier to disable non-x-compile...
Amaury de la Vieuville [Fri, 13 Sep 2013 10:59:01 +0000 (10:59 +0000)]
Add "native" to config.available_features, to make it easier to disable non-x-compile-safe tests

Patch by Artyom Skrobov!

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

10 years agoFix for executing AutoRegen.sh. Revert a part of r187209.
Patrik Hagglund [Fri, 13 Sep 2013 10:29:42 +0000 (10:29 +0000)]
Fix for executing AutoRegen.sh. Revert a part of r187209.

Since r187209, which modified ltdl.m4, I was unable to execute
AutoRegen.sh, getting:

  ../configure:10779: error: possibly undefined macro: AC_LTDL_FUNC_ARGZ

This commit re-adds AC_LTDL_FUNC_ARGZ to ltdl.m4, as a quick fix. For me, this
corresponds to the configure file currently checked in.

(However, the ltdl library seems to be unused since r74924 in 2009,
except for the use of the LTDL_SHLIB_EXT macro in
bugpoint(?). Therefore, the right solution seems to try to get rid of
the local ltdl.m4 file, specified by autoconf/README.TXT.)

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

10 years agoTest commit to verify that commit access works.
Zoran Jovanovic [Fri, 13 Sep 2013 10:08:05 +0000 (10:08 +0000)]
Test commit to verify that commit access works.

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

10 years ago[SystemZ] Use getTarget{Insert,Extract}Subreg rather than getMachineNode
Richard Sandiford [Fri, 13 Sep 2013 09:12:44 +0000 (09:12 +0000)]
[SystemZ] Use getTarget{Insert,Extract}Subreg rather than getMachineNode

Just a clean-up, no behavioral change intended.

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

10 years ago[SystemZ] Try to fold shifts into TMxx
Richard Sandiford [Fri, 13 Sep 2013 09:09:50 +0000 (09:09 +0000)]
[SystemZ] Try to fold shifts into TMxx

E.g. "SRL %r2, 2; TMLL %r2, 1" => "TMLL %r2, 4".

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

10 years agoAvoid a compiler warning about Found not being used when assertions are
Duncan Sands [Fri, 13 Sep 2013 08:16:06 +0000 (08:16 +0000)]
Avoid a compiler warning about Found not being used when assertions are
disabled.

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

10 years agoAArch64: use RegisterOperand for NEON registers.
Tim Northover [Fri, 13 Sep 2013 07:26:52 +0000 (07:26 +0000)]
AArch64: use RegisterOperand for NEON registers.

Previously we modelled VPR128 and VPR64 as essentially identical
register-classes containing V0-V31 (which had Q0-Q31 as "sub_alias"
sub-registers). This model is starting to cause significant problems
for code generation, particularly writing EXTRACT/INSERT_SUBREG
patterns for converting between the two.

The change here switches to classifying VPR64 & VPR128 as
RegisterOperands, which are essentially aliases for RegisterClasses
with different parsing and printing behaviour. This fits almost
exactly with their real status (VPR128 == FPR128 printed strangely,
VPR64 == FPR64 printed strangely).

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

10 years agoMove operator to end of previous line to match coding standards.
Craig Topper [Fri, 13 Sep 2013 04:41:06 +0000 (04:41 +0000)]
Move operator to end of previous line to match coding standards.

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

10 years agoAdd initial support for handling gnu style pubnames accepted by some
Eric Christopher [Fri, 13 Sep 2013 00:35:05 +0000 (00:35 +0000)]
Add initial support for handling gnu style pubnames accepted by some
versions of gold. This support is designed to allow gold to produce
gdb_index sections similar to the accelerator tables and consumable
by gdb.

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

10 years agoReformat and hoist section grabbing to top level.
Eric Christopher [Fri, 13 Sep 2013 00:34:58 +0000 (00:34 +0000)]
Reformat and hoist section grabbing to top level.

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

10 years agoR600: Move clamp handling code to R600IselLowering.cpp
Vincent Lejeune [Thu, 12 Sep 2013 23:45:00 +0000 (23:45 +0000)]
R600: Move clamp handling code to R600IselLowering.cpp

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

10 years agoR600: Move code handling literal folding into R600ISelLowering.
Vincent Lejeune [Thu, 12 Sep 2013 23:44:53 +0000 (23:44 +0000)]
R600: Move code handling literal folding into R600ISelLowering.

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

10 years agoR600: Move fabs/fneg/sel folding logic into PostProcessIsel
Vincent Lejeune [Thu, 12 Sep 2013 23:44:44 +0000 (23:44 +0000)]
R600: Move fabs/fneg/sel folding logic into PostProcessIsel

This move makes possible to correctly handle multiples instructions
from a single pattern.

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

10 years agoRemove an unused variable, fixing -Werror build with latest Clang.
Chandler Carruth [Thu, 12 Sep 2013 23:30:48 +0000 (23:30 +0000)]
Remove an unused variable, fixing -Werror build with latest Clang.

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

10 years agoRemove unnecessary TBAA metadata from r190636's test case
Hal Finkel [Thu, 12 Sep 2013 23:23:12 +0000 (23:23 +0000)]
Remove unnecessary TBAA metadata from r190636's test case

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

10 years agoFix PPC ABI for ByVal structs with vector members
Hal Finkel [Thu, 12 Sep 2013 23:20:06 +0000 (23:20 +0000)]
Fix PPC ABI for ByVal structs with vector members

When a structure is passed by value, and that structure contains a vector
member, according to the PPC ABI, the structure will receive enhanced alignment
(so that the vector within the structure will always be aligned).

This should resolve PR16641.

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

10 years agoPatch provide by Tom Roeder!
Joe Abbey [Thu, 12 Sep 2013 22:02:31 +0000 (22:02 +0000)]
Patch provide by Tom Roeder!

Reviewed by Joe Abbey and Tobias Grosser

Here is a patch that fixes decoding of CE_SELECT in BitcodeReader,
along with a simple test case. The problem in the current code is that
it generates but doesn't accept bitcode that uses vectors for the
first element of a select in this context.

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

10 years agoIn AliasSetTracker, do not change the alias set to "mod/ref" when adding
Krzysztof Parzyszek [Thu, 12 Sep 2013 20:15:50 +0000 (20:15 +0000)]
In AliasSetTracker, do not change the alias set to "mod/ref" when adding
a volatile load, or a volatile store.

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

10 years agoMake the PPC fast-math sqrt expansion safe at 0
Hal Finkel [Thu, 12 Sep 2013 19:04:12 +0000 (19:04 +0000)]
Make the PPC fast-math sqrt expansion safe at 0

In fast-math mode sqrt(x) is calculated using the fast expansion of the
reciprocal of the reciprocal sqrt expansion. The reciprocal and reciprocal
sqrt expansions use the associated estimate instructions along with some Newton
iterations. Unfortunately, as a result, sqrt(0) was being calculated as NaN,
which is not correct. Now we explicitly return a result of zero if the input is
zero.

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

10 years agoImplement asm support for a few PowerPC bookIII that are needed for assembling
Roman Divacky [Thu, 12 Sep 2013 17:50:54 +0000 (17:50 +0000)]
Implement asm support for a few PowerPC bookIII that are needed for assembling
FreeBSD kernel.

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

10 years agoThis switches CrashRecoveryContext to using ManagedStatic for its global Mutex and
Filip Pizlo [Thu, 12 Sep 2013 17:46:57 +0000 (17:46 +0000)]
This switches CrashRecoveryContext to using ManagedStatic for its global Mutex and
global ThreadLocals, thereby getting rid of the load-time initialization of those
objects and also getting rid of their destruction unless the LLVM client calls
llvm_shutdown.

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

10 years agoPartial support for Intel SHA Extensions (sha1rnds4)
Ben Langmuir [Thu, 12 Sep 2013 15:51:31 +0000 (15:51 +0000)]
Partial support for Intel SHA Extensions (sha1rnds4)

Add basic assembly/disassembly support for the first Intel SHA
instruction 'sha1rnds4'. Also includes feature flag, and test cases.

Support for the remaining instructions will follow in a separate patch.

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

10 years agoMark PPC MFTB and DST (and friends) as deprecated
Hal Finkel [Thu, 12 Sep 2013 14:40:06 +0000 (14:40 +0000)]
Mark PPC MFTB and DST (and friends) as deprecated

Use the new instruction deprecation feature to mark mftb (now replaced with
mfspr) and dst (along with the other Altivec cache control instructions) as
deprecated when targeting cores supporting at least ISA v2.03.

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

10 years agoSomehow this important part of the patch, where I actually check the Mask,
Joey Gouly [Thu, 12 Sep 2013 14:23:19 +0000 (14:23 +0000)]
Somehow this important part of the patch, where I actually check the Mask,
got lost during my iterations of review.

Thanks to Hal for spotting it!

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

10 years ago[LTO] Fix the LTO tool, after my API breakage.
Joey Gouly [Thu, 12 Sep 2013 12:55:29 +0000 (12:55 +0000)]
[LTO] Fix the LTO tool, after my API breakage.

Thanks to Zonr Chang!

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

10 years agoLLVM interpreter: added a test for insert- extract- value
Elena Demikhovsky [Thu, 12 Sep 2013 10:52:03 +0000 (10:52 +0000)]
LLVM interpreter: added a test for insert- extract- value

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

10 years agoLLVM Interpreter: implementation of "insertvalue" and "extractvalue";
Elena Demikhovsky [Thu, 12 Sep 2013 10:48:23 +0000 (10:48 +0000)]
LLVM Interpreter: implementation of "insertvalue" and "extractvalue";
undef constatnt for structure and test for these functions.

done by Yuri Veselov (mailto:Yuri.Veselov@intel.com)

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

10 years agoAdd an instruction deprecation feature to TableGen.
Joey Gouly [Thu, 12 Sep 2013 10:28:05 +0000 (10:28 +0000)]
Add an instruction deprecation feature to TableGen.

The 'Deprecated' class allows you to specify a SubtargetFeature that the
instruction is deprecated on.

The 'ComplexDeprecationPredicate' class allows you to define a custom
predicate that is called to check for deprecation.
For example:
  ComplexDeprecationPredicate<"MCR">

would mean you would have to define the following function:
  bool getMCRDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI,
                             std::string &Info)

Which returns 'false' for not deprecated, and 'true' for deprecated
and store the warning message in 'Info'.

The MCTargetAsmParser constructor was chaned to take an extra argument of
the MCInstrInfo class, so out-of-tree targets will need to be changed.

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

10 years agoAVX-512: implemented extractelement with variable index.
Elena Demikhovsky [Thu, 12 Sep 2013 08:55:00 +0000 (08:55 +0000)]
AVX-512: implemented extractelement with variable index.
Added parsing of mask register and "zeroing" semantic, like {%k1} {z}.

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

10 years agoFixup for r190409: add dep on LZMA only if CMake is cross-compiling
Alexey Samsonov [Thu, 12 Sep 2013 08:26:53 +0000 (08:26 +0000)]
Fixup for r190409: add dep on LZMA only if CMake is cross-compiling

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

10 years agoPPC: Enable aggressive anti-dependency breaking
Hal Finkel [Thu, 12 Sep 2013 05:24:49 +0000 (05:24 +0000)]
PPC: Enable aggressive anti-dependency breaking

Aggressive anti-dependency breaking is enabled by default for all PPC cores.
This provides a general speedup on the P7 and other platforms (among other
factors, the instruction group formation for the non-embedded PPC cores is done
during post-RA scheduling). In order to do this safely, the incompatibility
between uses of the MFOCRF instruction and anti-dependency breaking are
resolved by marking MFOCRF with hasExtraSrcRegAllocReq. As noted in the removed
FIXME, the problem was that MFOCRF's output is sensitive to the identify of the
source register, and always paired with a shift to undo this effect. Because
anti-dependency breaking is unaware of this hidden dependency of the shift
amount on the source register of the MFOCRF instruction, changing that register
must be inhibited.

Two test cases were adjusted: The SjLj test was made more insensitive to
register choices and scheduling; the saveCR test disabled anti-dependency
breaking because part of what it is testing is proper register reuse.

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

10 years agoFix crash in AggressiveAntiDepBreaker with empty CriticalPathSet
Hal Finkel [Thu, 12 Sep 2013 04:22:31 +0000 (04:22 +0000)]
Fix crash in AggressiveAntiDepBreaker with empty CriticalPathSet

If no register classes are added to CriticalPathRCs, then the CriticalPathSet
bitmask will be empty. In that case, ExcludeRegs must remain NULL or else this
line will cause a segfault:

  } else if ((ExcludeRegs != NULL) && ExcludeRegs->test(AntiDepReg)) {

I have no in-tree test case.

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