<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 13, 2016 at 1:50 AM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@gmail.com" target="_blank">chandlerc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span class=""><div dir="ltr">On Wed, Jul 13, 2016 at 1:40 AM Sean Silva <<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a>> wrote:<br></div></span><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"><span class="">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></span><span class=""><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></span></div></div></div><span class=""><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></span></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></div></blockquote><div><br></div><div>Yeah, the overhead is my main concern. (also, this would be very difficult to coexist with the old PM so at least in the immediate future isn't an option)</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_quote"><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><span class=""><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></span><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><span class=""><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></span><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>
</blockquote></div><br></div><div class="gmail_extra">Looking around a bit:</div><div class="gmail_extra">Looks like DomTreeNode isn't held by anything currently.</div><div class="gmail_extra">Pointers to Loop are only held by LAA as far as I can tell.</div><div class="gmail_extra">CallGraphSCC objects are only used by GlobalsAA but only for a "recalculate" step.</div><div class="gmail_extra">Region's data structures don't seem to be held by anything.</div><div class="gmail_extra"><br></div><div class="gmail_extra">So it seems like LAA is the main offender in this regard.</div><div class="gmail_extra"><br></div><div class="gmail_extra">-- Sean Silva</div></div>