Is there a declerative way to define a lamdba function on a pass to filter function/module operations? For example, I would like my pass not to be called for FuncOp which is Decalertaion (without skipping inside runOnOperation function of the pass).
I considered at some point a generic “filter-symbol” adaptor/wrapper for this purpose, but it’s hard to have a general solution, it always seems ad-hoc and I didn’t find a goood API (do you take a regex?).
That said what you want is fairly easy to implement, it is a pass that has an option which is a pass-pipeline. It initializes the pipeline in its initialize() method, do the filtering in the runOnOperation() before calling runPipeline with the provided pipeline.