Insert a buffer copy unless the dims are guaranteed to be collapsible. In the verifier, accept collapses unless they are guaranteed to be non-collapsible.
Depends On D123369
Paths
| Differential D123316
[mlir][tensor] Fix verifier and bufferization of collapse_shape ClosedPublic Authored by springerm on Apr 7 2022, 8:46 AM.
Details Summary Insert a buffer copy unless the dims are guaranteed to be collapsible. In the verifier, accept collapses unless they are guaranteed to be non-collapsible. Depends On D123369
Diff Detail
Event Timeline
springerm added a parent revision: D123369: [mlir][bufferize] Do not insert useless casts for newly allocated buffers. This revision is now accepted and ready to land.Apr 8 2022, 2:16 AM This revision was landed with ongoing or failed builds.Apr 8 2022, 2:23 AM Closed by commit rGd7a9bf91431a: [mlir][tensor] Fix verifier and bufferization of collapse_shape (authored by springerm). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 421463 mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h
mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp
mlir/lib/Dialect/Linalg/Transforms/BufferizableOpInterfaceImpl.cpp
mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp
mlir/test/Dialect/Tensor/bufferize.mlir
|
I am not sure, but isn't the cast actually wrong? It will cast it back to have the original affine map. But that affine map has already been taken into account when copying to the alloc. So after copying, only the identity map should be used when accessing the data.