<br><br><div class="gmail_quote">On Thu, Feb 14, 2013 at 2:49 PM, Arnold Schwaighofer <span dir="ltr"><<a href="mailto:aschwaighofer@apple.com" target="_blank">aschwaighofer@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"><br><div><div class="im"><div>On Feb 14, 2013, at 12:34 PM, Renato Golin <<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>> wrote:</div><br><blockquote type="cite">
<div dir="ltr">On 14 February 2013 17:46, Arnold Schwaighofer <span dir="ltr"><<a href="mailto:aschwaighofer@apple.com" target="_blank">aschwaighofer@apple.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">The existing implementation already relies on runtime checks (it has to make sure that an unknown object and a known object do not overlap). Yes, AA will conservatively return MayAlias/PartialAlias if it does not know two objects. You just have to make sure that you actually query it with that unknown object.<br>
</div></blockquote><div><br></div><div>I was expecting this, and I'm planning to be extra conservative to begin with. So, for now, MayAlias and PartialAlias are reasons to stop trying. Once we can get the code to understand basic independent objects inside a structure, we can specialize for the other cases.</div>
<div><br></div></div></div></div></blockquote><div><br></div></div><div>Okay. But understand that LLVM IR semantics does not give you much leeway in "understanding independent objects inside a structure". That is what you need TBAA for.</div>
</div></div></blockquote><div><br></div><div>TBAA is not a good answer to this general problem. It falls down pretty quickly when you start to ask it about fields inside structures.</div><div>Proper structure aliasing (IE aliasing on pieces of structs), including pointer analysis, in languages where things can point to fields inside structures (like GEP does) is not only possible to do on LLVM IR, it's actually been done before :)</div>
<div><br></div><div>See, e.g, <a href="http://www.cs.ucsb.edu/~benh/research/downloads.html">http://www.cs.ucsb.edu/~benh/research/downloads.html</a> (The field sensitive version, and the flow sensitive/field sensitive versions).</div>
<div>Both were done on earlier versions of LLVM, but could be made to work today.</div><div><br></div><div><br></div></div>