1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs
2 ; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-rewrite-out-arguments < %s | FileCheck %s
4 define void @no_ret_blocks() #0 {
8 define void @void_one_out_arg_i32_no_use(ptr addrspace(5) %val) #0 {
12 define void @skip_byval_arg(ptr addrspace(5) byval(i32) %val) #0 {
13 store i32 0, ptr addrspace(5) %val
17 define void @skip_optnone(ptr addrspace(5) byval(i32) %val) #1 {
18 store i32 0, ptr addrspace(5) %val
22 define void @skip_volatile(ptr addrspace(5) byval(i32) %val) #0 {
23 store volatile i32 0, ptr addrspace(5) %val
27 define void @skip_atomic(ptr addrspace(5) byval(i32) %val) #0 {
28 store atomic i32 0, ptr addrspace(5) %val seq_cst, align 4
32 define void @skip_store_pointer_val(ptr addrspace(5) %val) #0 {
33 store ptr addrspace(5) %val, ptr poison
37 define void @skip_store_gep(ptr addrspace(5) %val) #0 {
38 %gep = getelementptr inbounds i32, ptr addrspace(5) %val, i32 1
39 store i32 0, ptr addrspace(5) %gep
43 define void @skip_sret(ptr addrspace(5) sret(i32) %sret, ptr addrspace(5) %out) #0 {
44 store i32 1, ptr addrspace(5) %sret
45 store i32 0, ptr addrspace(5) %out
50 define void @void_one_out_arg_i32_1_use(ptr addrspace(5) %val) #0 {
51 store i32 0, ptr addrspace(5) %val
56 define void @void_one_out_arg_i32_1_use_align(ptr addrspace(5) align 8 %val) #0 {
57 store i32 0, ptr addrspace(5) %val, align 8
64 define void @void_one_out_arg_i32_2_use(i1 %arg0, ptr addrspace(5) %val) #0 {
65 br i1 %arg0, label %ret0, label %ret1
68 store i32 0, ptr addrspace(5) %val
72 store i32 9, ptr addrspace(5) %val
76 declare void @may.clobber()
79 define void @void_one_out_arg_i32_2_stores(ptr addrspace(5) %val) #0 {
80 store i32 0, ptr addrspace(5) %val
81 store i32 1, ptr addrspace(5) %val
86 define void @void_one_out_arg_i32_2_stores_clobber(ptr addrspace(5) %val) #0 {
87 store i32 0, ptr addrspace(5) %val
88 call void @may.clobber()
89 store i32 1, ptr addrspace(5) %val
94 define void @void_one_out_arg_i32_call_may_clobber(ptr addrspace(5) %val) #0 {
95 store i32 0, ptr addrspace(5) %val
96 call void @may.clobber()
101 define void @void_one_out_arg_i32_pre_call_may_clobber(ptr addrspace(5) %val) #0 {
102 call void @may.clobber()
103 store i32 0, ptr addrspace(5) %val
107 define void @void_one_out_arg_i32_reload(ptr addrspace(5) %val) #0 {
108 store i32 0, ptr addrspace(5) %val
109 %load = load i32, ptr addrspace(5) %val, align 4
113 define void @void_one_out_arg_i32_store_in_different_block(ptr addrspace(5) %out) #0 {
114 %load = load i32, ptr addrspace(1) poison
115 store i32 0, ptr addrspace(5) %out
123 define void @unused_out_arg_one_branch(i1 %arg0, ptr addrspace(5) %val) #0 {
124 br i1 %arg0, label %ret0, label %ret1
130 store i32 9, ptr addrspace(5) %val
135 define void @void_one_out_arg_v2i32_1_use(ptr addrspace(5) %val) #0 {
136 store <2 x i32> <i32 17, i32 9>, ptr addrspace(5) %val
140 %struct = type { i32, i8, float }
143 ; Normally this is split into element accesses which we don't handle.
144 define void @void_one_out_arg_struct_1_use(ptr addrspace(5) %out) #0 {
145 store %struct { i32 9, i8 99, float 4.0 }, ptr addrspace(5) %out
150 define i32 @i32_one_out_arg_i32_1_use(ptr addrspace(5) %val) #0 {
151 store i32 24, ptr addrspace(5) %val
156 define void @unused_different_type(ptr addrspace(5) %arg0, ptr addrspace(5) nocapture %arg1) #0 {
157 store float 4.0, ptr addrspace(5) %arg1, align 4
162 define void @multiple_same_return_noalias(ptr addrspace(5) noalias %out0, ptr addrspace(5) noalias %out1) #0 {
163 store i32 1, ptr addrspace(5) %out0, align 4
164 store i32 2, ptr addrspace(5) %out1, align 4
169 define void @multiple_same_return_mayalias(ptr addrspace(5) %out0, ptr addrspace(5) %out1) #0 {
170 store i32 1, ptr addrspace(5) %out0, align 4
171 store i32 2, ptr addrspace(5) %out1, align 4
176 define void @multiple_same_return_mayalias_order(ptr addrspace(5) %out0, ptr addrspace(5) %out1) #0 {
177 store i32 2, ptr addrspace(5) %out1, align 4
178 store i32 1, ptr addrspace(5) %out0, align 4
182 ; Currently this fails to convert because the store won't be found if
183 ; it isn't in the same block as the return.
184 define i32 @store_in_entry_block(i1 %arg0, ptr addrspace(5) %out) #0 {
186 %val0 = load i32, ptr addrspace(1) poison
187 store i32 %val0, ptr addrspace(5) %out
188 br i1 %arg0, label %if, label %endif
191 %val1 = load i32, ptr addrspace(1) poison
195 %phi = phi i32 [ 0, %entry ], [ %val1, %if ]
200 define i1 @i1_one_out_arg_i32_1_use(ptr addrspace(5) %val) #0 {
201 store i32 24, ptr addrspace(5) %val
205 ; Make sure we don't leave around return attributes that are
206 ; incompatible with struct return types.
209 define zeroext i1 @i1_zeroext_one_out_arg_i32_1_use(ptr addrspace(5) %val) #0 {
210 store i32 24, ptr addrspace(5) %val
215 define signext i1 @i1_signext_one_out_arg_i32_1_use(ptr addrspace(5) %val) #0 {
216 store i32 24, ptr addrspace(5) %val
221 define noalias ptr addrspace(1) @p1i32_noalias_one_out_arg_i32_1_use(ptr addrspace(5) %val) #0 {
222 store i32 24, ptr addrspace(5) %val
223 ret ptr addrspace(1) null
226 define void @void_one_out_non_private_arg_i32_1_use(ptr addrspace(1) %val) #0 {
227 store i32 0, ptr addrspace(1) %val
231 define void @func_ptr_type(ptr addrspace(5) %out) #0 {
232 %func = load ptr, ptr poison
233 store ptr %func, ptr addrspace(5) %out
237 define void @bitcast_func_ptr_type(ptr addrspace(5) %out) #0 {
238 %func = load ptr, ptr poison
239 store ptr %func, ptr addrspace(5) %out
244 define void @out_arg_small_array(ptr addrspace(5) %val) #0 {
245 store [4 x i32] [i32 0, i32 1, i32 2, i32 3], ptr addrspace(5) %val
249 define void @out_arg_large_array(ptr addrspace(5) %val) #0 {
250 store [17 x i32] zeroinitializer, ptr addrspace(5) %val
254 define <16 x i32> @num_regs_return_limit(ptr addrspace(5) %out, i32 %val) #0 {
255 %load = load volatile <16 x i32>, ptr addrspace(1) poison
256 store i32 %val, ptr addrspace(5) %out
260 define [15 x i32] @num_regs_reach_limit(ptr addrspace(5) %out, i32 %val) #0 {
261 %load = load volatile [15 x i32], ptr addrspace(1) poison
262 store i32 %val, ptr addrspace(5) %out
267 define [15 x i32] @num_regs_reach_limit_leftover(ptr addrspace(5) %out0, ptr addrspace(5) %out1, i32 %val0) #0 {
268 %load0 = load volatile [15 x i32], ptr addrspace(1) poison
269 %load1 = load volatile i32, ptr addrspace(1) poison
270 store i32 %val0, ptr addrspace(5) %out0
271 store i32 %load1, ptr addrspace(5) %out1
272 ret [15 x i32] %load0
276 define void @preserve_debug_info(i32 %arg0, ptr addrspace(5) %val) #0 !dbg !5 {
277 call void @may.clobber(), !dbg !10
278 store i32 %arg0, ptr addrspace(5) %val, !dbg !11
282 define void @preserve_metadata(i32 %arg0, ptr addrspace(5) %val) #0 !kernel_arg_access_qual !13 {
283 call void @may.clobber()
284 store i32 %arg0, ptr addrspace(5) %val
288 ; Clang emits this pattern for 3-vectors for some reason.
290 define void @bitcast_pointer_v4i32_v3i32(ptr addrspace(5) %out) #0 {
291 %load = load volatile <4 x i32>, ptr addrspace(1) poison
292 store <4 x i32> %load, ptr addrspace(5) %out
296 define void @bitcast_pointer_v4i32_v3f32(ptr addrspace(5) %out) #0 {
297 %load = load volatile <4 x i32>, ptr addrspace(1) poison
298 store <4 x i32> %load, ptr addrspace(5) %out
303 ; Try different element and bitwidths which could produce broken
307 define void @bitcast_pointer_i32_f32(ptr addrspace(5) %out) #0 {
308 %load = load volatile i32, ptr addrspace(1) poison
309 store i32 %load, ptr addrspace(5) %out
313 define void @bitcast_pointer_i32_f16(ptr addrspace(5) %out) #0 {
314 %load = load volatile i32, ptr addrspace(1) poison
315 store i32 %load, ptr addrspace(5) %out
319 define void @bitcast_pointer_f16_i32(ptr addrspace(5) %out) #0 {
320 %load = load volatile half, ptr addrspace(1) poison
321 store half %load, ptr addrspace(5) %out
325 %struct.i128 = type { i128 }
326 %struct.v2f32 = type { <2 x float> }
327 %struct.v3f32 = type { <3 x float> }
328 %struct.v3f32.f32 = type { <3 x float>, float }
329 %struct.v4f32 = type { <4 x float> }
332 define void @bitcast_struct_v3f32_v3f32(ptr addrspace(5) %out, <3 x float> %value) #0 {
333 %extractVec = shufflevector <3 x float> %value, <3 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
334 store <4 x float> %extractVec, ptr addrspace(5) %out, align 16
339 define void @bitcast_struct_v3f32_v3i32(ptr addrspace(5) %out, <3 x i32> %value) #0 {
340 %extractVec = shufflevector <3 x i32> %value, <3 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
341 store <4 x i32> %extractVec, ptr addrspace(5) %out, align 16
346 define void @bitcast_struct_v4f32_v4f32(ptr addrspace(5) %out, <4 x float> %value) #0 {
347 store <4 x float> %value, ptr addrspace(5) %out, align 16
351 define void @bitcast_struct_v3f32_v4i32(ptr addrspace(5) %out, <4 x i32> %value) #0 {
352 store <4 x i32> %value, ptr addrspace(5) %out, align 16
356 define void @bitcast_struct_v4f32_v3f32(ptr addrspace(5) %out, <3 x float> %value) #0 {
357 %extractVec = shufflevector <3 x float> %value, <3 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
358 store <4 x float> %extractVec, ptr addrspace(5) %out, align 16
362 define void @bitcast_struct_v3f32_v2f32(ptr addrspace(5) %out, <2 x float> %value) #0 {
363 store <2 x float> %value, ptr addrspace(5) %out, align 8
367 define void @bitcast_struct_v3f32_f32_v3f32(ptr addrspace(5) %out, <3 x float> %value) #0 {
368 %extractVec = shufflevector <3 x float> %value, <3 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
369 store <4 x float> %extractVec, ptr addrspace(5) %out, align 16
373 define void @bitcast_struct_v3f32_f32_v4f32(ptr addrspace(5) %out, <4 x float> %value) #0 {
374 store <4 x float> %value, ptr addrspace(5) %out, align 16
378 define void @bitcast_struct_i128_v4f32(ptr addrspace(5) %out, <4 x float> %value) #0 {
379 store <4 x float> %value, ptr addrspace(5) %out, align 16
383 define void @bitcast_array_v4i32_v4f32(ptr addrspace(5) %out, [4 x float] %value) #0 {
384 store [4 x float] %value, ptr addrspace(5) %out, align 4
389 define void @multi_return_bitcast_struct_v3f32_v3f32(i1 %cond, ptr addrspace(5) %out, <3 x float> %value) #0 {
391 br i1 %cond, label %ret0, label %ret1
394 %extractVec = shufflevector <3 x float> %value, <3 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
395 store <4 x float> %extractVec, ptr addrspace(5) %out, align 16
399 %load = load <4 x float>, ptr addrspace(1) poison
400 store <4 x float> %load, ptr addrspace(5) %out, align 16
404 define void @bitcast_v3f32_struct_v3f32(ptr addrspace(5) %out, %struct.v3f32 %value) #0 {
405 store %struct.v3f32 %value, ptr addrspace(5) %out, align 4
409 attributes #0 = { nounwind }
410 attributes #1 = { nounwind noinline optnone }
411 attributes #2 = { alwaysinline nounwind }
414 !llvm.module.flags = !{!3, !4}
416 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 5.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
417 !1 = !DIFile(filename: "code-object-metadata-kernel-debug-props.cl", directory: "/some/random/directory")
419 !3 = !{i32 2, !"Dwarf Version", i32 2}
420 !4 = !{i32 2, !"Debug Info Version", i32 3}
421 !5 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
422 !6 = !DISubroutineType(types: !7)
424 !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64)
425 !9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
426 !10 = !DILocation(line: 2, column: 3, scope: !5)
427 !11 = !DILocation(line: 2, column: 8, scope: !5)
428 !12 = !DILocation(line: 3, column: 3, scope: !5)
431 ; CHECK-LABEL: define {{[^@]+}}@no_ret_blocks
432 ; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
433 ; CHECK-NEXT: unreachable
436 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_no_use
437 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
438 ; CHECK-NEXT: ret void
441 ; CHECK-LABEL: define {{[^@]+}}@skip_byval_arg
442 ; CHECK-SAME: (ptr addrspace(5) byval(i32) [[VAL:%.*]]) #[[ATTR0]] {
443 ; CHECK-NEXT: store i32 0, ptr addrspace(5) [[VAL]], align 4
444 ; CHECK-NEXT: ret void
447 ; CHECK-LABEL: define {{[^@]+}}@skip_optnone
448 ; CHECK-SAME: (ptr addrspace(5) byval(i32) [[VAL:%.*]]) #[[ATTR1:[0-9]+]] {
449 ; CHECK-NEXT: store i32 0, ptr addrspace(5) [[VAL]], align 4
450 ; CHECK-NEXT: ret void
453 ; CHECK-LABEL: define {{[^@]+}}@skip_volatile
454 ; CHECK-SAME: (ptr addrspace(5) byval(i32) [[VAL:%.*]]) #[[ATTR0]] {
455 ; CHECK-NEXT: store volatile i32 0, ptr addrspace(5) [[VAL]], align 4
456 ; CHECK-NEXT: ret void
459 ; CHECK-LABEL: define {{[^@]+}}@skip_atomic
460 ; CHECK-SAME: (ptr addrspace(5) byval(i32) [[VAL:%.*]]) #[[ATTR0]] {
461 ; CHECK-NEXT: store atomic i32 0, ptr addrspace(5) [[VAL]] seq_cst, align 4
462 ; CHECK-NEXT: ret void
465 ; CHECK-LABEL: define {{[^@]+}}@skip_store_pointer_val
466 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
467 ; CHECK-NEXT: store ptr addrspace(5) [[VAL]], ptr poison, align 4
468 ; CHECK-NEXT: ret void
471 ; CHECK-LABEL: define {{[^@]+}}@skip_store_gep
472 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
473 ; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i32, ptr addrspace(5) [[VAL]], i32 1
474 ; CHECK-NEXT: store i32 0, ptr addrspace(5) [[GEP]], align 4
475 ; CHECK-NEXT: ret void
478 ; CHECK-LABEL: define {{[^@]+}}@skip_sret
479 ; CHECK-SAME: (ptr addrspace(5) sret(i32) [[SRET:%.*]], ptr addrspace(5) [[OUT:%.*]]) #[[ATTR0]] {
480 ; CHECK-NEXT: store i32 1, ptr addrspace(5) [[SRET]], align 4
481 ; CHECK-NEXT: store i32 0, ptr addrspace(5) [[OUT]], align 4
482 ; CHECK-NEXT: ret void
485 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_1_use.body
486 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
487 ; CHECK-NEXT: ret [[VOID_ONE_OUT_ARG_I32_1_USE:%.*]] zeroinitializer
490 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_1_use
491 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2:[0-9]+]] {
492 ; CHECK-NEXT: [[TMP2:%.*]] = call [[VOID_ONE_OUT_ARG_I32_1_USE:%.*]] @void_one_out_arg_i32_1_use.body(ptr addrspace(5) poison)
493 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[VOID_ONE_OUT_ARG_I32_1_USE]] [[TMP2]], 0
494 ; CHECK-NEXT: store i32 [[TMP3]], ptr addrspace(5) [[TMP0]], align 4
495 ; CHECK-NEXT: ret void
498 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_1_use_align.body
499 ; CHECK-SAME: (ptr addrspace(5) align 8 [[VAL:%.*]]) #[[ATTR0]] {
500 ; CHECK-NEXT: ret [[VOID_ONE_OUT_ARG_I32_1_USE_ALIGN:%.*]] zeroinitializer
503 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_1_use_align
504 ; CHECK-SAME: (ptr addrspace(5) align 8 [[TMP0:%.*]]) #[[ATTR2]] {
505 ; CHECK-NEXT: [[TMP2:%.*]] = call [[VOID_ONE_OUT_ARG_I32_1_USE_ALIGN:%.*]] @void_one_out_arg_i32_1_use_align.body(ptr addrspace(5) poison)
506 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[VOID_ONE_OUT_ARG_I32_1_USE_ALIGN]] [[TMP2]], 0
507 ; CHECK-NEXT: store i32 [[TMP3]], ptr addrspace(5) [[TMP0]], align 8
508 ; CHECK-NEXT: ret void
511 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_2_use.body
512 ; CHECK-SAME: (i1 [[ARG0:%.*]], ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
513 ; CHECK-NEXT: br i1 [[ARG0]], label [[RET0:%.*]], label [[RET1:%.*]]
515 ; CHECK-NEXT: ret [[VOID_ONE_OUT_ARG_I32_2_USE:%.*]] zeroinitializer
517 ; CHECK-NEXT: ret [[VOID_ONE_OUT_ARG_I32_2_USE]] { i32 9 }
520 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_2_use
521 ; CHECK-SAME: (i1 [[TMP0:%.*]], ptr addrspace(5) [[TMP1:%.*]]) #[[ATTR2]] {
522 ; CHECK-NEXT: [[TMP3:%.*]] = call [[VOID_ONE_OUT_ARG_I32_2_USE:%.*]] @void_one_out_arg_i32_2_use.body(i1 [[TMP0]], ptr addrspace(5) poison)
523 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[VOID_ONE_OUT_ARG_I32_2_USE]] [[TMP3]], 0
524 ; CHECK-NEXT: store i32 [[TMP4]], ptr addrspace(5) [[TMP1]], align 4
525 ; CHECK-NEXT: ret void
528 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_2_stores.body
529 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
530 ; CHECK-NEXT: store i32 0, ptr addrspace(5) [[VAL]], align 4
531 ; CHECK-NEXT: ret [[VOID_ONE_OUT_ARG_I32_2_STORES:%.*]] { i32 1 }
534 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_2_stores
535 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
536 ; CHECK-NEXT: [[TMP2:%.*]] = call [[VOID_ONE_OUT_ARG_I32_2_STORES:%.*]] @void_one_out_arg_i32_2_stores.body(ptr addrspace(5) poison)
537 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[VOID_ONE_OUT_ARG_I32_2_STORES]] [[TMP2]], 0
538 ; CHECK-NEXT: store i32 [[TMP3]], ptr addrspace(5) [[TMP0]], align 4
539 ; CHECK-NEXT: ret void
542 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_2_stores_clobber.body
543 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
544 ; CHECK-NEXT: store i32 0, ptr addrspace(5) [[VAL]], align 4
545 ; CHECK-NEXT: call void @may.clobber()
546 ; CHECK-NEXT: ret [[VOID_ONE_OUT_ARG_I32_2_STORES_CLOBBER:%.*]] { i32 1 }
549 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_2_stores_clobber
550 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
551 ; CHECK-NEXT: [[TMP2:%.*]] = call [[VOID_ONE_OUT_ARG_I32_2_STORES_CLOBBER:%.*]] @void_one_out_arg_i32_2_stores_clobber.body(ptr addrspace(5) poison)
552 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[VOID_ONE_OUT_ARG_I32_2_STORES_CLOBBER]] [[TMP2]], 0
553 ; CHECK-NEXT: store i32 [[TMP3]], ptr addrspace(5) [[TMP0]], align 4
554 ; CHECK-NEXT: ret void
557 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_call_may_clobber
558 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
559 ; CHECK-NEXT: store i32 0, ptr addrspace(5) [[VAL]], align 4
560 ; CHECK-NEXT: call void @may.clobber()
561 ; CHECK-NEXT: ret void
564 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_pre_call_may_clobber.body
565 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
566 ; CHECK-NEXT: call void @may.clobber()
567 ; CHECK-NEXT: ret [[VOID_ONE_OUT_ARG_I32_PRE_CALL_MAY_CLOBBER:%.*]] zeroinitializer
570 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_pre_call_may_clobber
571 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
572 ; CHECK-NEXT: [[TMP2:%.*]] = call [[VOID_ONE_OUT_ARG_I32_PRE_CALL_MAY_CLOBBER:%.*]] @void_one_out_arg_i32_pre_call_may_clobber.body(ptr addrspace(5) poison)
573 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[VOID_ONE_OUT_ARG_I32_PRE_CALL_MAY_CLOBBER]] [[TMP2]], 0
574 ; CHECK-NEXT: store i32 [[TMP3]], ptr addrspace(5) [[TMP0]], align 4
575 ; CHECK-NEXT: ret void
578 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_reload
579 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
580 ; CHECK-NEXT: store i32 0, ptr addrspace(5) [[VAL]], align 4
581 ; CHECK-NEXT: [[LOAD:%.*]] = load i32, ptr addrspace(5) [[VAL]], align 4
582 ; CHECK-NEXT: ret void
585 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_i32_store_in_different_block
586 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]]) #[[ATTR0]] {
587 ; CHECK-NEXT: [[LOAD:%.*]] = load i32, ptr addrspace(1) poison, align 4
588 ; CHECK-NEXT: store i32 0, ptr addrspace(5) [[OUT]], align 4
589 ; CHECK-NEXT: br label [[RET:%.*]]
591 ; CHECK-NEXT: ret void
594 ; CHECK-LABEL: define {{[^@]+}}@unused_out_arg_one_branch
595 ; CHECK-SAME: (i1 [[ARG0:%.*]], ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
596 ; CHECK-NEXT: br i1 [[ARG0]], label [[RET0:%.*]], label [[RET1:%.*]]
598 ; CHECK-NEXT: ret void
600 ; CHECK-NEXT: store i32 9, ptr addrspace(5) [[VAL]], align 4
601 ; CHECK-NEXT: ret void
604 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_v2i32_1_use.body
605 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
606 ; CHECK-NEXT: ret [[VOID_ONE_OUT_ARG_V2I32_1_USE:%.*]] { <2 x i32> <i32 17, i32 9> }
609 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_v2i32_1_use
610 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
611 ; CHECK-NEXT: [[TMP2:%.*]] = call [[VOID_ONE_OUT_ARG_V2I32_1_USE:%.*]] @void_one_out_arg_v2i32_1_use.body(ptr addrspace(5) poison)
612 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[VOID_ONE_OUT_ARG_V2I32_1_USE]] [[TMP2]], 0
613 ; CHECK-NEXT: store <2 x i32> [[TMP3]], ptr addrspace(5) [[TMP0]], align 8
614 ; CHECK-NEXT: ret void
617 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_struct_1_use.body
618 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]]) #[[ATTR0]] {
619 ; CHECK-NEXT: ret [[VOID_ONE_OUT_ARG_STRUCT_1_USE:%.*]] { [[STRUCT:%.*]] { i32 9, i8 99, float 4.000000e+00 } }
622 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_arg_struct_1_use
623 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
624 ; CHECK-NEXT: [[TMP2:%.*]] = call [[VOID_ONE_OUT_ARG_STRUCT_1_USE:%.*]] @void_one_out_arg_struct_1_use.body(ptr addrspace(5) poison)
625 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[VOID_ONE_OUT_ARG_STRUCT_1_USE]] [[TMP2]], 0
626 ; CHECK-NEXT: store [[STRUCT:%.*]] [[TMP3]], ptr addrspace(5) [[TMP0]], align 4
627 ; CHECK-NEXT: ret void
630 ; CHECK-LABEL: define {{[^@]+}}@i32_one_out_arg_i32_1_use.body
631 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
632 ; CHECK-NEXT: ret [[I32_ONE_OUT_ARG_I32_1_USE:%.*]] { i32 9, i32 24 }
635 ; CHECK-LABEL: define {{[^@]+}}@i32_one_out_arg_i32_1_use
636 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
637 ; CHECK-NEXT: [[TMP2:%.*]] = call [[I32_ONE_OUT_ARG_I32_1_USE:%.*]] @i32_one_out_arg_i32_1_use.body(ptr addrspace(5) poison)
638 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[I32_ONE_OUT_ARG_I32_1_USE]] [[TMP2]], 1
639 ; CHECK-NEXT: store i32 [[TMP3]], ptr addrspace(5) [[TMP0]], align 4
640 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[I32_ONE_OUT_ARG_I32_1_USE]] [[TMP2]], 0
641 ; CHECK-NEXT: ret i32 [[TMP4]]
644 ; CHECK-LABEL: define {{[^@]+}}@unused_different_type.body
645 ; CHECK-SAME: (ptr addrspace(5) [[ARG0:%.*]], ptr addrspace(5) nocapture [[ARG1:%.*]]) #[[ATTR0]] {
646 ; CHECK-NEXT: ret [[UNUSED_DIFFERENT_TYPE:%.*]] { float 4.000000e+00 }
649 ; CHECK-LABEL: define {{[^@]+}}@unused_different_type
650 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], ptr addrspace(5) nocapture [[TMP1:%.*]]) #[[ATTR2]] {
651 ; CHECK-NEXT: [[TMP3:%.*]] = call [[UNUSED_DIFFERENT_TYPE:%.*]] @unused_different_type.body(ptr addrspace(5) [[TMP0]], ptr addrspace(5) poison)
652 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[UNUSED_DIFFERENT_TYPE]] [[TMP3]], 0
653 ; CHECK-NEXT: store float [[TMP4]], ptr addrspace(5) [[TMP1]], align 4
654 ; CHECK-NEXT: ret void
657 ; CHECK-LABEL: define {{[^@]+}}@multiple_same_return_noalias.body
658 ; CHECK-SAME: (ptr addrspace(5) noalias [[OUT0:%.*]], ptr addrspace(5) noalias [[OUT1:%.*]]) #[[ATTR0]] {
659 ; CHECK-NEXT: ret [[MULTIPLE_SAME_RETURN_NOALIAS:%.*]] { i32 1, i32 2 }
662 ; CHECK-LABEL: define {{[^@]+}}@multiple_same_return_noalias
663 ; CHECK-SAME: (ptr addrspace(5) noalias [[TMP0:%.*]], ptr addrspace(5) noalias [[TMP1:%.*]]) #[[ATTR2]] {
664 ; CHECK-NEXT: [[TMP3:%.*]] = call [[MULTIPLE_SAME_RETURN_NOALIAS:%.*]] @multiple_same_return_noalias.body(ptr addrspace(5) poison, ptr addrspace(5) poison)
665 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[MULTIPLE_SAME_RETURN_NOALIAS]] [[TMP3]], 0
666 ; CHECK-NEXT: store i32 [[TMP4]], ptr addrspace(5) [[TMP0]], align 4
667 ; CHECK-NEXT: [[TMP5:%.*]] = extractvalue [[MULTIPLE_SAME_RETURN_NOALIAS]] [[TMP3]], 1
668 ; CHECK-NEXT: store i32 [[TMP5]], ptr addrspace(5) [[TMP1]], align 4
669 ; CHECK-NEXT: ret void
672 ; CHECK-LABEL: define {{[^@]+}}@multiple_same_return_mayalias.body
673 ; CHECK-SAME: (ptr addrspace(5) [[OUT0:%.*]], ptr addrspace(5) [[OUT1:%.*]]) #[[ATTR0]] {
674 ; CHECK-NEXT: ret [[MULTIPLE_SAME_RETURN_MAYALIAS:%.*]] { i32 2, i32 1 }
677 ; CHECK-LABEL: define {{[^@]+}}@multiple_same_return_mayalias
678 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], ptr addrspace(5) [[TMP1:%.*]]) #[[ATTR2]] {
679 ; CHECK-NEXT: [[TMP3:%.*]] = call [[MULTIPLE_SAME_RETURN_MAYALIAS:%.*]] @multiple_same_return_mayalias.body(ptr addrspace(5) poison, ptr addrspace(5) poison)
680 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[MULTIPLE_SAME_RETURN_MAYALIAS]] [[TMP3]], 0
681 ; CHECK-NEXT: store i32 [[TMP4]], ptr addrspace(5) [[TMP0]], align 4
682 ; CHECK-NEXT: [[TMP5:%.*]] = extractvalue [[MULTIPLE_SAME_RETURN_MAYALIAS]] [[TMP3]], 1
683 ; CHECK-NEXT: store i32 [[TMP5]], ptr addrspace(5) [[TMP1]], align 4
684 ; CHECK-NEXT: ret void
687 ; CHECK-LABEL: define {{[^@]+}}@multiple_same_return_mayalias_order.body
688 ; CHECK-SAME: (ptr addrspace(5) [[OUT0:%.*]], ptr addrspace(5) [[OUT1:%.*]]) #[[ATTR0]] {
689 ; CHECK-NEXT: ret [[MULTIPLE_SAME_RETURN_MAYALIAS_ORDER:%.*]] { i32 1, i32 2 }
692 ; CHECK-LABEL: define {{[^@]+}}@multiple_same_return_mayalias_order
693 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], ptr addrspace(5) [[TMP1:%.*]]) #[[ATTR2]] {
694 ; CHECK-NEXT: [[TMP3:%.*]] = call [[MULTIPLE_SAME_RETURN_MAYALIAS_ORDER:%.*]] @multiple_same_return_mayalias_order.body(ptr addrspace(5) poison, ptr addrspace(5) poison)
695 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[MULTIPLE_SAME_RETURN_MAYALIAS_ORDER]] [[TMP3]], 0
696 ; CHECK-NEXT: store i32 [[TMP4]], ptr addrspace(5) [[TMP0]], align 4
697 ; CHECK-NEXT: [[TMP5:%.*]] = extractvalue [[MULTIPLE_SAME_RETURN_MAYALIAS_ORDER]] [[TMP3]], 1
698 ; CHECK-NEXT: store i32 [[TMP5]], ptr addrspace(5) [[TMP1]], align 4
699 ; CHECK-NEXT: ret void
702 ; CHECK-LABEL: define {{[^@]+}}@store_in_entry_block
703 ; CHECK-SAME: (i1 [[ARG0:%.*]], ptr addrspace(5) [[OUT:%.*]]) #[[ATTR0]] {
705 ; CHECK-NEXT: [[VAL0:%.*]] = load i32, ptr addrspace(1) poison, align 4
706 ; CHECK-NEXT: store i32 [[VAL0]], ptr addrspace(5) [[OUT]], align 4
707 ; CHECK-NEXT: br i1 [[ARG0]], label [[IF:%.*]], label [[ENDIF:%.*]]
709 ; CHECK-NEXT: [[VAL1:%.*]] = load i32, ptr addrspace(1) poison, align 4
710 ; CHECK-NEXT: br label [[ENDIF]]
712 ; CHECK-NEXT: [[PHI:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[VAL1]], [[IF]] ]
713 ; CHECK-NEXT: ret i32 [[PHI]]
716 ; CHECK-LABEL: define {{[^@]+}}@i1_one_out_arg_i32_1_use.body
717 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
718 ; CHECK-NEXT: ret [[I1_ONE_OUT_ARG_I32_1_USE:%.*]] { i1 true, i32 24 }
721 ; CHECK-LABEL: define {{[^@]+}}@i1_one_out_arg_i32_1_use
722 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
723 ; CHECK-NEXT: [[TMP2:%.*]] = call [[I1_ONE_OUT_ARG_I32_1_USE:%.*]] @i1_one_out_arg_i32_1_use.body(ptr addrspace(5) poison)
724 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[I1_ONE_OUT_ARG_I32_1_USE]] [[TMP2]], 1
725 ; CHECK-NEXT: store i32 [[TMP3]], ptr addrspace(5) [[TMP0]], align 4
726 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[I1_ONE_OUT_ARG_I32_1_USE]] [[TMP2]], 0
727 ; CHECK-NEXT: ret i1 [[TMP4]]
730 ; CHECK-LABEL: define {{[^@]+}}@i1_zeroext_one_out_arg_i32_1_use.body
731 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
732 ; CHECK-NEXT: ret [[I1_ZEROEXT_ONE_OUT_ARG_I32_1_USE:%.*]] { i1 true, i32 24 }
735 ; CHECK-LABEL: define {{[^@]+}}@i1_zeroext_one_out_arg_i32_1_use
736 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
737 ; CHECK-NEXT: [[TMP2:%.*]] = call [[I1_ZEROEXT_ONE_OUT_ARG_I32_1_USE:%.*]] @i1_zeroext_one_out_arg_i32_1_use.body(ptr addrspace(5) poison)
738 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[I1_ZEROEXT_ONE_OUT_ARG_I32_1_USE]] [[TMP2]], 1
739 ; CHECK-NEXT: store i32 [[TMP3]], ptr addrspace(5) [[TMP0]], align 4
740 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[I1_ZEROEXT_ONE_OUT_ARG_I32_1_USE]] [[TMP2]], 0
741 ; CHECK-NEXT: ret i1 [[TMP4]]
744 ; CHECK-LABEL: define {{[^@]+}}@i1_signext_one_out_arg_i32_1_use.body
745 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
746 ; CHECK-NEXT: ret [[I1_SIGNEXT_ONE_OUT_ARG_I32_1_USE:%.*]] { i1 true, i32 24 }
749 ; CHECK-LABEL: define {{[^@]+}}@i1_signext_one_out_arg_i32_1_use
750 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
751 ; CHECK-NEXT: [[TMP2:%.*]] = call [[I1_SIGNEXT_ONE_OUT_ARG_I32_1_USE:%.*]] @i1_signext_one_out_arg_i32_1_use.body(ptr addrspace(5) poison)
752 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[I1_SIGNEXT_ONE_OUT_ARG_I32_1_USE]] [[TMP2]], 1
753 ; CHECK-NEXT: store i32 [[TMP3]], ptr addrspace(5) [[TMP0]], align 4
754 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[I1_SIGNEXT_ONE_OUT_ARG_I32_1_USE]] [[TMP2]], 0
755 ; CHECK-NEXT: ret i1 [[TMP4]]
758 ; CHECK-LABEL: define {{[^@]+}}@p1i32_noalias_one_out_arg_i32_1_use.body
759 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
760 ; CHECK-NEXT: ret [[P1I32_NOALIAS_ONE_OUT_ARG_I32_1_USE:%.*]] { ptr addrspace(1) null, i32 24 }
763 ; CHECK-LABEL: define {{[^@]+}}@p1i32_noalias_one_out_arg_i32_1_use
764 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
765 ; CHECK-NEXT: [[TMP2:%.*]] = call [[P1I32_NOALIAS_ONE_OUT_ARG_I32_1_USE:%.*]] @p1i32_noalias_one_out_arg_i32_1_use.body(ptr addrspace(5) poison)
766 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[P1I32_NOALIAS_ONE_OUT_ARG_I32_1_USE]] [[TMP2]], 1
767 ; CHECK-NEXT: store i32 [[TMP3]], ptr addrspace(5) [[TMP0]], align 4
768 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[P1I32_NOALIAS_ONE_OUT_ARG_I32_1_USE]] [[TMP2]], 0
769 ; CHECK-NEXT: ret ptr addrspace(1) [[TMP4]]
772 ; CHECK-LABEL: define {{[^@]+}}@void_one_out_non_private_arg_i32_1_use
773 ; CHECK-SAME: (ptr addrspace(1) [[VAL:%.*]]) #[[ATTR0]] {
774 ; CHECK-NEXT: store i32 0, ptr addrspace(1) [[VAL]], align 4
775 ; CHECK-NEXT: ret void
778 ; CHECK-LABEL: define {{[^@]+}}@func_ptr_type.body
779 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]]) #[[ATTR0]] {
780 ; CHECK-NEXT: [[FUNC:%.*]] = load ptr, ptr poison, align 8
781 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[FUNC_PTR_TYPE:%.*]] poison, ptr [[FUNC]], 0
782 ; CHECK-NEXT: ret [[FUNC_PTR_TYPE]] [[TMP1]]
785 ; CHECK-LABEL: define {{[^@]+}}@func_ptr_type
786 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
787 ; CHECK-NEXT: [[TMP2:%.*]] = call [[FUNC_PTR_TYPE:%.*]] @func_ptr_type.body(ptr addrspace(5) poison)
788 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[FUNC_PTR_TYPE]] [[TMP2]], 0
789 ; CHECK-NEXT: store ptr [[TMP3]], ptr addrspace(5) [[TMP0]], align 8
790 ; CHECK-NEXT: ret void
793 ; CHECK-LABEL: define {{[^@]+}}@bitcast_func_ptr_type.body
794 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]]) #[[ATTR0]] {
795 ; CHECK-NEXT: [[FUNC:%.*]] = load ptr, ptr poison, align 8
796 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_FUNC_PTR_TYPE:%.*]] poison, ptr [[FUNC]], 0
797 ; CHECK-NEXT: ret [[BITCAST_FUNC_PTR_TYPE]] [[TMP1]]
800 ; CHECK-LABEL: define {{[^@]+}}@bitcast_func_ptr_type
801 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
802 ; CHECK-NEXT: [[TMP2:%.*]] = call [[BITCAST_FUNC_PTR_TYPE:%.*]] @bitcast_func_ptr_type.body(ptr addrspace(5) poison)
803 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[BITCAST_FUNC_PTR_TYPE]] [[TMP2]], 0
804 ; CHECK-NEXT: store ptr [[TMP3]], ptr addrspace(5) [[TMP0]], align 8
805 ; CHECK-NEXT: ret void
808 ; CHECK-LABEL: define {{[^@]+}}@out_arg_small_array.body
809 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
810 ; CHECK-NEXT: ret [[OUT_ARG_SMALL_ARRAY:%.*]] { [4 x i32] [i32 0, i32 1, i32 2, i32 3] }
813 ; CHECK-LABEL: define {{[^@]+}}@out_arg_small_array
814 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
815 ; CHECK-NEXT: [[TMP2:%.*]] = call [[OUT_ARG_SMALL_ARRAY:%.*]] @out_arg_small_array.body(ptr addrspace(5) poison)
816 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[OUT_ARG_SMALL_ARRAY]] [[TMP2]], 0
817 ; CHECK-NEXT: store [4 x i32] [[TMP3]], ptr addrspace(5) [[TMP0]], align 4
818 ; CHECK-NEXT: ret void
821 ; CHECK-LABEL: define {{[^@]+}}@out_arg_large_array
822 ; CHECK-SAME: (ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
823 ; CHECK-NEXT: store [17 x i32] zeroinitializer, ptr addrspace(5) [[VAL]], align 4
824 ; CHECK-NEXT: ret void
827 ; CHECK-LABEL: define {{[^@]+}}@num_regs_return_limit
828 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]], i32 [[VAL:%.*]]) #[[ATTR0]] {
829 ; CHECK-NEXT: [[LOAD:%.*]] = load volatile <16 x i32>, ptr addrspace(1) poison, align 64
830 ; CHECK-NEXT: store i32 [[VAL]], ptr addrspace(5) [[OUT]], align 4
831 ; CHECK-NEXT: ret <16 x i32> [[LOAD]]
834 ; CHECK-LABEL: define {{[^@]+}}@num_regs_reach_limit.body
835 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]], i32 [[VAL:%.*]]) #[[ATTR0]] {
836 ; CHECK-NEXT: [[LOAD:%.*]] = load volatile [15 x i32], ptr addrspace(1) poison, align 4
837 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[NUM_REGS_REACH_LIMIT:%.*]] poison, [15 x i32] [[LOAD]], 0
838 ; CHECK-NEXT: [[TMP2:%.*]] = insertvalue [[NUM_REGS_REACH_LIMIT]] [[TMP1]], i32 [[VAL]], 1
839 ; CHECK-NEXT: ret [[NUM_REGS_REACH_LIMIT]] [[TMP2]]
842 ; CHECK-LABEL: define {{[^@]+}}@num_regs_reach_limit
843 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] {
844 ; CHECK-NEXT: [[TMP3:%.*]] = call [[NUM_REGS_REACH_LIMIT:%.*]] @num_regs_reach_limit.body(ptr addrspace(5) poison, i32 [[TMP1]])
845 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[NUM_REGS_REACH_LIMIT]] [[TMP3]], 1
846 ; CHECK-NEXT: store i32 [[TMP4]], ptr addrspace(5) [[TMP0]], align 4
847 ; CHECK-NEXT: [[TMP5:%.*]] = extractvalue [[NUM_REGS_REACH_LIMIT]] [[TMP3]], 0
848 ; CHECK-NEXT: ret [15 x i32] [[TMP5]]
851 ; CHECK-LABEL: define {{[^@]+}}@num_regs_reach_limit_leftover.body
852 ; CHECK-SAME: (ptr addrspace(5) [[OUT0:%.*]], ptr addrspace(5) [[OUT1:%.*]], i32 [[VAL0:%.*]]) #[[ATTR0]] {
853 ; CHECK-NEXT: [[LOAD0:%.*]] = load volatile [15 x i32], ptr addrspace(1) poison, align 4
854 ; CHECK-NEXT: [[LOAD1:%.*]] = load volatile i32, ptr addrspace(1) poison, align 4
855 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[NUM_REGS_REACH_LIMIT_LEFTOVER:%.*]] poison, [15 x i32] [[LOAD0]], 0
856 ; CHECK-NEXT: [[TMP2:%.*]] = insertvalue [[NUM_REGS_REACH_LIMIT_LEFTOVER]] [[TMP1]], i32 [[LOAD1]], 1
857 ; CHECK-NEXT: [[TMP3:%.*]] = insertvalue [[NUM_REGS_REACH_LIMIT_LEFTOVER]] [[TMP2]], i32 [[VAL0]], 2
858 ; CHECK-NEXT: ret [[NUM_REGS_REACH_LIMIT_LEFTOVER]] [[TMP3]]
861 ; CHECK-LABEL: define {{[^@]+}}@num_regs_reach_limit_leftover
862 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], ptr addrspace(5) [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR2]] {
863 ; CHECK-NEXT: [[TMP4:%.*]] = call [[NUM_REGS_REACH_LIMIT_LEFTOVER:%.*]] @num_regs_reach_limit_leftover.body(ptr addrspace(5) poison, ptr addrspace(5) poison, i32 [[TMP2]])
864 ; CHECK-NEXT: [[TMP5:%.*]] = extractvalue [[NUM_REGS_REACH_LIMIT_LEFTOVER]] [[TMP4]], 1
865 ; CHECK-NEXT: store i32 [[TMP5]], ptr addrspace(5) [[TMP0]], align 4
866 ; CHECK-NEXT: [[TMP6:%.*]] = extractvalue [[NUM_REGS_REACH_LIMIT_LEFTOVER]] [[TMP4]], 2
867 ; CHECK-NEXT: store i32 [[TMP6]], ptr addrspace(5) [[TMP1]], align 4
868 ; CHECK-NEXT: [[TMP7:%.*]] = extractvalue [[NUM_REGS_REACH_LIMIT_LEFTOVER]] [[TMP4]], 0
869 ; CHECK-NEXT: ret [15 x i32] [[TMP7]]
872 ; CHECK-LABEL: define {{[^@]+}}@preserve_debug_info.body
873 ; CHECK-SAME: (i32 [[ARG0:%.*]], ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
874 ; CHECK-NEXT: call void @may.clobber(), !dbg [[DBG5:![0-9]+]]
875 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[PRESERVE_DEBUG_INFO:%.*]] poison, i32 [[ARG0]], 0, !dbg [[DBG11:![0-9]+]]
876 ; CHECK-NEXT: ret [[PRESERVE_DEBUG_INFO]] [[TMP1]], !dbg [[DBG11]]
879 ; CHECK-LABEL: define {{[^@]+}}@preserve_debug_info
880 ; CHECK-SAME: (i32 [[TMP0:%.*]], ptr addrspace(5) [[TMP1:%.*]]) #[[ATTR2]] !dbg [[DBG6:![0-9]+]] {
881 ; CHECK-NEXT: [[TMP3:%.*]] = call [[PRESERVE_DEBUG_INFO:%.*]] @preserve_debug_info.body(i32 [[TMP0]], ptr addrspace(5) poison)
882 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[PRESERVE_DEBUG_INFO]] [[TMP3]], 0
883 ; CHECK-NEXT: store i32 [[TMP4]], ptr addrspace(5) [[TMP1]], align 4
884 ; CHECK-NEXT: ret void
887 ; CHECK-LABEL: define {{[^@]+}}@preserve_metadata.body
888 ; CHECK-SAME: (i32 [[ARG0:%.*]], ptr addrspace(5) [[VAL:%.*]]) #[[ATTR0]] {
889 ; CHECK-NEXT: call void @may.clobber()
890 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[PRESERVE_METADATA:%.*]] poison, i32 [[ARG0]], 0
891 ; CHECK-NEXT: ret [[PRESERVE_METADATA]] [[TMP1]]
894 ; CHECK-LABEL: define {{[^@]+}}@preserve_metadata
895 ; CHECK-SAME: (i32 [[TMP0:%.*]], ptr addrspace(5) [[TMP1:%.*]]) #[[ATTR2]] !kernel_arg_access_qual !12 {
896 ; CHECK-NEXT: [[TMP3:%.*]] = call [[PRESERVE_METADATA:%.*]] @preserve_metadata.body(i32 [[TMP0]], ptr addrspace(5) poison)
897 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[PRESERVE_METADATA]] [[TMP3]], 0
898 ; CHECK-NEXT: store i32 [[TMP4]], ptr addrspace(5) [[TMP1]], align 4
899 ; CHECK-NEXT: ret void
902 ; CHECK-LABEL: define {{[^@]+}}@bitcast_pointer_v4i32_v3i32.body
903 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]]) #[[ATTR0]] {
904 ; CHECK-NEXT: [[LOAD:%.*]] = load volatile <4 x i32>, ptr addrspace(1) poison, align 16
905 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_POINTER_V4I32_V3I32:%.*]] poison, <4 x i32> [[LOAD]], 0
906 ; CHECK-NEXT: ret [[BITCAST_POINTER_V4I32_V3I32]] [[TMP1]]
909 ; CHECK-LABEL: define {{[^@]+}}@bitcast_pointer_v4i32_v3i32
910 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
911 ; CHECK-NEXT: [[TMP2:%.*]] = call [[BITCAST_POINTER_V4I32_V3I32:%.*]] @bitcast_pointer_v4i32_v3i32.body(ptr addrspace(5) poison)
912 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[BITCAST_POINTER_V4I32_V3I32]] [[TMP2]], 0
913 ; CHECK-NEXT: store <4 x i32> [[TMP3]], ptr addrspace(5) [[TMP0]], align 16
914 ; CHECK-NEXT: ret void
917 ; CHECK-LABEL: define {{[^@]+}}@bitcast_pointer_v4i32_v3f32.body
918 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]]) #[[ATTR0]] {
919 ; CHECK-NEXT: [[LOAD:%.*]] = load volatile <4 x i32>, ptr addrspace(1) poison, align 16
920 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_POINTER_V4I32_V3F32:%.*]] poison, <4 x i32> [[LOAD]], 0
921 ; CHECK-NEXT: ret [[BITCAST_POINTER_V4I32_V3F32]] [[TMP1]]
924 ; CHECK-LABEL: define {{[^@]+}}@bitcast_pointer_v4i32_v3f32
925 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
926 ; CHECK-NEXT: [[TMP2:%.*]] = call [[BITCAST_POINTER_V4I32_V3F32:%.*]] @bitcast_pointer_v4i32_v3f32.body(ptr addrspace(5) poison)
927 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[BITCAST_POINTER_V4I32_V3F32]] [[TMP2]], 0
928 ; CHECK-NEXT: store <4 x i32> [[TMP3]], ptr addrspace(5) [[TMP0]], align 16
929 ; CHECK-NEXT: ret void
932 ; CHECK-LABEL: define {{[^@]+}}@bitcast_pointer_i32_f32.body
933 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]]) #[[ATTR0]] {
934 ; CHECK-NEXT: [[LOAD:%.*]] = load volatile i32, ptr addrspace(1) poison, align 4
935 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_POINTER_I32_F32:%.*]] poison, i32 [[LOAD]], 0
936 ; CHECK-NEXT: ret [[BITCAST_POINTER_I32_F32]] [[TMP1]]
939 ; CHECK-LABEL: define {{[^@]+}}@bitcast_pointer_i32_f32
940 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
941 ; CHECK-NEXT: [[TMP2:%.*]] = call [[BITCAST_POINTER_I32_F32:%.*]] @bitcast_pointer_i32_f32.body(ptr addrspace(5) poison)
942 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[BITCAST_POINTER_I32_F32]] [[TMP2]], 0
943 ; CHECK-NEXT: store i32 [[TMP3]], ptr addrspace(5) [[TMP0]], align 4
944 ; CHECK-NEXT: ret void
947 ; CHECK-LABEL: define {{[^@]+}}@bitcast_pointer_i32_f16.body
948 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]]) #[[ATTR0]] {
949 ; CHECK-NEXT: [[LOAD:%.*]] = load volatile i32, ptr addrspace(1) poison, align 4
950 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_POINTER_I32_F16:%.*]] poison, i32 [[LOAD]], 0
951 ; CHECK-NEXT: ret [[BITCAST_POINTER_I32_F16]] [[TMP1]]
954 ; CHECK-LABEL: define {{[^@]+}}@bitcast_pointer_i32_f16
955 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
956 ; CHECK-NEXT: [[TMP2:%.*]] = call [[BITCAST_POINTER_I32_F16:%.*]] @bitcast_pointer_i32_f16.body(ptr addrspace(5) poison)
957 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[BITCAST_POINTER_I32_F16]] [[TMP2]], 0
958 ; CHECK-NEXT: store i32 [[TMP3]], ptr addrspace(5) [[TMP0]], align 4
959 ; CHECK-NEXT: ret void
962 ; CHECK-LABEL: define {{[^@]+}}@bitcast_pointer_f16_i32.body
963 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]]) #[[ATTR0]] {
964 ; CHECK-NEXT: [[LOAD:%.*]] = load volatile half, ptr addrspace(1) poison, align 2
965 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_POINTER_F16_I32:%.*]] poison, half [[LOAD]], 0
966 ; CHECK-NEXT: ret [[BITCAST_POINTER_F16_I32]] [[TMP1]]
969 ; CHECK-LABEL: define {{[^@]+}}@bitcast_pointer_f16_i32
970 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]]) #[[ATTR2]] {
971 ; CHECK-NEXT: [[TMP2:%.*]] = call [[BITCAST_POINTER_F16_I32:%.*]] @bitcast_pointer_f16_i32.body(ptr addrspace(5) poison)
972 ; CHECK-NEXT: [[TMP3:%.*]] = extractvalue [[BITCAST_POINTER_F16_I32]] [[TMP2]], 0
973 ; CHECK-NEXT: store half [[TMP3]], ptr addrspace(5) [[TMP0]], align 2
974 ; CHECK-NEXT: ret void
977 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v3f32_v3f32.body
978 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]], <3 x float> [[VALUE:%.*]]) #[[ATTR0]] {
979 ; CHECK-NEXT: [[EXTRACTVEC:%.*]] = shufflevector <3 x float> [[VALUE]], <3 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
980 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_STRUCT_V3F32_V3F32:%.*]] poison, <4 x float> [[EXTRACTVEC]], 0
981 ; CHECK-NEXT: ret [[BITCAST_STRUCT_V3F32_V3F32]] [[TMP1]]
984 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v3f32_v3f32
985 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], <3 x float> [[TMP1:%.*]]) #[[ATTR2]] {
986 ; CHECK-NEXT: [[TMP3:%.*]] = call [[BITCAST_STRUCT_V3F32_V3F32:%.*]] @bitcast_struct_v3f32_v3f32.body(ptr addrspace(5) poison, <3 x float> [[TMP1]])
987 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[BITCAST_STRUCT_V3F32_V3F32]] [[TMP3]], 0
988 ; CHECK-NEXT: store <4 x float> [[TMP4]], ptr addrspace(5) [[TMP0]], align 16
989 ; CHECK-NEXT: ret void
992 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v3f32_v3i32.body
993 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]], <3 x i32> [[VALUE:%.*]]) #[[ATTR0]] {
994 ; CHECK-NEXT: [[EXTRACTVEC:%.*]] = shufflevector <3 x i32> [[VALUE]], <3 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
995 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_STRUCT_V3F32_V3I32:%.*]] poison, <4 x i32> [[EXTRACTVEC]], 0
996 ; CHECK-NEXT: ret [[BITCAST_STRUCT_V3F32_V3I32]] [[TMP1]]
999 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v3f32_v3i32
1000 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], <3 x i32> [[TMP1:%.*]]) #[[ATTR2]] {
1001 ; CHECK-NEXT: [[TMP3:%.*]] = call [[BITCAST_STRUCT_V3F32_V3I32:%.*]] @bitcast_struct_v3f32_v3i32.body(ptr addrspace(5) poison, <3 x i32> [[TMP1]])
1002 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[BITCAST_STRUCT_V3F32_V3I32]] [[TMP3]], 0
1003 ; CHECK-NEXT: store <4 x i32> [[TMP4]], ptr addrspace(5) [[TMP0]], align 16
1004 ; CHECK-NEXT: ret void
1007 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v4f32_v4f32.body
1008 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]], <4 x float> [[VALUE:%.*]]) #[[ATTR0]] {
1009 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_STRUCT_V4F32_V4F32:%.*]] poison, <4 x float> [[VALUE]], 0
1010 ; CHECK-NEXT: ret [[BITCAST_STRUCT_V4F32_V4F32]] [[TMP1]]
1013 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v4f32_v4f32
1014 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], <4 x float> [[TMP1:%.*]]) #[[ATTR2]] {
1015 ; CHECK-NEXT: [[TMP3:%.*]] = call [[BITCAST_STRUCT_V4F32_V4F32:%.*]] @bitcast_struct_v4f32_v4f32.body(ptr addrspace(5) poison, <4 x float> [[TMP1]])
1016 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[BITCAST_STRUCT_V4F32_V4F32]] [[TMP3]], 0
1017 ; CHECK-NEXT: store <4 x float> [[TMP4]], ptr addrspace(5) [[TMP0]], align 16
1018 ; CHECK-NEXT: ret void
1021 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v3f32_v4i32.body
1022 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]], <4 x i32> [[VALUE:%.*]]) #[[ATTR0]] {
1023 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_STRUCT_V3F32_V4I32:%.*]] poison, <4 x i32> [[VALUE]], 0
1024 ; CHECK-NEXT: ret [[BITCAST_STRUCT_V3F32_V4I32]] [[TMP1]]
1027 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v3f32_v4i32
1028 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], <4 x i32> [[TMP1:%.*]]) #[[ATTR2]] {
1029 ; CHECK-NEXT: [[TMP3:%.*]] = call [[BITCAST_STRUCT_V3F32_V4I32:%.*]] @bitcast_struct_v3f32_v4i32.body(ptr addrspace(5) poison, <4 x i32> [[TMP1]])
1030 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[BITCAST_STRUCT_V3F32_V4I32]] [[TMP3]], 0
1031 ; CHECK-NEXT: store <4 x i32> [[TMP4]], ptr addrspace(5) [[TMP0]], align 16
1032 ; CHECK-NEXT: ret void
1035 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v4f32_v3f32.body
1036 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]], <3 x float> [[VALUE:%.*]]) #[[ATTR0]] {
1037 ; CHECK-NEXT: [[EXTRACTVEC:%.*]] = shufflevector <3 x float> [[VALUE]], <3 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
1038 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_STRUCT_V4F32_V3F32:%.*]] poison, <4 x float> [[EXTRACTVEC]], 0
1039 ; CHECK-NEXT: ret [[BITCAST_STRUCT_V4F32_V3F32]] [[TMP1]]
1042 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v4f32_v3f32
1043 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], <3 x float> [[TMP1:%.*]]) #[[ATTR2]] {
1044 ; CHECK-NEXT: [[TMP3:%.*]] = call [[BITCAST_STRUCT_V4F32_V3F32:%.*]] @bitcast_struct_v4f32_v3f32.body(ptr addrspace(5) poison, <3 x float> [[TMP1]])
1045 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[BITCAST_STRUCT_V4F32_V3F32]] [[TMP3]], 0
1046 ; CHECK-NEXT: store <4 x float> [[TMP4]], ptr addrspace(5) [[TMP0]], align 16
1047 ; CHECK-NEXT: ret void
1050 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v3f32_v2f32.body
1051 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]], <2 x float> [[VALUE:%.*]]) #[[ATTR0]] {
1052 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_STRUCT_V3F32_V2F32:%.*]] poison, <2 x float> [[VALUE]], 0
1053 ; CHECK-NEXT: ret [[BITCAST_STRUCT_V3F32_V2F32]] [[TMP1]]
1056 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v3f32_v2f32
1057 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], <2 x float> [[TMP1:%.*]]) #[[ATTR2]] {
1058 ; CHECK-NEXT: [[TMP3:%.*]] = call [[BITCAST_STRUCT_V3F32_V2F32:%.*]] @bitcast_struct_v3f32_v2f32.body(ptr addrspace(5) poison, <2 x float> [[TMP1]])
1059 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[BITCAST_STRUCT_V3F32_V2F32]] [[TMP3]], 0
1060 ; CHECK-NEXT: store <2 x float> [[TMP4]], ptr addrspace(5) [[TMP0]], align 8
1061 ; CHECK-NEXT: ret void
1064 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v3f32_f32_v3f32.body
1065 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]], <3 x float> [[VALUE:%.*]]) #[[ATTR0]] {
1066 ; CHECK-NEXT: [[EXTRACTVEC:%.*]] = shufflevector <3 x float> [[VALUE]], <3 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
1067 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_STRUCT_V3F32_F32_V3F32:%.*]] poison, <4 x float> [[EXTRACTVEC]], 0
1068 ; CHECK-NEXT: ret [[BITCAST_STRUCT_V3F32_F32_V3F32]] [[TMP1]]
1071 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v3f32_f32_v3f32
1072 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], <3 x float> [[TMP1:%.*]]) #[[ATTR2]] {
1073 ; CHECK-NEXT: [[TMP3:%.*]] = call [[BITCAST_STRUCT_V3F32_F32_V3F32:%.*]] @bitcast_struct_v3f32_f32_v3f32.body(ptr addrspace(5) poison, <3 x float> [[TMP1]])
1074 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[BITCAST_STRUCT_V3F32_F32_V3F32]] [[TMP3]], 0
1075 ; CHECK-NEXT: store <4 x float> [[TMP4]], ptr addrspace(5) [[TMP0]], align 16
1076 ; CHECK-NEXT: ret void
1079 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v3f32_f32_v4f32.body
1080 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]], <4 x float> [[VALUE:%.*]]) #[[ATTR0]] {
1081 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_STRUCT_V3F32_F32_V4F32:%.*]] poison, <4 x float> [[VALUE]], 0
1082 ; CHECK-NEXT: ret [[BITCAST_STRUCT_V3F32_F32_V4F32]] [[TMP1]]
1085 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_v3f32_f32_v4f32
1086 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], <4 x float> [[TMP1:%.*]]) #[[ATTR2]] {
1087 ; CHECK-NEXT: [[TMP3:%.*]] = call [[BITCAST_STRUCT_V3F32_F32_V4F32:%.*]] @bitcast_struct_v3f32_f32_v4f32.body(ptr addrspace(5) poison, <4 x float> [[TMP1]])
1088 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[BITCAST_STRUCT_V3F32_F32_V4F32]] [[TMP3]], 0
1089 ; CHECK-NEXT: store <4 x float> [[TMP4]], ptr addrspace(5) [[TMP0]], align 16
1090 ; CHECK-NEXT: ret void
1093 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_i128_v4f32.body
1094 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]], <4 x float> [[VALUE:%.*]]) #[[ATTR0]] {
1095 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_STRUCT_I128_V4F32:%.*]] poison, <4 x float> [[VALUE]], 0
1096 ; CHECK-NEXT: ret [[BITCAST_STRUCT_I128_V4F32]] [[TMP1]]
1099 ; CHECK-LABEL: define {{[^@]+}}@bitcast_struct_i128_v4f32
1100 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], <4 x float> [[TMP1:%.*]]) #[[ATTR2]] {
1101 ; CHECK-NEXT: [[TMP3:%.*]] = call [[BITCAST_STRUCT_I128_V4F32:%.*]] @bitcast_struct_i128_v4f32.body(ptr addrspace(5) poison, <4 x float> [[TMP1]])
1102 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[BITCAST_STRUCT_I128_V4F32]] [[TMP3]], 0
1103 ; CHECK-NEXT: store <4 x float> [[TMP4]], ptr addrspace(5) [[TMP0]], align 16
1104 ; CHECK-NEXT: ret void
1107 ; CHECK-LABEL: define {{[^@]+}}@bitcast_array_v4i32_v4f32.body
1108 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]], [4 x float] [[VALUE:%.*]]) #[[ATTR0]] {
1109 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_ARRAY_V4I32_V4F32:%.*]] poison, [4 x float] [[VALUE]], 0
1110 ; CHECK-NEXT: ret [[BITCAST_ARRAY_V4I32_V4F32]] [[TMP1]]
1113 ; CHECK-LABEL: define {{[^@]+}}@bitcast_array_v4i32_v4f32
1114 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], [4 x float] [[TMP1:%.*]]) #[[ATTR2]] {
1115 ; CHECK-NEXT: [[TMP3:%.*]] = call [[BITCAST_ARRAY_V4I32_V4F32:%.*]] @bitcast_array_v4i32_v4f32.body(ptr addrspace(5) poison, [4 x float] [[TMP1]])
1116 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[BITCAST_ARRAY_V4I32_V4F32]] [[TMP3]], 0
1117 ; CHECK-NEXT: store [4 x float] [[TMP4]], ptr addrspace(5) [[TMP0]], align 4
1118 ; CHECK-NEXT: ret void
1121 ; CHECK-LABEL: define {{[^@]+}}@multi_return_bitcast_struct_v3f32_v3f32.body
1122 ; CHECK-SAME: (i1 [[COND:%.*]], ptr addrspace(5) [[OUT:%.*]], <3 x float> [[VALUE:%.*]]) #[[ATTR0]] {
1123 ; CHECK-NEXT: entry:
1124 ; CHECK-NEXT: br i1 [[COND]], label [[RET0:%.*]], label [[RET1:%.*]]
1126 ; CHECK-NEXT: [[EXTRACTVEC:%.*]] = shufflevector <3 x float> [[VALUE]], <3 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
1127 ; CHECK-NEXT: [[TMP0:%.*]] = insertvalue [[MULTI_RETURN_BITCAST_STRUCT_V3F32_V3F32:%.*]] poison, <4 x float> [[EXTRACTVEC]], 0
1128 ; CHECK-NEXT: ret [[MULTI_RETURN_BITCAST_STRUCT_V3F32_V3F32]] [[TMP0]]
1130 ; CHECK-NEXT: [[LOAD:%.*]] = load <4 x float>, ptr addrspace(1) poison, align 16
1131 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[MULTI_RETURN_BITCAST_STRUCT_V3F32_V3F32]] poison, <4 x float> [[LOAD]], 0
1132 ; CHECK-NEXT: ret [[MULTI_RETURN_BITCAST_STRUCT_V3F32_V3F32]] [[TMP1]]
1135 ; CHECK-LABEL: define {{[^@]+}}@multi_return_bitcast_struct_v3f32_v3f32
1136 ; CHECK-SAME: (i1 [[TMP0:%.*]], ptr addrspace(5) [[TMP1:%.*]], <3 x float> [[TMP2:%.*]]) #[[ATTR2]] {
1137 ; CHECK-NEXT: [[TMP4:%.*]] = call [[MULTI_RETURN_BITCAST_STRUCT_V3F32_V3F32:%.*]] @multi_return_bitcast_struct_v3f32_v3f32.body(i1 [[TMP0]], ptr addrspace(5) poison, <3 x float> [[TMP2]])
1138 ; CHECK-NEXT: [[TMP5:%.*]] = extractvalue [[MULTI_RETURN_BITCAST_STRUCT_V3F32_V3F32]] [[TMP4]], 0
1139 ; CHECK-NEXT: store <4 x float> [[TMP5]], ptr addrspace(5) [[TMP1]], align 16
1140 ; CHECK-NEXT: ret void
1143 ; CHECK-LABEL: define {{[^@]+}}@bitcast_v3f32_struct_v3f32.body
1144 ; CHECK-SAME: (ptr addrspace(5) [[OUT:%.*]], [[STRUCT_V3F32:%.*]] [[VALUE:%.*]]) #[[ATTR0]] {
1145 ; CHECK-NEXT: [[TMP1:%.*]] = insertvalue [[BITCAST_V3F32_STRUCT_V3F32:%.*]] poison, [[STRUCT_V3F32]] [[VALUE]], 0
1146 ; CHECK-NEXT: ret [[BITCAST_V3F32_STRUCT_V3F32]] [[TMP1]]
1149 ; CHECK-LABEL: define {{[^@]+}}@bitcast_v3f32_struct_v3f32
1150 ; CHECK-SAME: (ptr addrspace(5) [[TMP0:%.*]], [[STRUCT_V3F32:%.*]] [[TMP1:%.*]]) #[[ATTR2]] {
1151 ; CHECK-NEXT: [[TMP3:%.*]] = call [[BITCAST_V3F32_STRUCT_V3F32:%.*]] @bitcast_v3f32_struct_v3f32.body(ptr addrspace(5) poison, [[STRUCT_V3F32]] [[TMP1]])
1152 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue [[BITCAST_V3F32_STRUCT_V3F32]] [[TMP3]], 0
1153 ; CHECK-NEXT: store [[STRUCT_V3F32]] [[TMP4]], ptr addrspace(5) [[TMP0]], align 16
1154 ; CHECK-NEXT: ret void