1 ; RUN: opt -basicaa -print-alias-sets -S -o - < %s 2>&1 | FileCheck %s
3 ; CHECK: Alias sets for function 'test1':
4 ; CHECK: Alias Set Tracker: 2 alias sets for 2 pointer values.
5 ; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %a, LocationSize::precise(1))
6 ; CHECK-NOT: 1 Unknown instruction
7 ; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %b, LocationSize::precise(1))
8 define void @test1(i32 %c) {
10 %a = alloca i8, align 1
11 %b = alloca i8, align 1
12 store i8 1, i8* %a, align 1
13 %cond1 = icmp ne i32 %c, 0
14 call void @llvm.assume(i1 %cond1)
15 store i8 1, i8* %b, align 1
19 ; CHECK: Alias sets for function 'test2':
20 ; CHECK: Alias Set Tracker: 3 alias sets for 2 pointer values.
21 ; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %a, LocationSize::precise(1))
22 ; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] may alias, Ref
23 ; CHECK: 1 Unknown instructions: call void (i1, ...) @llvm.experimental.guard(i1 %cond1) [ "deopt"() ]
24 ; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %b, LocationSize::precise(1))
25 define void @test2(i32 %c) {
27 %a = alloca i8, align 1
28 %b = alloca i8, align 1
29 store i8 1, i8* %a, align 1
30 %cond1 = icmp ne i32 %c, 0
31 call void (i1, ...) @llvm.experimental.guard(i1 %cond1)["deopt"()]
32 store i8 1, i8* %b, align 1
36 ; CHECK: Alias sets for function 'test3':
37 ; CHECK: Alias Set Tracker: 1 alias sets for 2 pointer values.
38 ; CHECK: AliasSet[0x{{[0-9a-f]+}}, 3] may alias, Mod/Ref Pointers: (i8* %a, LocationSize::precise(1)), (i8* %b, LocationSize::precise(1))
39 ; CHECK: 1 Unknown instructions: call void (i1, ...) @llvm.experimental.guard(i1 %cond1) [ "deopt"() ]
40 define void @test3(i32 %c, i8* %a, i8* %b) {
42 store i8 1, i8* %a, align 1
43 %cond1 = icmp ne i32 %c, 0
44 call void (i1, ...) @llvm.experimental.guard(i1 %cond1)["deopt"()]
45 store i8 1, i8* %b, align 1
49 ; CHECK: Alias sets for function 'test4':
50 ; CHECK: Alias Set Tracker: 2 alias sets for 2 pointer values.
51 ; CHECK: AliasSet[0x{{[0-9a-f]+}}, 2] may alias, Mod/Ref Pointers: (i8* %a, LocationSize::precise(1))
52 ; CHECK: 1 Unknown instructions: call void (i1, ...) @llvm.experimental.guard(i1 %cond1) [ "deopt"() ]
53 ; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %b, LocationSize::precise(1))
54 define void @test4(i32 %c, i8* %a) {
56 %b = alloca i8, align 1
57 store i8 1, i8* %a, align 1
58 %cond1 = icmp ne i32 %c, 0
59 call void (i1, ...) @llvm.experimental.guard(i1 %cond1)["deopt"()]
60 store i8 1, i8* %b, align 1
64 declare void @llvm.assume(i1)
65 declare void @llvm.experimental.guard(i1, ...)