[PATCH] D108298: [WIP][NPM] Print '-passes' compatible string for built pipeline.

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 18 14:27:46 PDT 2021


aeubanks added a comment.

The point of this is to reduce pass pipelines right? And this is only relevant when there's state not captured in the IR.
Another approach would be to bisect where some state becomes corrupted. We can split the pipeline into two, where we first run the first set of passes, dump the IR, then only run the second set of passes on the dumped IR. Something similar to opt-bisect. This should be much less invasive than this proposed patch.
And I have no proof of this, but it seems like we wouldn't be able to reduce a lot of the pipeline, since earlier passes, especially when running on unoptimized IR, will make a lot of necessary changes to trigger issues.

If we do go down this proposed patch's route, we need to decide to what level do we want to make a pipeline completely representable as a string. Looking at PassBuilder.cpp, I don't think it's feasible to represent literally every possible pipeline as a string.
The legacy `-debug-pass=Arguments` decides to give up on handling pass params. It'll be a tradeoff of representing more vs more code changes/invasiveness. If we want to support pass params of any kind, each pass will have to map its params to a string (i.e. it can't be a static method). I'm not sure I really like adding more to `PassInfoMixin`.
Currently we just have a mapping of names to a pass. This patch is basically trying to add a map going back the other way and also trying to keep it in sync with the PassRegistry.def map. It seems wrong to me... I never liked `PassInstrumentationCallbacks::getPassNameForClassName()`, I only added it to support `--print-before/after`.

If we're not going to use pass instrumentation, we shouldn't use `PassInstrumentationCallbacks` to get the pass name. We should do something similar where we gather up class -> pass names by including PassRegistry.def.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108298



More information about the llvm-commits mailing list