1 ; Test that GCSE uses ds-aa to do alias analysis, which is capable of
2 ; disambiguating some cases.
4 ; RUN: if as < %s | opt -ds-aa -load-vn -gcse -instcombine -dce | dis | grep ELIM
9 %intpair = type {int*, int*}
12 %intpair *%alloc_pair() {
15 %C = malloc {int*, int*}
16 %C1p = getelementptr {int*, int*}* %C, long 0, ubyte 0
17 store int* %Ap, int** %C1p
18 %C2p = getelementptr {int*, int*}* %C, long 0, ubyte 1
19 store int* %Bp, int** %C2p
23 int* %getp(%intpair* %P) {
24 %pp = getelementptr %intpair* %P, long 0, ubyte 0
29 int* %getq(%intpair* %P) {
30 %pp = getelementptr %intpair* %P, long 0, ubyte 1
36 %C = call %intpair* %alloc_pair()
37 %A = call int* %getp(%intpair* %C)
38 %B = call int* %getp(%intpair* %C)
41 store int 123, int* %B ; Store does alias %A
48 int %test2() { ; Test context sensitivity
49 %C1 = call %intpair* %alloc_pair()
50 %C2 = call %intpair* %alloc_pair()
51 %P1 = call int* %getp(%intpair* %C1)
52 %P2 = call int* %getp(%intpair* %C2)
56 %ELIM_x = sub int %X, %Y
61 %C = call %intpair* %alloc_pair()
62 %P1 = call int* %getp(%intpair* %C)
63 %P2 = call int* %getq(%intpair* %C)
67 %ELIM_x = sub int %X, %Y ; Check field sensitivity