This file is empty.
[oota-llvm.git] / test / Analysis / LoadVN / RLE-Preserve.ll
1 ; This testcase ensures that redundant loads are preserved when they are not
2 ; allowed to be eliminated.
3 ; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | grep sub
4 ;
5
6 define i32 @test1(i32* %P) {
7         %A = load i32* %P               ; <i32> [#uses=1]
8         store i32 1, i32* %P
9         %B = load i32* %P               ; <i32> [#uses=1]
10         %C = sub i32 %A, %B             ; <i32> [#uses=1]
11         ret i32 %C
12 }
13
14 define i32 @test2(i32* %P) {
15         %A = load i32* %P               ; <i32> [#uses=1]
16         br label %BB2
17
18 BB2:            ; preds = %0
19         store i32 5, i32* %P
20         br label %BB3
21
22 BB3:            ; preds = %BB2
23         %B = load i32* %P               ; <i32> [#uses=1]
24         %C = sub i32 %A, %B             ; <i32> [#uses=1]
25         ret i32 %C
26 }