[Openmp-commits] [PATCH] D71987: [OpenMP][NFC] Add a couple of TODOs to the runtime

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Dec 29 23:21:31 PST 2019


jdoerfert created this revision.
jdoerfert added reviewers: tlwilmar, AndreyChurbanov, Hahnfeld, jlpeyton, protze.joachim, ABataev, JonChesterfield.
Herald added subscribers: guansong, bollu.
Herald added a project: OpenMP.

The runtime contains various cases of functions and variables/members
hat are not used or which seem to be overly complicated. This patch
points two such cases out so we can remove them later on (with the
appropriate changes in the code generation).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71987

Files:
  openmp/runtime/src/kmp.h


Index: openmp/runtime/src/kmp.h
===================================================================
--- openmp/runtime/src/kmp.h
+++ openmp/runtime/src/kmp.h
@@ -2087,6 +2087,7 @@
  */
 typedef kmp_int32 (*kmp_routine_entry_t)(kmp_int32, void *);
 
+// TODO: This needs to be removed. See the TODO in kmp_task.
 typedef union kmp_cmplrdata {
   kmp_int32 priority; /**< priority specified by user for the task */
   kmp_routine_entry_t
@@ -2103,6 +2104,15 @@
   kmp_routine_entry_t
       routine; /**< pointer to routine to call for executing task */
   kmp_int32 part_id; /**< part id for the task                          */
+  // TODO: We should *not* have two union members but two explicit members:
+  //       One for the priority, one for the destructors. That would not only
+  //       make a kmp_task fit in a single cache line (which it does not now!)
+  //       it would also make it way easier to deal with than an encoding only
+  //       described in some comments.
+  //       Once the clang codegen is gone, or someone finds the time to fix it,
+  //       the following to fields need to be replaced by:
+  //  kmp_int32 priority;
+  //  kmp_routine_entry_t destructors;
   kmp_cmplrdata_t
       data1; /* Two known optional additions: destructors and priority */
   kmp_cmplrdata_t data2; /* Process destructors first, priority second */
@@ -2230,6 +2240,8 @@
   /* Compiler flags */ /* Total compiler flags must be 16 bits */
   unsigned tiedness : 1; /* task is either tied (1) or untied (0) */
   unsigned final : 1; /* task is final(1) so execute immediately */
+  // TODO: merged_if0 does not seem to be used in any meaningful way. Is it
+  // needed?
   unsigned merged_if0 : 1; /* no __kmpc_task_{begin/complete}_if0 calls in if0
                               code path */
   unsigned destructors_thunk : 1; /* set if the compiler creates a thunk to


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71987.235552.patch
Type: text/x-patch
Size: 1881 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20191230/4b07de35/attachment.bin>


More information about the Openmp-commits mailing list