Chris Lattner | dbcc2f7 | 2005-03-25 15:36:19 +0000 | [diff] [blame] | 1 | ; RUN: llvm-as < %s | opt -ds-aa -load-vn -gcse | llvm-dis | grep 'load int\* %L' |
Chris Lattner | 4e59c64 | 2005-03-24 17:57:43 +0000 | [diff] [blame] | 2 | |
| 3 | %G = internal global int* null |
| 4 | |
| 5 | int %caller(bool %P) { |
| 6 | %L = alloca int |
| 7 | call void %callee(bool %P, int* %L) |
| 8 | |
| 9 | ;; At this point, G could point to L, so we can't eliminate these operations. |
| 10 | %GP = load int** %G |
| 11 | store int 17, int* %L |
| 12 | store int 18, int* %GP ;; might clober L |
| 13 | |
| 14 | %A = load int* %L ;; is not necessarily 17! |
| 15 | ret int %A |
| 16 | } |
| 17 | |
| 18 | internal void %callee(bool %Cond, int* %P) { |
| 19 | br bool %Cond, label %T, label %F |
| 20 | T: |
| 21 | store int* %P, int** %G |
| 22 | ret void |
| 23 | F: |
| 24 | ret void |
| 25 | } |
| 26 | |