From: AndreyChurbanov Date: Fri, 25 Oct 2019 12:59:07 +0000 (+0300) Subject: OpenMP Tasks dependencies hash re-sizing fixed. X-Git-Tag: llvmorg-11-init~5802 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be29d9285487e1970f0ad070d79d5dfeca345f2e;p=platform%2Fupstream%2Fllvm.git OpenMP Tasks dependencies hash re-sizing fixed. Details: - nconflicts field initialized; - formatting fix (moved declaration out of the long line); - count conflicts in new hash as opposed to old one. Differential Revision: https://reviews.llvm.org/D68036 --- diff --git a/openmp/runtime/src/kmp_taskdeps.cpp b/openmp/runtime/src/kmp_taskdeps.cpp index f8aa51d..8d60bbbc 100644 --- a/openmp/runtime/src/kmp_taskdeps.cpp +++ b/openmp/runtime/src/kmp_taskdeps.cpp @@ -85,19 +85,19 @@ static kmp_dephash_t *__kmp_dephash_extend(kmp_info_t *thread, h->nelements = current_dephash->nelements; h->buckets = (kmp_dephash_entry **)(h + 1); h->generation = gen; - + h->nconflicts = 0; // insert existing elements in the new table for (size_t i = 0; i < current_dephash->size; i++) { - kmp_dephash_entry_t *next; - for (kmp_dephash_entry_t *entry = current_dephash->buckets[i]; entry; entry = next) { + kmp_dephash_entry_t *next, *entry; + for (entry = current_dephash->buckets[i]; entry; entry = next) { next = entry->next_in_bucket; // Compute the new hash using the new size, and insert the entry in // the new bucket. kmp_int32 new_bucket = __kmp_dephash_hash(entry->addr, h->size); + entry->next_in_bucket = h->buckets[new_bucket]; if (entry->next_in_bucket) { h->nconflicts++; } - entry->next_in_bucket = h->buckets[new_bucket]; h->buckets[new_bucket] = entry; } }