1 ; This testcase ensures that AliasAttrs are propagated not only on the same
2 ; level but also downward.
4 ; RUN: opt < %s -disable-basic-aa -cfl-anders-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
5 ; RUN: opt < %s -aa-pipeline=cfl-anders-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
7 ; CHECK-LABEL: Function: test_attr_below
8 ; CHECK: MayAlias: i64* %q, i64*** %p
9 ; CHECK: NoAlias: i64* %esc, i64*** %p
10 ; CHECK: NoAlias: i64* %esc, i64* %q
12 ; CHECK: MayAlias: i64* %unknown, i64*** %p
13 ; CHECK: MayAlias: i64* %q, i64* %unknown
14 ; CHECK: MayAlias: i64* %esc, i64* %unknown
15 ; CHECK: MayAlias: i64* %q, i64** %pdrf
16 ; CHECK: MayAlias: i64* %esc, i64** %pdrf
17 ; CHECK: MayAlias: i64* %unknown, i64** %pdrf
18 ; CHECK: MayAlias: i64* %pdrf2, i64* %q
19 ; CHECK: MayAlias: i64* %esc, i64* %pdrf2
20 ; CHECK: MayAlias: i64* %pdrf2, i64* %unknown
21 define void @test_attr_below(i64*** %p, i64* %q) {
22 %esc = alloca i64, align 8
23 %escint = ptrtoint i64* %esc to i64
24 %unknown = inttoptr i64 %escint to i64*
26 %pdrf = load i64**, i64*** %p
27 %pdrf2 = load i64*, i64** %pdrf
32 ; CHECK-LABEL: Function: test_attr_assign_below
33 ; CHECK: MayAlias: i64** %sel, i64*** %p
34 ; CHECK: MayAlias: i64* %q, i64** %sel
35 ; CHECK: MayAlias: i64** %a, i64** %sel
36 ; CHECK: MayAlias: i64** %pdrf, i64** %sel
38 ; CHECK: MayAlias: i64** %c, i64*** %p
39 ; CHECK: MayAlias: i64* %q, i64** %c
40 ; CHECK: MayAlias: i64** %a, i64** %c
41 ; CHECK: MayAlias: i64** %c, i64** %pdrf
42 ; CHECK: MayAlias: i64** %c, i64** %sel
44 ; CHECK: MayAlias: i64* %d, i64*** %p
45 ; CHECK: MayAlias: i64* %d, i64* %q
46 ; CHECK: MayAlias: i64* %d, i64** %pdrf
47 ; CHECK: MayAlias: i64* %d, i64** %sel
48 define void @test_attr_assign_below(i64*** %p, i64* %q, i1 %cond) {
49 %a = alloca i64*, align 8
50 %pdrf = load i64**, i64*** %p
51 %sel = select i1 %cond, i64** %a, i64** %pdrf
53 %b = alloca i64**, align 8
54 store i64** %sel, i64*** %b
56 %c = load i64**, i64*** %b
57 %d = load i64*, i64** %c