<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 16, 2016 at 1:21 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">dvyukov added a comment.<br>
<br>
Anna reported that there is in fact some degradation if we use monotonic atomics. I am fine if we ignore the counters during tsan instrumentation, </blockquote><div><br></div><div><br></div><div>Fine with that too if that is a must, but what is wrong with test configuration  modified to avoid this known limitation?  According to Anna, the following configs are tested:</div><div><br></div><div>- coverage + tsan</div><div>- coverage + asan</div><div>..</div><div><br></div><div>If the motivation is to save build time (by merging intrumentations), </div><div><br></div><div>How about just</div><div><br></div><div>- coverage + asan</div><div>- tsan</div><div>-...</div><div><br></div><div>This is also faster.  There does not seem to be any value to repeatedly enable coverage.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">but also file bugs on optimizer (there must be no performance difference). </blockquote><div><br></div><div>DSE won't happen with monotonic used (as below) -- I am not sure if that is a bug. The LangRef has a paragraph about Optimization guidance.</div><div><br></div><div><div>define void @foo() #0 {</div><div>  store atomic i32 1, i32* @g monotonic, align 4</div><div>  store atomic i32 2, i32* @g monotonic, align 4</div><div>  ret void</div><div>}</div></div><div><br></div><div>thanks,</div><div><br></div><div>David</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">This whole discussion has little to do with profiler, we are discussing that llvm does not permit users to have fast and correct code at the same time.<br>
<br>
I don't that switch to atomic RMWs under tsan is a good idea: having precise counters only in tsan build does not make sense. That could be a separate option (if user wants precise counters), but it is orthogonal to this discussion.<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>