This is an archive of the discontinued LLVM Phabricator instance.

[mlir][bufferization] Add DeallocOp canonicalizer to remove duplicate values
ClosedPublic

Authored by maerhart on Jul 24 2023, 11:24 AM.

Details

Summary

Duplicate values in the retained list can just be removed, however, for duplicates in the list of memrefs to deallocate, we also need to check the conditions and if thhey don't match, we need to compute the OR in order to not miss a case leading to a memory leak.

Diff Detail

Event Timeline

maerhart created this revision.Jul 24 2023, 11:24 AM
Herald added a project: Restricted Project. · View Herald Transcript
maerhart requested review of this revision.Jul 24 2023, 11:24 AM
maerhart updated this revision to Diff 543742.Jul 24 2023, 4:13 PM

Make sure the arith dialect is registered since the canonicalizer builds arith.ori operations in some situations.

springerm accepted this revision.Jul 24 2023, 5:19 PM
springerm added inline comments.
mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
771

Let's put a comment with a small example here.

785

We usually spell out the type unless there's a cast/dyn_cast in the assignment.

This revision is now accepted and ready to land.Jul 24 2023, 5:19 PM
maerhart updated this revision to Diff 544486.Jul 26 2023, 1:08 PM

Address comments