<div dir="ltr"><br><br><div class="gmail_quote">On Mon, Apr 27, 2015 at 4:21 PM Daniel Berlin <<a href="mailto:dberlin@dberlin.org">dberlin@dberlin.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You can't win here (believe me, i've tried, and better people than me have tried, for years :P).<div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><span style="line-height:1.5;font-size:13.1999998092651px">No matter what you do, the partitioning will never be 100% precise.  The only way to solve that in general is to pairwise query over the partitioning.</span><br></div></div><div><span style="line-height:1.5;font-size:13.1999998092651px"><br></span></div><div>Your basic problem is that all of the alias analyses do not come up with the same partitioning of the heap.</div><div><br></div><div>Worse, some are not even transitive, or even symmetric.</div><div><br></div><div>This means one single variable may be in multiple disjoint alias sets in reality.  </div><div><br></div><div>(For example, GEP, PHI will give you different AA results than PHI, GEP in some cases. That is mostly a FIXME, but there are plenty of cases you can come up with where info tells you something about one variable and it's relationship to another, but not to a third. The non-symmetric case is rarer, but again, possible.)</div><div><br></div><div>Let's say you modify AliasSetTracker to not collapse, and handle multiple disjoint partitions at once.</div><div><span style="font-size:13.1999998092651px;line-height:1.5"><br></span></div><div><span style="font-size:13.1999998092651px;line-height:1.5">(Here is here i will draw the equivalence between this and what we've done before in GCC :) )</span><br></div><div><br></div><div>The only way to maintain correctness (in general) and not collapse is to maintain multiple alias sets, and say which are affected by which instructions.</div><div><br></div><div>(IE you have 1 instruction, and it may MOD 5 different alias sets, each of which represents a different partitioning of the heap).</div><div><br></div><div>You will discover very quickly, that for most partitioning you can think of, the cost of maintaining the alias sets over a set of instructions with is greater than the cost of additional queries you may come up with in the first place</div><div><br></div><div>In other words, depending on how precise your partitioning you may have variables that clobber 10 or 20 or 30 of the disjoint alias sets. </div></div></blockquote><div><br></div><div>This should be "instructions", not variables.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
</blockquote></div></blockquote></div></div>