1 ; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output \
2 ; RUN: |& grep {NoAlias: double\\* \[%\]a, double\\* \[%\]b\$} | count 4
4 ; BasicAA should detect NoAliases in PHIs and Selects.
6 ; Two PHIs in the same block.
7 define void @foo(i1 %m, double* noalias %x, double* noalias %y) {
9 br i1 %m, label %true, label %false
18 %a = phi double* [ %x, %true ], [ %y, %false ]
19 %b = phi double* [ %x, %false ], [ %y, %true ]
20 volatile store double 0.0, double* %a
21 volatile store double 1.0, double* %b
25 ; Two selects with the same condition.
26 define void @bar(i1 %m, double* noalias %x, double* noalias %y) {
28 %a = select i1 %m, double* %x, double* %y
29 %b = select i1 %m, double* %y, double* %x
30 volatile store double 0.000000e+00, double* %a
31 volatile store double 1.000000e+00, double* %b
35 ; Two PHIs with disjoint sets of inputs.
36 define void @qux(i1 %m, double* noalias %x, double* noalias %y,
37 i1 %n, double* noalias %v, double* noalias %w) {
39 br i1 %m, label %true, label %false
48 %a = phi double* [ %x, %true ], [ %y, %false ]
49 br i1 %n, label %ntrue, label %nfalse
58 %b = phi double* [ %v, %ntrue ], [ %w, %nfalse ]
59 volatile store double 0.0, double* %a
60 volatile store double 1.0, double* %b
64 ; Two selects with disjoint sets of arms.
65 define void @fin(i1 %m, double* noalias %x, double* noalias %y,
66 i1 %n, double* noalias %v, double* noalias %w) {
68 %a = select i1 %m, double* %x, double* %y
69 %b = select i1 %n, double* %v, double* %w
70 volatile store double 0.000000e+00, double* %a
71 volatile store double 1.000000e+00, double* %b