<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I don't think it does.  I previously proposed TBAA on calls as a way of modeling arbitrary effects, and there seemed to be something like consensus that this is something we want.  <div><br></div><div>I believe that TBAA on calls will give you what you want.  You can basically name arbitrary heaps and claim to read/write them and the optimizer is obligated to take your word for it.  For example, if you wanted to model the fact that a function never writes the Java heap but does write to memory, you could create a TBAA hierarchy like:<div><br></div><div><font face="Monaco">JVMRoot</font></div><div><font face="Monaco">  |</font></div><div><font face="Monaco">  +- JVMHeap</font></div><div><font face="Monaco">  |   |</font></div><div><font face="Monaco">  |   +- ... hierarchy of heap things...</font></div><div><font face="Monaco">  |</font></div><div><span style="font-family: Monaco;">  +- JVMExternal</span></div><div><font face="Monaco">  |   |</font></div><div><font face="Monaco">  |   +- JVMFilesystem</font></div><div><font face="Monaco">  |<br></font><div>    +- ... other things</div><div><br></div><div>Then having a call that claims to write JVMFilesystem but _not_ anything in JVMHeap would give you what you want, provided that all of your loads/stores claims to load or store things within the JVMHeap hierarchy.</div><div><br></div><div>JavaScriptCore already uses this internally within our DFG IR.  We have abstract heaps like "SideState" that do not represent anything actually in memory but are used by some of the more subtle operations to inform the compiler that there *are* effects that happen just that they are outside of what the VM would ordinarily think of as its heap.  It would be awesome to do more of this in LLVM IR and I believe that TBAA on calls gives you what you need.</div><div><br></div><div>-Filip</div><div><br></div><div><br><div><div>On Mar 20, 2014, at 9:50 AM, Philip Reames <<a href="mailto:listmail@philipreames.com">listmail@philipreames.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I've got a library function which writes to external state, but which does not update any location addressable from the code being compiled.  I'd like to mark this function as read only to enable store forwarding, but I still need to model the side effect. (Otherwise, LLVM will happily remove any calls to the function since it returns void.)<br><br>Does LLVM have a mechanism to describe something like this?  I can't find anything along these lines.<br><br>Philip<br>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></div></div></div></body></html>