2008-02-14 06:56:27 +00:00
|
|
|
; RUN: llvm-as < %s | opt -load-vn -gcse -instcombine | llvm-dis | grep sub
|
2003-04-22 22:00:15 +00:00
|
|
|
|
|
|
|
; BasicAA was incorrectly concluding that P1 and P2 didn't conflict!
|
|
|
|
|
2008-02-14 06:56:27 +00:00
|
|
|
define i32 @test(i32 *%Ptr, i64 %V) {
|
|
|
|
%P2 = getelementptr i32* %Ptr, i64 1
|
|
|
|
%P1 = getelementptr i32* %Ptr, i64 %V
|
|
|
|
%X = load i32* %P1
|
|
|
|
store i32 5, i32* %P2
|
2003-04-22 22:00:15 +00:00
|
|
|
|
2008-02-14 06:56:27 +00:00
|
|
|
%Y = load i32* %P1
|
2003-04-22 22:00:15 +00:00
|
|
|
|
2008-02-14 06:56:27 +00:00
|
|
|
%Z = sub i32 %X, %Y
|
|
|
|
ret i32 %Z
|
2003-04-22 22:00:15 +00:00
|
|
|
}
|