Today the pass pipeline is fairly static: the user creates a PassManager and populate it with the nested structure that defines the passes to execute.
The new features implemented in https://reviews.llvm.org/D86392 aim to include in a pass pipeline a different kind of pass: Dynamic Passes.
Instead of inheriting from
PassWrapper and defining
runOnOperation() to perform a transformation, a Dynamic Pass inherits from
DynamicPassWrapper and instead of performing a transformation (even though it can), it returns an optional
OpPassManager * that defines a sub-pipeline to schedule on the currently visited operation.
This feature can be used for example to implement a sub-pipeline that would run only on an operation with specific attributes. Another example would be to compute a cost model and dynamic schedule a pipeline based on the result of this analysis.