Use InstrSlots::NUM rather than pre-dividing by four. Also, mark this const.
[oota-llvm.git] / test / Analysis / LoadVN / RLE-Eliminate.ll
1 ; This testcase ensures that redundant loads are eliminated when they should
2 ; be.  All RL variables (redundant loads) should be eliminated.
3 ;
4 ; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | not grep %RL
5 ;
6
7 define i32 @test1(i32* %P) {
8         %A = load i32* %P               ; <i32> [#uses=1]
9         %RL = load i32* %P              ; <i32> [#uses=1]
10         %C = add i32 %A, %RL            ; <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         br label %BB3
20
21 BB3:            ; preds = %BB2
22         %RL = load i32* %P              ; <i32> [#uses=1]
23         %B = add i32 %A, %RL            ; <i32> [#uses=1]
24         ret i32 %B
25 }