[PATCH] D12554: tsan: speed up race deduplication

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 12:44:45 PDT 2015


dvyukov added a comment.

ptal


================
Comment at: lib/lsan/lsan_common.cc:602
@@ -600,2 +601,3 @@
       s->weight += leaks_[i].total_size;
-      s->hit_count += leaks_[i].hit_count;
+      atomic_store(&s->hit_count, atomic_load(&s->hit_count,
+          memory_order_relaxed) + leaks_[i].hit_count, memory_order_relaxed);
----------------
kcc wrote:
> May I ask you to introduce atomic_{load,store}_relaxed to make the code less verbose? 
done

================
Comment at: lib/sanitizer_common/sanitizer_suppressions.h:25
@@ -23,3 +24,3 @@
   char *templ;
-  unsigned hit_count;
+  atomic_uintptr_t hit_count;
   uptr weight;
----------------
samsonov wrote:
> Why is it not atomic_u32?
done

================
Comment at: test/tsan/race_stress.cc:1
@@ +1,2 @@
+// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
+#include "test.h"
----------------
kcc wrote:
> Do we still need %deflake? 
done


http://reviews.llvm.org/D12554





More information about the llvm-commits mailing list