<div dir="ltr"><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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><br><div><br></div><div>We have no way of specifying the lifetime has ended, either.</div><div>You can make the problem as hard or as simple as you want above, but you can't solve it in general.</div><div>Even if you wanted to, it is in fact, trivial to come up with cases where basicaa will say no alias for the load/store, but not say noalias at the propagation point.<br></div></div></div></div></blockquote><div><br></div><div>In fact, you can make it worse than this.</div><div>You can get our AA to say may-alias/must-alias for the memory during gvn, and say noalias for the same pair of pointers by the time licm rolls around.</div><div><br></div><div>The only real solution, IMHO,  is to this is to have real object lifetime/ordering chains and build an SSA-like form for them like memoryssa.</div><div>The languages generate the lifetime orderings.</div><div><br></div><div>(Giving up on noalias for this case only fixes this case, it still affects other languages, etc)<br></div><div><br></div><div><br></div></div></div></div>