blob: fb79cfa7fd711a00811fc7b58360979bf617ebad [file] [log] [blame]
Chris Lattner5abaa0c2002-05-16 01:03:12 +00001; This testcase ensures that redundant loads are eliminated when they should
2; be. All RL variables (redundant loads) should be eliminated.
3;
Chris Lattner50e86822003-06-28 23:23:34 +00004; RUN: as < %s | opt -load-vn -gcse | dis | not grep %RL
Chris Lattner5abaa0c2002-05-16 01:03:12 +00005;
6int "test1"(int* %P) {
7 %A = load int* %P
8 %RL = load int* %P
9 %C = add int %A, %RL
10 ret int %C
11}
12
13int "test2"(int* %P) {
14 %A = load int* %P
15 br label %BB2
16BB2:
17 br label %BB3
18BB3:
19 %RL = load int* %P
20 %B = add int %A, %RL
21 ret int %B
22}
23