FunctionPass deprecated in favor of OperationPass<FuncOp>

Hi all,

FunctionPass has been marked deprecated, please switch to OperationPass<FuncOp>(in C++) and Pass<"...", "::mlir::FuncOp"> (in Tablegen) instead. The main change in behavior is that FunctionPass implicitly skips external functions whereas OperationPass<FuncOp> does not, so please pay attention when switching your passes if you need to add new explicitly skipping of external functions or not.

Some Rationale: FunctionPass is from a time before functions were operations (and well, before operations were even a thing). It was created when MLIR had a structure similar to LLVM, but its existence is not very justifiable in modern MLIR where FuncOp is just another operation (and not really one that deserves/needs to be priviledged).

I’ve left the definition of FunctionPass as-is for now, but it will be removed in 1.5-2 weeks.

Thanks
– River

2 Likes