diff options
Diffstat (limited to 'test/OpenMP/nvptx_data_sharing.cpp')
-rw-r--r-- | test/OpenMP/nvptx_data_sharing.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/test/OpenMP/nvptx_data_sharing.cpp b/test/OpenMP/nvptx_data_sharing.cpp index 0acb119915279..7b21d827941c7 100644 --- a/test/OpenMP/nvptx_data_sharing.cpp +++ b/test/OpenMP/nvptx_data_sharing.cpp @@ -26,10 +26,15 @@ void test_ds(){ } } } +// CK1: [[MEM_TY:%.+]] = type { [128 x i8] } +// CK1-DAG: [[SHARED_GLOBAL_RD:@.+]] = common addrspace(3) global [[MEM_TY]] zeroinitializer +// CK1-DAG: [[KERNEL_PTR:@.+]] = internal addrspace(3) global i8* null +// CK1-DAG: [[KERNEL_SIZE:@.+]] = internal unnamed_addr constant i64 8 +// CK1-DAG: [[KERNEL_SHARED:@.+]] = internal unnamed_addr constant i16 1 /// ========= In the worker function ========= /// // CK1: {{.*}}define internal void @__omp_offloading{{.*}}test_ds{{.*}}_worker() -// CK1: call void @llvm.nvvm.barrier0() +// CK1: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CK1-NOT: call void @__kmpc_data_sharing_init_stack /// ========= In the kernel function ========= /// @@ -39,7 +44,11 @@ void test_ds(){ // CK1: [[SHAREDARGS2:%.+]] = alloca i8** // CK1: call void @__kmpc_kernel_init // CK1: call void @__kmpc_data_sharing_init_stack -// CK1: [[GLOBALSTACK:%.+]] = call i8* @__kmpc_data_sharing_push_stack(i64 8, i16 0) +// CK1: [[SHARED_MEM_FLAG:%.+]] = load i16, i16* [[KERNEL_SHARED]], +// CK1: [[SIZE:%.+]] = load i64, i64* [[KERNEL_SIZE]], +// CK1: call void @__kmpc_get_team_static_memory(i16 0, i8* addrspacecast (i8 addrspace(3)* getelementptr inbounds ([[MEM_TY]], [[MEM_TY]] addrspace(3)* [[SHARED_GLOBAL_RD]], i32 0, i32 0, i32 0) to i8*), i64 [[SIZE]], i16 [[SHARED_MEM_FLAG]], i8** addrspacecast (i8* addrspace(3)* [[KERNEL_PTR]] to i8**)) +// CK1: [[KERNEL_RD:%.+]] = load i8*, i8* addrspace(3)* [[KERNEL_PTR]], +// CK1: [[GLOBALSTACK:%.+]] = getelementptr inbounds i8, i8* [[KERNEL_RD]], i64 0 // CK1: [[GLOBALSTACK2:%.+]] = bitcast i8* [[GLOBALSTACK]] to %struct._globalized_locals_ty* // CK1: [[A:%.+]] = getelementptr inbounds %struct._globalized_locals_ty, %struct._globalized_locals_ty* [[GLOBALSTACK2]], i32 0, i32 0 // CK1: [[B:%.+]] = getelementptr inbounds %struct._globalized_locals_ty, %struct._globalized_locals_ty* [[GLOBALSTACK2]], i32 0, i32 1 @@ -50,8 +59,8 @@ void test_ds(){ // CK1: [[SHARGSTMP2:%.+]] = getelementptr inbounds i8*, i8** [[SHARGSTMP1]], i64 0 // CK1: [[SHAREDVAR:%.+]] = bitcast i32* [[A]] to i8* // CK1: store i8* [[SHAREDVAR]], i8** [[SHARGSTMP2]] -// CK1: call void @llvm.nvvm.barrier0() -// CK1: call void @llvm.nvvm.barrier0() +// CK1: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) +// CK1: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CK1: call void @__kmpc_end_sharing_variables() // CK1: store i32 100, i32* [[B]] // CK1: call void @__kmpc_kernel_prepare_parallel({{.*}}, i16 1) @@ -63,10 +72,11 @@ void test_ds(){ // CK1: [[SHARGSTMP12:%.+]] = getelementptr inbounds i8*, i8** [[SHARGSTMP3]], i64 1 // CK1: [[SHAREDVAR2:%.+]] = bitcast i32* [[A]] to i8* // CK1: store i8* [[SHAREDVAR2]], i8** [[SHARGSTMP12]] -// CK1: call void @llvm.nvvm.barrier0() -// CK1: call void @llvm.nvvm.barrier0() +// CK1: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) +// CK1: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CK1: call void @__kmpc_end_sharing_variables() -// CK1: call void @__kmpc_data_sharing_pop_stack(i8* [[GLOBALSTACK]]) +// CK1: [[SHARED_MEM_FLAG:%.+]] = load i16, i16* [[KERNEL_SHARED]], +// CK1: call void @__kmpc_restore_team_static_memory(i16 0, i16 [[SHARED_MEM_FLAG]]) // CK1: call void @__kmpc_kernel_deinit(i16 1) /// ========= In the data sharing wrapper function ========= /// |