new testcase for PR1435
[oota-llvm.git] / test / Transforms / ScalarRepl / vector_promote.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | \
2 ; RUN:   not grep alloca
3
4 void %test(<4 x float>* %F, float %f) {
5 entry:
6         %G = alloca <4 x float>, align 16               ; <<4 x float>*> [#uses=3]
7         %tmp = load <4 x float>* %F             ; <<4 x float>> [#uses=2]
8         %tmp3 = add <4 x float> %tmp, %tmp              ; <<4 x float>> [#uses=1]
9         store <4 x float> %tmp3, <4 x float>* %G
10         %G = getelementptr <4 x float>* %G, int 0, int 0                ; <float*> [#uses=1]
11         store float %f, float* %G
12         %tmp4 = load <4 x float>* %G            ; <<4 x float>> [#uses=2]
13         %tmp6 = add <4 x float> %tmp4, %tmp4            ; <<4 x float>> [#uses=1]
14         store <4 x float> %tmp6, <4 x float>* %F
15         ret void
16 }
17
18 void %test2(<4 x float>* %F, float %f) {
19 entry:
20         %G = alloca <4 x float>, align 16               ; <<4 x float>*> [#uses=3]
21         %tmp = load <4 x float>* %F             ; <<4 x float>> [#uses=2]
22         %tmp3 = add <4 x float> %tmp, %tmp              ; <<4 x float>> [#uses=1]
23         store <4 x float> %tmp3, <4 x float>* %G
24         %tmp = getelementptr <4 x float>* %G, int 0, int 2              ; <float*> [#uses=1]
25         store float %f, float* %tmp
26         %tmp4 = load <4 x float>* %G            ; <<4 x float>> [#uses=2]
27         %tmp6 = add <4 x float> %tmp4, %tmp4            ; <<4 x float>> [#uses=1]
28         store <4 x float> %tmp6, <4 x float>* %F
29         ret void
30 }
31
32 void %test3(<4 x float>* %F, float* %f) {
33 entry:
34         %G = alloca <4 x float>, align 16               ; <<4 x float>*> [#uses=2]
35         %tmp = load <4 x float>* %F             ; <<4 x float>> [#uses=2]
36         %tmp3 = add <4 x float> %tmp, %tmp              ; <<4 x float>> [#uses=1]
37         store <4 x float> %tmp3, <4 x float>* %G
38         %tmp = getelementptr <4 x float>* %G, int 0, int 2              ; <float*> [#uses=1]
39         %tmp = load float* %tmp         ; <float> [#uses=1]
40         store float %tmp, float* %f
41         ret void
42 }
43
44 void %test4(<4 x float>* %F, float* %f) {
45 entry:
46         %G = alloca <4 x float>, align 16               ; <<4 x float>*> [#uses=2]
47         %tmp = load <4 x float>* %F             ; <<4 x float>> [#uses=2]
48         %tmp3 = add <4 x float> %tmp, %tmp              ; <<4 x float>> [#uses=1]
49         store <4 x float> %tmp3, <4 x float>* %G
50         %G = getelementptr <4 x float>* %G, int 0, int 0                ; <float*> [#uses=1]
51         %tmp = load float* %G           ; <float> [#uses=1]
52         store float %tmp, float* %f
53         ret void
54 }
55