llvm-6502/test/Transforms/ScalarRepl
Chris Lattner d2fa781169 Implement the first half of PR3290: if there is a store of an
integer to a (transitive) bitcast the alloca and if that integer
has the full size of the alloca, then it clobbers the whole thing.
Handle this by extracting pieces out of the stored integer and 
filing them away in the SROA'd elements.

This triggers fairly frequently because the CFE uses integers to
pass small structs by value and the inliner exposes these.  For 
example, in kimwitu++, I see a bunch of these with i64 stores to
"%struct.std::pair<std::_Rb_tree_const_iterator<kc::impl_abstract_phylum*>,bool>"

In 176.gcc I see a few i32 stores to "%struct..0anon".

In the testcase, this is a difference between compiling test1 to:

_test1:
	subl	$12, %esp
	movl	20(%esp), %eax
	movl	%eax, 4(%esp)
	movl	16(%esp), %eax
	movl	%eax, (%esp)
	movl	(%esp), %eax
	addl	4(%esp), %eax
	addl	$12, %esp
	ret

vs:

_test1:
	movl	8(%esp), %eax
	addl	4(%esp), %eax
	ret

The second half of this will be to handle loads of the same form.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61853 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 08:11:13 +00:00
..
2003-05-29-ArrayFail.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
2003-05-30-InvalidIndices.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
2003-05-30-MultiLevel.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
2003-09-12-IncorrectPromote.ll Fix some escaping and quoting in RUN lines, mainly involving { and <. In two 2008-06-10 16:04:47 +00:00
2003-10-29-ArrayProblem.ll Fix some tests. 2008-06-12 21:23:38 +00:00
2005-12-14-UnionPromoteCrash.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
2006-01-24-IllegalUnionPromoteCrash.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
2006-04-20-PromoteCrash.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
2006-10-23-PointerUnionCrash.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
2006-11-07-InvalidArrayPromote.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
2006-12-11-SROA-Crash.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
2007-03-19-CanonicalizeMemcpy.ll
2007-05-24-LargeAggregate.ll
2007-05-29-MemcpyPreserve.ll
2007-11-03-bigendian_apint.ll Change uses of getTypeSize to getABITypeSize, getTypeStoreSize 2007-11-04 14:43:57 +00:00
2008-01-29-PromoteBug.ll Fix a bug where scalarrepl would discard offset if type would match. 2008-01-30 00:39:15 +00:00
2008-02-28-SubElementExtractCrash.ll fix a bug Anders ran into where scalarrepl would crash when promoting 2008-02-29 07:12:06 +00:00
2008-06-05-loadstore-agg.ll Learn ScalarReplAggregrates how stores and loads of first class aggregrates 2008-06-05 12:51:53 +00:00
2008-06-22-LargeArray.ll Fix PR2369 by making scalarrepl more careful about promoting 2008-06-22 17:46:21 +00:00
2008-08-22-out-of-range-array-promote.ll Fix PR2423 by checking all indices for out of range access, not only 2008-08-23 05:21:06 +00:00
2008-09-22-vector-gep.ll Allow scalarrepl to treat an all-zero GEP just as bitcast. 2008-10-06 16:23:31 +00:00
AggregatePromote.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
arraytest.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
badarray.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
basictest.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
copy-aggregate.ll Implement the first half of PR3290: if there is a store of an 2009-01-07 08:11:13 +00:00
dg.exp sabre brings to my attention that the 'tr' suffix is also obsolete 2008-05-20 21:00:03 +00:00
DifferingTypes.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
load-store-aggregate.ll Add a testcase showing that scalarrepl supports first class structs. 2008-09-29 10:42:13 +00:00
memcpy-from-global.ll
memset-aggregate-byte-leader.ll
memset-aggregate.ll
phinodepromote.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
select_promote.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
sroa_two.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
union-fp-int.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
union-packed.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
union-pointer.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00
vector_promote.ll Upgrade tests to not use llvm-upgrade. 2008-03-18 04:14:37 +00:00