LLVM currently has a number of passes that are not used by the upstream project, i.e. are not part of any standard optimization pipeline.
Some of these passes are maintained and used by downstream users of LLVM. For example, various passes related to GC and deoptimization are not used by upstream LLVM, but are maintained by Azul. I believe having such passes upstream is both desirable and encouraged.
However, there are also passes that have no upstream use and also no upstream maintenance, beyond keeping up with API changes. To give an example, the LoopReroll pass is not part of the default optimization pipeline and has a long list of open miscompilation bug reports that nobody is working on.
When I proposed to remove it (⚙ D150684 [LoopReroll] Remove unused LoopReroll pass), I found out that there are actually is at least one downstream users of this pass, which has implemented their own fixes that were never upstreamed. I don’t think this is an acceptable state of affairs – if a pass is upstream, it also needs to be developed and maintained upstream. Otherwise, it should be kept downstream entirely.
Independently of this specific example, I would like to establish the following general policy:
All passes must satisfy at least one of the following:
- The pass is used by a standard optimization pipeline, or is a development/debugging pass. Standard optimization pipelines include those defined by PassBuilderPipelines (excluding those guarded by a default-disabled cl::opt option), passes injected by BackendUtil, as well as passes used by upstream backend targets.
- The pass has a documented code owner, who does at least fix reported miscompilations and crashes in a timely manner.
Otherwise, the pass may be removed.
Of course, it would be ideal to have a dedicated maintainer for all passes, whether they are used in the default pipeline or not, but for default passes we at least do fairly well with collective maintenance, even for passes that nobody actively works on otherwise.
I think removing unmaintained code should be a fairly uncontroversial position. I’m putting this up as an RFC mainly to make it clear that the only way to block a pass removal proposal is for somebody to actually step up, take personal responsibility for the pass, and become the new code owner.