This is an archive of the discontinued LLVM Phabricator instance.

[mlir][bufferization][NFC] Introduce BufferDeallocationOpInterface
ClosedPublic

Authored by maerhart on Aug 24 2023, 10:34 AM.

Details

Summary

This new interface allows operations to implement custom handling of ownership
values and insertion of dealloc operations which is useful when an op cannot
implement the interfaces supported by default by the buffer deallocation pass
(e.g., because they are not exactly compatible or because there are some
additional semantics to it that would render the default implementations in
buffer deallocation invalid, or because no interfaces exist for this kind of
behavior and it's not worth introducing one plus a default implementation in
buffer deallocation). Additionally, it can also be used to provide more
efficient handling for a specific op than the interface based default
implementations can.

Depends on D158421

Diff Detail

Event Timeline

maerhart created this revision.Aug 24 2023, 10:34 AM
Herald added a project: Restricted Project. · View Herald Transcript
maerhart requested review of this revision.Aug 24 2023, 10:34 AM
maerhart updated this revision to Diff 553419.Aug 25 2023, 2:39 AM

fixes, improvements, and clang-format

springerm added inline comments.Aug 28 2023, 8:03 AM
mlir/include/mlir/Dialect/Bufferization/IR/BufferDeallocationOpInterface.h
184–186

Just noticed that this field is public but the others are private.

mlir/include/mlir/Dialect/Bufferization/IR/BufferDeallocationOpInterface.td
26

Mention that the other interface handler are skipped if an op implements this interface.

31

result

33

On failure, ...

maerhart updated this revision to Diff 555742.Sep 4 2023, 6:36 AM
maerhart marked 4 inline comments as done.

rebase

springerm accepted this revision.Sep 6 2023, 8:39 AM

There is a small change in the test case, but it does not change the functionality. Can this change be marked NFC?

mlir/lib/Dialect/ControlFlow/Transforms/CMakeLists.txt
15

nit: new line

This revision is now accepted and ready to land.Sep 6 2023, 8:39 AM
maerhart updated this revision to Diff 556570.Sep 12 2023, 6:46 AM

address comments

maerhart retitled this revision from [mlir][bufferization] Introduce BufferDeallocationOpInterface to [mlir][bufferization][NFC] Introduce BufferDeallocationOpInterface.Sep 12 2023, 6:46 AM
This revision was landed with ongoing or failed builds.Sep 13 2023, 2:31 AM
This revision was automatically updated to reflect the committed changes.