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.
Paths
| Differential D124849
[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 TimelineComment Actions
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 Closed by commit rG37a147352457: [mlir][bufferize] Allow in-place bufferization for writes to init_tensors in… (authored by springerm). · Explain WhyMay 4 2022, 12:48 AM This revision was automatically updated to reflect the committed changes. Comment Actions
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.
Revision Contents
Diff 426933 mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp
mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize-analysis.mlir
|