[PATCH] D96101: [opt][NewPM] Add a --print-passes flag to print all available passes

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 13:41:17 PST 2021


aeubanks added inline comments.


================
Comment at: llvm/test/Other/print-passes.ll:6
+; CHECK: Module analyses:
+; CHECK: no-op-module
+; CHECK: Module alias analyses:
----------------
bjope wrote:
> aeubanks wrote:
> > bjope wrote:
> > > Should analysis passes perhaps be printed as require<name>?
> > Technically `require<foo>` is a pass that just runs `foo`, so that's separate. I added in the `--help` for `-passes` that you can specify `require<foo>`.
> But you can't for example do `-passes="aa"` so you need to write `-passes="require<aa>"`. If comparing with the print passes they are listed as for example `"print<loops>"`. So it is a bit inconsistent (or maybe I am missing something).
> 
> One idea was to use the output from `-print-passes` in scripts to randomly generate strings to use in `-passes`. It will be slightly more complicated if one need to parse the headings in the output to find which passes that need an enclosing `require<>`.
`print<loops>` is a name that happens to have `<` inside it, it's not special in any way.

Is it helpful to run arbitrary analyses? It seems more fruitful to just run random passes and have them query analyses as needed. Although there are special cases required, like making sure GlobalsAA and ProfileSummaryAnalysis are available before running function passes (see the uses of `RequireAnalysisPass` in PassBuilder).

Alternatively, rather than randomly constructing the list of passes outside LLVM via text, it could be interesting to do that within PassBuilder.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96101



More information about the llvm-commits mailing list