Page MenuHomePhabricator

[mlir] Generalize Affine transforms to work on FunctionOpInterface.

Authored by stellaraccident on Jun 26 2022, 12:36 PM.



Most transforms have assumptions that they are processing children as part of a FuncOp currently, so migrating these to FunctionOpInterface is natural and does not change semantics. While some passes, upon inspection *could* operate on another container, I just uniformly changed them all to FunctionOpInterface for consistency and to avoid hidden gotchas.

I was somewhat surprised that on the CMake side none of this had a dependency on the Func dialect: I guess that was coming in transitively.

This is nearly an NFC, however, the change to InterfacePass means that the passes only work with PassManagers that have been explicitly nested properly (OperationPass has some legacy fallback paths for implicit nesting that do not exist in the new paths). I expect that this mainly impacts *-opt invocations, which must switch to a -pass-pipeline that is nested properly. However, it is possible that C++ code is also incorrect, in which case it will begin asserting and nesting must be done explicitly.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald Transcript
stellaraccident requested review of this revision.Jun 26 2022, 12:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2022, 12:59 PM

Nothing sticks out to me here as wrong/broken, but given this is affine stuff I'll defer to @bondhugula for approval.

jpienaar accepted this revision.Jun 29 2022, 12:59 PM

Same as River (and thanks for generalizing)

This revision is now accepted and ready to land.Jun 29 2022, 12:59 PM