This is an archive of the discontinued LLVM Phabricator instance.

[mlir][memref] Add MemRef Lifetime Markers
Needs ReviewPublic

Authored by AlexandreSinger on Aug 16 2023, 7:56 AM.

Details

Summary

Add MemRef Lifetime Markers similar to those found within LLVM in order
to mark the lifetime of MemRefs within MLIR for use in analysis passes such
as buffer reause. This is further explained in an RFC found here:

https://discourse.llvm.org/t/rfc-lifetime-annotations-of-memory-within-mlir/72697

This patch is based on previous discussions on the LLVM lifetime markers with
the intent of making a more constrained version in MLIR using higher level
semantics. This old patch on the llvm repo does a great job explaining the ideal
assumptions the llvm lifetime markers should have:

https://reviews.llvm.org/D93376

Diff Detail

Event Timeline

AlexandreSinger requested review of this revision.Aug 16 2023, 7:56 AM

Updated the documentation of the proposed lifetime operations using points discussed in the RFC.

mehdi_amini added inline comments.Aug 19 2023, 7:47 PM
mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
1194

Accessing a memref at this point should still be undefined behavior I believe, but you op description above isn't clear about this...

Matt added a subscriber: Matt.Aug 21 2023, 1:11 PM