[PATCH] D65805: [PassManager] add setupAnalysis() to customize analyses registered in AnalysisManager

Fedor Sergeev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 08:48:10 PDT 2019


fedor.sergeev abandoned this revision.
fedor.sergeev added a comment.

Had a chat with @ppf and there is a feeling that we are getting too many ways of customizing the pass (global command line options, explicit arguments passed to constructors, command line parsing etc).
If there is a need to customize passes/analyzes in a way similar to this patch then it should better be done by introducing a generic notion of PassSettings, handled in somewhat general manner through PassManager/PassBuilder.

Yet, as this particular patch and this particular need is concerned, colleague of mine just found  a way to customize the analysis during the registration time.
Apparently, it is allowed to "pre-register" analysis by doing PM.addPass(ParticularAnalysis(parameters)) **before** registering all the "standard" PassRegistry.def analyses.
Then "standard" analysis will just be skipped (as AnalysisManager::addPass just skips analyses that are already registered).
This approach, while being a bit fragile to my tastes, completely solves our current need of customized analysis without any PassManager changes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65805





More information about the llvm-commits mailing list