This is an archive of the discontinued LLVM Phabricator instance.

[mlir][bufferization] Better handling of unranked tensors in resolveTensorOpOperandConflicts
ClosedPublic

Authored by springerm on Jan 23 2023, 1:22 AM.

Details

Summary

Unranked tensors can currently not be copied. They are forced to always bufferize in-place. There is typically some other OpOperand that can bufferize out-of-place instead if needed.

Note: There is IR that cannot be bufferized with One-Shot Bufferize at the moment (see invalid test case). But it is unclear if we need to support such cases. We do not have a use case at the moment. This restriction could be loosened in the future if needed.

This change improves error handling when bufferizing IR where an unranked tensor would be copied. It also disables an optimization where an OpResult was copied instead of an OpOperand in case the OpResult is an unranked tensor (Github #60187).

Diff Detail

Event Timeline

springerm created this revision.Jan 23 2023, 1:22 AM
springerm requested review of this revision.Jan 23 2023, 1:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2023, 1:22 AM
This revision is now accepted and ready to land.Jan 30 2023, 12:10 AM