[Openmp-commits] [PATCH] D60983: [OpenMP] Eliminate some compiler warnings

Jonathan Peyton via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Apr 30 12:12:21 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL359599: [OpenMP] Eliminate some compiler warnings (authored by jlpeyton, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D60983?vs=196138&id=197402#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60983/new/

https://reviews.llvm.org/D60983

Files:
  openmp/trunk/runtime/src/kmp_affinity.cpp
  openmp/trunk/runtime/src/kmp_atomic.cpp
  openmp/trunk/runtime/src/kmp_dispatch_hier.h


Index: openmp/trunk/runtime/src/kmp_dispatch_hier.h
===================================================================
--- openmp/trunk/runtime/src/kmp_dispatch_hier.h
+++ openmp/trunk/runtime/src/kmp_dispatch_hier.h
@@ -208,7 +208,7 @@
 // Can be used in a unit with between 2 to 8 threads
 template <typename T> 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 @@
 
   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 @@
          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 @@
   typename traits_t<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 @@
          "length:%d\n",
          num_active, t, sched, chunk, length));
   }
+#endif
 };
 
 /*
@@ -887,6 +891,7 @@
   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 @@
       }
     }
   }
+#endif
 };
 
 template <typename T>
@@ -910,8 +916,6 @@
                                    typename traits_t<T>::signed_t *new_chunks,
                                    T lb, T ub,
                                    typename traits_t<T>::signed_t st) {
-  typedef typename traits_t<T>::signed_t ST;
-  typedef typename traits_t<T>::unsigned_t UT;
   int tid, gtid, num_hw_threads, num_threads_per_layer1, active;
   int my_buffer_index;
   kmp_info_t *th;
Index: openmp/trunk/runtime/src/kmp_atomic.cpp
===================================================================
--- openmp/trunk/runtime/src/kmp_atomic.cpp
+++ openmp/trunk/runtime/src/kmp_atomic.cpp
@@ -2565,6 +2565,8 @@
       new_value = rhs;                                                         \
     else                                                                       \
       new_value = old_value;                                                   \
+  } else {                                                                     \
+    new_value = *lhs;                                                          \
   }                                                                            \
   __kmp_release_atomic_lock(&ATOMIC_LOCK##LCK_ID, gtid);                       \
   return new_value;
Index: openmp/trunk/runtime/src/kmp_affinity.cpp
===================================================================
--- openmp/trunk/runtime/src/kmp_affinity.cpp
+++ openmp/trunk/runtime/src/kmp_affinity.cpp
@@ -544,7 +544,7 @@
   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;
     }
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60983.197402.patch
Type: text/x-patch
Size: 3432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20190430/824a9e86/attachment.bin>


More information about the Openmp-commits mailing list