Fine tuning of TC* macros

This patch introduces following:
* TCI_* and TCD_* macros for incrementation and decrementation
* Fix for invalid use of TCR_8 in one expression

Differential Revision: http://reviews.llvm.org/D19880

git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@268826 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Paul Osmialowski
2016-05-07 00:00:00 +00:00
parent 039c3ab59a
commit 2f585ea95f
3 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -2507,7 +2507,7 @@ __kmp_acquire_drdpa_lock_timed_template( kmp_drdpa_lock_t *lck, kmp_int32 gtid )
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.
+4
View File
@@ -596,8 +596,12 @@ extern kmp_real64 __kmp_xchg_real64( volatile kmp_real64 *p, kmp_real64 v );
#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))
+2 -2
View File
@@ -2845,7 +2845,7 @@ static void __kmp_first_top_half_finish_proxy( kmp_taskdata_t * taskdata )
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 @@ static void __kmp_second_top_half_finish_proxy( kmp_taskdata_t * taskdata )
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 )