[Openmp-commits] [PATCH] D25510: Fix for mistake done by https://reviews.llvm.org/D23115

Andrey Churbanov via Openmp-commits openmp-commits at lists.llvm.org
Wed Oct 12 04:21:29 PDT 2016


AndreyChurbanov created this revision.
AndreyChurbanov added reviewers: Hahnfeld, tlwilmar, jlpeyton.
AndreyChurbanov added a subscriber: openmp-commits.
AndreyChurbanov set the repository for this revision to rL LLVM.

Condition (team_serial || tasking_ser) was mistakenly replaced with task_serial.  As a result serialized tasks in active parallel region got lost causing memory leak.
This patch restores the original condition leaving the rest of the https://reviews.llvm.org/D23115 in place.  The temp variable also renamed to correspond with the condition.


Repository:
  rL LLVM

https://reviews.llvm.org/D25510

Files:
  src/kmp_tasking.c


Index: src/kmp_tasking.c
===================================================================
--- src/kmp_tasking.c
+++ src/kmp_tasking.c
@@ -578,7 +578,8 @@
 {
     // Proxy tasks must always be allowed to free their parents
     // because they can be run in background even in serial mode.
-    kmp_int32 task_serial = taskdata->td_flags.task_serial && !taskdata->td_flags.proxy;
+    kmp_int32 team_serial = ( taskdata->td_flags.team_serial ||
+        taskdata->td_flags.tasking_ser ) && !taskdata->td_flags.proxy;
     KMP_DEBUG_ASSERT( taskdata -> td_flags.tasktype == TASK_EXPLICIT );
 
     kmp_int32 children = KMP_TEST_THEN_DEC32( (kmp_int32 *)(& taskdata -> td_allocated_child_tasks) ) - 1;
@@ -599,7 +600,7 @@
 
         // Stop checking ancestors at implicit task
         // instead of walking up ancestor tree to avoid premature deallocation of ancestors.
-        if ( task_serial || taskdata -> td_flags.tasktype == TASK_IMPLICIT )
+        if ( team_serial || taskdata -> td_flags.tasktype == TASK_IMPLICIT )
             return;
 
         // Predecrement simulated by "- 1" calculation


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25510.74359.patch
Type: text/x-patch
Size: 1106 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20161012/befa4af6/attachment.bin>


More information about the Openmp-commits mailing list