[llvm-branch-commits] [openmp] 64f04f6 - [OpenMP] Fix performance regression reported in bug #51235

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Aug 10 00:48:47 PDT 2021


Author: Shilei Tian
Date: 2021-08-10T00:48:14-07:00
New Revision: 64f04f6b228ba5237f4ea9ca5beb2923d54c5e5c

URL: https://github.com/llvm/llvm-project/commit/64f04f6b228ba5237f4ea9ca5beb2923d54c5e5c
DIFF: https://github.com/llvm/llvm-project/commit/64f04f6b228ba5237f4ea9ca5beb2923d54c5e5c.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

(cherry picked from commit 9f5d6ea52eb120ba370bf16ee0537602c6fc727e)

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 6c3e2c95cb5a2..55e9c307638a6 100644
--- a/openmp/runtime/src/kmp_tasking.cpp
+++ b/openmp/runtime/src/kmp_tasking.cpp
@@ -1441,6 +1441,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 llvm-branch-commits mailing list