AfterPassSkipped callback is added to have BeforePass callback correspond to some After* callback:
- AfterPass - if the pass ran
- AfterPassInvalidated - if the pass ran but invalidated the IRUnit
- AfterPassSkipped - if the pass was skipped because some of the BeforePass callbacks returned false.
These complete Before-After braces are needed for maintaining pass-related data structures in instrumentation passes. For example, stack of CFGs before passes in D81558 that checks PreserveCFG: in BeforePass a CFG snapshot is created and pushed to the stack, then in AfterPass it is popped from the stack and compared with current CFG. Even if we do not need to compare CFG we need to push and pop it from the stack.
I would prefer BeforeSkippedPassFunc. To be compatible with D84772