oota-llvm.git
11 years ago[PM] Fix an iterator problem spotted by the MSVC debug iterators and
Chandler Carruth [Fri, 15 Nov 2013 21:56:44 +0000 (21:56 +0000)]
[PM] Fix an iterator problem spotted by the MSVC debug iterators and
AaronBallman. Thanks for the excellent review.

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

11 years ago[PM] Run clang-format on a few lines that I missed in my first pass,
Chandler Carruth [Fri, 15 Nov 2013 21:44:35 +0000 (21:44 +0000)]
[PM] Run clang-format on a few lines that I missed in my first pass,
pulling them under 80-columns. No functionality changed.

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

11 years ago[AArch64] Fix the scalar NEON ACLE functions so that they return float/double
Chad Rosier [Fri, 15 Nov 2013 21:28:10 +0000 (21:28 +0000)]
[AArch64] Fix the scalar NEON ACLE functions so that they return float/double
rather than the vector equivalent.

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

11 years agoPath: Recognize COFF import library file magic.
Rui Ueyama [Fri, 15 Nov 2013 21:22:02 +0000 (21:22 +0000)]
Path: Recognize COFF import library file magic.

Summary: Make identify_magic to recognize COFF import file.

Reviewers: Bigcheese

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

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

11 years agoReimplement r194843 in a slightly less broken way.
Adrian Prantl [Fri, 15 Nov 2013 21:05:09 +0000 (21:05 +0000)]
Reimplement r194843 in a slightly less broken way.

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

11 years agoArgumentPromotion: correctly transfer TBAA tags and alignments.
Manman Ren [Fri, 15 Nov 2013 20:41:15 +0000 (20:41 +0000)]
ArgumentPromotion: correctly transfer TBAA tags and alignments.

We used to use std::map<IndicesVector, LoadInst*> for OriginalLoads, and when we
try to promote two arguments, they will both write to OriginalLoads causing
created loads for the two arguments to have the same original load. And the same
tbaa tag and alignment will be put to the created loads for the two arguments.

The fix is to use std::map<std::pair<Argument*, IndicesVector>, LoadInst*>
for OriginalLoads, so each Argument will write to different parts of the map.

PR17906

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

11 years agoReadobj: If NumbersOfSections is 0xffff, it's an COFF import library.
Rui Ueyama [Fri, 15 Nov 2013 20:23:25 +0000 (20:23 +0000)]
Readobj: If NumbersOfSections is 0xffff, it's an COFF import library.

0xffff does not mean that there are 65535 sections in a COFF file but
indicates that it's a COFF import library. This patch fixes SEGV error
when an import library file is passed to llvm-readobj.

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

11 years agoRestore the behaviour from before r194728.
Adrian Prantl [Fri, 15 Nov 2013 19:53:23 +0000 (19:53 +0000)]
Restore the behaviour from before r194728.
If getDIE() fails, getOrCreateContextDIE() should also return the CUDie.

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

11 years agoAvoid illegal integer promotion in fastisel
Bob Wilson [Fri, 15 Nov 2013 19:09:27 +0000 (19:09 +0000)]
Avoid illegal integer promotion in fastisel

Stop folding constant adds into GEP when the type size doesn't match.
Otherwise, the adds' operands are effectively being promoted, changing the
conditions of an overflow.  Results are different when:

    sext(a) + sext(b) != sext(a + b)

Problem originally found on x86-64, but also fixed issues with ARM and PPC,
which used similar code.

<rdar://problem/15292280>

Patch by Duncan Exon Smith!

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

11 years agoR600/SI: Add VReg_96 register class to SIRegisterInfo::hasVGPRs()
Tom Stellard [Fri, 15 Nov 2013 18:26:45 +0000 (18:26 +0000)]
R600/SI: Add VReg_96 register class to SIRegisterInfo::hasVGPRs()

This fixes a crash with GNOME settings manager.

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

11 years agoResolve JIT runtime linking problems on Android.
Andrew Kaylor [Fri, 15 Nov 2013 17:59:43 +0000 (17:59 +0000)]
Resolve JIT runtime linking problems on Android.

Patch by James Lyon!

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

11 years agoDon't try to initialize memory for a global if the allocation failed in ExecutionEngine.
Andrew Kaylor [Fri, 15 Nov 2013 17:52:54 +0000 (17:52 +0000)]
Don't try to initialize memory for a global if the allocation failed in ExecutionEngine.

Patch by Dale Martin!

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

11 years agoUpdate contact information.
Chad Rosier [Fri, 15 Nov 2013 17:35:29 +0000 (17:35 +0000)]
Update contact information.

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

11 years ago[mips][msa] Merge basic_operations_little.ll into basic_operations.ll.
Daniel Sanders [Fri, 15 Nov 2013 17:24:41 +0000 (17:24 +0000)]
[mips][msa] Merge basic_operations_little.ll into basic_operations.ll.

Now that FileCheck supports multiple check prefixes, we don't need to keep the
little and big endian versions of this test separate anymore. Merge them back
together.

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

11 years agoAdd AVX512 unmasked FMA intrinsics and support.
Cameron McInally [Fri, 15 Nov 2013 17:01:14 +0000 (17:01 +0000)]
Add AVX512 unmasked FMA intrinsics and support.

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

11 years ago[NVPTX] Fix type in usage doc
Justin Holewinski [Fri, 15 Nov 2013 16:08:49 +0000 (16:08 +0000)]
[NVPTX] Fix type in usage doc

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

11 years ago[mips][msa] lowerMSABitClear() should use SelectionDAG::getNOT() instead of using...
Daniel Sanders [Fri, 15 Nov 2013 16:02:04 +0000 (16:02 +0000)]
[mips][msa] lowerMSABitClear() should use SelectionDAG::getNOT() instead of using a long-winded equivalent.

Now that getConstant(-1, MVT::v2i64) works correctly on MIPS32 we can use
SelectionDAG::getNOT() to produce the bitmask.

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

11 years agoHopefully fix uninitialized memory read in AArch64AsmParser found by MSan bootstrap bot
Alexey Samsonov [Fri, 15 Nov 2013 15:49:30 +0000 (15:49 +0000)]
Hopefully fix uninitialized memory read in AArch64AsmParser found by MSan bootstrap bot

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

11 years ago[NVPTX] Update the usage document
Justin Holewinski [Fri, 15 Nov 2013 13:02:10 +0000 (13:02 +0000)]
[NVPTX] Update the usage document

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

11 years agoFix illegal DAG produced by SelectionDAG::getConstant() for v2i64 type
Daniel Sanders [Fri, 15 Nov 2013 12:56:49 +0000 (12:56 +0000)]
Fix illegal DAG produced by SelectionDAG::getConstant() for v2i64 type

Summary:
When getConstant() is called for an expanded vector type, it is split into
multiple scalar constants which are then combined using appropriate build_vector
and bitcast operations.

In addition to the usual big/little endian differences, the case where the
element-order of the vector does not have the same endianness as the elements
themselves is also accounted for.  For example, for v4i32 on big-endian MIPS,
the byte-order of the vector is <3210,7654,BA98,FEDC>. For little-endian, it is
<0123,4567,89AB,CDEF>.
Handling this case turns out to be a nop since getConstant() returns a splatted
vector (so reversing the element order doesn't change the value)

This fixes a number of cases in MIPS MSA where calling getConstant() during
operation legalization introduces illegal types (e.g. to legalize v2i64 UNDEF
into a v2i64 BUILD_VECTOR of illegal i64 zeros). It should also handle bigger
differences between illegal and legal types such as legalizing v2i64 into v8i16.

lowerMSASplatImm() in the MIPS backend no longer needs to avoid calling
getConstant() so this function has been updated in the same patch.

For the sake of transparency, the steps I've taken since the review are:
* Added 'virtual' to isVectorEltOrderLittleEndian() as requested. This revealed
  that the MIPS tests were falsely passing because a polymorphic function was
  not actually polymorphic in the reviewed patch.
* Fixed the tests that were now failing. This involved deleting the code to
  handle the MIPS MSA element-order (which was previously doing an byte-order
  swap instead of an element-order swap). This left
  isVectorEltOrderLittleEndian() unused and it was deleted.
* Fixed build failures caused by rebasing beyond r194467-r194472. These build
  failures involved the bset, bneg, and bclr instructions added in these commits
  using lowerMSASplatImm() in a way that was no longer valid after this patch.
  Some of these were fixed by calling SelectionDAG::getConstant() instead,
  others were fixed by a new function getBuildVectorSplat() that provided the
  removed functionality of lowerMSASplatImm() in a more sensible way.

Reviewers: bkramer

Reviewed By: bkramer

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

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

11 years ago[NVPTX] Fix handling of indirect calls
Justin Holewinski [Fri, 15 Nov 2013 12:30:04 +0000 (12:30 +0000)]
[NVPTX] Fix handling of indirect calls

Using a special machine node is cleaner than an InlineAsm node, and fixes an assertion failure in InstrEmitter

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

11 years agoCorrect spelling.
Yaron Keren [Fri, 15 Nov 2013 11:42:49 +0000 (11:42 +0000)]
Correct spelling.

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

11 years ago[mips][msa] Build all the tests in little and big endian modes and correct an incorre...
Daniel Sanders [Fri, 15 Nov 2013 11:04:16 +0000 (11:04 +0000)]
[mips][msa] Build all the tests in little and big endian modes and correct an incorrect test.

Summary:
This patch (correctly) breaks some MSA tests by exposing the cases when
SelectionDAG::getConstant() produces illegal types. These have been temporarily
marked XFAIL and the XFAIL flag will be removed when
SelectionDAG::getConstant() is fixed.

There are three categories of failure:
* Immediate instructions are not selected in one endian mode.
* Immediates used in ldi.[bhwd] must be different according to endianness.
  (this only affects cases where the 'wrong' ldi is used to load the correct
   bitpattern. E.g. (bitcast:v2i64 (build_vector:v4i32 ...)))
* Non-immediate instructions that rely on immediates affected by the
  previous two categories as part of their match pattern.
  For example, the bset match pattern is the vector equivalent of
  'ws | (1 << wt)'.

One test needed correcting to expect different output depending on whether big
or little endian was in use. This test was
test/CodeGen/Mips/msa/basic_operations.ll and experiences the second category
of failure shown above. The little endian version of this test is named
basic_operations_little.ll and will be merged back into basic_operations.ll in
a follow up commit now that FileCheck supports multiple check prefixes.

Reviewers: bkramer, jacksprat, dsanders

Reviewed By: dsanders

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

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

11 years agoMove all of the GoogleTest files back to the same locations they occupy
Chandler Carruth [Fri, 15 Nov 2013 10:20:45 +0000 (10:20 +0000)]
Move all of the GoogleTest files back to the same locations they occupy
externally to simplify our integration of GoogleTest into LLVM. Also,
build the single source file gtest-all.cc instead of the individual
source files as we don't expect these to change and thus gain nothing
from increased incrementality in compiles.

This makes our standard build of googletest exactly like upstream's
recommended build and the sanitizer's build. It also simplifies the
steps of importing a new version should we ever want one.

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

11 years ago[asan] use GlobalValue::PrivateLinkage for coverage guard to save quite a bit of...
Kostya Serebryany [Fri, 15 Nov 2013 09:52:05 +0000 (09:52 +0000)]
[asan] use GlobalValue::PrivateLinkage for coverage guard to save quite a bit of code size

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

11 years agollvm-cov: Clean up memory leaks.
Benjamin Kramer [Fri, 15 Nov 2013 09:44:17 +0000 (09:44 +0000)]
llvm-cov: Clean up memory leaks.

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

11 years agoRedirect unused test case output to /dev/null
Alexey Samsonov [Fri, 15 Nov 2013 09:36:58 +0000 (09:36 +0000)]
Redirect unused test case output to /dev/null

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

11 years agoGive unit test its own LLVMContext so MDNodes aren't leaked even if we never call...
Benjamin Kramer [Fri, 15 Nov 2013 09:34:33 +0000 (09:34 +0000)]
Give unit test its own LLVMContext so MDNodes aren't leaked even if we never call llvm_shutdown.

Found by valgrind.

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

11 years agoAdding some info about stability of ARM boards
Renato Golin [Fri, 15 Nov 2013 08:42:14 +0000 (08:42 +0000)]
Adding some info about stability of ARM boards

Patch by Mikael Lyngvig

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

11 years agoUse instr mapping for microMIPS in llvm-mc.
Zoran Jovanovic [Fri, 15 Nov 2013 08:07:34 +0000 (08:07 +0000)]
Use instr mapping for microMIPS in llvm-mc.

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

11 years agoReapply "[asan] Poor man's coverage that works with ASan"
Bob Wilson [Fri, 15 Nov 2013 07:16:09 +0000 (07:16 +0000)]
Reapply "[asan] Poor man's coverage that works with ASan"

I was able to successfully run a bootstrapped LTO build of clang with
r194701, so this change does not seem to be the cause of our failing
buildbots.

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

11 years agoPlatform proof a test case.
Andrew Trick [Fri, 15 Nov 2013 05:52:56 +0000 (05:52 +0000)]
Platform proof a test case.

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

11 years agoAdd instcombine visitor for addrspacecast
Matt Arsenault [Fri, 15 Nov 2013 05:45:08 +0000 (05:45 +0000)]
Add instcombine visitor for addrspacecast

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

11 years agoFix grammar in addrspacecast description
Matt Arsenault [Fri, 15 Nov 2013 05:44:56 +0000 (05:44 +0000)]
Fix grammar in addrspacecast description

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

11 years agoAdd target hook to prevent folding some bitcasted loads.
Matt Arsenault [Fri, 15 Nov 2013 04:42:23 +0000 (04:42 +0000)]
Add target hook to prevent folding some bitcasted loads.

This is to avoid this transformation in some cases:
fold (conv (load x)) -> (load (conv*)x)

On architectures that don't natively support some vector
loads efficiently casting the load to a smaller vector of
larger types and loading is more efficient.

Patch by Micah Villmow.

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

11 years ago[OCaml] Add REQUIRES: native, object-emission to the Target test
Peter Zotov [Fri, 15 Nov 2013 03:43:51 +0000 (03:43 +0000)]
[OCaml] Add REQUIRES: native, object-emission to the Target test

While the test would work with any compiled in target with object
emission support, it's nontrivial to formulate this condition in
lit, so a conservative restriction is used instead.

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

11 years agoRevert "[asan] Poor man's coverage that works with ASan"
Bob Wilson [Fri, 15 Nov 2013 03:28:22 +0000 (03:28 +0000)]
Revert "[asan] Poor man's coverage that works with ASan"

This reverts commit 194701. Apple's bootstrapped LTO builds have been failing,
and this change (along with compiler-rt 194702-194704) is the only thing on
the blamelist.  I will either reappy these changes or help debug the problem,
depending on whether this fixes the buildbots.

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

11 years ago[OCaml] Use native target in testsuite instead of hardcoding X86
Peter Zotov [Fri, 15 Nov 2013 03:19:08 +0000 (03:19 +0000)]
[OCaml] Use native target in testsuite instead of hardcoding X86

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

11 years ago[OCaml] Add Target and TargetMachine bindings to Llvm_target
Peter Zotov [Fri, 15 Nov 2013 02:51:57 +0000 (02:51 +0000)]
[OCaml] Add Target and TargetMachine bindings to Llvm_target

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

11 years ago[OCaml] Refactor Llvm_target interface
Peter Zotov [Fri, 15 Nov 2013 02:51:44 +0000 (02:51 +0000)]
[OCaml] Refactor Llvm_target interface

This commit brings the module structure, argument order and
primitive names in Llvm_target in order with the rest of the bindings,
in preparation for adding TargetMachine API.

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

11 years ago[OCaml] Fix building of stub libraries
Peter Zotov [Fri, 15 Nov 2013 02:51:27 +0000 (02:51 +0000)]
[OCaml] Fix building of stub libraries

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

11 years ago[llvm-c] Make LLVMGetTargetFromName actually work
Peter Zotov [Fri, 15 Nov 2013 02:51:18 +0000 (02:51 +0000)]
[llvm-c] Make LLVMGetTargetFromName actually work

LLVMGetTargetFromName used to compare two char* strings directly.

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

11 years ago[llvm-c] Add missing const qualifiers to LLVMCreateTargetMachine
Peter Zotov [Fri, 15 Nov 2013 02:51:12 +0000 (02:51 +0000)]
[llvm-c] Add missing const qualifiers to LLVMCreateTargetMachine

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

11 years ago[llvm-c] Simplify signature of LLVMGetTargetFromName
Peter Zotov [Fri, 15 Nov 2013 02:51:01 +0000 (02:51 +0000)]
[llvm-c] Simplify signature of LLVMGetTargetFromName

LLVMGetTargetFromName was not yet present in an LLVM release,
so this does not break compatibility.

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

11 years agoMake all the conditional Mips 16 branches get initially set for the
Reed Kotler [Fri, 15 Nov 2013 02:21:52 +0000 (02:21 +0000)]
Make all the conditional Mips 16 branches get initially set for the
short form. Constant islands will expand them if they are out of range.
Since there is not direct object emitter at this time, it does not
have any material affect because the assembler sorts this out. But we
need to know for the actual constant island work. We track the difference
by putting # 16 inst in the comments.

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

11 years agoUse a reference rather than a pointer as we don't expect a NULL
Eric Christopher [Fri, 15 Nov 2013 01:43:19 +0000 (01:43 +0000)]
Use a reference rather than a pointer as we don't expect a NULL
DbgVariable.

No functional change.

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

11 years agoAdd addrspacecast instruction.
Matt Arsenault [Fri, 15 Nov 2013 01:34:59 +0000 (01:34 +0000)]
Add addrspacecast instruction.

Patch by Michele Scandale!

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

11 years agoInclude raw_ostream.h.
Rui Ueyama [Fri, 15 Nov 2013 01:25:34 +0000 (01:25 +0000)]
Include raw_ostream.h.

Including only Debug.h did not cause a compilation error, but you couldn't
do anything (like writing something with <<) to raw_ostreams returned by
llvm::dbgs() or llvm::errs() without including raw_ostream.h. So including
it from Debug.h should make sense.

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

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

11 years agoR600: Fix scheduling of instructions that use the LDS output queue
Tom Stellard [Fri, 15 Nov 2013 00:12:45 +0000 (00:12 +0000)]
R600: Fix scheduling of instructions that use the LDS output queue

The LDS output queue is accessed via the OQAP register.  The OQAP
register cannot be live across clauses, so if value is written to the
output queue, it must be retrieved before the end of the clause.
With the machine scheduler, we cannot statisfy this constraint, because
it lacks proper alias analysis and it will mark some LDS accesses as
having a chain dependency on vertex fetches.  Since vertex fetches
require a new clauses, the dependency may end up spiltting OQAP uses and
defs so the end up in different clauses.  See the lds-output-queue.ll
test for a more detailed explanation.

To work around this issue, we now combine the LDS read and the OQAP
copy into one instruction and expand it after register allocation.

This patch also adds some checks to the EmitClauseMarker pass, so that
it doesn't end a clause with a value still in the output queue and
removes AR.X and OQAP handling from the scheduler (AR.X uses and defs
were already being expanded post-RA, so the scheduler will never see
them).

Reviewed-by: Vincent Lejeune <vljn at ovi.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194755 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTeach the Makefile build system how to handle SOURCES which include
Chandler Carruth [Thu, 14 Nov 2013 23:51:29 +0000 (23:51 +0000)]
Teach the Makefile build system how to handle SOURCES which include
subdirectories. The only thing needed here is to create the appropriate
object file directories and add those as dependencies for the
compilation rules.

As a consequence, factor the non-source-file-specific dependencies for
compilation rules into a helper variable. This fixes an issue where the
project makefile wasn't actually a dependency of a bunch of compilation
make rules for no apparant reason.

This should have no observable effect for current makefile usage, but
will simplify how we build other libraries and is something CMake
already supports.

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

11 years agoR600/SI: Add processor type for Hawaii
Tom Stellard [Thu, 14 Nov 2013 23:46:00 +0000 (23:46 +0000)]
R600/SI: Add processor type for Hawaii

Patch by: Alex Deucher

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194752 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhen folding memory operands, preserve existing MachineMemOperands.
Andrew Trick [Thu, 14 Nov 2013 23:45:04 +0000 (23:45 +0000)]
When folding memory operands, preserve existing MachineMemOperands.

This comes into play with patchpoint, which can fold multiple
operands. Since the patchpoint is already treated as a call, the
machine mem operands won't affect anything, and there's nothing to
test. But we still want to do the right thing here to be sure that our
MIs obey the rules.

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

11 years agoR600/SI: Remove redundant legalizeOperands call
Matt Arsenault [Thu, 14 Nov 2013 23:44:25 +0000 (23:44 +0000)]
R600/SI: Remove redundant legalizeOperands call

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

11 years agoSimplify testcase.
Eric Christopher [Thu, 14 Nov 2013 23:43:10 +0000 (23:43 +0000)]
Simplify testcase.

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

11 years agoAdd #include raw_ostream.h in lib/Target/R600/SIFixSGPRCopies.cpp
Hans Wennborg [Thu, 14 Nov 2013 23:24:09 +0000 (23:24 +0000)]
Add #include raw_ostream.h in lib/Target/R600/SIFixSGPRCopies.cpp

This was casuing my release+asserts build on Windows to fail.

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

11 years agoR600/SI: Specify S_ADDK/S_MULK set SCC and are commutable
Matt Arsenault [Thu, 14 Nov 2013 22:32:49 +0000 (22:32 +0000)]
R600/SI: Specify S_ADDK/S_MULK set SCC and are commutable

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

11 years agoDebugInfo: Simplify/narrow null-check for getOrCreateType
David Blaikie [Thu, 14 Nov 2013 22:25:02 +0000 (22:25 +0000)]
DebugInfo: Simplify/narrow null-check for getOrCreateType

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

11 years agoRecognize 0x0000 as a COFF file magic.
Rui Ueyama [Thu, 14 Nov 2013 22:09:08 +0000 (22:09 +0000)]
Recognize 0x0000 as a COFF file magic.

Summary:
Some machine-type-neutral object files containing only undefined symbols
actually do exist in the Windows standard library. Need to recognize them
as COFF files.

Reviewers: Bigcheese

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

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

11 years ago[AArch64] Remove redundant Neon_immAllOnes/Neon_immAllZeros leaf patterns.
Chad Rosier [Thu, 14 Nov 2013 22:02:46 +0000 (22:02 +0000)]
[AArch64] Remove redundant Neon_immAllOnes/Neon_immAllZeros leaf patterns.

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

11 years agoDwarfCompileUnit::getOrCreateContext: Return the compile unit DIE rather than null.
David Blaikie [Thu, 14 Nov 2013 21:24:34 +0000 (21:24 +0000)]
DwarfCompileUnit::getOrCreateContext: Return the compile unit DIE rather than null.

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

11 years agoRemove unnecessary 'else' after return.
David Blaikie [Thu, 14 Nov 2013 19:37:56 +0000 (19:37 +0000)]
Remove unnecessary 'else' after return.

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

11 years agoTypos. (Test commit.)
Paul Robinson [Thu, 14 Nov 2013 18:47:23 +0000 (18:47 +0000)]
Typos.  (Test commit.)

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

11 years agoFix regular expression to work with multiple-digit version numbers
Dmitri Gribenko [Thu, 14 Nov 2013 18:31:30 +0000 (18:31 +0000)]
Fix regular expression to work with multiple-digit version numbers

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

11 years agoARM: produce friendly error for invalid inline asm
Tim Northover [Thu, 14 Nov 2013 17:15:39 +0000 (17:15 +0000)]
ARM: produce friendly error for invalid inline asm

We used to perform an invalid operation on an MVT and crash, which wasn't much
fun.

Patch by Oliver Stannard.

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

11 years agoAdd a triple and switch test to FileCheck.
Rafael Espindola [Thu, 14 Nov 2013 17:12:32 +0000 (17:12 +0000)]
Add a triple and switch test to FileCheck.

On windows we don't print .weak for function definitions, so count was only
finding 1 'weak'.

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

11 years agollvm-cov.test: Remove XFAIL:arm. Seems this is passing since my tweaks.
NAKAMURA Takumi [Thu, 14 Nov 2013 17:08:26 +0000 (17:08 +0000)]
llvm-cov.test: Remove XFAIL:arm. Seems this is passing since my tweaks.

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

11 years agoError if we see an alias to a declaration.
Rafael Espindola [Thu, 14 Nov 2013 13:58:06 +0000 (13:58 +0000)]
Error if we see an alias to a declaration.

In ELF and COFF an alias is just another offset in a section. There is no way
to represent an alias to something in another file.

In MachO, the spec has the N_INDR type which should allow for exactly that, but
is not currently implemented. Given that it is specified but not implemented,
we error in codegen to avoid miscompiling but don't reject aliases to
declarations in the verifier to leave the option open of implementing it.

In the past we have used alias to declarations as a way of implementing
weakref, which is why it exists in some old tests which this patch updates.

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

11 years ago[asan] Poor man's coverage that works with ASan
Kostya Serebryany [Thu, 14 Nov 2013 13:27:41 +0000 (13:27 +0000)]
[asan] Poor man's coverage that works with ASan

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

11 years ago[msan] Use CHECK-DAG instead of CHECK where order of instructions does not matter.
Evgeniy Stepanov [Thu, 14 Nov 2013 12:46:12 +0000 (12:46 +0000)]
[msan] Use CHECK-DAG instead of CHECK where order of instructions does not matter.

This may fix hexagon-elf bots.

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

11 years ago[msan] Fast path optimization for wrap-indirect-calls feature of MemorySanitizer.
Evgeniy Stepanov [Thu, 14 Nov 2013 12:29:04 +0000 (12:29 +0000)]
[msan] Fast path optimization for wrap-indirect-calls feature of MemorySanitizer.

Indirect call wrapping helps MSanDR (dynamic instrumentation companion tool
for MSan) to catch all cases where execution leaves a compiler-instrumented
module by allowing the tool to rewrite targets of indirect calls.

This change is an optimization that skips wrapping for calls when target is
inside the current module. This relies on the linker providing symbols at the
begin and end of the module code (or code + data, does not really matter).
Gold linker provides such symbols by default. GNU (BFD) linker needs a link
flag: -Wl,--defsym=__executable_start=0.

More info:
https://code.google.com/p/memory-sanitizer/wiki/MSanDR#Native_exec

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

11 years agollvm-cov requires IR and Support as libraries. Instrumentation would be overkill.
NAKAMURA Takumi [Thu, 14 Nov 2013 11:45:16 +0000 (11:45 +0000)]
llvm-cov requires IR and Support as libraries. Instrumentation would be overkill.

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

11 years agollvm-cov.test: Tweak win32 hosts not confused by \r\n in llvm-cov's stdout.
NAKAMURA Takumi [Thu, 14 Nov 2013 11:45:10 +0000 (11:45 +0000)]
llvm-cov.test: Tweak win32 hosts not confused by \r\n in llvm-cov's stdout.

"diff -b" -- Ignore space changes.

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

11 years agoIR/GCOV.cpp: Use PRIu64 as format string with uint64_t.
NAKAMURA Takumi [Thu, 14 Nov 2013 11:45:04 +0000 (11:45 +0000)]
IR/GCOV.cpp: Use PRIu64 as format string with uint64_t.

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

11 years agoWhitespace.
NAKAMURA Takumi [Thu, 14 Nov 2013 11:44:58 +0000 (11:44 +0000)]
Whitespace.

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

11 years agoAVX-512: Handled extractelement from mask vector;
Elena Demikhovsky [Thu, 14 Nov 2013 11:29:27 +0000 (11:29 +0000)]
AVX-512: Handled extractelement from mask vector;
Added VMOSHDUP/VMOVSLDUP shuffle instructions.

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

11 years agoFix the header comment of the new pass manager stuff to not claim to be
Chandler Carruth [Thu, 14 Nov 2013 10:55:14 +0000 (10:55 +0000)]
Fix the header comment of the new pass manager stuff to not claim to be
the legacy stuff. =]

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

11 years agoIndentation fixes
Matt Arsenault [Thu, 14 Nov 2013 10:08:50 +0000 (10:08 +0000)]
Indentation fixes

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

11 years agoAdd a comment
Matt Arsenault [Thu, 14 Nov 2013 08:06:38 +0000 (08:06 +0000)]
Add a comment

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

11 years agoFix trailing whitespace in debug printing
Matt Arsenault [Thu, 14 Nov 2013 08:06:35 +0000 (08:06 +0000)]
Fix trailing whitespace in debug printing

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

11 years agoR600/SI: Add testcase for problem I ran into
Matt Arsenault [Thu, 14 Nov 2013 07:57:29 +0000 (07:57 +0000)]
R600/SI: Add testcase for problem I ran into
with the older version of the moveToVALU changes.

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

11 years agoyaml::Input::mapTag(): Don't use StringRef to hold return type of std::string.
NAKAMURA Takumi [Thu, 14 Nov 2013 07:08:56 +0000 (07:08 +0000)]
yaml::Input::mapTag(): Don't use StringRef to hold return type of std::string.

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

11 years agoWhitespace.
NAKAMURA Takumi [Thu, 14 Nov 2013 07:08:49 +0000 (07:08 +0000)]
Whitespace.

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

11 years agoAArch64DAGToDAGISel::SelectVTBL(): Fix a warning. [-Wunused-variable]
NAKAMURA Takumi [Thu, 14 Nov 2013 07:04:07 +0000 (07:04 +0000)]
AArch64DAGToDAGISel::SelectVTBL(): Fix a warning. [-Wunused-variable]

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

11 years agoMinor extension to llvm.experimental.patchpoint: don't require a call.
Andrew Trick [Thu, 14 Nov 2013 06:54:10 +0000 (06:54 +0000)]
Minor extension to llvm.experimental.patchpoint: don't require a call.

If a null call target is provided, don't emit a dummy call. This
allows the runtime to reserve as little nop space as it needs without
the requirement of emitting a call.

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

11 years agoAdd test case for AArch64 NEON instruction set misc.
Kevin Qin [Thu, 14 Nov 2013 06:45:17 +0000 (06:45 +0000)]
Add test case for AArch64 NEON instruction set misc.

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

11 years ago[OCaml] Build stub OCaml libraries for all configured targets
Peter Zotov [Thu, 14 Nov 2013 06:34:21 +0000 (06:34 +0000)]
[OCaml] Build stub OCaml libraries for all configured targets

This allows to only link in the needed targets, reducing binary
size and more importantly link time.

Note that this is an incomplete implementation: currently,
LLVM does not have the plumbing which would allow to conditionally
link in AsmPrinter, AsmParser and Disassembler for the targets
which support them. This should be improved in the future.

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

11 years ago[OCaml] Expose LLVM's fatal error and stacktrace APIs
Peter Zotov [Thu, 14 Nov 2013 06:34:13 +0000 (06:34 +0000)]
[OCaml] Expose LLVM's fatal error and stacktrace APIs

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

11 years agoDon't mangle \n and "
Rafael Espindola [Thu, 14 Nov 2013 06:05:49 +0000 (06:05 +0000)]
Don't mangle \n and "

There is nothing special about quotes and newlines from the object
file point of view, only the assembler has to worry about expanding
the \n and \".

This patch then removes the special handling from the Mangler.

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

11 years agoAdd external project LDC to release notes.
Kai Nacke [Thu, 14 Nov 2013 05:57:40 +0000 (05:57 +0000)]
Add external project LDC to release notes.

LDC, the LLVM-based D compiler, is already using LLVM 3.4.

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

11 years agoR600/SIFixSGPRCopies.cpp: Fix \param to \return. [-Wdocumentation]
NAKAMURA Takumi [Thu, 14 Nov 2013 04:05:28 +0000 (04:05 +0000)]
R600/SIFixSGPRCopies.cpp: Fix \param to \return. [-Wdocumentation]

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

11 years agoWhitespace.
NAKAMURA Takumi [Thu, 14 Nov 2013 04:05:22 +0000 (04:05 +0000)]
Whitespace.

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

11 years ago[AArch64 neon] support poly64 and relevant intrinsic functions.
Kevin Qin [Thu, 14 Nov 2013 03:27:58 +0000 (03:27 +0000)]
[AArch64 neon] support poly64 and relevant intrinsic functions.

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

11 years agoremove extra semicolon
Nick Kledzik [Thu, 14 Nov 2013 03:03:05 +0000 (03:03 +0000)]
remove extra semicolon

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

11 years agoImplement aarch64 neon instruction class SIMD misc.
Kevin Qin [Thu, 14 Nov 2013 02:44:13 +0000 (02:44 +0000)]
Implement aarch64 neon instruction class SIMD misc.

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

11 years agoAdd dyn_cast<> support to YAML I/O's IO class
Nick Kledzik [Thu, 14 Nov 2013 02:38:07 +0000 (02:38 +0000)]
Add dyn_cast<> support to YAML I/O's IO class

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

11 years agoAdded BlockFrequencyInfo::view for displaying the block frequency propagation graph...
Michael Gottesman [Thu, 14 Nov 2013 02:27:46 +0000 (02:27 +0000)]
Added BlockFrequencyInfo::view for displaying the block frequency propagation graph via graphviz.

This is useful for debugging issues in the BlockFrequency implementation since
one can easily visualize where probability mass and other errors occur in the
propagation.

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

11 years agoSuppress llvm-cov.test on Win32, with REQUIRES: shell
NAKAMURA Takumi [Thu, 14 Nov 2013 02:05:41 +0000 (02:05 +0000)]
Suppress llvm-cov.test on Win32, with REQUIRES: shell

"cd" is unsupported in lit internal runner.

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

11 years agoUpdate emacs llvm mode.
Matt Arsenault [Thu, 14 Nov 2013 02:03:02 +0000 (02:03 +0000)]
Update emacs llvm mode.

It seems this hasn't been done in a while.

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

11 years agoImplement AArch64 NEON instruction set AdvSIMD (table).
Jiangning Liu [Thu, 14 Nov 2013 01:57:32 +0000 (01:57 +0000)]
Implement AArch64 NEON instruction set AdvSIMD (table).

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

11 years agoFixing a heisenbug where the memory dependence analysis behaves differently
Yunzhong Gao [Thu, 14 Nov 2013 01:10:52 +0000 (01:10 +0000)]
Fixing a heisenbug where the memory dependence analysis behaves differently
with and without -g.

Adding a test case to make sure that the threshold used in the memory
dependence analysis is respected. The test case also checks that debug
intrinsics are not counted towards this threshold.

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

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