1 ; RUN: opt < %s -scalarrepl -S | not grep alloca
2 ; RUN: opt < %s -scalarrepl -S | grep {load <4 x float>}
3 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
5 define void @test(<4 x float>* %F, float %f) {
7 %G = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=3]
8 %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2]
9 %tmp3 = fadd <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1]
10 store <4 x float> %tmp3, <4 x float>* %G
11 %G.upgrd.1 = getelementptr <4 x float>* %G, i32 0, i32 0 ; <float*> [#uses=1]
12 store float %f, float* %G.upgrd.1
13 %tmp4 = load <4 x float>* %G ; <<4 x float>> [#uses=2]
14 %tmp6 = fadd <4 x float> %tmp4, %tmp4 ; <<4 x float>> [#uses=1]
15 store <4 x float> %tmp6, <4 x float>* %F
19 define void @test2(<4 x float>* %F, float %f) {
21 %G = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=3]
22 %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2]
23 %tmp3 = fadd <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1]
24 store <4 x float> %tmp3, <4 x float>* %G
25 %tmp.upgrd.2 = getelementptr <4 x float>* %G, i32 0, i32 2 ; <float*> [#uses=1]
26 store float %f, float* %tmp.upgrd.2
27 %tmp4 = load <4 x float>* %G ; <<4 x float>> [#uses=2]
28 %tmp6 = fadd <4 x float> %tmp4, %tmp4 ; <<4 x float>> [#uses=1]
29 store <4 x float> %tmp6, <4 x float>* %F
33 define void @test3(<4 x float>* %F, float* %f) {
35 %G = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=2]
36 %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2]
37 %tmp3 = fadd <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1]
38 store <4 x float> %tmp3, <4 x float>* %G
39 %tmp.upgrd.3 = getelementptr <4 x float>* %G, i32 0, i32 2 ; <float*> [#uses=1]
40 %tmp.upgrd.4 = load float* %tmp.upgrd.3 ; <float> [#uses=1]
41 store float %tmp.upgrd.4, float* %f
45 define void @test4(<4 x float>* %F, float* %f) {
47 %G = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=2]
48 %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2]
49 %tmp3 = fadd <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1]
50 store <4 x float> %tmp3, <4 x float>* %G
51 %G.upgrd.5 = getelementptr <4 x float>* %G, i32 0, i32 0 ; <float*> [#uses=1]
52 %tmp.upgrd.6 = load float* %G.upgrd.5 ; <float> [#uses=1]
53 store float %tmp.upgrd.6, float* %f
57 define i32 @test5(float %X) { ;; should turn into bitcast.
58 %X_addr = alloca [4 x float]
59 %X1 = getelementptr [4 x float]* %X_addr, i32 0, i32 2
60 store float %X, float* %X1
61 %a = bitcast float* %X1 to i32*