[PATCH] D27197: [PM] Support invalidation of inner analysis managers from a pass over the outer IR unit.

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


chandlerc created this revision.
chandlerc added a reviewer: jlebar.
chandlerc added a subscriber: llvm-commits.
Herald added subscribers: mzolotukhin, mcrosier, mehdi_amini.

This never really got implemented, and was very hard to test before
a lot of the refactoring changes to make things more robust. But now we
can test it thoroughly and cleanly, especially at the CGSCC level.

The core idea is that when an inner analysis manager proxy receives the
invalidation event for the outer IR unit, it needs to walk the inner IR
units and propagate it to the inner analysis manager for each of those
units. For example, each function in the SCC needs to get an
invalidation event when the SCC gets one.

The function / module interaction is somewhat boring here. This really
becomes interesting in the face of analysis-backed IR units. This patch
effectively handles all of the CGSCC layer's needs -- both invalidating
SCC analysis and invalidating function analysis when an SCC gets
invalidated.

However, this second aspect doesn't really handle the
LoopAnalysisManager well at this point. That one will need some change
of design in order to fully integrate, because unlike the call graph,
the entire function behind a LoopAnalysis's results can vanish out from
under us, and we won't even have a cached API to access. I'd like to try
to separate solving the loop problems into a subsequent patch though in
order to keep this more focused so I've adapted them to the API and
updated the tests that immediately fail, but I've not added the level of
testing and validation at that layer that I have at the CGSCC layer.

An important aspect of this change is that the proxy for the
FunctionAnalysisManager at the SCC pass layer doesn't work like the
other proxies for an inner IR unit as it doesn't directly manage the
FunctionAnalysisManager and invalidation or clearing of it. This would
create an ever worsening problem of dual ownership of this
responsibility, split between the module-level FAM proxy and this
SCC-level FAM proxy. Instead, this patch changes the SCC-level FAM proxy
to work in terms of the module-level proxy and defer to it to handle
much of the updates. It only does SCC-specific invalidation. This will
become more important in subsequent patches that support more complex
invalidaiton scenarios.


https://reviews.llvm.org/D27197

Files:
  include/llvm/Analysis/CGSCCPassManager.h
  include/llvm/Analysis/LoopPassManager.h
  include/llvm/IR/PassManager.h
  lib/Analysis/CGSCCPassManager.cpp
  lib/Analysis/LoopPassManager.cpp
  lib/IR/PassManager.cpp
  lib/Passes/PassBuilder.cpp
  lib/Passes/PassRegistry.def
  test/Other/new-pass-manager.ll
  unittests/Analysis/CGSCCPassManagerTest.cpp
  unittests/IR/PassManagerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27197.79528.patch
Type: text/x-patch
Size: 46711 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161129/d91adfeb/attachment.bin>


More information about the llvm-commits mailing list