This is an archive of the discontinued LLVM Phabricator instance.

[mlir][bufferize] Allow in-place bufferization for writes to init_tensors in loops
ClosedPublic

Authored by springerm on May 3 2022, 5:36 AM.

Details

Summary

This commit relaxes the rules around ops that define a value but do not specify the tensor's contents. (The only such op at the moment is init_tensor.)

When such a tensor is written in a loop, it should not cause out-of-place bufferization.

Diff Detail

Event Timeline

springerm created this revision.May 3 2022, 5:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2022, 5:36 AM
springerm requested review of this revision.May 3 2022, 5:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2022, 5:36 AM
hanchung accepted this revision.May 3 2022, 11:30 PM
`linalg.init_tensor` is an operation that materializes a tensor of
a given shape. The shape could be dynamic or static.

The summary looks good to me. I don't fully understand that how we play with init_tensor in this case. Based on current documentation, it looks good to me.

This revision is now accepted and ready to land.May 3 2022, 11:30 PM
`linalg.init_tensor` is an operation that materializes a tensor of
a given shape. The shape could be dynamic or static.

The summary looks good to me. I don't fully understand that how we play with init_tensor in this case. Based on current documentation, it looks good to me.

I'm going to update documentation and do a few cleanups for init_tensor soon. Then it should be clearer what this op is doing. It is basically an alloc in tensor land.