1 ; Test that LICM uses basicaa to do alias analysis, which is capable of
2 ; disambiguating some obvious cases. If LICM is able to disambiguate the
3 ; two pointers, then the load should be hoisted, and the store sunk. Thus
4 ; the loop becomes empty and can be deleted by ADCE.
6 ; RUN: llvm-upgrade < %s | llvm-as | opt -basicaa -licm --adce | llvm-dis | not grep Loop
10 %C = global [2 x int ] [ int 4, int 8 ]
17 %ToRemove = load int* %A
18 store int %Atmp, int* %B ; Store cannot alias %A
20 br bool %c, label %Out, label %Loop
22 %X = sub int %ToRemove, %Atmp
30 %C0 = getelementptr [2 x int ]* %C, long 0, long 0
31 store int %AVal, int* %C0 ; Store cannot alias %A
34 %C1 = getelementptr [2 x int ]* %C, long 0, long 1
35 store int %BVal, int* %C1 ; Store cannot alias %A, %B, or %C0
37 br bool %c, label %Out, label %Loop
39 %X = sub int %AVal, %BVal