| ; Test that GCSE uses basicaa to do alias analysis, which is capable of |
| ; disambiguating some obvious cases. All loads should be removable in |
| ; RUN: opt < %s -basicaa -gvn -instcombine -dce -S | FileCheck %s |
| ; CHECK: define i32 @test() |
| ; CHECK-NEXT: store i32 123, i32* @B |
| store i32 123, i32* @B ; Store cannot alias @A |
| ; CHECK: define i32 @test2() |
| ; CHECK-NEXT: br label %Loop |
| ; CHECK-NEXT: store i32 0, i32* @B |
| ; CHECK-NEXT: br i1 true, label %out, label %Loop |
| %AP = phi i32 [0, %0], [%X, %Loop] |
| store i32 %AP, i32* @B ; Store cannot alias @A |
| br i1 %c, label %out, label %Loop |
| ; CHECK: define i32 @test3() |
| ; CHECK-NEXT: call void @external() |