<div dir="ltr"><div><div><div>>inaccessiblememonly functions, without further constraints, cannot be 
reordered w.r.t each other or CSE’d. <br>>However, readonly + 
inaccessiblememory attributes could be combined to allow both of those 
transformations<br></div>Although this seems right, from what I understand, read-only itself should be sufficient to do these optimizations.<br><br></div>More importantly, inaccessiblememonly was introduced to aid GlobalsAA to be able to say that a function, even though not marked read-only may not access a program visible global. Currently the attribute is not made use of anywhere and there is a plan to remove the attribute in future versions.<br><br></div>Thanks,<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">  - Vaivaswatha<br></div></div></div>
<br><div class="gmail_quote">On Tue, Feb 23, 2016 at 11:39 AM, Andrew Trick <span dir="ltr"><<a href="mailto:atrick@apple.com" target="_blank">atrick@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class=""><br><div><blockquote type="cite"><div>On Feb 22, 2016, at 9:58 PM, Sanjoy Das <<a href="mailto:sanjoy@playingwithpointers.com" target="_blank">sanjoy@playingwithpointers.com</a>> wrote:</div><br><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">You'd still have to be careful around</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">inaccessiblememonly and friends, though.</span></div></blockquote></div><br></span><div>I either missed that attribute or forgot about it. The semantics aren’t well specified. I would hope that it works as follows:</div><div>inaccessiblememonly functions, without further constraints, cannot be reordered w.r.t each other or CSE’d. However, readonly + inaccessiblememory attributes could be combined to allow both of those transformations.</div><div><br></div><div>@trap_on could be reordered with readonly + inaccessiblememory.</div><div><br></div><div>I’m suggesting that readonly should refer to both accessible (LLVM) and inaccessible (system) memory.</div><div><br></div><div>-Andy</div></div></blockquote></div><br></div>