Page MenuHomePhabricator

[mlir] Move some linalg patterns around.

Authored by silvas on Oct 27 2020, 11:17 AM.



The bufferization patterns are moved to the .cpp file, which is
preferred in the codebase when it makes sense.

The LinalgToStandard patterns are kept a header because they are
expected to be used individually. However, they are moved to
LinalgToStandard.h which is the file corresponding to where they are

This also removes TensorCastOpConverter, which is handled by
populateStdBufferizePatterns now. Eventually, the constant op lowering
will be handled as well, but it there are currently holdups on moving
it (see

Diff Detail

Event Timeline

silvas created this revision.Oct 27 2020, 11:17 AM
silvas requested review of this revision.Oct 27 2020, 11:17 AM

I wouldn't hide these, the finer granularity of control that individual patterns bring is useful for this type of rewrite.
Pass granularity is quite inconvenient for this.
I do not plan concrete uses of this in the short term but I expect I'd have to revert this in the future ..


These ones make sense to hide at the pass granularity.

silvas updated this revision to Diff 301431.Oct 28 2020, 2:15 PM

Address comments.

silvas retitled this revision from [mlir] Move some linalg patterns to .cpp file. to [mlir] Move some linalg patterns around. .Oct 28 2020, 2:15 PM
silvas edited the summary of this revision. (Show Details)
silvas added inline comments.

Makes sense! I moved them to LinalgToStandard.h instead (which matches with the .cpp file that they seem to be defined in anyway).

This revision is now accepted and ready to land.Oct 29 2020, 1:40 AM
This revision was automatically updated to reflect the committed changes.