<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 20, 2017 at 1:22 PM, PaweÅ‚ Batko <span dir="ltr"><<a href="mailto:pawel.batko@gmail.com" target="_blank">pawel.batko@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Reid,<br>
<span class=""><br>
On 20 November 2017 at 21:44, Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:<br>
> For example, llvm should be able to mem2reg<br>
> unescaped atomics because it knows they cannot be modified by other threads,<br>
<br>
</span>Could you point to some resources that explain what an unescaped atomic is?<br></blockquote><div><br></div><div>I mean a local variable that is _Atomic qualified whose address does not escape the function that allocates it. An unused _Atomic int, for example, can be removed. If it were volatile, the storage and any loads and stores would have to be preserved.</div><div><br></div><div>In other words, atomics come with a threading model, semantics, and rules that permit certain transformations. Volatile still acts as an escape hatch to throw that out the window.</div></div></div></div>