Page MenuHomePhabricator

[mlir][linalg] Use OpBuilder in rewriteAsPaddedOp (NFC).

Authored by gysit on Oct 18 2021, 8:33 AM.



Adapt the rewriteAsPaddedOp method to use the OpBuilder instead of the PatterRewriter.

Diff Detail

Event Timeline

gysit created this revision.Oct 18 2021, 8:33 AM
gysit requested review of this revision.Oct 18 2021, 8:33 AM
gysit updated this revision to Diff 383011.Oct 28 2021, 6:09 AM


nicolasvasilache accepted this revision.Oct 28 2021, 8:27 AM
nicolasvasilache added inline comments.

this older exit condition seems fishy, can this be cleaned up ?

This revision is now accepted and ready to land.Oct 28 2021, 8:27 AM
gysit added inline comments.Oct 28 2021, 8:59 AM

If paddingFunc returns failure we do not have a padding value. I agree the clean solution should be return failure in that case. But the exit condition will stay there. I will clean this up.

gysit added inline comments.Oct 28 2021, 9:12 AM

Turns out it is still needed. We use paddingFunc also to control if a specific operand shall be padded. So if there is no padding value this is actually not a failure but a success. We can refactor this once we use all the new flags / padding control.

This revision was automatically updated to reflect the committed changes.