<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jun 13, 2014, at 3:28 AM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 13, 2014 at 11:04 AM, Andrew Trick <span dir="ltr"><<a href="mailto:atrick@apple.com" target="_blank">atrick@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Sure, I’m just gently floating some ideas without spending much time understanding how the new design works.</div>
<div><br></div><div>The part that seems limiting to me is that a transform has to return a set of invalidated analysis. I supposed that set by default contains all the cached analyses and the transform selectively prunes what it preserves?</div>
</blockquote></div><br>Not at all.</div><div class="gmail_extra"><br></div><div class="gmail_extra">The transform has to return a set of preserved analyses. This is more like the existing system where the assumption is conservative. Again similar to the existing system, it should be possible (although I've not yet made it this far) to preserve an abstract set of analyses such as all those only tied to the CFG.</div></div></blockquote><div><br></div>Right.</div><div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra">As for your hypothetical example, I'm not really sure what concrete things you have in mind, but I'm pretty sure it will be possible based on your description.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Notably, the analysis actually gets to handle the invalidation event, and at that time even gets a new reference to the IR. It get's to then *ignore* the invalidation request by updating its internal state as needed. Similarly, it gets lots of information about what was invalidated by the transform.</div></div></blockquote><div><br></div><div>Yes, that’s one of the features I was asking for.</div><br><blockquote type="cite"><div dir="ltr">
<div class="gmail_extra">The thing that doesn't really seem likely to work the way you describe is that I don't think the *default* behavior will involve mid-transform invalidation of analyses. The cached analyses are typically invalidated between transformations. However, there is an explicit API for directly invalidating, updating, etc. the analysis cache so more things are possible even if they aren't the default behavior.</div>
</div>
</blockquote></div><br><div>The important thing to me is that the API exists and it is possible. The default behavior can be similar to what we have with the LegacyPassManager.</div><div><br></div><div>-Andy</div></body></html>