<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Filip,<br>
<br>
Thank you for this insight. This is absolutely a technique I'll be
applying in the future. This seems really, really powerful. <br>
<br>
I actually figured out a way around my immediate problem right after
sending my email. I can restructure my runtime call to explicitly
expose the state update to my compiled code. I have to actually
implement this, but in principal it should have the effect I
desire. <br>
<br>
Philip<br>
<br>
<div class="moz-cite-prefix">On 03/20/2014 10:00 AM, Filip Pizlo
wrote:<br>
</div>
<blockquote
cite="mid:D247BE8B-69A5-4C49-A066-81F7BA403891@apple.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
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
moz-do-not-send="true"
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 moz-do-not-send="true"
href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>
<a moz-do-not-send="true"
href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br>
<a moz-do-not-send="true"
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>
</blockquote>
<br>
</body>
</html>