<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 15, 2016 at 10:44 AM, Dmitry Vyukov <span dir="ltr"><<a href="mailto:dvyukov@google.com" target="_blank">dvyukov@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dvyukov added a comment.<br>
<span class=""><br>
> What is the right way to teach tsan to be quiet about benign races?<br>
<br>
<br>
</span>There is no such thing as benign data races in llvm, so there is nothing to teach tsan about.<br>
<a href="http://llvm.org/docs/Atomics.html#optimization-outside-atomic" rel="noreferrer" target="_blank">http://llvm.org/docs/Atomics.html#optimization-outside-atomic</a><br>
<span class=""><br>
> No -- tsan warning should not be the right motivation for this kind of change.<br>
<br>
<br>
</span>You seem to assume that marking the profiler memory accesses as monotonically atomic will degrade performance. Why? If that's the case then there is a bug in llvm optimizer, and we need to fix it.<br></blockquote><div><br></div><div>It might -- at least we should measure it. Note that instrumentation run is already pretty slow, so we need to be careful not to regress it.  </div><div><br></div><div>David</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There is no difference between the compiler-emitted instrumentation and similar hand-written instrumentation. And we definitely don't want users to write racy code. But we don't want users to be penalized for writing correct code as well.<br>
<br>
<br>
<a href="http://reviews.llvm.org/D18164" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18164</a><br>
<br>
<br>
<br>
</blockquote></div><br></div></div>