This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg][bufferize] Allow unbufferizable ops in input
ClosedPublic

Authored by springerm on Nov 27 2021, 5:59 PM.

Details

Summary

Allow ops that are not bufferizable in the input IR. (Deactivated by default.)

bufferization::ToMemrefOp and bufferization::ToTensorOp are generated at the bufferization boundaries.

Depends On D114661

Diff Detail

Event Timeline

springerm created this revision.Nov 27 2021, 5:59 PM
springerm requested review of this revision.Nov 27 2021, 5:59 PM
nicolasvasilache accepted this revision.Dec 1 2021, 12:34 AM
nicolasvasilache added inline comments.
mlir/test/Dialect/Linalg/comprehensive-module-bufferize-partial.mlir
104

In one of the previous CLs, please write heavy documentation that to_memref represents the "future location in memory" to which the tensor will be bufferized.
This may connect nicely to the analysis we do in comprehensive bufferize which thinks in term of these "futures".
What do we know at a particular point in time re these futures for to_memref ?
It depends, often almost nothing and they may alias with the world.

116

please use m1 and print memref in the test so there is less ambiguity on what we expect.

119

Similar comment for this one but it seems easier:
this is a "load" of the whole tensor from whatever "future memory location" this will be bufferized to.
This also aliases with the world as a read until more information is available in the comprehensive bufferize analysis.

138

Can we add a comment here that this must alloc and copy?
This way if anyone ever tries to change the behavior they walk into a miniefield that they have to strongly justify.

This revision is now accepted and ready to land.Dec 1 2021, 12:34 AM
This revision was automatically updated to reflect the committed changes.
springerm marked 2 inline comments as done.
springerm marked 2 inline comments as done.Dec 3 2021, 3:26 AM