<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Jul 13, 2016 at 1:40 AM Sean Silva <<a href="mailto:chisophugis@gmail.com">chisophugis@gmail.com</a>> wrote:<br></div><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">On Wed, Jul 13, 2016 at 12:39 AM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:rgb(0,0,0)">Interesting. I'm not sure this is the right metric, however. There are lots of analyses that hold pointers to other analyses but don't need to. The analysis handle itself can be reacquired lazily if we care to do so.</div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div>Are you thinking of instead holding a pointer to the analysis manager?</div></div></div></div></div></blockquote><div><br></div><div>I'm really concerned with using this approach as the common case. It triggers the run of the analyses at very strange points (mid-query of some other analysis) and forces us to pay the analysis manager lookup overhead on every query. For many analyses, this overhead is larger than the actual query.</div><div><br></div><div>There may be cases where this is the only sane way to manage things, but this should be the exception rather than the rule IMO.</div><div> </div><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"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:rgb(0,0,0)"> What's truly problematic is holding pointers into another analysis's data structures. To be concrete, holding a pointer to ScalarEvolution is not a fundamental problem because we could make the analysis reacquire the pointer at the start of every query. Holding SCEV* is the problem.<br></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Looks like SCEV* at least is held only by LoopAccessInfo. (Looks like LAA holds Loop* too)<br></div></div></div></div></blockquote><div><br></div><div>Note that Loop (and SCC) are somewhat special as they are IRUnitTs and might as a consequence be more reasonable to hold on to and expect definitive invalidation to occur. But I say "might". I think this will be case-by-case depending on how they're being used.</div><div> </div><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"><div></div><div>New updated rendering at <a href="http://reviews.llvm.org/F2161258" target="_blank">http://reviews.llvm.org/F2161258</a> (DependenceAnalysis was missing some edges in my previous rendering and I didn't have and I've added LoopAccessAnalysis; I've updated <a href="http://reviews.llvm.org/P6603" target="_blank">http://reviews.llvm.org/P6603</a>). Which other analyses vend data objects that others might hold pointers to?</div></div></div></div></blockquote><div><br></div><div>SCEV, Loop, SCC, DomTreeNode, and Region leap immediately to mind. and 3 of those are what would be IRUnitTs (Region being the third, and its weird and likely won't be in the new PM ever).</div></div></div>