1 ; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
3 ; BasicAA should detect NoAliases in PHIs and Selects.
6 ; CHECK: NoAlias: double* %a, double* %b
8 ; CHECK: NoAlias: double* %a, double* %b
10 ; CHECK: NoAlias: double* %a, double* %b
11 ; CHECK: Function: fin
12 ; CHECK: NoAlias: double* %a, double* %b
13 ; CHECK: ===== Alias Analysis Evaluator Report =====
15 ; Two PHIs in the same block.
16 define void @foo(i1 %m, double* noalias %x, double* noalias %y) {
18 br i1 %m, label %true, label %false
27 %a = phi double* [ %x, %true ], [ %y, %false ]
28 %b = phi double* [ %x, %false ], [ %y, %true ]
29 store volatile double 0.0, double* %a
30 store volatile double 1.0, double* %b
34 ; Two selects with the same condition.
35 define void @bar(i1 %m, double* noalias %x, double* noalias %y) {
37 %a = select i1 %m, double* %x, double* %y
38 %b = select i1 %m, double* %y, double* %x
39 store volatile double 0.000000e+00, double* %a
40 store volatile double 1.000000e+00, double* %b
44 ; Two PHIs with disjoint sets of inputs.
45 define void @qux(i1 %m, double* noalias %x, double* noalias %y,
46 i1 %n, double* noalias %v, double* noalias %w) {
48 br i1 %m, label %true, label %false
57 %a = phi double* [ %x, %true ], [ %y, %false ]
58 br i1 %n, label %ntrue, label %nfalse
67 %b = phi double* [ %v, %ntrue ], [ %w, %nfalse ]
68 store volatile double 0.0, double* %a
69 store volatile double 1.0, double* %b
73 ; Two selects with disjoint sets of arms.
74 define void @fin(i1 %m, double* noalias %x, double* noalias %y,
75 i1 %n, double* noalias %v, double* noalias %w) {
77 %a = select i1 %m, double* %x, double* %y
78 %b = select i1 %n, double* %v, double* %w
79 store volatile double 0.000000e+00, double* %a
80 store volatile double 1.000000e+00, double* %b