llvm/test
Chris Lattner 8a594489bf Fix a long standing deficiency in the X86 backend: we would
sometimes emit "zero" and "all one" vectors multiple times,
for example:

_test2:
	pcmpeqd	%mm0, %mm0
	movq	%mm0, _M1
	pcmpeqd	%mm0, %mm0
	movq	%mm0, _M2
	ret

instead of:

_test2:
	pcmpeqd	%mm0, %mm0
	movq	%mm0, _M1
	movq	%mm0, _M2
	ret

This patch fixes this by always arranging for zero/one vectors
to be defined as v4i32 or v2i32 (SSE/MMX) instead of letting them be
any random type.  This ensures they get trivially CSE'd on the dag.
This fix is also important for LegalizeDAGTypes, as it gets unhappy
when the x86 backend wants BUILD_VECTOR(i64 0) to be legal even when
'i64' isn't legal.

This patch makes the following changes:

1) X86TargetLowering::LowerBUILD_VECTOR now lowers 0/1 vectors into
   their canonical types.
2) The now-dead patterns are removed from the SSE/MMX .td files.
3) All the patterns in the .td file that referred to immAllOnesV or
   immAllZerosV in the wrong form now use *_bc to match them with a
   bitcast wrapped around them.
4) X86DAGToDAGISel::SelectScalarSSELoad is generalized to handle 
   bitcast'd zero vectors, which simplifies the code actually.
5) getShuffleVectorZeroOrUndef is updated to generate a shuffle that
   is legal, instead of generating one that is illegal and expecting
   a later legalize pass to clean it up.
6) isZeroShuffle is generalized to handle bitcast of zeros.
7) several other minor tweaks.

This patch is definite goodness, but has the potential to cause random
code quality regressions.  Please be on the lookout for these and let 
me know if they happen.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44310 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 00:24:49 +00:00
..
Analysis Ding dong, the DoesntAccessMemoryFns and 2007-11-23 19:30:27 +00:00
Archive Delete the svn:executable property on these files, which aren't executable. 2007-07-23 19:26:08 +00:00
Assembler Fix PR1645 by resolving forward alias references. 2007-09-10 23:23:53 +00:00
Bindings/Ocaml C and Objective Caml bindings for PHINode::addIncoming etc. 2007-10-08 18:14:39 +00:00
Bitcode This is the patch to provide clean intrinsic function overloading support in LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future. 2007-08-04 01:51:18 +00:00
BugPoint Convert .cvsignore files 2007-06-29 16:35:07 +00:00
C++Frontend New test. 2007-10-02 00:39:19 +00:00
CFrontend Un XFAIL these tests, now that Bill has backported 2007-11-14 13:40:53 +00:00
CodeGen Fix a long standing deficiency in the X86 backend: we would 2007-11-25 00:24:49 +00:00
DebugInfo For PR1558: 2007-07-17 06:20:38 +00:00
ExecutionEngine Convert .cvsignore files 2007-06-29 16:35:07 +00:00
Feature Add support for vectors to int <-> float casts. 2007-11-17 03:58:34 +00:00
FrontendAda For multipart tests, place the parts with no 2007-07-23 13:41:53 +00:00
FrontendObjC Thanks to the XTARGET line, this test should still 2007-11-09 13:50:25 +00:00
Integer Change all floating constants that are not exactly 2007-09-05 17:50:36 +00:00
lib Implement the XTARGET feature for PR1778 2007-11-06 22:32:17 +00:00
Linker Add a test to ensure that obvious link messages are actually produced on 2007-08-16 07:22:43 +00:00
Other New test. 2007-09-10 18:12:52 +00:00
Scripts Add a test script for counting lines. This can be used instead of the 2007-08-10 15:07:05 +00:00
TableGen Convert tests using "| wc -l | grep ..." to use the count script. 2007-08-15 13:36:28 +00:00
Transforms Fix PR1816, by correcting the broken definition of APInt::countTrailingZeros. 2007-11-23 22:42:31 +00:00
Verifier Fix for PR1633: Verifier doesn't fully verify GC intrinsics 2007-09-17 20:30:04 +00:00
Makefile Add explicit --enable-bindings option to configure. 2007-10-02 09:50:18 +00:00
Makefile.tests Failure.sh is dead, remove it. 2007-04-21 20:46:55 +00:00
TestRunner.sh Avoid an infinite loop when TestRunner.sh is run outside of the test dir. 2007-05-18 02:06:03 +00:00