summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGOpenMPRuntime.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-02-24 18:44:42 +0000
committerHans Wennborg <hans@hanshq.net>2017-02-24 18:44:42 +0000
commitf300ac389346fb08353339732fdb579f900995df (patch)
tree6ec557d58289386132b17565af2f5cd1a28eadcb /lib/CodeGen/CGOpenMPRuntime.cpp
parentb5cac107dc7fc13b635f1348e3f07a926d790443 (diff)
downloadclang-f300ac389346fb08353339732fdb579f900995df.tar.gz
Merging r295474:
------------------------------------------------------------------------ r295474 | hahnfeld | 2017-02-17 10:32:58 -0800 (Fri, 17 Feb 2017) | 6 lines [OpenMP] Fix cancellation point in task with no cancel With tasks, the cancel may happen in another task. This has a different region info which means that we can't find it here. Differential Revision: https://reviews.llvm.org/D30091 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@296151 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r--lib/CodeGen/CGOpenMPRuntime.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CGOpenMPRuntime.cpp b/lib/CodeGen/CGOpenMPRuntime.cpp
index df3f38c6ee..4025217136 100644
--- a/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -4697,7 +4697,9 @@ void CGOpenMPRuntime::emitCancellationPointCall(
// global_tid, kmp_int32 cncl_kind);
if (auto *OMPRegionInfo =
dyn_cast_or_null<CGOpenMPRegionInfo>(CGF.CapturedStmtInfo)) {
- if (OMPRegionInfo->hasCancel()) {
+ // For 'cancellation point taskgroup', the task region info may not have a
+ // cancel. This may instead happen in another adjacent task.
+ if (CancelRegion == OMPD_taskgroup || OMPRegionInfo->hasCancel()) {
llvm::Value *Args[] = {
emitUpdateLocation(CGF, Loc), getThreadID(CGF, Loc),
CGF.Builder.getInt32(getCancellationKind(CancelRegion))};