[Openmp-commits] [openmp] 9f5d6ea - [OpenMP] Fix performance regression reported in bug #51235

Shilei Tian via Openmp-commits openmp-commits at lists.llvm.org
Wed Aug 4 09:34:54 PDT 2021


Author: Shilei Tian
Date: 2021-08-04T12:34:49-04:00
New Revision: 9f5d6ea52eb120ba370bf16ee0537602c6fc727e

URL: https://github.com/llvm/llvm-project/commit/9f5d6ea52eb120ba370bf16ee0537602c6fc727e
DIFF: https://github.com/llvm/llvm-project/commit/9f5d6ea52eb120ba370bf16ee0537602c6fc727e.diff

LOG: [OpenMP] Fix performance regression reported in bug #51235

This patch fixes the "performance regression" reported in https://bugs.llvm.org/show_bug.cgi?id=51235. In fact it has nothing to do with performance. The root cause is, the stolen task is not allowed to execute by another thread because by default it is tied task. Since hidden helper task will always be executed by hidden helper threads, it should be untied.

Reviewed By: protze.joachim

Differential Revision: https://reviews.llvm.org/D107121

Added: 
    

Modified: 
    openmp/runtime/src/kmp_tasking.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/src/kmp_tasking.cpp b/openmp/runtime/src/kmp_tasking.cpp
index ea94b3c15c88..ae9728778bb7 100644
--- a/openmp/runtime/src/kmp_tasking.cpp
+++ b/openmp/runtime/src/kmp_tasking.cpp
@@ -1444,6 +1444,7 @@ kmp_task_t *__kmpc_omp_target_task_alloc(ident_t *loc_ref, kmp_int32 gtid,
   if (__kmp_enable_hidden_helper) {
     auto &input_flags = reinterpret_cast<kmp_tasking_flags_t &>(flags);
     input_flags.hidden_helper = TRUE;
+    input_flags.tiedness = TASK_UNTIED;
   }
 
   return __kmpc_omp_task_alloc(loc_ref, gtid, flags, sizeof_kmp_task_t,


        


More information about the Openmp-commits mailing list