<div><br><div class="gmail_extra"><br><div class="gmail_quote">On Aug 25, 2016 16:09, "Sanjoy Das via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">Hi Hal,<br>
<br>
Hal Finkel via llvm-dev wrote:<br></div><div class="quoted-text">
> Some questions: Do we allow stores to these locations at all? Only if<br>
<br></div>
I'd vote for disallowing stores to these locations, but if "stores<br>
allowed only if the value is the same" is helpful in some situation<br>
then I don't have specific reasons why that would be problematic.</blockquote></div></div></div><div>I disagree. It's much easier to write fronted and use invariant load when you can emit stores that store the same value.</div><div>For example with invariant.group used on vptrs optimizer can assume the 2 loads load the same vtable, even when you can write code in c++ that is valid that store vptr after calling virtual function (like placement new(this) with the same type).</div><div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">
<br>
> the value is the same? Must any change be observable to be a problem? Do<br>
<br></div>
Not sure what you mean by "Must any change be observable".<div class="quoted-text"><br>
<br>
> atomic loads of invariant locations really need to be atomic?<br>
<br></div>
It depends on the answer to "Do we allow stores to these locations at<br>
all?".  If we don't allow stores to these locations at all then atomic<br>
loads are not required, since we can't have racing stores to that<br>
location.<br>
<br>
However, syntactically, I'd be tempted to allow invariant loads to be<br>
atomic; and maybe have a later pass strip out the atomic bit if the<br>
semantics we decide allow that.<br>
<br>
-- Sanjoy<div class="elided-text"><br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</div></blockquote></div><br></div></div>