<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 13, 2016 at 1:33 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 12:47 AM Xinliang David Li <<a href="mailto:davidxl@google.com" target="_blank">davidxl@google.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 Tue, Jul 12, 2016 at 11:34 PM, Sean Silva <span dir="ltr"><<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@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"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Tue, Jul 12, 2016 at 11:32 PM, Xinliang David Li <span dir="ltr"><<a href="mailto:davidxl@google.com" target="_blank">davidxl@google.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"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Tue, Jul 12, 2016 at 10:57 PM, 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"><div>Yea, this is a nasty problem.</div><div><br></div><div>One important thing to understand is that this is specific to analyses which hold references to other analyses. While this isn't unheard of, it isn't as common as it could be. Still, definitely something we need to address.</div></div></div></blockquote><div><br></div></span><div>We can call this type of dependencies (holding references) hard-dependency. The soft dependency refers to the case where analysis 'A' depends on 'B' during computation, but does not need 'B' once it is computed.</div><div><br></div><div>There are actually quite a few examples of hard-dependency case. For instance LoopAccessInfo, LazyValueInfo etc which hold references to other analyses.</div><div><br></div><div>Problem involving hard-dependency is actually easier to detect, as it is usually a compile time problem. Issues involving soft dependencies are more subtle and can lead to wrong code gen.</div></div></div></div></blockquote><div><br></div></span><div>Did you mean to say that soft-dependency problems are easier to detect? At least my intuition is that soft-dependency is easier because there is no risk of dangling pointers to other analyses.</div></div></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I meant it is harder to detect. If 'A' soft-depends on 'B', when 'B' gets invalidated, but 'A' survives (can be used without compile time problem such as dangling pointer) -- we don't really know if 'A' is in fact still in valid state -- as it may need to be recalculated too. </div></div></div></div></blockquote><div><br></div></span><div>The only way that 'A' is still around is if a pass *specifically* said it preserved 'A'. So I think it is reasonable to say that even if 'B' is gone, 'A' remains trustworthy here.</div></div></div></blockquote><div><br></div><div><br></div><div>This can be problematic in other ways -- wrong assumption made by the pass writer, i.e. 'A' is preserved even though 'B' can be invalidated. But this is a different issue.</div><div><br></div><div>David</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>The issue with the "hard dependency" that Sean pointed out is that there are analyses which are trivial to update, but somewhat incidentally have references to other analyses stashed away that are no longer valid. This isn't actually a "hard dependency", in that there is no fundamental reason why this layering was enforced.</div><div><br></div><div>Yet another reason to prefer passing auxiliary analyses into the query path rather than modeling these as transitive invalidation is dramatically less invalidation.</div></div></div>
</blockquote></div><br></div></div>