This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Add named Linalg ops on tensor to buffer support.
ClosedPublic

Authored by nicolasvasilache on Oct 12 2020, 3:07 AM.

Details

Summary

This revision introduces support for buffer allocation for any named linalg op.
To avoid template instantiating many ops, a new ConversionPattern is created to capture the LinalgOp interface.

A few interfaces are also updated to be consistent with MLIR style:
OwningRewritePatternList * -> OwningRewritePatternList &
BufferAssignmentTypeConverter * -> BufferAssignmentTypeConverter &

Diff Detail

Event Timeline

Herald added a reviewer: silvas. · View Herald Transcript
Herald added a reviewer: aartbik. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
nicolasvasilache requested review of this revision.Oct 12 2020, 3:07 AM

Missed a few spots

This revision was not accepted when it landed; it landed in state Needs Review.Oct 12 2020, 4:21 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
silvas added inline comments.Oct 12 2020, 10:49 AM
mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
808

Do these have to inherit from BufferAssignmentConversionPattern? I think a regular one should be fine. (you can access the typeConverter with getTypeConverter() from a regular conversion pattern)

mlir/lib/Dialect/Linalg/Transforms/TensorsToBuffers.cpp
248

here you can just say getTypeConverter() and then don't have to inherit from BufferAssignmentConversionPattern.