Move a DenseMap's declaration outside of a loop, and just call
[oota-llvm.git] / test / Transforms / InstCombine / store-merge.ll
1 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
2 ; RUN:    grep {ret i32 %.toremerge} | count 2
3 ;; Simple sinking tests
4
5 ; "if then else"
6 define i32 @test1(i1 %C) {
7         %A = alloca i32
8         br i1 %C, label %Cond, label %Cond2
9
10 Cond:
11         store i32 -987654321, i32* %A
12         br label %Cont
13
14 Cond2:
15         store i32 47, i32* %A
16         br label %Cont
17
18 Cont:
19         %V = load i32* %A
20         ret i32 %V
21 }
22
23 ; "if then"
24 define i32 @test2(i1 %C) {
25         %A = alloca i32
26         store i32 47, i32* %A
27         br i1 %C, label %Cond, label %Cont
28
29 Cond:
30         store i32 -987654321, i32* %A
31         br label %Cont
32
33 Cont:
34         %V = load i32* %A
35         ret i32 %V
36 }
37