1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-attributes --check-globals --include-generated-funcs
2 ; RUN: opt -passes=openmp-opt -S < %s | FileCheck %s --check-prefixes=CHECK
4 @_ZN4ompx5state9TeamStateE = internal addrspace(3) global ptr undef
6 define internal fastcc i1 @__kmpc_kernel_parallel() {
8 %i = load ptr, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 16
9 %i1 = icmp eq ptr %i, null
13 define weak_odr amdgpu_kernel void @__omp_offloading_16_2e1d69__ZN11qmcplusplus7ompBLAS9gemv_implIfEEiRiciiT_PKS3_iS5_iS3_PS3_i_l44() #1 {
16 %i31 = call fastcc i1 @__kmpc_kernel_parallel()
18 store ptr @use, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 16
20 store ptr null, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 16
22 call void @use(i1 %i31)
27 declare void @barrier() nocallback
29 attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
30 attributes #1 = { "kernel" }
32 !llvm.module.flags = !{!0, !1}
34 !0 = !{i32 7, !"openmp", i32 50}
35 !1 = !{i32 7, !"openmp-device", i32 50}
37 ; CHECK: @_ZN4ompx5state9TeamStateE = internal addrspace(3) global ptr undef
39 ; CHECK: Function Attrs: norecurse nosync nounwind memory(read)
40 ; CHECK-LABEL: define {{[^@]+}}@__kmpc_kernel_parallel
41 ; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
43 ; CHECK-NEXT: [[I:%.*]] = load ptr, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 16
44 ; CHECK-NEXT: [[I1:%.*]] = icmp eq ptr [[I]], null
45 ; CHECK-NEXT: ret i1 [[I1]]
48 ; CHECK-LABEL: define {{[^@]+}}@__omp_offloading_16_2e1d69__ZN11qmcplusplus7ompBLAS9gemv_implIfEEiRiciiT_PKS3_iS5_iS3_PS3_i_l44
49 ; CHECK-SAME: () #[[ATTR1:[0-9]+]] {
51 ; CHECK-NEXT: call void @barrier()
52 ; CHECK-NEXT: [[I31:%.*]] = call fastcc i1 @__kmpc_kernel_parallel()
53 ; CHECK-NEXT: call void @barrier()
54 ; CHECK-NEXT: store ptr @use, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 16
55 ; CHECK-NEXT: call void @barrier()
56 ; CHECK-NEXT: store ptr null, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 16
57 ; CHECK-NEXT: call void @barrier()
58 ; CHECK-NEXT: call void @use(i1 [[I31]])
59 ; CHECK-NEXT: ret void
62 ; CHECK: attributes #[[ATTR0]] = { norecurse nosync nounwind memory(read) }
63 ; CHECK: attributes #[[ATTR1]] = { "kernel" }
64 ; CHECK: attributes #[[ATTR2:[0-9]+]] = { nocallback }
65 ; CHECK: attributes #[[ATTR3:[0-9]+]] = { nosync nounwind memory(read) }
67 ; CHECK: [[META0:![0-9]+]] = !{i32 7, !"openmp", i32 50}
68 ; CHECK: [[META1:![0-9]+]] = !{i32 7, !"openmp-device", i32 50}