1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

97534 Commits

Author SHA1 Message Date
Daniel Sanders
0ebbe1d56c 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

llvm-svn: 194811
2013-11-15 12:56:49 +00:00
Justin Holewinski
70fd1ffdc4 [NVPTX] Fix handling of indirect calls
Using a special machine node is cleaner than an InlineAsm node, and fixes an assertion failure in InstrEmitter

llvm-svn: 194810
2013-11-15 12:30:04 +00:00
Yaron Keren
383afa17d9 Correct spelling.
llvm-svn: 194808
2013-11-15 11:42:49 +00:00
Daniel Sanders
4d431047f3 [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

llvm-svn: 194806
2013-11-15 11:04:16 +00:00
Chandler Carruth
fecf2a3964 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.

llvm-svn: 194801
2013-11-15 10:20:45 +00:00
Kostya Serebryany
3b2f8ea060 [asan] use GlobalValue::PrivateLinkage for coverage guard to save quite a bit of code size
llvm-svn: 194800
2013-11-15 09:52:05 +00:00
Benjamin Kramer
0207e765c7 llvm-cov: Clean up memory leaks.
llvm-svn: 194799
2013-11-15 09:44:17 +00:00
Alexey Samsonov
41e10022fb Redirect unused test case output to /dev/null
llvm-svn: 194798
2013-11-15 09:36:58 +00:00
Benjamin Kramer
a2ecba54d6 Give unit test its own LLVMContext so MDNodes aren't leaked even if we never call llvm_shutdown.
Found by valgrind.

llvm-svn: 194797
2013-11-15 09:34:33 +00:00
Renato Golin
17984e763c Adding some info about stability of ARM boards
Patch by Mikael Lyngvig

llvm-svn: 194794
2013-11-15 08:42:14 +00:00
Zoran Jovanovic
e87258135d Use instr mapping for microMIPS in llvm-mc.
llvm-svn: 194792
2013-11-15 08:07:34 +00:00
Bob Wilson
5f54393e59 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.

llvm-svn: 194789
2013-11-15 07:16:09 +00:00
Andrew Trick
615a458a47 Platform proof a test case.
llvm-svn: 194788
2013-11-15 05:52:56 +00:00
Matt Arsenault
2c9ec5c652 Add instcombine visitor for addrspacecast
llvm-svn: 194786
2013-11-15 05:45:08 +00:00
Matt Arsenault
21f695f0ab Fix grammar in addrspacecast description
llvm-svn: 194785
2013-11-15 05:44:56 +00:00
Matt Arsenault
084675c776 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.

llvm-svn: 194783
2013-11-15 04:42:23 +00:00
Peter Zotov
494e0ed7e2 [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.

llvm-svn: 194781
2013-11-15 03:43:51 +00:00
Bob Wilson
1eb0da26bc 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.

llvm-svn: 194780
2013-11-15 03:28:22 +00:00
Peter Zotov
e3aea5bc85 [OCaml] Use native target in testsuite instead of hardcoding X86
llvm-svn: 194778
2013-11-15 03:19:08 +00:00
Peter Zotov
ec8c29b1d7 [OCaml] Add Target and TargetMachine bindings to Llvm_target
llvm-svn: 194774
2013-11-15 02:51:57 +00:00
Peter Zotov
5d089306c3 [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.

llvm-svn: 194773
2013-11-15 02:51:44 +00:00
Peter Zotov
e66ae0045d [OCaml] Fix building of stub libraries
llvm-svn: 194772
2013-11-15 02:51:27 +00:00
Peter Zotov
df3c4f939f [llvm-c] Make LLVMGetTargetFromName actually work
LLVMGetTargetFromName used to compare two char* strings directly.

llvm-svn: 194771
2013-11-15 02:51:18 +00:00
Peter Zotov
d805fbbee2 [llvm-c] Add missing const qualifiers to LLVMCreateTargetMachine
llvm-svn: 194770
2013-11-15 02:51:12 +00:00
Peter Zotov
9d1fb89548 [llvm-c] Simplify signature of LLVMGetTargetFromName
LLVMGetTargetFromName was not yet present in an LLVM release,
so this does not break compatibility.

llvm-svn: 194769
2013-11-15 02:51:01 +00:00
Reed Kotler
fe9db0b6cc 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.

llvm-svn: 194766
2013-11-15 02:21:52 +00:00
Eric Christopher
4b3475b5b7 Use a reference rather than a pointer as we don't expect a NULL
DbgVariable.

No functional change.

llvm-svn: 194761
2013-11-15 01:43:19 +00:00
Matt Arsenault
9921608896 Add addrspacecast instruction.
Patch by Michele Scandale!

llvm-svn: 194760
2013-11-15 01:34:59 +00:00
Rui Ueyama
0a09bce84f 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

llvm-svn: 194759
2013-11-15 01:25:34 +00:00
Tom Stellard
43da22dc72 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>
llvm-svn: 194755
2013-11-15 00:12:45 +00:00
Chandler Carruth
688fb4ad98 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.

llvm-svn: 194753
2013-11-14 23:51:29 +00:00
Tom Stellard
f83d4c8450 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>
llvm-svn: 194752
2013-11-14 23:46:00 +00:00
Andrew Trick
a299d799ed 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.

llvm-svn: 194750
2013-11-14 23:45:04 +00:00
Matt Arsenault
7a5074baf9 R600/SI: Remove redundant legalizeOperands call
llvm-svn: 194749
2013-11-14 23:44:25 +00:00
Eric Christopher
5c8a91e390 Simplify testcase.
llvm-svn: 194748
2013-11-14 23:43:10 +00:00
Hans Wennborg
24c3194a8c Add #include raw_ostream.h in lib/Target/R600/SIFixSGPRCopies.cpp
This was casuing my release+asserts build on Windows to fail.

llvm-svn: 194747
2013-11-14 23:24:09 +00:00
Matt Arsenault
7977e191dc R600/SI: Specify S_ADDK/S_MULK set SCC and are commutable
llvm-svn: 194738
2013-11-14 22:32:49 +00:00
David Blaikie
c66f57b05c DebugInfo: Simplify/narrow null-check for getOrCreateType
llvm-svn: 194737
2013-11-14 22:25:02 +00:00
Rui Ueyama
caa74a04ef 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

llvm-svn: 194734
2013-11-14 22:09:08 +00:00
Chad Rosier
7891b8257a [AArch64] Remove redundant Neon_immAllOnes/Neon_immAllZeros leaf patterns.
llvm-svn: 194733
2013-11-14 22:02:46 +00:00
David Blaikie
f2c4229f67 DwarfCompileUnit::getOrCreateContext: Return the compile unit DIE rather than null.
llvm-svn: 194728
2013-11-14 21:24:34 +00:00
David Blaikie
2da163137a Remove unnecessary 'else' after return.
llvm-svn: 194724
2013-11-14 19:37:56 +00:00
Paul Robinson
602bf7c61a Typos. (Test commit.)
llvm-svn: 194720
2013-11-14 18:47:23 +00:00
Dmitri Gribenko
1d3344d42f Fix regular expression to work with multiple-digit version numbers
llvm-svn: 194719
2013-11-14 18:31:30 +00:00
Tim Northover
f4b55b1a75 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.

llvm-svn: 194714
2013-11-14 17:15:39 +00:00
Rafael Espindola
9c31f574d3 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'.

llvm-svn: 194713
2013-11-14 17:12:32 +00:00
NAKAMURA Takumi
d4f6e2b832 llvm-cov.test: Remove XFAIL:arm. Seems this is passing since my tweaks.
llvm-svn: 194712
2013-11-14 17:08:26 +00:00
Rafael Espindola
0073c32e5f 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.

llvm-svn: 194705
2013-11-14 13:58:06 +00:00
Kostya Serebryany
8bd4b917a6 [asan] Poor man's coverage that works with ASan
llvm-svn: 194701
2013-11-14 13:27:41 +00:00
Evgeniy Stepanov
fec309eeb3 [msan] Use CHECK-DAG instead of CHECK where order of instructions does not matter.
This may fix hexagon-elf bots.

llvm-svn: 194700
2013-11-14 12:46:12 +00:00