1; Test that GCSE uses basicaa to do alias analysis, which is capable of 2; disambiguating some obvious cases. All loads should be removable in 3; this testcase. 4 5; RUN: opt < %s -basicaa -gvn -instcombine -dce -S \ 6; RUN: | not grep load 7 8@A = global i32 7 9@B = global i32 8 10 11define i32 @test() { 12 %A1 = load i32* @A 13 14 store i32 123, i32* @B ; Store cannot alias @A 15 16 %A2 = load i32* @A 17 %X = sub i32 %A1, %A2 18 ret i32 %X 19} 20 21define i32 @test2() { 22 %A1 = load i32* @A 23 br label %Loop 24Loop: 25 %AP = phi i32 [0, %0], [%X, %Loop] 26 store i32 %AP, i32* @B ; Store cannot alias @A 27 28 %A2 = load i32* @A 29 %X = sub i32 %A1, %A2 30 %c = icmp eq i32 %X, 0 31 br i1 %c, label %out, label %Loop 32 33out: 34 ret i32 %X 35} 36 37declare void @external() 38 39define i32 @test3() { 40 %X = alloca i32 41 store i32 7, i32* %X 42 call void @external() 43 %V = load i32* %X 44 ret i32 %V 45} 46 47