llvm-6502/test
Chris Lattner 2e0d5f8432 Simplify and generalize the SROA "convert to scalar" transformation to
be able to handle *ANY* alloca that is poked by loads and stores of 
bitcasts and GEPs with constant offsets.  Before the code had a number
of annoying limitations and caused it to miss cases such as storing into
holes in structs and complex casts (as in bitfield-sroa) where we had
unions of bitfields etc.  This also handles a number of important cases
that are exposed due to the ABI lowering stuff we do to pass stuff by
value.

One case that is pretty great is that we compile 
2006-11-07-InvalidArrayPromote.ll into:

define i32 @func(<4 x float> %v0, <4 x float> %v1) nounwind {
	%tmp10 = call <4 x i32> @llvm.x86.sse2.cvttps2dq(<4 x float> %v1)
	%tmp105 = bitcast <4 x i32> %tmp10 to i128
	%tmp1056 = zext i128 %tmp105 to i256	
	%tmp.upgrd.43 = lshr i256 %tmp1056, 96
	%tmp.upgrd.44 = trunc i256 %tmp.upgrd.43 to i32	
	ret i32 %tmp.upgrd.44
}

which turns into:

_func:
	subl	$28, %esp
	cvttps2dq	%xmm1, %xmm0
	movaps	%xmm0, (%esp)
	movl	12(%esp), %eax
	addl	$28, %esp
	ret

Which is pretty good code all things considering :).

One effect of this is that SROA will start generating arbitrary bitwidth 
integers that are a multiple of 8 bits.  In the case above, we got a 
256 bit integer, but the codegen guys assure me that it can handle the 
simple and/or/shift/zext stuff that we're doing on these operations.

This addresses rdar://6532315



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-31 02:28:54 +00:00
..
Analysis Wind SCEV back in time, to Nov 18th. This 'fixes' PR3275, PR3294, PR3295, 2009-01-13 09:18:58 +00:00
Archive
Assembler Add the private linkage. 2009-01-15 20:18:42 +00:00
Bindings/Ocaml [PR2886] Ignore stderr from ocamlc since it prints unresolvable warnings on some platforms. 2008-10-22 12:41:54 +00:00
Bitcode
BugPoint
CodeGen XFAIL this test. It only worked before because of a bug in the spill point selection code. Not deleting because 2009-01-29 22:27:56 +00:00
DebugInfo Each input file is encoded as a separate compile unit in LLVM debugging 2009-01-30 18:20:31 +00:00
ExecutionEngine This is case is to uncover the bug in IntrinsicLowering.cpp, 2009-01-30 08:59:51 +00:00
Feature Reimplement the old and horrible bison parser for .ll files with a nice 2009-01-02 07:01:27 +00:00
FrontendAda
FrontendC Add a always_inline test case. 2009-01-29 09:31:54 +00:00
FrontendC++ Remove no-longer relevant comment. Pointed out 2009-01-22 15:37:29 +00:00
FrontendFortran Testcase for recent llvm-gcc fix 2008-11-03 14:43:31 +00:00
FrontendObjC Testcase for 6522054. 2009-01-26 23:22:19 +00:00
FrontendObjC++ This is an objective-c test, not an objective-c++ one. 2008-10-06 18:42:48 +00:00
Integer alignment of 0 is not valid. 2009-01-05 08:14:35 +00:00
lib Fix make check on Solaris 10/x86: the default grep is not GNU grep, same for as. 2008-10-21 17:21:32 +00:00
Linker Reimplement the old and horrible bison parser for .ll files with a nice 2009-01-02 07:01:27 +00:00
LLVMC Add three new option properties. 2009-01-28 03:47:20 +00:00
Other Testcase for PR2894. 2008-10-15 22:34:34 +00:00
Scripts
TableGen Fun x86 encoding tricks: when adding an immediate value of 128, 2008-10-17 01:33:43 +00:00
Transforms Simplify and generalize the SROA "convert to scalar" transformation to 2009-01-31 02:28:54 +00:00
Verifier Reimplement the old and horrible bison parser for .ll files with a nice 2009-01-02 07:01:27 +00:00
Makefile * Quoted the executable 'runtest' to emphasize the binary needed; 2009-01-01 20:26:05 +00:00
Makefile.tests
TestRunner.sh