diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
commit | 676fbe8105eeb6ff4bb2ed261cb212fcfdbe7b63 (patch) | |
tree | 02a1ac369cb734d0abfa5000dd86e5b7797e6a74 /test/OpenMP/declare_target_codegen_globalization.cpp | |
parent | c7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (diff) |
Notes
Diffstat (limited to 'test/OpenMP/declare_target_codegen_globalization.cpp')
-rw-r--r-- | test/OpenMP/declare_target_codegen_globalization.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/test/OpenMP/declare_target_codegen_globalization.cpp b/test/OpenMP/declare_target_codegen_globalization.cpp index 7ef4f8af3deca..06d7e5ce64565 100644 --- a/test/OpenMP/declare_target_codegen_globalization.cpp +++ b/test/OpenMP/declare_target_codegen_globalization.cpp @@ -10,7 +10,7 @@ int bar() { } // CHECK: define weak void @__omp_offloading_{{.*}}maini1{{.*}}_l[[@LINE+5]](i32* dereferenceable{{.*}}) -// CHECK-NOT: @__kmpc_data_sharing_push_stack +// CHECK-NOT: @__kmpc_data_sharing_coalesced_push_stack int maini1() { int a; @@ -24,7 +24,7 @@ int maini1() { // parallel region // CHECK: define {{.*}}void @{{.*}}(i32* noalias {{.*}}, i32* noalias {{.*}}, i32* dereferenceable{{.*}}) -// CHECK-NOT: call i8* @__kmpc_data_sharing_push_stack( +// CHECK-NOT: call i8* @__kmpc_data_sharing_coalesced_push_stack( // CHECK: [[B_ADDR:%.+]] = alloca i32, // CHECK: call {{.*}}[[FOO:@.*foo.*]](i32* dereferenceable{{.*}} [[B_ADDR]]) // CHECK: call {{.*}}[[BAR:@.*bar.*]]() @@ -32,12 +32,27 @@ int maini1() { // CHECK: ret void // CHECK: define {{.*}}[[FOO]](i32* dereferenceable{{.*}}) -// CHECK-NOT: @__kmpc_data_sharing_push_stack +// CHECK-NOT: @__kmpc_data_sharing_coalesced_push_stack // CHECK: define {{.*}}[[BAR]]() -// CHECK: [[RES:%.+]] = call i8* @__kmpc_data_sharing_push_stack(i64 4, i16 0) -// CHECK: [[GLOBALS:%.+]] = bitcast i8* [[RES]] to [[GLOBAL_ST:%struct[.].*]]* -// CHECK: [[A_ADDR:%.+]] = getelementptr inbounds [[GLOBAL_ST]], [[GLOBAL_ST]]* [[GLOBALS]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 +// CHECK: alloca i32, +// CHECK: [[A_LOCAL_ADDR:%.+]] = alloca i32, +// CHECK: [[RES:%.+]] = call i8 @__kmpc_is_spmd_exec_mode() +// CHECK: [[IS_SPMD:%.+]] = icmp ne i8 [[RES]], 0 +// CHECK: br i1 [[IS_SPMD]], label +// CHECK: br label +// CHECK: [[RES:%.+]] = call i8* @__kmpc_data_sharing_coalesced_push_stack(i64 128, i16 0) +// CHECK: [[GLOBALS:%.+]] = bitcast i8* [[RES]] to [[GLOBAL_ST:%.+]]* +// CHECK: br label +// CHECK: [[ITEMS:%.+]] = phi [[GLOBAL_ST]]* [ null, {{.+}} ], [ [[GLOBALS]], {{.+}} ] +// CHECK: [[A_ADDR:%.+]] = getelementptr inbounds [[GLOBAL_ST]], [[GLOBAL_ST]]* [[ITEMS]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 +// CHECK: [[TID:%.+]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() +// CHECK: [[LID:%.+]] = and i32 [[TID]], 31 +// CHECK: [[A_GLOBAL_ADDR:%.+]] = getelementptr inbounds [32 x i32], [32 x i32]* [[A_ADDR]], i32 0, i32 [[LID]] +// CHECK: [[A_ADDR:%.+]] = select i1 [[IS_SPMD]], i32* [[A_LOCAL_ADDR]], i32* [[A_GLOBAL_ADDR]] // CHECK: call {{.*}}[[FOO]](i32* dereferenceable{{.*}} [[A_ADDR]]) -// CHECK: call void @__kmpc_data_sharing_pop_stack(i8* [[RES]]) +// CHECK: br i1 [[IS_SPMD]], label +// CHECK: [[BC:%.+]] = bitcast [[GLOBAL_ST]]* [[ITEMS]] to i8* +// CHECK: call void @__kmpc_data_sharing_pop_stack(i8* [[BC]]) +// CHECK: br label // CHECK: ret i32 |