[Openmp-commits] [PATCH] D19880: Fine tuning of TC* macros

Paul Osmialowski via Openmp-commits openmp-commits at lists.llvm.org
Fri May 6 17:05:57 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL268826: Fine tuning of TC* macros (authored by pawosm01).

Changed prior to commit:
  http://reviews.llvm.org/D19880?vs=56033&id=56482#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19880

Files:
  openmp/trunk/runtime/src/kmp_lock.cpp
  openmp/trunk/runtime/src/kmp_os.h
  openmp/trunk/runtime/src/kmp_tasking.c

Index: openmp/trunk/runtime/src/kmp_lock.cpp
===================================================================
--- openmp/trunk/runtime/src/kmp_lock.cpp
+++ openmp/trunk/runtime/src/kmp_lock.cpp
@@ -2507,7 +2507,7 @@
 
     KMP_FSYNC_PREPARE(lck);
     KMP_INIT_YIELD(spins);
-    while (TCR_8(polls[ticket & mask]).poll < ticket) { // volatile load
+    while (TCR_8(polls[ticket & mask].poll) < ticket) { // volatile load
         // If we are oversubscribed,
         // or have waited a bit (and KMP_LIBRARY=turnaround), then yield.
         // CPU Pause is in the macros for yield.
Index: openmp/trunk/runtime/src/kmp_tasking.c
===================================================================
--- openmp/trunk/runtime/src/kmp_tasking.c
+++ openmp/trunk/runtime/src/kmp_tasking.c
@@ -2845,7 +2845,7 @@
        KMP_TEST_THEN_DEC32( (kmp_int32 *)(& taskdata->td_taskgroup->count) );
 
     // Create an imaginary children for this task so the bottom half cannot release the task before we have completed the second top half
-    TCR_4(taskdata->td_incomplete_child_tasks++);
+    TCI_4(taskdata->td_incomplete_child_tasks);
 }
 
 static void __kmp_second_top_half_finish_proxy( kmp_taskdata_t * taskdata )
@@ -2857,7 +2857,7 @@
     KMP_DEBUG_ASSERT( children >= 0 );
 
     // Remove the imaginary children
-    TCR_4(taskdata->td_incomplete_child_tasks--);
+    TCD_4(taskdata->td_incomplete_child_tasks);
 }
 
 static void __kmp_bottom_half_finish_proxy( kmp_int32 gtid, kmp_task_t * ptask )
Index: openmp/trunk/runtime/src/kmp_os.h
===================================================================
--- openmp/trunk/runtime/src/kmp_os.h
+++ openmp/trunk/runtime/src/kmp_os.h
@@ -596,8 +596,12 @@
 
 #define TCR_4(a)            (a)
 #define TCW_4(a,b)          (a) = (b)
+#define TCI_4(a)            (++(a))
+#define TCD_4(a)            (--(a))
 #define TCR_8(a)            (a)
 #define TCW_8(a,b)          (a) = (b)
+#define TCI_8(a)            (++(a))
+#define TCD_8(a)            (--(a))
 #define TCR_SYNC_4(a)       (a)
 #define TCW_SYNC_4(a,b)     (a) = (b)
 #define TCX_SYNC_4(a,b,c)   KMP_COMPARE_AND_STORE_REL32((volatile kmp_int32 *)(volatile void *)&(a), (kmp_int32)(b), (kmp_int32)(c))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19880.56482.patch
Type: text/x-patch
Size: 2208 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20160507/80a24858/attachment.bin>


More information about the Openmp-commits mailing list