This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Move some linalg patterns around.
ClosedPublic

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

Details

Summary

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
defined.

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 https://reviews.llvm.org/D89916).

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
mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
758

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 ..

mlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp
197

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.
mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
758

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.