1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
3 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
5 target triple = "amdgcn-amd-amdhsa"
7 %struct.ident_t = type { i32, i32, i32, i32, ptr }
8 @ReachableKernel = internal addrspace(3) global i32 3, align 4
9 @UnreachableKernel = internal addrspace(3) global i32 42, align 4
10 @ReachableKernelAS0 = internal global i32 7, align 4
11 @AS3OneKernelAtATime = internal addrspace(3) global i32 42, align 4
14 ; CHECK: @ReachableKernel = internal addrspace(3) global i32 3, align 4
15 ; CHECK: @UnreachableKernel = internal addrspace(3) global i32 42, align 4
16 ; CHECK: @ReachableKernelAS0 = internal global i32 7, align 4
17 ; CHECK: @AS3OneKernelAtATime = internal addrspace(3) global i32 42, align 4
18 ; CHECK: @ReachableNonKernel = internal addrspace(3) global i32 0, align 4
19 ; CHECK: @UnreachableNonKernel = internal addrspace(3) global i32 0, align 4
21 define dso_local void @kernel(i32 %C) norecurse "kernel" {
22 ; TUNIT: Function Attrs: norecurse nosync nounwind
23 ; TUNIT-LABEL: define {{[^@]+}}@kernel
24 ; TUNIT-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] {
26 ; TUNIT-NEXT: call void @level1Kernel(i32 [[C]]) #[[ATTR1:[0-9]+]]
27 ; TUNIT-NEXT: ret void
29 ; CGSCC: Function Attrs: norecurse nosync nounwind
30 ; CGSCC-LABEL: define {{[^@]+}}@kernel
31 ; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] {
33 ; CGSCC-NEXT: call void @level1Kernel(i32 [[C]]) #[[ATTR4:[0-9]+]]
34 ; CGSCC-NEXT: ret void
37 call void @level1Kernel(i32 %C)
41 define internal void @level1Kernel(i32 %C) {
42 ; TUNIT: Function Attrs: norecurse nosync nounwind
43 ; TUNIT-LABEL: define {{[^@]+}}@level1Kernel
44 ; TUNIT-SAME: (i32 [[C:%.*]]) #[[ATTR1]] {
46 ; TUNIT-NEXT: call void @level2Kernelall_early() #[[ATTR4:[0-9]+]]
47 ; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[C]], 0
48 ; TUNIT-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
50 ; TUNIT-NEXT: call void @level2Kernela() #[[ATTR5:[0-9]+]]
51 ; TUNIT-NEXT: br label [[IF_END:%.*]]
53 ; TUNIT-NEXT: call void @level2Kernelb() #[[ATTR5]]
54 ; TUNIT-NEXT: br label [[IF_END]]
56 ; TUNIT-NEXT: call void @level2Kernelall_late() #[[ATTR6:[0-9]+]]
57 ; TUNIT-NEXT: ret void
59 ; CGSCC: Function Attrs: norecurse nosync nounwind
60 ; CGSCC-LABEL: define {{[^@]+}}@level1Kernel
61 ; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR1:[0-9]+]] {
63 ; CGSCC-NEXT: call void @level2Kernelall_early() #[[ATTR5:[0-9]+]]
64 ; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[C]], 0
65 ; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
67 ; CGSCC-NEXT: call void @level2Kernela() #[[ATTR4]]
68 ; CGSCC-NEXT: br label [[IF_END:%.*]]
70 ; CGSCC-NEXT: call void @level2Kernelb() #[[ATTR4]]
71 ; CGSCC-NEXT: br label [[IF_END]]
73 ; CGSCC-NEXT: call void @level2Kernelall_late() #[[ATTR6:[0-9]+]]
74 ; CGSCC-NEXT: ret void
77 call void @level2Kernelall_early()
78 %tobool = icmp ne i32 %C, 0
79 br i1 %tobool, label %if.then, label %if.else
81 if.then: ; preds = %entry
82 call void @level2Kernela()
85 if.else: ; preds = %entry
86 call void @level2Kernelb()
89 if.end: ; preds = %if.else, %if.then
90 call void @level2Kernelall_late()
94 define internal void @level2Kernelall_early() {
95 ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
96 ; CHECK-LABEL: define {{[^@]+}}@level2Kernelall_early
97 ; CHECK-SAME: () #[[ATTR2:[0-9]+]] {
99 ; CHECK-NEXT: store i32 1, ptr @ReachableKernelAS0, align 4
100 ; CHECK-NEXT: store i32 1, ptr addrspace(3) @ReachableKernel, align 4
101 ; CHECK-NEXT: ret void
104 store i32 1, ptr @ReachableKernelAS0, align 4
105 store i32 1, ptr addrspacecast (ptr addrspace(3) @ReachableKernel to ptr), align 4
109 define internal void @level2Kernela() {
110 ; TUNIT: Function Attrs: norecurse nosync nounwind
111 ; TUNIT-LABEL: define {{[^@]+}}@level2Kernela
112 ; TUNIT-SAME: () #[[ATTR1]] {
114 ; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(3) @ReachableKernel, align 4
115 ; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr @ReachableKernelAS0, align 4
116 ; TUNIT-NEXT: [[TMP2:%.*]] = load i32, ptr addrspace(3) @UnreachableKernel, align 4
117 ; TUNIT-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 noundef [[TMP2]]) #[[ATTR7:[0-9]+]]
118 ; TUNIT-NEXT: ret void
120 ; CGSCC: Function Attrs: nosync nounwind
121 ; CGSCC-LABEL: define {{[^@]+}}@level2Kernela
122 ; CGSCC-SAME: () #[[ATTR3:[0-9]+]] {
124 ; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(3) @ReachableKernel, align 4
125 ; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr @ReachableKernelAS0, align 4
126 ; CGSCC-NEXT: [[TMP2:%.*]] = load i32, ptr addrspace(3) @UnreachableKernel, align 4
127 ; CGSCC-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 noundef [[TMP2]]) #[[ATTR4]]
128 ; CGSCC-NEXT: ret void
131 %0 = load i32, ptr addrspacecast (ptr addrspace(3) @ReachableKernel to ptr), align 4
132 %1 = load i32, ptr @ReachableKernelAS0, align 4
133 %2 = load i32, ptr addrspacecast (ptr addrspace(3) @UnreachableKernel to ptr), align 4
134 call void @use(i32 %0, i32 %1, i32 %2)
138 define internal void @level2Kernelb() {
139 ; TUNIT: Function Attrs: norecurse nosync nounwind
140 ; TUNIT-LABEL: define {{[^@]+}}@level2Kernelb
141 ; TUNIT-SAME: () #[[ATTR1]] {
143 ; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(3) @ReachableKernel, align 4
144 ; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr @ReachableKernelAS0, align 4
145 ; TUNIT-NEXT: [[TMP2:%.*]] = load i32, ptr addrspace(3) @UnreachableKernel, align 4
146 ; TUNIT-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 noundef [[TMP2]]) #[[ATTR7]]
147 ; TUNIT-NEXT: ret void
149 ; CGSCC: Function Attrs: nosync nounwind
150 ; CGSCC-LABEL: define {{[^@]+}}@level2Kernelb
151 ; CGSCC-SAME: () #[[ATTR3]] {
153 ; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(3) @ReachableKernel, align 4
154 ; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr @ReachableKernelAS0, align 4
155 ; CGSCC-NEXT: [[TMP2:%.*]] = load i32, ptr addrspace(3) @UnreachableKernel, align 4
156 ; CGSCC-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 noundef [[TMP2]]) #[[ATTR4]]
157 ; CGSCC-NEXT: ret void
160 %0 = load i32, ptr addrspacecast (ptr addrspace(3) @ReachableKernel to ptr), align 4
161 %1 = load i32, ptr @ReachableKernelAS0, align 4
162 %2 = load i32, ptr addrspacecast (ptr addrspace(3) @UnreachableKernel to ptr), align 4
163 call void @use(i32 %0, i32 %1, i32 %2)
167 define internal void @level2Kernelall_late() {
168 ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
169 ; CHECK-LABEL: define {{[^@]+}}@level2Kernelall_late
170 ; CHECK-SAME: () #[[ATTR2]] {
172 ; CHECK-NEXT: store i32 1, ptr addrspace(3) @UnreachableKernel, align 4
173 ; CHECK-NEXT: ret void
176 store i32 1, ptr addrspacecast (ptr addrspace(3) @UnreachableKernel to ptr), align 4
180 @ReachableNonKernel = internal addrspace(3) global i32 0, align 4
181 @UnreachableNonKernel = internal addrspace(3) global i32 0, align 4
183 define dso_local void @non_kernel(i32 %C) norecurse {
184 ; TUNIT: Function Attrs: norecurse nosync nounwind
185 ; TUNIT-LABEL: define {{[^@]+}}@non_kernel
186 ; TUNIT-SAME: (i32 [[C:%.*]]) #[[ATTR1]] {
188 ; TUNIT-NEXT: call void @level1(i32 [[C]]) #[[ATTR1]]
189 ; TUNIT-NEXT: ret void
191 ; CGSCC: Function Attrs: norecurse nosync nounwind
192 ; CGSCC-LABEL: define {{[^@]+}}@non_kernel
193 ; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR1]] {
195 ; CGSCC-NEXT: call void @level1(i32 [[C]]) #[[ATTR4]]
196 ; CGSCC-NEXT: ret void
199 call void @level1(i32 %C)
203 define internal void @level1(i32 %C) {
204 ; TUNIT: Function Attrs: norecurse nosync nounwind
205 ; TUNIT-LABEL: define {{[^@]+}}@level1
206 ; TUNIT-SAME: (i32 [[C:%.*]]) #[[ATTR1]] {
208 ; TUNIT-NEXT: [[LOCAL:%.*]] = alloca i32, align 4
209 ; TUNIT-NEXT: call void @level2all_early(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR4]]
210 ; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[C]], 0
211 ; TUNIT-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
213 ; TUNIT-NEXT: call void @level2a() #[[ATTR5]]
214 ; TUNIT-NEXT: br label [[IF_END:%.*]]
216 ; TUNIT-NEXT: call void @level2b() #[[ATTR5]]
217 ; TUNIT-NEXT: br label [[IF_END]]
219 ; TUNIT-NEXT: call void @level2all_late(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR6]]
220 ; TUNIT-NEXT: ret void
222 ; CGSCC: Function Attrs: norecurse nosync nounwind
223 ; CGSCC-LABEL: define {{[^@]+}}@level1
224 ; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR1]] {
226 ; CGSCC-NEXT: [[LOCAL:%.*]] = alloca i32, align 4
227 ; CGSCC-NEXT: call void @level2all_early(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR5]]
228 ; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[C]], 0
229 ; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
231 ; CGSCC-NEXT: call void @level2a(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR4]]
232 ; CGSCC-NEXT: br label [[IF_END:%.*]]
234 ; CGSCC-NEXT: call void @level2b(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR4]]
235 ; CGSCC-NEXT: br label [[IF_END]]
237 ; CGSCC-NEXT: call void @level2all_late(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR6]]
238 ; CGSCC-NEXT: ret void
242 call void @level2all_early(ptr %local)
243 %tobool = icmp ne i32 %C, 0
244 br i1 %tobool, label %if.then, label %if.else
246 if.then: ; preds = %entry
247 call void @level2a(ptr %local)
250 if.else: ; preds = %entry
251 call void @level2b(ptr %local)
254 if.end: ; preds = %if.else, %if.then
255 call void @level2all_late(ptr %local)
259 define internal void @level2all_early(ptr %addr) {
260 ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
261 ; TUNIT-LABEL: define {{[^@]+}}@level2all_early
262 ; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR2]] {
264 ; TUNIT-NEXT: store i32 1, ptr addrspace(3) @ReachableNonKernel, align 4
265 ; TUNIT-NEXT: ret void
267 ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
268 ; CGSCC-LABEL: define {{[^@]+}}@level2all_early
269 ; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR2]] {
271 ; CGSCC-NEXT: store i32 1, ptr addrspace(3) @ReachableNonKernel, align 4
272 ; CGSCC-NEXT: store i32 17, ptr [[ADDR]], align 4
273 ; CGSCC-NEXT: ret void
276 store i32 1, ptr addrspacecast (ptr addrspace(3) @ReachableNonKernel to ptr), align 4
277 store i32 17, ptr %addr, align 4
281 define internal void @level2a(ptr %addr) {
282 ; TUNIT: Function Attrs: norecurse nosync nounwind memory(readwrite, argmem: none)
283 ; TUNIT-LABEL: define {{[^@]+}}@level2a
284 ; TUNIT-SAME: () #[[ATTR3:[0-9]+]] {
286 ; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(3) @ReachableNonKernel, align 4
287 ; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr addrspace(3) @UnreachableNonKernel, align 4
288 ; TUNIT-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 17) #[[ATTR7]]
289 ; TUNIT-NEXT: ret void
291 ; CGSCC: Function Attrs: nosync nounwind
292 ; CGSCC-LABEL: define {{[^@]+}}@level2a
293 ; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR3]] {
295 ; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(3) @ReachableNonKernel, align 4
296 ; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr addrspace(3) @UnreachableNonKernel, align 4
297 ; CGSCC-NEXT: [[QQQQ2:%.*]] = load i32, ptr [[ADDR]], align 4
298 ; CGSCC-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 [[QQQQ2]]) #[[ATTR4]]
299 ; CGSCC-NEXT: ret void
302 %0 = load i32, ptr addrspacecast (ptr addrspace(3) @ReachableNonKernel to ptr), align 4
303 %1 = load i32, ptr addrspacecast (ptr addrspace(3) @UnreachableNonKernel to ptr), align 4
304 %qqqq2 = load i32, ptr %addr
305 call void @use(i32 %0, i32 %1, i32 %qqqq2)
309 define internal void @level2b(ptr %addr) {
310 ; TUNIT: Function Attrs: norecurse nosync nounwind memory(readwrite, argmem: none)
311 ; TUNIT-LABEL: define {{[^@]+}}@level2b
312 ; TUNIT-SAME: () #[[ATTR3]] {
314 ; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(3) @ReachableNonKernel, align 4
315 ; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr addrspace(3) @UnreachableNonKernel, align 4
316 ; TUNIT-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 17) #[[ATTR7]]
317 ; TUNIT-NEXT: ret void
319 ; CGSCC: Function Attrs: nosync nounwind
320 ; CGSCC-LABEL: define {{[^@]+}}@level2b
321 ; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR3]] {
323 ; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(3) @ReachableNonKernel, align 4
324 ; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr addrspace(3) @UnreachableNonKernel, align 4
325 ; CGSCC-NEXT: [[TMP2:%.*]] = load i32, ptr [[ADDR]], align 4
326 ; CGSCC-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 [[TMP2]]) #[[ATTR4]]
327 ; CGSCC-NEXT: ret void
330 %0 = load i32, ptr addrspacecast (ptr addrspace(3) @ReachableNonKernel to ptr), align 4
331 %1 = load i32, ptr addrspacecast (ptr addrspace(3) @UnreachableNonKernel to ptr), align 4
332 %2 = load i32, ptr %addr
333 call void @use(i32 %0, i32 %1, i32 %2)
337 define internal void @level2all_late(ptr %addr) {
338 ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
339 ; TUNIT-LABEL: define {{[^@]+}}@level2all_late
340 ; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR2]] {
342 ; TUNIT-NEXT: store i32 1, ptr addrspace(3) @UnreachableNonKernel, align 4
343 ; TUNIT-NEXT: ret void
345 ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
346 ; CGSCC-LABEL: define {{[^@]+}}@level2all_late
347 ; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR2]] {
349 ; CGSCC-NEXT: store i32 1, ptr addrspace(3) @UnreachableNonKernel, align 4
350 ; CGSCC-NEXT: store i32 5, ptr [[ADDR]], align 4
351 ; CGSCC-NEXT: ret void
354 store i32 1, ptr addrspacecast (ptr addrspace(3) @UnreachableNonKernel to ptr), align 4
355 store i32 5, ptr %addr, align 4
359 define dso_local void @kernel2(i32 %C) norecurse "kernel" {
360 ; TUNIT: Function Attrs: norecurse nosync nounwind
361 ; TUNIT-LABEL: define {{[^@]+}}@kernel2
362 ; TUNIT-SAME: (i32 [[C:%.*]]) #[[ATTR0]] {
363 ; TUNIT-NEXT: [[I:%.*]] = icmp eq i32 [[C]], 42
364 ; TUNIT-NEXT: br i1 [[I]], label [[T:%.*]], label [[F:%.*]]
366 ; TUNIT-NEXT: store i32 333, ptr addrspace(3) @AS3OneKernelAtATime, align 4
367 ; TUNIT-NEXT: br label [[F]]
369 ; TUNIT-NEXT: [[L:%.*]] = load i32, ptr addrspace(3) @AS3OneKernelAtATime, align 4
370 ; TUNIT-NEXT: call void @use(i32 noundef [[L]], i32 noundef [[L]], i32 noundef [[L]]) #[[ATTR7]]
371 ; TUNIT-NEXT: ret void
373 ; CGSCC: Function Attrs: norecurse nosync nounwind
374 ; CGSCC-LABEL: define {{[^@]+}}@kernel2
375 ; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] {
376 ; CGSCC-NEXT: [[I:%.*]] = icmp eq i32 [[C]], 42
377 ; CGSCC-NEXT: br i1 [[I]], label [[T:%.*]], label [[F:%.*]]
379 ; CGSCC-NEXT: store i32 333, ptr addrspace(3) @AS3OneKernelAtATime, align 4
380 ; CGSCC-NEXT: br label [[F]]
382 ; CGSCC-NEXT: [[L:%.*]] = load i32, ptr addrspace(3) @AS3OneKernelAtATime, align 4
383 ; CGSCC-NEXT: call void @use(i32 noundef [[L]], i32 noundef [[L]], i32 noundef [[L]]) #[[ATTR4]]
384 ; CGSCC-NEXT: ret void
386 %i = icmp eq i32 %C, 42
387 br i1 %i, label %t, label %f
389 store i32 333, ptr addrspace(3) @AS3OneKernelAtATime
392 %l = load i32, ptr addrspace(3) @AS3OneKernelAtATime
393 call void @use(i32 %l,i32 %l, i32 %l)
397 define dso_local void @kernel3(i32 %C) norecurse "kernel" {
398 ; TUNIT: Function Attrs: norecurse nosync nounwind
399 ; TUNIT-LABEL: define {{[^@]+}}@kernel3
400 ; TUNIT-SAME: (i32 [[C:%.*]]) #[[ATTR0]] {
401 ; TUNIT-NEXT: [[I:%.*]] = icmp eq i32 [[C]], 42
402 ; TUNIT-NEXT: br i1 [[I]], label [[T:%.*]], label [[F:%.*]]
404 ; TUNIT-NEXT: call void @use(i32 noundef 42, i32 noundef 42, i32 noundef 42) #[[ATTR7]]
405 ; TUNIT-NEXT: ret void
407 ; TUNIT-NEXT: ret void
409 ; CGSCC: Function Attrs: norecurse nosync nounwind
410 ; CGSCC-LABEL: define {{[^@]+}}@kernel3
411 ; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] {
412 ; CGSCC-NEXT: [[I:%.*]] = icmp eq i32 [[C]], 42
413 ; CGSCC-NEXT: br i1 [[I]], label [[T:%.*]], label [[F:%.*]]
415 ; CGSCC-NEXT: call void @use(i32 noundef 42, i32 noundef 42, i32 noundef 42) #[[ATTR4]]
416 ; CGSCC-NEXT: ret void
418 ; CGSCC-NEXT: ret void
420 %i = icmp eq i32 %C, 42
421 br i1 %i, label %t, label %f
423 %l = load i32, ptr addrspace(3) @AS3OneKernelAtATime
424 call void @use(i32 %l,i32 %l, i32 %l)
430 declare dso_local void @use(i32, i32, i32) nosync norecurse nounwind
433 ; TUNIT: attributes #[[ATTR0]] = { norecurse nosync nounwind "kernel" }
434 ; TUNIT: attributes #[[ATTR1]] = { norecurse nosync nounwind }
435 ; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) }
436 ; TUNIT: attributes #[[ATTR3]] = { norecurse nosync nounwind memory(readwrite, argmem: none) }
437 ; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn memory(write) }
438 ; TUNIT: attributes #[[ATTR5]] = { nosync nounwind }
439 ; TUNIT: attributes #[[ATTR6]] = { nosync nounwind memory(write) }
440 ; TUNIT: attributes #[[ATTR7]] = { nounwind }
442 ; CGSCC: attributes #[[ATTR0]] = { norecurse nosync nounwind "kernel" }
443 ; CGSCC: attributes #[[ATTR1]] = { norecurse nosync nounwind }
444 ; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) }
445 ; CGSCC: attributes #[[ATTR3]] = { nosync nounwind }
446 ; CGSCC: attributes #[[ATTR4]] = { nounwind }
447 ; CGSCC: attributes #[[ATTR5]] = { nofree nounwind willreturn memory(write) }
448 ; CGSCC: attributes #[[ATTR6]] = { nounwind memory(write) }