This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Fold tensor.pad when inserting into linalg.fill
ClosedPublic

Authored by antiagainst on Feb 23 2022, 7:05 AM.

Details

Summary

Fold tensor.insert_slice(tensor.pad(<input>), linalg.fill) into
tensor.insert_slice(<input>, linalg.fill) if the padding value and
the filling value are the same.

Diff Detail

Event Timeline

antiagainst created this revision.Feb 23 2022, 7:05 AM
antiagainst requested review of this revision.Feb 23 2022, 7:05 AM
ThomasRaoux accepted this revision.Feb 28 2022, 12:58 PM
ThomasRaoux added inline comments.
mlir/test/Dialect/Linalg/canonicalize.mlir
786

nit: you can still use CHECK-LABEL if you make the map name $MAP (as it prevents the variable to get cleared by CHECK-LABEL)

This revision is now accepted and ready to land.Feb 28 2022, 12:58 PM
antiagainst marked an inline comment as done.Feb 28 2022, 1:42 PM
antiagainst added inline comments.
mlir/test/Dialect/Linalg/canonicalize.mlir
786

I didn't know about that! Thanks a lot for the tip!

This revision was automatically updated to reflect the committed changes.
antiagainst marked an inline comment as done.