]> granicus.if.org Git - clang/commit
[OPENMP] Emit __kmpc_cancel_barrier() and code for 'cancellation point' only if ...
authorAlexey Bataev <a.bataev@hotmail.com>
Tue, 15 Sep 2015 12:52:43 +0000 (12:52 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Tue, 15 Sep 2015 12:52:43 +0000 (12:52 +0000)
commitdfff1f26664649b94c0a5d2038fdbe2317ada7bc
tree9b2cf2a8b73d59d6429a6457b5049fd28866049c
parentcf5dc434bd15c969d5b9811a7e0493d9cea92fda
[OPENMP] Emit __kmpc_cancel_barrier() and code for 'cancellation point' only if 'cancel' is found.
Patch improves codegen for OpenMP constructs. If the OpenMP region does not have internal 'cancel' construct, a call to 'void __kmpc_barrier()' runtime function is generated for all implicit/explicit barriers. If the region has inner 'cancel' directive, then
```
if (__kmpc_cancel_barrier())
  exit from outer construct;
```
code is generated.
Also, the code for 'canellation point' directive is not generated if parent directive does not have 'cancel' directive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247681 91177308-0d34-0410-b5e6-96231b3b80d8
25 files changed:
include/clang/AST/StmtOpenMP.h
lib/AST/Stmt.cpp
lib/CodeGen/CGOpenMPRuntime.cpp
lib/CodeGen/CGOpenMPRuntime.h
lib/CodeGen/CGStmtOpenMP.cpp
lib/Sema/SemaOpenMP.cpp
lib/Serialization/ASTReaderStmt.cpp
lib/Serialization/ASTWriterStmt.cpp
test/OpenMP/cancel_codegen.cpp
test/OpenMP/cancellation_point_codegen.cpp
test/OpenMP/for_codegen.cpp
test/OpenMP/for_firstprivate_codegen.cpp
test/OpenMP/for_lastprivate_codegen.cpp
test/OpenMP/for_linear_codegen.cpp
test/OpenMP/for_reduction_codegen.cpp
test/OpenMP/for_simd_codegen.cpp
test/OpenMP/parallel_codegen.cpp
test/OpenMP/parallel_copyin_codegen.cpp
test/OpenMP/parallel_firstprivate_codegen.cpp
test/OpenMP/parallel_reduction_codegen.cpp
test/OpenMP/sections_codegen.cpp
test/OpenMP/sections_firstprivate_codegen.cpp
test/OpenMP/sections_lastprivate_codegen.cpp
test/OpenMP/sections_reduction_codegen.cpp
test/OpenMP/single_firstprivate_codegen.cpp