This is an archive of the discontinued LLVM Phabricator instance.

[mlir][memref] Clarify the documentation for memref.clone [NFC]
ClosedPublic

Authored by herhut on Jul 19 2021, 3:13 AM.

Details

Summary

The wording was wrong and suggested that operands to memref.clone may not be mutated.

Diff Detail

Event Timeline

herhut created this revision.Jul 19 2021, 3:13 AM
herhut requested review of this revision.Jul 19 2021, 3:13 AM
pifon2a accepted this revision.Jul 19 2021, 3:53 AM
This revision is now accepted and ready to land.Jul 19 2021, 3:53 AM
bondhugula added inline comments.
mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
428–431

This is just completely twisting and directly contradicting the statement above "Clones the data in the input view into an implicitly defined output view.". Is this op misnamed? clone_read_only_view? Even with that it doesn't explain disallowing mutations to the source.

mehdi_amini added inline comments.Jul 19 2021, 9:56 AM
mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
428–431

Yes the naming is very misleading, I'm very supportive of a renaming (if you want to send a patch @bondhugula ?)

bondhugula added inline comments.Jul 19 2021, 10:05 AM
mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
428–431

I just posted on the discord: https://llvm.discourse.group/t/reasoning-about-memref-mutability/3830/24?u=bondhugula The best I could think of based on my undertsanding is freeze_and_clone_read_only --- as in it freezes the source memref and makes a read-only clone. Pretty awkward but the semantics are as well!