This is an archive of the discontinued LLVM Phabricator instance.

[mlir][tensor] Fix bufferization of CollapseShapeOp / ExpandShapeOp
ClosedPublic

Authored by springerm on Mar 29 2022, 5:54 AM.

Details

Summary

Infer a tighter MemRef type instead of always falling back to the most dynamic MemRef type. This is inefficient and caused op verification errors.

Depends On D122647

Diff Detail

Event Timeline

springerm created this revision.Mar 29 2022, 5:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2022, 5:54 AM
springerm requested review of this revision.Mar 29 2022, 5:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2022, 5:54 AM

Nice, thanks for improving!

This revision is now accepted and ready to land.Mar 30 2022, 12:48 AM
tpopp accepted this revision.Mar 30 2022, 1:26 AM
tpopp added inline comments.
mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp
124

Nit: seems like formatting with tabs

200–201

Is stride related information preserved from the input buffer, in the case that it is consuming a buffer from a complicated extract_slice or similar?

springerm marked 2 inline comments as done.Mar 30 2022, 11:09 AM
springerm added inline comments.
mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp
124

these are actually spaces, the >> indicates that indentation was added

200–201

yes, e.g., see the @tensor.expand_shape_of_slice test case

springerm marked 2 inline comments as done.Mar 30 2022, 11:27 AM