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