[PATCH] D100912: [docs][NewPM] Add section on analyses

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 24 12:09:54 PDT 2021


asbirlea added inline comments.


================
Comment at: llvm/docs/NewPassManager.rst:161
+manager that only provides function-level analyses. This works for many
+passes which work on a fixed scope. However, some passes want to peer up or
+down the IR hierarchy. For example, an SCC pass may want to look at function
----------------
s/peer/peek


================
Comment at: llvm/docs/NewPassManager.rst:165
+immutable global analysis. In these cases, the analysis manager can provide a
+proxy to a outer or inner level analysis manager. For example, to get a
+``FunctionAnalysisManager`` from a ``CGSCCAnalysisManager``, you can call
----------------
s/a outer/an outer


================
Comment at: llvm/docs/NewPassManager.rst:184
+
+Getting direct access to an outer level IR analysis manager is not allowed.
+This is to keep in mind potential future pass concurrency. Since passes can
----------------
I'd also stress that in the current design, outer analyses are not invalidated until all the passes at that IR level are completed. So using an outer analysis that is not immutable leaves the door open for using incorrect or incomplete analyses. The work around for this is what we do between the Function and Loop IR unit levels with LoopAnalysisResults, where analyses are Function level but used and *updated* by all the Loop passes in the respective LoopPassManager. These are a limited set of trusted analyses and by contract the loop passes will preserve all. This approach makes it harder to "get things wrong" by preventing passes to retrieve arbitrary outer analysis. They can still do it, but they'll need to jump through some hoops to respect the "preserve" contract.


================
Comment at: llvm/docs/NewPassManager.rst:318
+Combining invalidation and analysis manager proxies results in some
+complexity. For example, when we invalidating all analyses in a module pass,
+we have to make sure that we also invalidate function analyses accessible via
----------------
s/when we invalidating/when we invalidate


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100912/new/

https://reviews.llvm.org/D100912



More information about the llvm-commits mailing list