summaryrefslogtreecommitdiffstats
path: root/openmp
diff options
context:
space:
mode:
authorAndrey Churbanov <Andrey.Churbanov@intel.com>2016-11-01 08:33:36 +0000
committerAndrey Churbanov <Andrey.Churbanov@intel.com>2016-11-01 08:33:36 +0000
commitdd313b0673febe0a5763c4aa475874d630b24fc1 (patch)
tree44fa5a8c98e0c203d9633d49533f8e6e2c89b790 /openmp
parent8cba0befb4b4151a8cde7c023ecbb786b47a8be3 (diff)
downloadbcm5719-llvm-dd313b0673febe0a5763c4aa475874d630b24fc1.tar.gz
bcm5719-llvm-dd313b0673febe0a5763c4aa475874d630b24fc1.zip
Add more conditions to check whether task waiting is necessary in kmp_omp_taskwait.
Differential Revision: https://reviews.llvm.org/D26058 Patch by Victor Campos llvm-svn: 285678
Diffstat (limited to 'openmp')
-rw-r--r--openmp/runtime/src/kmp_tasking.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/openmp/runtime/src/kmp_tasking.c b/openmp/runtime/src/kmp_tasking.c
index 888a3f3d929..d3fcba85dfa 100644
--- a/openmp/runtime/src/kmp_tasking.c
+++ b/openmp/runtime/src/kmp_tasking.c
@@ -1480,13 +1480,13 @@ __kmpc_omp_taskwait( ident_t *loc_ref, kmp_int32 gtid )
__kmp_itt_taskwait_starting( gtid, itt_sync_obj );
#endif /* USE_ITT_BUILD */
+ bool must_wait = ! taskdata->td_flags.team_serial && ! taskdata->td_flags.final;
+
#if OMP_45_ENABLED
- if ( ! taskdata->td_flags.team_serial || (thread->th.th_task_team != NULL && thread->th.th_task_team->tt.tt_found_proxy_tasks) )
-#else
- if ( ! taskdata->td_flags.team_serial )
+ must_wait = must_wait || (thread->th.th_task_team != NULL && thread->th.th_task_team->tt.tt_found_proxy_tasks);
#endif
+ if (must_wait)
{
- // GEH: if team serialized, avoid reading the volatile variable below.
kmp_flag_32 flag(&(taskdata->td_incomplete_child_tasks), 0U);
while ( TCR_4(taskdata -> td_incomplete_child_tasks) != 0 ) {
flag.execute_tasks(thread, gtid, FALSE, &thread_finished
OpenPOWER on IntegriCloud