<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 17, 2016 at 1:18 PM, 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>
> I am not sure what 'pretend' here means. It is possible that value '1' is still visible to other threads, or not?<br>
<br>
<br>
</span>Well, if we eliminate it, then it won't be visible.<br>
<br>
If we don't eliminate it, then value 1 may or may not be visible to other threads depending on scheduler (among other things). There are no requirements for scheduler. So implementation in which value 1 is never visible to other threads is legal.<br></blockquote><div> </div><div>I need to see the actual specification on the standard that this is legal :)</div><div><br></div><div>Note that the DSE example can be changed to:</div><div><br></div><div>atomic_store(p, 1);</div><div><br></div><div>....lots of other code not touching memory</div><div><br></div><div>atomic_store(p, 2);</div><div><br></div><div><br></div><div>David</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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>