[llvm] [opt][NewPM] Add isRequired to passes named *VerifierPass (PR #76517)

Björn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 2 10:06:38 PST 2024


bjope wrote:

> I wonder if we should change the default to a pass being required, and have passes specify that they're optional. this would probably require more code than we currently have, but we can add a test that at least optimization passes in the default optimization pipelines are properly marked as optional

Afaik the required passes are overriding all gates. So for example
`  -passes='verify<scalar-evoluation>,verify<scalar-evolution>'`
would result in doing the verification twice, even if the analysis haven't been modified in between. Right?

My thinking here, related to printer/verifier passes is that they are mostly used when debugging or in regression tests. And then it's makes sense to run such passes they appear in the pipeline (even if some runs could be considered redundant the user has requested it by adding the pass in the pipeline explicitly).

For other regular analyser/transform passes etc, it makes sense to apply the normal gates for running the pass.

I the above makes sense, then I wonder if this should be documented somewhere?

I'm also a bit unsure how we could ensure that future printer/verifier passes are marked as isRequired if we go for this approach. But maybe we do not need to worry that much about it.

https://github.com/llvm/llvm-project/pull/76517


More information about the llvm-commits mailing list