[LLVMdev] Passes calling

Chandler Carruth chandlerc at google.com
Fri Jun 13 03:28:26 PDT 2014


On Fri, Jun 13, 2014 at 11:04 AM, Andrew Trick <atrick at apple.com> wrote:

> Sure, I’m just gently floating some ideas without spending much time
> understanding how the new design works.
>
> 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?
>

Not at all.

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.

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.

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.

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140613/8483bb92/attachment.html>


More information about the llvm-dev mailing list