1 ; RUN: opt -mtriple=x86_64-apple-macosx10.7 -aa-pipeline=basic-aa -passes=inferattrs,aa-eval -print-all-alias-modref-info -disable-output 2>&1 %s | FileCheck %s
3 declare void @memset_pattern4(ptr, ptr, i64)
4 declare void @memset_pattern8(ptr, ptr, i64)
5 declare void @memset_pattern16(ptr, ptr, i64)
7 define void @test_memset_pattern4_const_size(ptr noalias %a, ptr noalias %pattern) {
8 ; CHECK-LABEL: Function: test_memset_pattern4_const_size
9 ; CHECK: Just Mod: Ptr: i8* %a <-> call void @memset_pattern4(ptr %a, ptr %pattern, i64 17)
10 ; CHECK-NEXT: Just Ref: Ptr: i8* %pattern <-> call void @memset_pattern4(ptr %a, ptr %pattern, i64 17)
11 ; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> call void @memset_pattern4(ptr %a, ptr %pattern, i64 17)
12 ; CHECK-NEXT: NoModRef: Ptr: i8* %a.gep.17 <-> call void @memset_pattern4(ptr %a, ptr %pattern, i64 17)
13 ; CHECK-NEXT: Just Ref: Ptr: i8* %pattern.gep.3 <-> call void @memset_pattern4(ptr %a, ptr %pattern, i64 17)
14 ; CHECK-NEXT: NoModRef: Ptr: i8* %pattern.gep.4 <-> call void @memset_pattern4(ptr %a, ptr %pattern, i64 17)
19 call void @memset_pattern4(ptr %a, ptr %pattern, i64 17)
20 %a.gep.1 = getelementptr i8, ptr %a, i32 1
21 store i8 0, ptr %a.gep.1
22 %a.gep.17 = getelementptr i8, ptr %a, i32 17
23 store i8 1, ptr %a.gep.17
25 %pattern.gep.3 = getelementptr i8, ptr %pattern, i32 3
26 store i8 1, ptr %pattern.gep.3
27 %pattern.gep.4 = getelementptr i8, ptr %pattern, i32 4
28 store i8 1, ptr %pattern.gep.4
32 define void @test_memset_pattern4_variable_size(ptr noalias %a, ptr noalias %pattern, i64 %n) {
33 ; CHECK-LABEL: Function: test_memset_pattern4_variable_size
34 ; CHECK: Just Mod: Ptr: i8* %a <-> call void @memset_pattern4(ptr %a, ptr %pattern, i64 %n)
35 ; CHECK-NEXT: Just Ref: Ptr: i8* %pattern <-> call void @memset_pattern4(ptr %a, ptr %pattern, i64 %n)
36 ; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> call void @memset_pattern4(ptr %a, ptr %pattern, i64 %n)
37 ; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.17 <-> call void @memset_pattern4(ptr %a, ptr %pattern, i64 %n)
42 call void @memset_pattern4(ptr %a, ptr %pattern, i64 %n)
43 %a.gep.1 = getelementptr i8, ptr %a, i32 1
44 store i8 0, ptr %a.gep.1
45 %a.gep.17 = getelementptr i8, ptr %a, i32 17
46 store i8 1, ptr %a.gep.17
50 define void @test_memset_pattern8_const_size(ptr noalias %a, ptr noalias %pattern) {
51 ; CHECK-LABEL: Function: test_memset_pattern8_const_size
52 ; CHECK: Just Mod: Ptr: i8* %a <-> call void @memset_pattern8(ptr %a, ptr %pattern, i64 17)
53 ; CHECK-NEXT: Just Ref: Ptr: i8* %pattern <-> call void @memset_pattern8(ptr %a, ptr %pattern, i64 17)
54 ; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> call void @memset_pattern8(ptr %a, ptr %pattern, i64 17)
55 ; CHECK-NEXT: NoModRef: Ptr: i8* %a.gep.17 <-> call void @memset_pattern8(ptr %a, ptr %pattern, i64 17)
56 ; CHECK-NEXT: Just Ref: Ptr: i8* %pattern.gep.7 <-> call void @memset_pattern8(ptr %a, ptr %pattern, i64 17)
57 ; CHECK-NEXT: NoModRef: Ptr: i8* %pattern.gep.8 <-> call void @memset_pattern8(ptr %a, ptr %pattern, i64 17)
62 call void @memset_pattern8(ptr %a, ptr %pattern, i64 17)
63 %a.gep.1 = getelementptr i8, ptr %a, i32 1
64 store i8 0, ptr %a.gep.1
65 %a.gep.17 = getelementptr i8, ptr %a, i32 17
66 store i8 1, ptr %a.gep.17
68 %pattern.gep.7 = getelementptr i8, ptr %pattern, i32 7
69 store i8 1, ptr %pattern.gep.7
70 %pattern.gep.8 = getelementptr i8, ptr %pattern, i32 8
71 store i8 1, ptr %pattern.gep.8
75 define void @test_memset_pattern8_variable_size(ptr noalias %a, ptr noalias %pattern, i64 %n) {
76 ; CHECK-LABEL: Function: test_memset_pattern8_variable_size
77 ; CHECK: Just Mod: Ptr: i8* %a <-> call void @memset_pattern8(ptr %a, ptr %pattern, i64 %n)
78 ; CHECK-NEXT: Just Ref: Ptr: i8* %pattern <-> call void @memset_pattern8(ptr %a, ptr %pattern, i64 %n)
79 ; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> call void @memset_pattern8(ptr %a, ptr %pattern, i64 %n)
80 ; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.17 <-> call void @memset_pattern8(ptr %a, ptr %pattern, i64 %n)
85 call void @memset_pattern8(ptr %a, ptr %pattern, i64 %n)
86 %a.gep.1 = getelementptr i8, ptr %a, i32 1
87 store i8 0, ptr %a.gep.1
88 %a.gep.17 = getelementptr i8, ptr %a, i32 17
89 store i8 1, ptr %a.gep.17
93 define void @test_memset_pattern16_const_size(ptr noalias %a, ptr noalias %pattern) {
94 ; CHECK-LABEL: Function: test_memset_pattern16_const_size
95 ; CHECK: Just Mod: Ptr: i8* %a <-> call void @memset_pattern16(ptr %a, ptr %pattern, i64 17)
96 ; CHECK-NEXT: Just Ref: Ptr: i8* %pattern <-> call void @memset_pattern16(ptr %a, ptr %pattern, i64 17)
97 ; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> call void @memset_pattern16(ptr %a, ptr %pattern, i64 17)
98 ; CHECK-NEXT: NoModRef: Ptr: i8* %a.gep.17 <-> call void @memset_pattern16(ptr %a, ptr %pattern, i64 17)
99 ; CHECK-NEXT: Just Ref: Ptr: i8* %pattern.gep.15 <-> call void @memset_pattern16(ptr %a, ptr %pattern, i64 17)
100 ; CHECK-NEXT: NoModRef: Ptr: i8* %pattern.gep.16 <-> call void @memset_pattern16(ptr %a, ptr %pattern, i64 17)
104 load i8, ptr %pattern
105 call void @memset_pattern16(ptr %a, ptr %pattern, i64 17)
106 %a.gep.1 = getelementptr i8, ptr %a, i32 1
107 store i8 0, ptr %a.gep.1
108 %a.gep.17 = getelementptr i8, ptr %a, i32 17
109 store i8 1, ptr %a.gep.17
111 %pattern.gep.15 = getelementptr i8, ptr %pattern, i32 15
112 store i8 1, ptr %pattern.gep.15
113 %pattern.gep.16 = getelementptr i8, ptr %pattern, i32 16
114 store i8 1, ptr %pattern.gep.16
118 define void @test_memset_pattern16_variable_size(ptr noalias %a, ptr noalias %pattern, i64 %n) {
119 ; CHECK-LABEL: Function: test_memset_pattern16_variable_size
120 ; CHECK: Just Mod: Ptr: i8* %a <-> call void @memset_pattern16(ptr %a, ptr %pattern, i64 %n)
121 ; CHECK-NEXT: Just Ref: Ptr: i8* %pattern <-> call void @memset_pattern16(ptr %a, ptr %pattern, i64 %n)
122 ; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> call void @memset_pattern16(ptr %a, ptr %pattern, i64 %n)
123 ; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.17 <-> call void @memset_pattern16(ptr %a, ptr %pattern, i64 %n)
127 load i8, ptr %pattern
128 call void @memset_pattern16(ptr %a, ptr %pattern, i64 %n)
129 %a.gep.1 = getelementptr i8, ptr %a, i32 1
130 store i8 0, ptr %a.gep.1
131 %a.gep.17 = getelementptr i8, ptr %a, i32 17
132 store i8 1, ptr %a.gep.17