This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Miscalleneous enhancements to cover more fusion cases.
ClosedPublic

Authored by mravishankar on Oct 25 2020, 6:57 AM.

Details

Summary

Adds support for

  • Dropping unit dimension loops for indexed_generic ops.
  • Folding consecutive folding (or expanding) reshapes when the result (or src) is a scalar.
  • Fixes to indexed_generic -> generic fusion when zero-dim tensors are involved.

Depends On D90082

Diff Detail

Event Timeline

mravishankar created this revision.Oct 25 2020, 6:57 AM
mravishankar requested review of this revision.Oct 25 2020, 6:57 AM
hanchung accepted this revision.Oct 26 2020, 11:35 AM

This is great, just two nits. :)

mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
167–169

nit: remove trivial braces

mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp
118–122

I think we can use std::max(numProducerIndices, numConsumerIndices)?

This revision is now accepted and ready to land.Oct 26 2020, 11:35 AM