This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Pass] Deprecate FunctionPass in favor of OperationPass<FuncOp
ClosedPublic

Authored by rriddle on Jan 12 2022, 8:27 PM.

Details

Summary

The only benefit of FunctionPass is that it filters out function
declarations. This isn't enough to justify carrying it around, as we can
simplify filter out declarations when necessary within the pass. We can
also explore with better scheduling primitives to filter out declarations
at the pipeline level in the future.

The definition of FunctionPass is left intact for now to allow time for downstream
users to migrate.

Diff Detail

Event Timeline

rriddle created this revision.Jan 12 2022, 8:27 PM
rriddle requested review of this revision.Jan 12 2022, 8:27 PM

I did a scan of the majority of FunctionPasses. I couldn't find any (in the quick scan, but I will do a more thorough one before submitting) that actually depend on no-declarations, but a majority do work that is essentially wasted with declarations.

The main comment I have is the same as the other patch: we should try to migrate these passes to OperationPass<> as much as possible instead: most of them are unlikely to be dependent on FuncOp.

The main comment I have is the same as the other patch: we should try to migrate these passes to OperationPass<> as much as possible instead: most of them are unlikely to be dependent on FuncOp.

Yes, I have an intention to try transitioning many of these to OperationPass<>. I refrained from doing that first, given that right now we already have some OperationPass<FuncOp> and some FunctionPass. My main goal right now is to kill FunctionPass, cleanup after its mess, and start evolving the pass infra in general.

mehdi_amini accepted this revision.Jan 12 2022, 9:29 PM

OK, LGTM then :)

This revision was not accepted when it landed; it landed in state Needs Review.Jan 18 2022, 8:03 PM
This revision was automatically updated to reflect the committed changes.