Simplify and generalize the SROA "convert to scalar" transformation to
[oota-llvm.git] / test / Transforms / ScalarRepl / bitfield-sroa.ll
1 ; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep alloca        
2 ; rdar://6532315
3 %t = type { { i32, i16, i8, i8 } }
4
5 define i8 @foo(i64 %A) {
6         %ALL = alloca %t, align 8 
7         %tmp59172 = bitcast %t* %ALL to i64*
8         store i64 %A, i64* %tmp59172, align 8
9         %C = getelementptr %t* %ALL, i32 0, i32 0, i32 1             
10         %D = bitcast i16* %C to i32*    
11         %E = load i32* %D, align 4     
12         %F = bitcast %t* %ALL to i8* 
13         %G = load i8* %F, align 8 
14         ret i8 %G
15 }
16