Page MenuHomePhabricator

[mlir][linalg] Add a pattern to split linalg.pad_tensor ops

Authored by antiagainst on Jan 11 2022, 5:50 AM.



This commit adds a pattern to wrap a linalg.pad_tensor op with
an scf.if op to separate the cases where we don't need padding
(all pad sizes are actually zeros) and where we indeed need

This pattern is meant to handle padding inside tiled loops.
Under such cases the padding sizes typically depend on the
loop induction variables. Splitting them would allow treating
perfect tiles and edge tiles separately.

Depends On D117017

Diff Detail

Event Timeline

antiagainst created this revision.Jan 11 2022, 5:50 AM
antiagainst requested review of this revision.Jan 11 2022, 5:50 AM
nicolasvasilache accepted this revision.Feb 16 2022, 7:40 AM
nicolasvasilache added inline comments.
19 ↗(On Diff #406201)

This is very limited in terms of control and heuristics.
Should this just be a test pass?

20 ↗(On Diff #406201)

Can we improve the terminology?


It is now called tensor.pad


trivial braces

This revision is now accepted and ready to land.Feb 16 2022, 7:40 AM
antiagainst marked 4 inline comments as done.

Address comments

19 ↗(On Diff #406201)

Good point. Converted into an uber pass for testing various tensor patterns.

Fix BUILD.bazel

This revision was landed with ongoing or failed builds.Feb 16 2022, 10:44 AM
This revision was automatically updated to reflect the committed changes.