From: Jonathan Peyton Date: Tue, 30 Apr 2019 19:13:37 +0000 (+0000) Subject: [OpenMP] Eliminate some compiler warnings X-Git-Tag: llvmorg-10-init~6635 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ca746170bb201cf396465c7ae2f0c260f6deb69;p=platform%2Fupstream%2Fllvm.git [OpenMP] Eliminate some compiler warnings * Remove accidental == for = * Assign values to variables to appease compiler * Surround debug code with KMP_DEBUG * Remove unused local typedefs Differential Revision: https://reviews.llvm.org/D60983 llvm-svn: 359599 --- diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp index bfbbdd8..9d08254 100644 --- a/openmp/runtime/src/kmp_affinity.cpp +++ b/openmp/runtime/src/kmp_affinity.cpp @@ -544,7 +544,7 @@ static int __kmp_hwloc_check_numa() { if (hN != NULL && hN->depth > hS->depth) { __kmp_numa_detected = TRUE; // socket includes node(s) if (__kmp_affinity_gran == affinity_gran_node) { - __kmp_affinity_gran == affinity_gran_numa; + __kmp_affinity_gran = affinity_gran_numa; } } diff --git a/openmp/runtime/src/kmp_atomic.cpp b/openmp/runtime/src/kmp_atomic.cpp index cd5d8c8..9940797 100644 --- a/openmp/runtime/src/kmp_atomic.cpp +++ b/openmp/runtime/src/kmp_atomic.cpp @@ -2565,6 +2565,8 @@ ATOMIC_CMPX_L_CPT(fixed8, orl_cpt, kmp_int64, 64, ||, new_value = rhs; \ else \ new_value = old_value; \ + } else { \ + new_value = *lhs; \ } \ __kmp_release_atomic_lock(&ATOMIC_LOCK##LCK_ID, gtid); \ return new_value; diff --git a/openmp/runtime/src/kmp_dispatch_hier.h b/openmp/runtime/src/kmp_dispatch_hier.h index ce507c0..3fde9bb 100644 --- a/openmp/runtime/src/kmp_dispatch_hier.h +++ b/openmp/runtime/src/kmp_dispatch_hier.h @@ -208,7 +208,7 @@ template struct kmp_hier_shared_bdata_t { // Can be used in a unit with between 2 to 8 threads template class core_barrier_impl { static inline kmp_uint64 get_wait_val(int num_active) { - kmp_uint64 wait_val; + kmp_uint64 wait_val = 0LL; switch (num_active) { case 2: wait_val = 0x0101LL; @@ -424,6 +424,7 @@ template struct kmp_hier_top_unit_t { kmp_int32 is_active() const { return active; } kmp_int32 get_num_active() const { return active; } +#ifdef KMP_DEBUG void print() { KD_TRACE( 10, @@ -431,6 +432,7 @@ template struct kmp_hier_top_unit_t { active, &hier_pr, hier_pr.u.p.lb, hier_pr.u.p.ub, hier_pr.u.p.st, hier_pr.u.p.tc)); } +#endif }; // Information regarding a single layer within the scheduling hierarchy @@ -441,6 +443,7 @@ template struct kmp_hier_layer_info_t { typename traits_t::signed_t chunk; // chunk size associated with schedule int length; // length of the kmp_hier_top_unit_t array +#ifdef KMP_DEBUG // Print this layer's information void print() { const char *t = __kmp_get_hier_str(type); @@ -450,6 +453,7 @@ template struct kmp_hier_layer_info_t { "length:%d\n", num_active, t, sched, chunk, length)); } +#endif }; /* @@ -887,6 +891,7 @@ public: int get_top_level_nproc() const { return top_level_nproc; } // Return whether this hierarchy is valid or not bool is_valid() const { return valid; } +#ifdef KMP_DEBUG // Print the hierarchy void print() { KD_TRACE(10, ("kmp_hier_t:\n")); @@ -901,6 +906,7 @@ public: } } } +#endif }; template @@ -910,8 +916,6 @@ void __kmp_dispatch_init_hierarchy(ident_t *loc, int n, typename traits_t::signed_t *new_chunks, T lb, T ub, typename traits_t::signed_t st) { - typedef typename traits_t::signed_t ST; - typedef typename traits_t::unsigned_t UT; int tid, gtid, num_hw_threads, num_threads_per_layer1, active; int my_buffer_index; kmp_info_t *th;