blob: 6518551c7aff3642d6f1b6059cd8aa61cb8df2d4 [file] [log] [blame]
Dan Gohman1b4c27772009-09-08 16:50:01 +00001; RUN: opt %s -gvn -instcombine | llvm-dis | grep sub
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002
3; BasicAA was incorrectly concluding that P1 and P2 didn't conflict!
4
Tanya Lattnera695f012008-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
Dan Gohmanf17a25c2007-07-18 16:29:46 +000010
Tanya Lattnera695f012008-02-14 06:56:27 +000011 %Y = load i32* %P1
Dan Gohmanf17a25c2007-07-18 16:29:46 +000012
Tanya Lattnera695f012008-02-14 06:56:27 +000013 %Z = sub i32 %X, %Y
14 ret i32 %Z
Dan Gohmanf17a25c2007-07-18 16:29:46 +000015}