This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Fix reshape fusion to reshape the outs instead of creating new tensors.
ClosedPublic

Authored by mravishankar on Dec 23 2020, 12:47 PM.

Details

Summary

When fusing tensor_reshape ops with generic/indexed_Generic op, new
linalg.init_tensor operations were created for the outs of the fused
op. While correct (technically) it is better to just reshape the
original outs operands and rely on canonicalization of init_tensor
-> tensor_reshape to achieve the same effect.

Depends On D93773

Diff Detail

Event Timeline

mravishankar created this revision.Dec 23 2020, 12:47 PM
mravishankar requested review of this revision.Dec 23 2020, 12:47 PM
hanchung accepted this revision.Dec 28 2020, 10:52 AM

Totally agree to reply on canonicalization of init_tensor -> tensor_reshape to achieve the same effect. This would make code much simpler!

This revision is now accepted and ready to land.Dec 28 2020, 10:52 AM
nicolasvasilache accepted this revision.Jan 6 2021, 3:20 AM

Great, much nicer, thanks!