This is an archive of the discontinued LLVM Phabricator instance.

[mlir][memref] Extend multi-buffering transform
ClosedPublic

Authored by kile on Sep 29 2022, 10:55 AM.

Details

Summary

Extend multi-buffering to simplify the affine map created if any of its operands are constants. This avoids downstream problems where more complex affine.apply operations cannot be expanded.
Transfer attributes from the old allocation to the new allocation.

Diff Detail

Event Timeline

kile created this revision.Sep 29 2022, 10:55 AM
kile requested review of this revision.Sep 29 2022, 10:55 AM
kile updated this revision to Diff 463970.Sep 29 2022, 11:14 AM

Added additional context to patch

ThomasRaoux added inline comments.Sep 29 2022, 11:27 AM
mlir/lib/Dialect/MemRef/Transforms/MultiBuffer.cpp
118

We should bail out before if the alloc doesn't dominate the loop as the transformation doesn't make sense.

kile updated this revision to Diff 464321.Sep 30 2022, 10:25 AM
kile edited the summary of this revision. (Show Details)

Bail when allocations are inside of the loop

ThomasRaoux accepted this revision.Sep 30 2022, 3:10 PM

This looks good to me once the style comments are addressed

mlir/lib/Dialect/MemRef/Transforms/MultiBuffer.cpp
108
129
This revision is now accepted and ready to land.Sep 30 2022, 3:10 PM
kile updated this revision to Diff 464740.Oct 3 2022, 10:52 AM

Style Updates

kile added a comment.Oct 3 2022, 10:53 AM

@ThomasRaoux thank you very much for the review! Would you mind being the one to actually commit the change? Unfortunately I don't have commit access.

@ThomasRaoux thank you very much for the review! Would you mind being the one to actually commit the change? Unfortunately I don't have commit access.

Not a problem. Could you send me the name and email to use for the commit? (for reference: https://llvm.org/docs/Phabricator.html#committing-someone-s-change-from-phabricator)

kile added a comment.Oct 3 2022, 11:14 AM

@ThomasRaoux sure thing: email - kile@microsoft.com, name: Kirsten Lee

This revision was automatically updated to reflect the committed changes.