1 ; RUN: opt < %s -aa-pipeline=basic-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
2 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:64-v128:32:128-a0:0:32-n32"
3 target triple = "arm-apple-ios"
5 declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1) #0
6 declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1) #0
7 declare void @llvm.memcpy.element.unordered.atomic.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i32) #0
9 declare void @a_readonly_func(ptr) #1
10 declare void @a_writeonly_func(ptr) #2
12 define void @test2(ptr %P, ptr %Q) #3 {
15 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
16 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
19 ; CHECK-LABEL: Function: test2:
21 ; CHECK: MayAlias: i8* %P, i8* %Q
22 ; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
23 ; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
24 ; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
25 ; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
26 ; CHECK: Both ModRef: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
27 ; CHECK: Both ModRef: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
30 define void @test2_atomic(ptr %P, ptr %Q) #3 {
33 tail call void @llvm.memcpy.element.unordered.atomic.p0.p0.i64(ptr align 1 %P, ptr align 1 %Q, i64 12, i32 1)
34 tail call void @llvm.memcpy.element.unordered.atomic.p0.p0.i64(ptr align 1 %P, ptr align 1 %Q, i64 12, i32 1)
37 ; CHECK-LABEL: Function: test2_atomic:
39 ; CHECK: MayAlias: i8* %P, i8* %Q
40 ; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.element.unordered.atomic.p0.p0.i64(ptr align 1 %P, ptr align 1 %Q, i64 12, i32 1)
41 ; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.element.unordered.atomic.p0.p0.i64(ptr align 1 %P, ptr align 1 %Q, i64 12, i32 1)
42 ; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.element.unordered.atomic.p0.p0.i64(ptr align 1 %P, ptr align 1 %Q, i64 12, i32 1)
43 ; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.element.unordered.atomic.p0.p0.i64(ptr align 1 %P, ptr align 1 %Q, i64 12, i32 1)
44 ; CHECK: Both ModRef: tail call void @llvm.memcpy.element.unordered.atomic.p0.p0.i64(ptr align 1 %P, ptr align 1 %Q, i64 12, i32 1) <-> tail call void @llvm.memcpy.element.unordered.atomic.p0.p0.i64(ptr align 1 %P, ptr align 1 %Q, i64 12, i32 1)
45 ; CHECK: Both ModRef: tail call void @llvm.memcpy.element.unordered.atomic.p0.p0.i64(ptr align 1 %P, ptr align 1 %Q, i64 12, i32 1) <-> tail call void @llvm.memcpy.element.unordered.atomic.p0.p0.i64(ptr align 1 %P, ptr align 1 %Q, i64 12, i32 1)
48 define void @test2a(ptr noalias %P, ptr noalias %Q) #3 {
51 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
52 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
55 ; CHECK-LABEL: Function: test2a:
57 ; CHECK: NoAlias: i8* %P, i8* %Q
58 ; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
59 ; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
60 ; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
61 ; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
62 ; CHECK: Just Mod: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
63 ; CHECK: Just Mod: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
66 define void @test2b(ptr noalias %P, ptr noalias %Q) #3 {
69 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
70 %R = getelementptr i8, ptr %P, i64 12
72 tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
75 ; CHECK-LABEL: Function: test2b:
77 ; CHECK: NoAlias: i8* %P, i8* %Q
78 ; CHECK: NoAlias: i8* %P, i8* %R
79 ; CHECK: NoAlias: i8* %Q, i8* %R
80 ; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
81 ; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
82 ; CHECK: NoModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
83 ; CHECK: NoModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
84 ; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
85 ; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
86 ; CHECK: NoModRef: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
87 ; CHECK: NoModRef: tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
90 define void @test2c(ptr noalias %P, ptr noalias %Q) #3 {
93 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
94 %R = getelementptr i8, ptr %P, i64 11
96 tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
99 ; CHECK-LABEL: Function: test2c:
101 ; CHECK: NoAlias: i8* %P, i8* %Q
102 ; CHECK: NoAlias: i8* %P, i8* %R
103 ; CHECK: NoAlias: i8* %Q, i8* %R
104 ; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
105 ; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
106 ; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
107 ; CHECK: NoModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
108 ; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
109 ; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
110 ; CHECK: Just Mod: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
111 ; CHECK: Just Mod: tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
114 define void @test2d(ptr noalias %P, ptr noalias %Q) #3 {
117 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
118 %R = getelementptr i8, ptr %P, i64 -12
120 tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
123 ; CHECK-LABEL: Function: test2d:
125 ; CHECK: NoAlias: i8* %P, i8* %Q
126 ; CHECK: NoAlias: i8* %P, i8* %R
127 ; CHECK: NoAlias: i8* %Q, i8* %R
128 ; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
129 ; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
130 ; CHECK: NoModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
131 ; CHECK: NoModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
132 ; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
133 ; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
134 ; CHECK: NoModRef: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
135 ; CHECK: NoModRef: tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
138 define void @test2e(ptr noalias %P, ptr noalias %Q) #3 {
141 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
142 %R = getelementptr i8, ptr %P, i64 -11
144 tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
147 ; CHECK-LABEL: Function: test2e:
149 ; CHECK: NoAlias: i8* %P, i8* %Q
150 ; CHECK: NoAlias: i8* %P, i8* %R
151 ; CHECK: NoAlias: i8* %Q, i8* %R
152 ; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
153 ; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
154 ; CHECK: NoModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
155 ; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
156 ; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
157 ; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
158 ; CHECK: Just Mod: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false)
159 ; CHECK: Just Mod: tail call void @llvm.memcpy.p0.p0.i64(ptr %R, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
162 define void @test3(ptr %P, ptr %Q) #3 {
165 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 8, i1 false)
166 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
169 ; CHECK-LABEL: Function: test3:
171 ; CHECK: MayAlias: i8* %P, i8* %Q
172 ; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 8, i1 false)
173 ; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 8, i1 false)
174 ; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
175 ; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
176 ; CHECK: Both ModRef: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 8, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
177 ; CHECK: Both ModRef: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 8, i1 false)
180 define void @test3a(ptr noalias %P, ptr noalias %Q) #3 {
183 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 8, i1 false)
184 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
187 ; CHECK-LABEL: Function: test3a:
189 ; CHECK: NoAlias: i8* %P, i8* %Q
190 ; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 8, i1 false)
191 ; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 8, i1 false)
192 ; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
193 ; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
194 ; CHECK: Just Mod: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 8, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
195 ; CHECK: Just Mod: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 8, i1 false)
198 define void @test4(ptr %P, ptr noalias %Q) #3 {
201 tail call void @llvm.memset.p0.i64(ptr %P, i8 42, i64 8, i1 false)
202 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
205 ; CHECK-LABEL: Function: test4:
207 ; CHECK: NoAlias: i8* %P, i8* %Q
208 ; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memset.p0.i64(ptr %P, i8 42, i64 8, i1 false)
209 ; CHECK: NoModRef: Ptr: i8* %Q <-> tail call void @llvm.memset.p0.i64(ptr %P, i8 42, i64 8, i1 false)
210 ; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
211 ; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
212 ; CHECK: Just Mod: tail call void @llvm.memset.p0.i64(ptr %P, i8 42, i64 8, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
213 ; CHECK: Just Mod: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memset.p0.i64(ptr %P, i8 42, i64 8, i1 false)
216 define void @test5(ptr %P, ptr %Q, ptr %R) #3 {
220 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
221 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %R, i64 12, i1 false)
224 ; CHECK-LABEL: Function: test5:
226 ; CHECK: MayAlias: i8* %P, i8* %Q
227 ; CHECK: MayAlias: i8* %P, i8* %R
228 ; CHECK: MayAlias: i8* %Q, i8* %R
229 ; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
230 ; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
231 ; CHECK: Both ModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
232 ; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %R, i64 12, i1 false)
233 ; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %R, i64 12, i1 false)
234 ; CHECK: Both ModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %R, i64 12, i1 false)
235 ; CHECK: Both ModRef: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %R, i64 12, i1 false)
236 ; CHECK: Both ModRef: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %R, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
239 define void @test5a(ptr noalias %P, ptr noalias %Q, ptr noalias %R) nounwind ssp {
243 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
244 tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %R, i64 12, i1 false)
247 ; CHECK-LABEL: Function: test5a:
249 ; CHECK: NoAlias: i8* %P, i8* %Q
250 ; CHECK: NoAlias: i8* %P, i8* %R
251 ; CHECK: NoAlias: i8* %Q, i8* %R
252 ; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
253 ; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
254 ; CHECK: NoModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
255 ; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %R, i64 12, i1 false)
256 ; CHECK: NoModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %R, i64 12, i1 false)
257 ; CHECK: Just Ref: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %R, i64 12, i1 false)
258 ; CHECK: Just Mod: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %R, i64 12, i1 false)
259 ; CHECK: Just Mod: tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %R, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0.p0.i64(ptr %P, ptr %Q, i64 12, i1 false)
262 define void @test6(ptr %P) #3 {
264 call void @llvm.memset.p0.i64(ptr align 8 %P, i8 -51, i64 32, i1 false)
265 call void @a_readonly_func(ptr %P)
268 ; CHECK-LABEL: Function: test6:
270 ; CHECK: Just Mod: Ptr: i8* %P <-> call void @llvm.memset.p0.i64(ptr align 8 %P, i8 -51, i64 32, i1 false)
271 ; CHECK: Just Ref: Ptr: i8* %P <-> call void @a_readonly_func(ptr %P)
272 ; CHECK: Just Mod: call void @llvm.memset.p0.i64(ptr align 8 %P, i8 -51, i64 32, i1 false) <-> call void @a_readonly_func(ptr %P)
273 ; CHECK: Just Ref: call void @a_readonly_func(ptr %P) <-> call void @llvm.memset.p0.i64(ptr align 8 %P, i8 -51, i64 32, i1 false)
276 define void @test7(ptr %P) #3 {
278 call void @a_writeonly_func(ptr %P)
279 call void @a_readonly_func(ptr %P)
282 ; CHECK-LABEL: Function: test7:
284 ; CHECK: Just Mod: Ptr: i8* %P <-> call void @a_writeonly_func(ptr %P)
285 ; CHECK: Just Ref: Ptr: i8* %P <-> call void @a_readonly_func(ptr %P)
286 ; CHECK: Just Mod: call void @a_writeonly_func(ptr %P) <-> call void @a_readonly_func(ptr %P)
287 ; CHECK: Just Ref: call void @a_readonly_func(ptr %P) <-> call void @a_writeonly_func(ptr %P)
290 declare void @an_inaccessiblememonly_func() #4
291 declare void @an_inaccessibleorargmemonly_func(ptr) #5
292 declare void @an_argmemonly_func(ptr) #0
294 define void @test8(ptr %p) {
296 %q = getelementptr i8, ptr %p, i64 16
299 call void @a_readonly_func(ptr %p)
300 call void @an_inaccessiblememonly_func()
301 call void @a_writeonly_func(ptr %q)
302 call void @an_inaccessiblememonly_func()
303 call void @an_inaccessibleorargmemonly_func(ptr %q)
304 call void @an_argmemonly_func(ptr %q)
307 ; CHECK-LABEL: Function: test8
308 ; CHECK: NoModRef: Ptr: i8* %p <-> call void @an_inaccessiblememonly_func()
309 ; CHECK: NoModRef: Ptr: i8* %q <-> call void @an_inaccessiblememonly_func()
310 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @an_inaccessibleorargmemonly_func(ptr %q)
311 ; CHECK: Both ModRef: Ptr: i8* %q <-> call void @an_inaccessibleorargmemonly_func(ptr %q)
312 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @an_argmemonly_func(ptr %q)
313 ; CHECK: Both ModRef: Ptr: i8* %q <-> call void @an_argmemonly_func(ptr %q)
314 ; CHECK: Just Ref: call void @a_readonly_func(ptr %p) <-> call void @an_inaccessiblememonly_func()
315 ; CHECK: Just Ref: call void @a_readonly_func(ptr %p) <-> call void @an_inaccessibleorargmemonly_func(ptr %q)
316 ; CHECK: Just Ref: call void @a_readonly_func(ptr %p) <-> call void @an_argmemonly_func(ptr %q)
317 ; CHECK: Both ModRef: call void @an_inaccessiblememonly_func() <-> call void @a_readonly_func(ptr %p)
318 ; CHECK: Both ModRef: call void @an_inaccessiblememonly_func() <-> call void @a_writeonly_func(ptr %q)
319 ; CHECK: Both ModRef: call void @an_inaccessiblememonly_func() <-> call void @an_inaccessiblememonly_func()
320 ; CHECK: Both ModRef: call void @an_inaccessiblememonly_func() <-> call void @an_inaccessibleorargmemonly_func(ptr %q)
321 ; CHECK: NoModRef: call void @an_inaccessiblememonly_func() <-> call void @an_argmemonly_func(ptr %q)
322 ; CHECK: Just Mod: call void @a_writeonly_func(ptr %q) <-> call void @an_inaccessiblememonly_func()
323 ; CHECK: Just Mod: call void @a_writeonly_func(ptr %q) <-> call void @an_inaccessibleorargmemonly_func(ptr %q)
324 ; CHECK: Just Mod: call void @a_writeonly_func(ptr %q) <-> call void @an_argmemonly_func(ptr %q)
325 ; CHECK: Both ModRef: call void @an_inaccessibleorargmemonly_func(ptr %q) <-> call void @a_readonly_func(ptr %p)
326 ; CHECK: Both ModRef: call void @an_inaccessibleorargmemonly_func(ptr %q) <-> call void @a_writeonly_func(ptr %q)
327 ; CHECK: Both ModRef: call void @an_inaccessibleorargmemonly_func(ptr %q) <-> call void @an_inaccessiblememonly_func()
328 ; CHECK: Both ModRef: call void @an_inaccessibleorargmemonly_func(ptr %q) <-> call void @an_argmemonly_func(ptr %q)
329 ; CHECK: Both ModRef: call void @an_argmemonly_func(ptr %q) <-> call void @a_readonly_func(ptr %p)
330 ; CHECK: Both ModRef: call void @an_argmemonly_func(ptr %q) <-> call void @a_writeonly_func(ptr %q)
331 ; CHECK: NoModRef: call void @an_argmemonly_func(ptr %q) <-> call void @an_inaccessiblememonly_func()
332 ; CHECK: Both ModRef: call void @an_argmemonly_func(ptr %q) <-> call void @an_inaccessibleorargmemonly_func(ptr %q)
335 ;; test that MustAlias is set for calls when no MayAlias is found.
336 declare void @another_argmemonly_func(ptr, ptr) #0
337 define void @test8a(ptr noalias %p, ptr noalias %q) {
341 call void @another_argmemonly_func(ptr %p, ptr %q)
344 ; CHECK-LABEL: Function: test8a
345 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @another_argmemonly_func(ptr %p, ptr %q)
346 ; CHECK: Both ModRef: Ptr: i8* %q <-> call void @another_argmemonly_func(ptr %p, ptr %q)
348 define void @test8b(ptr %p, ptr %q) {
352 call void @another_argmemonly_func(ptr %p, ptr %q)
355 ; CHECK-LABEL: Function: test8b
356 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @another_argmemonly_func(ptr %p, ptr %q)
357 ; CHECK: Both ModRef: Ptr: i8* %q <-> call void @another_argmemonly_func(ptr %p, ptr %q)
361 ;; test that unknown operand bundle has unknown effect to the heap
362 define void @test9(ptr %p) {
363 ; CHECK-LABEL: Function: test9
365 %q = getelementptr i8, ptr %p, i64 16
368 call void @a_readonly_func(ptr %p) [ "unknown"() ]
369 call void @an_inaccessiblememonly_func() [ "unknown"() ]
370 call void @an_inaccessibleorargmemonly_func(ptr %q) [ "unknown"() ]
371 call void @an_argmemonly_func(ptr %q) [ "unknown"() ]
374 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @a_readonly_func(ptr %p) [ "unknown"() ]
375 ; CHECK: Both ModRef: Ptr: i8* %q <-> call void @a_readonly_func(ptr %p) [ "unknown"() ]
376 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @an_inaccessiblememonly_func() [ "unknown"() ]
377 ; CHECK: Both ModRef: Ptr: i8* %q <-> call void @an_inaccessiblememonly_func() [ "unknown"() ]
378 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @an_inaccessibleorargmemonly_func(ptr %q) [ "unknown"() ]
379 ; CHECK: Both ModRef: Ptr: i8* %q <-> call void @an_inaccessibleorargmemonly_func(ptr %q) [ "unknown"() ]
380 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @an_argmemonly_func(ptr %q) [ "unknown"() ]
381 ; CHECK: Both ModRef: Ptr: i8* %q <-> call void @an_argmemonly_func(ptr %q) [ "unknown"() ]
382 ; CHECK: Both ModRef: call void @a_readonly_func(ptr %p) [ "unknown"() ] <-> call void @an_inaccessiblememonly_func() [ "unknown"() ]
383 ; CHECK: Both ModRef: call void @a_readonly_func(ptr %p) [ "unknown"() ] <-> call void @an_inaccessibleorargmemonly_func(ptr %q) [ "unknown"() ]
384 ; CHECK: Both ModRef: call void @a_readonly_func(ptr %p) [ "unknown"() ] <-> call void @an_argmemonly_func(ptr %q) [ "unknown"() ]
385 ; CHECK: Both ModRef: call void @an_inaccessiblememonly_func() [ "unknown"() ] <-> call void @a_readonly_func(ptr %p) [ "unknown"() ]
386 ; CHECK: Both ModRef: call void @an_inaccessiblememonly_func() [ "unknown"() ] <-> call void @an_inaccessibleorargmemonly_func(ptr %q) [ "unknown"() ]
387 ; CHECK: Both ModRef: call void @an_inaccessiblememonly_func() [ "unknown"() ] <-> call void @an_argmemonly_func(ptr %q) [ "unknown"() ]
388 ; CHECK: Both ModRef: call void @an_inaccessibleorargmemonly_func(ptr %q) [ "unknown"() ] <-> call void @a_readonly_func(ptr %p) [ "unknown"() ]
389 ; CHECK: Both ModRef: call void @an_inaccessibleorargmemonly_func(ptr %q) [ "unknown"() ] <-> call void @an_inaccessiblememonly_func() [ "unknown"() ]
390 ; CHECK: Both ModRef: call void @an_inaccessibleorargmemonly_func(ptr %q) [ "unknown"() ] <-> call void @an_argmemonly_func(ptr %q) [ "unknown"() ]
391 ; CHECK: Both ModRef: call void @an_argmemonly_func(ptr %q) [ "unknown"() ] <-> call void @a_readonly_func(ptr %p) [ "unknown"() ]
392 ; CHECK: Both ModRef: call void @an_argmemonly_func(ptr %q) [ "unknown"() ] <-> call void @an_inaccessiblememonly_func() [ "unknown"() ]
393 ; CHECK: Both ModRef: call void @an_argmemonly_func(ptr %q) [ "unknown"() ] <-> call void @an_inaccessibleorargmemonly_func(ptr %q) [ "unknown"() ]
396 ;; test callsite overwrite of unknown operand bundle
397 define void @test10(ptr %p) {
398 ; CHECK-LABEL: Function: test10
400 %q = getelementptr i8, ptr %p, i64 16
403 call void @a_readonly_func(ptr %p) #6 [ "unknown"() ]
404 call void @an_inaccessiblememonly_func() #7 [ "unknown"() ]
405 call void @an_inaccessibleorargmemonly_func(ptr %q) #8 [ "unknown"() ]
406 call void @an_argmemonly_func(ptr %q) #9 [ "unknown"() ]
409 ; CHECK: Just Ref: Ptr: i8* %p <-> call void @a_readonly_func(ptr %p) #9 [ "unknown"() ]
410 ; CHECK: Just Ref: Ptr: i8* %q <-> call void @a_readonly_func(ptr %p) #9 [ "unknown"() ]
411 ; CHECK: NoModRef: Ptr: i8* %p <-> call void @an_inaccessiblememonly_func() #10 [ "unknown"() ]
412 ; CHECK: NoModRef: Ptr: i8* %q <-> call void @an_inaccessiblememonly_func() #10 [ "unknown"() ]
413 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @an_inaccessibleorargmemonly_func(ptr %q) #11 [ "unknown"() ]
414 ; CHECK: Both ModRef: Ptr: i8* %q <-> call void @an_inaccessibleorargmemonly_func(ptr %q) #11 [ "unknown"() ]
415 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @an_argmemonly_func(ptr %q) #12 [ "unknown"() ]
416 ; CHECK: Both ModRef: Ptr: i8* %q <-> call void @an_argmemonly_func(ptr %q) #12 [ "unknown"() ]
417 ; CHECK: Just Ref: call void @a_readonly_func(ptr %p) #9 [ "unknown"() ] <-> call void @an_inaccessiblememonly_func() #10 [ "unknown"() ]
418 ; CHECK: Just Ref: call void @a_readonly_func(ptr %p) #9 [ "unknown"() ] <-> call void @an_inaccessibleorargmemonly_func(ptr %q) #11 [ "unknown"() ]
419 ; CHECK: Just Ref: call void @a_readonly_func(ptr %p) #9 [ "unknown"() ] <-> call void @an_argmemonly_func(ptr %q) #12 [ "unknown"() ]
420 ; CHECK: Both ModRef: call void @an_inaccessiblememonly_func() #10 [ "unknown"() ] <-> call void @a_readonly_func(ptr %p) #9 [ "unknown"() ]
421 ; CHECK: Both ModRef: call void @an_inaccessiblememonly_func() #10 [ "unknown"() ] <-> call void @an_inaccessibleorargmemonly_func(ptr %q) #11 [ "unknown"() ]
422 ; CHECK: NoModRef: call void @an_inaccessiblememonly_func() #10 [ "unknown"() ] <-> call void @an_argmemonly_func(ptr %q) #12 [ "unknown"() ]
423 ; CHECK: Both ModRef: call void @an_inaccessibleorargmemonly_func(ptr %q) #11 [ "unknown"() ] <-> call void @a_readonly_func(ptr %p) #9 [ "unknown"() ]
424 ; CHECK: Both ModRef: call void @an_inaccessibleorargmemonly_func(ptr %q) #11 [ "unknown"() ] <-> call void @an_inaccessiblememonly_func() #10 [ "unknown"() ]
425 ; CHECK: Both ModRef: call void @an_inaccessibleorargmemonly_func(ptr %q) #11 [ "unknown"() ] <-> call void @an_argmemonly_func(ptr %q) #12 [ "unknown"() ]
426 ; CHECK: Both ModRef: call void @an_argmemonly_func(ptr %q) #12 [ "unknown"() ] <-> call void @a_readonly_func(ptr %p) #9 [ "unknown"() ]
427 ; CHECK: NoModRef: call void @an_argmemonly_func(ptr %q) #12 [ "unknown"() ] <-> call void @an_inaccessiblememonly_func() #10 [ "unknown"() ]
428 ; CHECK: Both ModRef: call void @an_argmemonly_func(ptr %q) #12 [ "unknown"() ] <-> call void @an_inaccessibleorargmemonly_func(ptr %q) #11 [ "unknown"() ]
431 attributes #0 = { argmemonly nounwind }
432 attributes #1 = { noinline nounwind readonly }
433 attributes #2 = { noinline nounwind writeonly }
434 attributes #3 = { nounwind ssp }
435 attributes #4 = { inaccessiblememonly nounwind }
436 attributes #5 = { inaccessiblemem_or_argmemonly nounwind }
437 attributes #6 = { readonly }
438 attributes #7 = { inaccessiblememonly }
439 attributes #8 = { inaccessiblemem_or_argmemonly }
440 attributes #9 = { argmemonly }