[PATCH] D27198: [PM] Introduce the facilities for registering cross-IR-unit dependencies that require deferred invalidation.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 03:51:55 PST 2016


chandlerc created this revision.
chandlerc added reviewers: jlebar, silvas.
chandlerc added a subscriber: llvm-commits.
chandlerc added a dependency: D27197: [PM] Support invalidation of inner analysis managers from a pass over the outer IR unit..
Herald added subscribers: mcrosier, mehdi_amini.

This handles the other real-world invalidation scenario that we have
cases of: a function analysis which caches references to a module
analysis. We currently do this in the AA aggregation layer and might
well do this in other places as well.

Since this is relative rare, the technique is somewhat more cumbersome.
Analyses need to register themselves when accessing the outer analysis
manager's proxy. This proxy is already necessarily present to allow
access to the outer IR unit's analyses. By registering here we can track
and trigger invalidation when that outer analysis goes away.

To make this work we need to enhance the PreservedAnalyses
infrastructure to support a (slightly) more explicit model for "sets" of
analyses, and allow abandoning a single specific analyses even when
a set covering that analysis is preserved. That allows us to describe
the scenario of preserving all Function analyses *except* for the one
where deferred invalidation has triggered.

We also need to teach the invalidator API to support direct ID calls
instead of always going through a template to dispatch so that we can
just record the ID mapping.

I've introduced testing of all of this both for simple module<->function
cases as well as for more complex cases involving a CGSCC layer.

Much like the previous patch I've not tried to fully update the loop
pass management layer because that layer is due to be heavily reworked
to use similar techniques to the CGSCC to handle updates. As that
happens, we'll have a better testing basis for adding support like this.

Depends on https://reviews.llvm.org/D27197.


https://reviews.llvm.org/D27198

Files:
  include/llvm/IR/PassManager.h
  include/llvm/IR/PassManagerInternal.h
  lib/Analysis/CGSCCPassManager.cpp
  lib/IR/PassManager.cpp
  unittests/Analysis/CGSCCPassManagerTest.cpp
  unittests/IR/PassManagerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27198.79533.patch
Type: text/x-patch
Size: 38812 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161129/f0cfaf78/attachment-0001.bin>


More information about the llvm-commits mailing list