This is an archive of the discontinued LLVM Phabricator instance.

[mlir][bufferize][NFC] Move FuncOp bufferization to BufferizableOpInterface impl
ClosedPublic

Authored by springerm on Apr 6 2022, 5:50 AM.

Details

Summary

FuncOps are now less special. They must still be analyzed + bufferized in a certain order, but they are now bufferized same as other ops that have a region: Bufferize the op first (bufferize interface method), then bufferize the region body with other bufferization patterns. In the case of FuncOps, the function signature is bufferized together with ReturnOps. Similar to how, e.g., scf.for ops are bufferized together with scf.yield ops.

This change is essentially a reimplementation of the FuncOp bufferization, but mostly NFC from a user's perspective. This change is in preparation of moving the code to the bufferization dialect.

Depends On D123618

Diff Detail

Event Timeline

springerm created this revision.Apr 6 2022, 5:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2022, 5:50 AM
springerm requested review of this revision.Apr 6 2022, 5:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2022, 5:50 AM
pifon2a accepted this revision.Apr 20 2022, 12:13 AM
This revision is now accepted and ready to land.Apr 20 2022, 12:13 AM
springerm retitled this revision from [mlir][bufferize] Move FuncOp bufferization to BufferizableOpInterface impl to [mlir][bufferize][NFC] Move FuncOp bufferization to BufferizableOpInterface impl.Apr 20 2022, 12:16 AM

Please mark as NFC as this is a refactoring to use common infra and does not introduce or modify any functionality.
The fact that 2 errors are now generated when invalid IR is given as input is not load-bearing IMO.

mlir/lib/Dialect/Linalg/ComprehensiveBufferize/ModuleBufferization.cpp
853

nit: All resulting function argument buffers...

This revision was landed with ongoing or failed builds.Apr 22 2022, 2:48 AM
This revision was automatically updated to reflect the committed changes.