When running the opt-tool with a pass pipeline that does not include
-pass-pipeline="builtin.func(..)", such as -test-print-liveness, a
crash occurs during casting if this pass operates on an operation that
does not have a SymbolOpInterface. For example, a ModuleOp that lacks a
symbol attribute. In a previous change at https://reviews.llvm.org/D121191,
FuncOp was replaced with SymbolOpInterface to reduce the dependency on
FuncOp. This patch adds a check to determine whether an operation can be
cast to SymbolOpInterface before performing the operation.
Fixes #61870
This is supposed to handle the filtering already, can you provide a test case where it does not?
We should fix it in the framework, it's not the role of the individual passes to do so.