This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Make tensor_to_memref op docs match reality
ClosedPublic

Authored by silvas on Nov 12 2020, 12:54 PM.

Details

Summary

The previous code defined it as allocating a new memref for its result.
However, this is not how it is treated by the dialect conversion framework,
that does the equivalent of inserting and folding it away internally
(even independent of any canonicalization patterns that we have
defined).

The semantics as they were previously written were also very
constraining: Nontrivial analysis is needed to prove that the new
allocation isn't needed for correctness (e.g. to avoid aliasing).
By removing those semantics, we avoid losing that information.

Diff Detail

Event Timeline

silvas created this revision.Nov 12 2020, 12:54 PM
silvas requested review of this revision.Nov 12 2020, 12:54 PM
nicolasvasilache accepted this revision.Nov 12 2020, 1:03 PM
nicolasvasilache added inline comments.
mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
3760

tensors to not have layout as of today so that would indeed produce just tensor<4x?xf32>

This revision is now accepted and ready to land.Nov 12 2020, 1:03 PM
silvas updated this revision to Diff 304945.Nov 12 2020, 1:04 PM

Address comments.

mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
3760

Oops, sorry! For some reason, I read tensor as memref and mechanically updated it to match the type in the IR snippet!

This revision was automatically updated to reflect the committed changes.