Tighten the conditions under which we do PRE, remove some unneeded code, and correct...
[oota-llvm.git] / test / CodeGen / PowerPC / stfiwx.ll
1 ; RUN: llvm-as < %s | \
2 ; RUN:   llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=stfiwx -o %t1 -f
3 ; RUN: grep stfiwx %t1
4 ; RUN: not grep r1 %t1
5 ; RUN: llvm-as < %s | \
6 ; RUN:   llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-stfiwx \
7 ; RUN:   -o %t2 -f
8 ; RUN: not grep stfiwx %t2
9 ; RUN: grep r1 %t2
10
11 define void @test(float %a, i32* %b) {
12         %tmp.2 = fptosi float %a to i32         ; <i32> [#uses=1]
13         store i32 %tmp.2, i32* %b
14         ret void
15 }
16
17 define void @test2(float %a, i32* %b, i32 %i) {
18         %tmp.2 = getelementptr i32* %b, i32 1           ; <i32*> [#uses=1]
19         %tmp.5 = getelementptr i32* %b, i32 %i          ; <i32*> [#uses=1]
20         %tmp.7 = fptosi float %a to i32         ; <i32> [#uses=3]
21         store i32 %tmp.7, i32* %tmp.5
22         store i32 %tmp.7, i32* %tmp.2
23         store i32 %tmp.7, i32* %b
24         ret void
25 }
26