[PATCH] D50080: [Support] Use atomics in DebugCounter to silence TSAN

Ilya Biryukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 1 02:28:41 PDT 2018


ilya-biryukov abandoned this revision.
ilya-biryukov added a comment.

Abandoning in favor of George's fix.

In https://reviews.llvm.org/D50080#1182820, @george.burgess.iv wrote:

> Might it be reasonable to just have an `enabled` bit inside of the DebugCounters `instance()`? If true, we'll do all of this counting. If false, we'll just skip it all? (Logically, it would be set to "were we passed any -debug-counter args, or do we plan to run the pass from https://reviews.llvm.org/D50031?")


LG. Anything that keeps TSAN happy is good with our use-case, there's does not seem to be a way to make debug counters useful in the multi-threaded environment anyway.

> Also, if this is still breaking you (or anyone else), please let me know. I'm happy to revert the problematic patch while we work this out if it makes anyone's life easier. :)

It's tensorflow under TSAN that's broken, they do run LLVM code that uses debug counters in parallel and get those errors from TSAN.


Repository:
  rL LLVM

https://reviews.llvm.org/D50080





More information about the llvm-commits mailing list