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

George Burgess IV via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 10:35:20 PDT 2018


george.burgess.iv added a comment.

Thanks for this!

I totally agree that DebugCounters, in their current state, make no sense to really use with threads. So, I'm not the biggest fan of silencing the tools that're correctly telling us "hey, you're holding these DebugCounters wrong."

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?")

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. :)


Repository:
  rL LLVM

https://reviews.llvm.org/D50080





More information about the llvm-commits mailing list