blob: 6e9276f7dce06802c8185727f1600db0110c1612 [file] [log] [blame]
Dan Gohman3e054fe2009-09-08 22:34:10 +00001; RUN: opt %s -gvn -instcombine -S | grep sub
Chris Lattner63a6e772003-04-22 22:00:15 +00002
3; BasicAA was incorrectly concluding that P1 and P2 didn't conflict!
4
Tanya Lattnerdcd188d2008-02-14 06:56:27 +00005define i32 @test(i32 *%Ptr, i64 %V) {
6 %P2 = getelementptr i32* %Ptr, i64 1
7 %P1 = getelementptr i32* %Ptr, i64 %V
8 %X = load i32* %P1
9 store i32 5, i32* %P2
Chris Lattner63a6e772003-04-22 22:00:15 +000010
Tanya Lattnerdcd188d2008-02-14 06:56:27 +000011 %Y = load i32* %P1
Chris Lattner63a6e772003-04-22 22:00:15 +000012
Tanya Lattnerdcd188d2008-02-14 06:56:27 +000013 %Z = sub i32 %X, %Y
14 ret i32 %Z
Chris Lattner63a6e772003-04-22 22:00:15 +000015}