This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Linalg] Change destination logic in `bubbleUpPackOpThroughGenericOp`.
ClosedPublic

Authored by chelini on Apr 26 2023, 4:15 AM.

Details

Summary

In bubbleUpPackOpThroughGenericOp, we replaced the init operands with
a new tensor.empty if the operation was a pure element-wise op. This
behaviour is not wrong but not ideal because we "break" the original
use-def-chain of the output operand by materializing a new
tensor.empty. We should use tensor.empty as a destination *only* if the
initial init operand was already a tensor.empty, as we do in
PushDownUnpack.

Diff Detail

Event Timeline

chelini created this revision.Apr 26 2023, 4:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2023, 4:15 AM
chelini requested review of this revision.Apr 26 2023, 4:15 AM
chelini edited the summary of this revision. (Show Details)
hanchung accepted this revision.Apr 26 2023, 4:06 PM
This revision is now accepted and ready to land.Apr 26 2023, 4:06 PM