This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Add comprehensive bufferization support for subtensor (5/n)
ClosedPublic

Authored by nicolasvasilache on May 14 2021, 10:05 AM.

Details

Summary

This revision refactors and simplifies the pattern detection logic: thanks to SSA value properties, we can actually look at all the uses of a given value and avoid having to pattern-match specific chains of operations.

A bufferization pattern for subtensor is added and specific inplaceability analysis is implemented for the simple case of subtensor. More advanced use cases will follow.

Diff Detail

Event Timeline

nicolasvasilache requested review of this revision.May 14 2021, 10:05 AM
ftynse accepted this revision.May 17 2021, 7:32 AM
This revision is now accepted and ready to land.May 17 2021, 7:32 AM
herhut added inline comments.May 18 2021, 6:45 AM
mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
574

nit: if

mlir/test/Dialect/Linalg/comprehensive-func-bufferize.mlir
233

Should there be a test for this?

nicolasvasilache edited the summary of this revision. (Show Details)May 27 2021, 5:20 AM
nicolasvasilache marked 2 inline comments as done.
nicolasvasilache added inline comments.
mlir/test/Dialect/Linalg/comprehensive-func-bufferize.mlir
233

Added more test for the simple cases, a bunch of other steps are necessary to get everything in the right place, these will be coming in followup CLs.

ftynse accepted this revision.May 27 2021, 5:33 AM
ftynse added inline comments.
mlir/test/Dialect/Linalg/comprehensive-func-bufferize.mlir
3

Why do we need tee here, looks like debug leftover.

It may not be available on Windows.

nicolasvasilache marked an inline comment as done.

Address comment.

nicolasvasilache marked an inline comment as done.May 27 2021, 5:41 AM
This revision was landed with ongoing or failed builds.May 27 2021, 5:51 AM
This revision was automatically updated to reflect the committed changes.