Closed adam-smnk closed 5 months ago
@llvm/pr-subscribers-mlir-tensor
@llvm/pr-subscribers-mlir
Author: Adam Siemieniuk (adam-smnk)
It also could be an optional pattern maybe in populateSimplifyPackAndUnpackPatterns
or populateFoldTensorEmptyPatterns
.
Thanks for the feedback. I'll move it to the folder patterns.
Also packs have padding semantics. Those need to be accounted for. I think if there is padding you can't do this transformation
At first I treated packing on empty as mostly UB but I suppose you could materialize it as a valid initialization of a buffer. I'll make the transform more conservative.
Thanks for the feedback. I'll move it to the folder patterns.
Also packs have padding semantics. Those need to be accounted for. I think if there is padding you can't do this transformation
At first I treated packing on empty as mostly UB but I suppose you could materialize it as a valid initialization of a buffer. I'll make the transform more conservative.
This is where you should add this https://github.com/shark-infra/llvm-project/blob/f44eaa13d0c56630791e6484fa3d86a813fa716c/mlir/lib/Dialect/Tensor/Transforms/EmptyOpPatterns.cpp#L98
Extends
tensor.empty
folding patterns with pack and unpack consumers to fold away the operations when their source is empty.