summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2018-12-04 15:25:01 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2018-12-04 15:25:01 +0000
commit2c1ff9dda762e010075f429e18ce1c499f1f4d0e (patch)
treebc7d2419d792a1f031e19134b2038c677d1f0f4c /clang/test/OpenMP
parentc3028cac2462ec22f695ac673b5980be411abf41 (diff)
downloadbcm5719-llvm-2c1ff9dda762e010075f429e18ce1c499f1f4d0e.tar.gz
bcm5719-llvm-2c1ff9dda762e010075f429e18ce1c499f1f4d0e.zip
[OPENMP][NVPTX]Fixed emission of the critical region.
Critical regions in NVPTX are the constructs, which, generally speaking, are not supported by the NVPTX target. Instead we're using special technique to handle the critical regions. Currently they are supported only within the loop and all the threads in the loop must execute the same critical region. Inside of this special regions the regions still must be emitted as critical, to avoid possible data races between the teams + synchronization must use __kmpc_barrier functions. llvm-svn: 348272
Diffstat (limited to 'clang/test/OpenMP')
-rw-r--r--clang/test/OpenMP/nvptx_parallel_codegen.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/test/OpenMP/nvptx_parallel_codegen.cpp b/clang/test/OpenMP/nvptx_parallel_codegen.cpp
index 08431fccc00..3dcf3301798 100644
--- a/clang/test/OpenMP/nvptx_parallel_codegen.cpp
+++ b/clang/test/OpenMP/nvptx_parallel_codegen.cpp
@@ -356,7 +356,13 @@ int bar(int n){
// CHECK: [[RES:%.+]] = icmp eq i32 [[TID]], [[CC_VAL]]
// CHECK: br i1 [[RES]], label
-// CHECK: call void @llvm.nvvm.barrier0()
+// CHECK: call void @__kmpc_critical(
+// CHECK: load i32, i32*
+// CHECK: add nsw i32
+// CHECK: store i32
+// CHECK: call void @__kmpc_end_critical(
+
+// CHECK: call void @__kmpc_barrier(%struct.ident_t* @{{.+}}, i32 %{{.+}})
// CHECK: [[NEW_CC_VAL:%.+]] = add nsw i32 [[CC_VAL]], 1
// CHECK: store i32 [[NEW_CC_VAL]], i32* [[CC]],
// CHECK: br label
OpenPOWER on IntegriCloud