This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Add a pattern to fold `linalg.fill`s with `tensor.expand/collapse_shape` ops.
AcceptedPublic

Authored by mravishankar on Aug 28 2023, 6:45 PM.

Details

Summary

Combine these patterns with the SwapExtractSliceOfFill patterns and
expose them through a single entry point
populateFoldLinalgFillPatterns. Rename files and tests accordingly.

Diff Detail

Event Timeline

mravishankar created this revision.Aug 28 2023, 6:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 28 2023, 6:45 PM
mravishankar requested review of this revision.Aug 28 2023, 6:45 PM
hanchung accepted this revision.Aug 28 2023, 10:54 PM
hanchung added inline comments.
mlir/lib/Dialect/Linalg/Transforms/FoldLinalgFillPatterns.cpp
48–50

MLIR style nit: do not add braces

This revision is now accepted and ready to land.Aug 28 2023, 10:54 PM
springerm added inline comments.Aug 28 2023, 11:52 PM
mlir/lib/Dialect/Linalg/Transforms/FoldLinalgFillPatterns.cpp
61

The name is a bit misleading. These patterns do not fold anything.

mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp
192

This still has the old name.

I can change the names to be consistent. What makes sense 'swapFillWithTensorOps` ?

springerm accepted this revision.Aug 29 2023, 11:37 AM

I can change the names to be consistent. What makes sense 'swapFillWithTensorOps` ?

that sounds good to me!