This is an archive of the discontinued LLVM Phabricator instance.

[mlir][bufferization] Generalize dealloc simplification pattern
ClosedPublic

Authored by maerhart on Aug 21 2023, 12:55 AM.

Details

Summary

We are allowed to remove any values from the memref list for which there is no
memref in the retained list with a may-alias relation. Before removing, we
just have to make sure that the corresponding op results for all retained
memrefs with must-alias relation are updated accordingly. This means, the the
condition operand has to become part of the disjunction the result value is
computed with.

Diff Detail

Event Timeline

maerhart created this revision.Aug 21 2023, 12:55 AM
Herald added a project: Restricted Project. · View Herald Transcript
maerhart requested review of this revision.Aug 21 2023, 12:55 AM
springerm accepted this revision.Aug 21 2023, 3:43 AM
springerm added inline comments.
mlir/lib/Dialect/Bufferization/Transforms/BufferDeallocationSimplification.cpp
110

can't find this in the code

113

situations

mlir/test/Dialect/Bufferization/Transforms/buffer-deallocation-simplification.mlir
22

What is COM?

This revision is now accepted and ready to land.Aug 21 2023, 3:43 AM
maerhart updated this revision to Diff 551997.Aug 21 2023, 6:07 AM
maerhart marked 3 inline comments as done.

Fix docstring

mlir/lib/Dialect/Bufferization/Transforms/BufferDeallocationSimplification.cpp
110

Oops, I refactored the function, but forgot to update the docstring. Let me fix that.

mlir/test/Dialect/Bufferization/Transforms/buffer-deallocation-simplification.mlir
22

https://llvm.org/docs/CommandGuide/FileCheck.html#the-com-directive

It's actually not needed here because the comment does not include any FileCheck directive. I'm not sure what the best practices are, to always prefix with COM, or only when necessary.

This revision was landed with ongoing or failed builds.Aug 21 2023, 6:09 AM
This revision was automatically updated to reflect the committed changes.