llvm/test/Transforms
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
..
ADCE
ArgumentPromotion
BlockPlacement
BranchFolding
CodeExtractor
CodeGenPrepare
CondProp Handle single-entry phi nodes gracefully in condprop. 2009-01-26 02:18:20 +00:00
ConstantMerge
ConstProp
DeadArgElim
DeadStoreElimination
FunctionAttrs Remove alloca tracking from nocapture analysis. Not only 2009-01-07 19:39:06 +00:00
GlobalDCE Delete unused global aliases with internal linkage. 2009-01-05 20:37:33 +00:00
GlobalOpt rewrite OptimizeAwayTrappingUsesOfLoads to 1) avoid a temporary 2009-01-14 00:12:58 +00:00
GVN fix two more cases where we could let the NLPDI cache get unsorted. 2009-01-23 07:12:16 +00:00
GVNPRE
IndMemRem Actually run the test in this directory. 2009-01-25 08:05:07 +00:00
IndVarsSimplify
Inline Fix testsuite regressions from recursive inlining. 2009-01-13 22:43:37 +00:00
InstCombine Fixed optimization of combining two shuffles where the first shuffle inputs 2009-01-26 04:39:00 +00:00
Internalize Teach the internalize pass to also internalize 2009-01-05 21:24:45 +00:00
IPConstantProp
JumpThreading Fix PR3353, infinitely jump threading an infinite loop make from switches. 2009-01-19 21:20:34 +00:00
LCSSA
LICM
LoopDeletion
LoopIndexSplit
LoopRotate Fix PR3408 by making a non-obvious assumption very obvious, and 2009-01-26 02:11:30 +00:00
LoopSimplify
LoopStrengthReduce Fix the time regression I introduced in 464.h264ref with 2009-01-14 02:35:31 +00:00
LoopUnroll
LoopUnswitch
LowerInvoke
LowerSetJmp
LowerSwitch
Mem2Reg
MemCpyOpt
MergeFunc
PredicateSimplifier
PruneEH Do not inline functions with (dynamic) alloca into 2009-01-08 21:45:23 +00:00
RaiseAllocations
Reassociate
ScalarRepl Simplify and generalize the SROA "convert to scalar" transformation to 2009-01-31 02:28:54 +00:00
SCCP Fix PR3325, a miscompilation of invokes by IPSCCP. Patch by Jay Foad! 2009-01-14 21:01:16 +00:00
SimplifyCFG fix a testcase. 2009-01-22 07:08:58 +00:00
SimplifyLibCalls Forgot this in the previous checkin: fopen now has nocapture, realloc is 2009-01-18 04:46:10 +00:00
SRETPromotion
StripSymbols
TailCallElim
TailDup