[llvm] [Pass] Add `RequiredPassMixin` for non skippable passes (PR #115692)
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 12 12:44:17 PST 2024
https://github.com/aeubanks commented:
I actually meant that we'd have
```
struct RequiredPassInfoMixin : PassInfoMixin {
static constexpr bool isRequired = true;
};
struct OptionalPassInfoMixin: PassInfoMixin {
static constexpr bool isRequired = false;
};
```
and we'd get rid of the default `isRequired = false` [here](https://github.com/llvm/llvm-project/blob/5cd6e21bddb882150068ea1c94e7b35c11f515be/llvm/include/llvm/IR/PassManagerInternal.h#L110). passes must inherit from one of them or get a compilation error. this forces people to make the decision on whether or not the pass is a required or optional one (maybe we should rename to unconditional/conditional, or mandatory, or something else), as opposed to getting a default "optional" pass which is often times incorrect
if we do this, we should probably have an RFC since it affects a lot of people. there are also things we can do to make the transition from `static bool isRequired()` to this new method easier for people
https://github.com/llvm/llvm-project/pull/115692
More information about the llvm-commits
mailing list