diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-03-30 04:30:22 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-03-30 04:30:22 +0000 |
commit | f268568447067410bb7c5e0b8674cd197325c179 (patch) | |
tree | 6dc83bfcea38baf41912ea760b068d31b52db900 /clang/test/OpenMP/sections_codegen.cpp | |
parent | e3526025175a69ef919934fd4a84dac524948f78 (diff) | |
download | bcm5719-llvm-f268568447067410bb7c5e0b8674cd197325c179.tar.gz bcm5719-llvm-f268568447067410bb7c5e0b8674cd197325c179.zip |
[OPENMP] Improved codegen for implicit/explicit 'barrier' constructs.
Replace boolean IsExplicit parameter of OpenMPRuntime::emitBarrierCall() method by OpenMPDirectiveKind Kind for better compatibility with the runtime library. Also add processing of 'nowait' clause on worksharing directives.
Differential Revision: http://reviews.llvm.org/D8659
llvm-svn: 233511
Diffstat (limited to 'clang/test/OpenMP/sections_codegen.cpp')
-rw-r--r-- | clang/test/OpenMP/sections_codegen.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/clang/test/OpenMP/sections_codegen.cpp b/clang/test/OpenMP/sections_codegen.cpp index 9485d9ffe20..e385550e883 100644 --- a/clang/test/OpenMP/sections_codegen.cpp +++ b/clang/test/OpenMP/sections_codegen.cpp @@ -5,7 +5,8 @@ #ifndef HEADER #define HEADER - +// CHECK: [[IMPLICIT_BARRIER_SECTIONS_LOC:@.+]] = private unnamed_addr constant %{{.+}} { i32 0, i32 194, i32 0, i32 0, i8* +// CHECK: [[IMPLICIT_BARRIER_SINGLE_LOC:@.+]] = private unnamed_addr constant %{{.+}} { i32 0, i32 322, i32 0, i32 0, i8* // CHECK-LABEL: foo void foo() {}; // CHECK-LABEL: bar @@ -26,7 +27,7 @@ int main() { float l = 0.0; // Used as a base point in checks. // CHECK: [[GTID:%.+]] = call{{.*}} i32 @__kmpc_global_thread_num({{.*}}) // CHECK: store float -#pragma omp sections nowait +#pragma omp sections { // CHECK: store i32 0, i32* [[LB_PTR:%.+]], // CHECK: store i32 1, i32* [[UB_PTR:%.+]], @@ -71,6 +72,13 @@ int main() { // CHECK: [[INNER_LOOP_END]] } // CHECK: call void @__kmpc_for_static_fini(%{{.+}}* @{{.+}}, i32 [[GTID]]) +// CHECK: call i32 @__kmpc_cancel_barrier(%{{.+}}* [[IMPLICIT_BARRIER_SECTIONS_LOC]], +#pragma omp sections nowait + { + foo(); +#pragma omp section + bar(); + } // CHECK-NOT: __kmpc_cancel_barrier return tmain<int>(); } @@ -87,7 +95,7 @@ int main() { // CHECK: call void @__kmpc_end_single( // CHECK-NEXT: br label %[[END]] // CHECK: [[END]] -// CHECK-NEXT: call i32 @__kmpc_cancel_barrier( +// CHECK-NEXT: call i32 @__kmpc_cancel_barrier(%{{.+}}* [[IMPLICIT_BARRIER_SINGLE_LOC]], // CHECK-NEXT: ret // CHECK: [[TERM_LPAD]] // CHECK: call void @__clang_call_terminate(i8* |